| Crates.io | texcore |
| lib.rs | texcore |
| version | 0.7.2 |
| created_at | 2022-07-19 23:28:59.521498+00 |
| updated_at | 2023-04-29 16:47:39.064211+00 |
| description | Create LaTeX documents using native Rust types. |
| homepage | https://texcreate.mkproj.com |
| repository | https://github.com/MKProj/texcore |
| max_upload_size | |
| id | 628579 |
| size | 158,220 |
The TexCore library is under the MIT License
TexCore is a library that allows a developer to write LaTeX using native Rust types. We also provide functions
to compile the code using a Rust built LaTeX compiler, tectonic.
To add to your project:
[dependencies]
texcore = "0.7"
To allow this library to be able to run on Windows systems, I have made the tectonic dependency optional and only
available under the compile feature. This means that the function, texcore::compile() and ElementList::compile()
are hidden under this feature.
[dependencies]
texcore = { version = "0.7", features = ["compile"] }
To allow easier development with the TexCreate project, I have decided to add the texcreate-templates portion under
the texcreate_template feature.
texcore = { version = "0.7", features = ["texcreate_template"] }
This feature provides asynchronous options using the type, TexAsync which isn't a trait but a generic struct that
requires T to implement Tex. The reason of not using a trait is that asynchronous methods in a trait isn't stable
yet.
Most importantly we get the following functions from the future module:
async_latex_string<T: Tex>(t: &T) -> impl Future<Output=String> + SendElement<Any>::async_latex_string()ElementList::async_latex_string()ElementList::async_latex_split_string()ElementList::async_write()ElementList::async_split_write()Advantages of using the asynchronous writing operations is because they are done so concurrently, and in terms of
async_split_write(), the task of writing to each file is done in parallel.
texcore = { version = "0.7", features = ["async"] }
This features utilizes the rayon crate to allow ElementList to contain the following functions:
ElementList::par_write()ElementList::par_write_split()ElementList::par_iter()ElementList::par_iter_mut()texcore = { version = "0.7", features = ["parallel"] }
To enable all features seen above , you may use the full feature.
texcore = { version = "0.7", features = ["full"] }
bundle module provides types to easily add into your document:
graphicx package under the module, texcore::bundle::graphicxtexcore::bundle::mathmodify_element() function
texcore::extra_ops moduleRead documentation here