[−][src]Struct texrender::TexRender
LaTeX-rendering command.
Creating a new rendering command usually starts by supplying a LaTeX-document, either via
from_bytes
or from_file
. Other options can be set through the various builder methods.
Once satisfied, the render
method will perform the call to the external TeX-engine and return
a rendered PDF as raw bytes.
TEXINPUTS
The search path for classes, includes or other files used in TeX can be extended using the
TEXINPUTS
environment variable; TexRender
sets this variable when rendering. See
add_texinput
for details.
Assets
Instead of adding a folder to TEXINPUTS
, any sort of external file can be added as an asset.
Assets are stored in a temporary folder that lives as long as the TexRender
instance, the
folder will automatically be added to TEXINPUTS
when rendering. See the add_asset_*
functions for details.
Implementations
impl TexRender
[src]
pub fn from_bytes(source: Vec<u8>) -> TexRender
[src]
Create a new tex render configuration using raw input bytes as the source file.
pub fn from_file<P: AsRef<Path>>(source: P) -> Result<TexRender>
[src]
Create a new tex render configuration from an input latex file.
pub fn add_asset_from_bytes<S: AsRef<OsStr>>(
&mut self,
filename: S,
bytes: &[u8]
) -> Result<()>
[src]
&mut self,
filename: S,
bytes: &[u8]
) -> Result<()>
Adds an asset to the texrender.
pub fn add_asset_from_file<P: AsRef<Path>>(&mut self, path: P) -> Result<()>
[src]
Adds an assets to the texrender from a file.
Panics
Panics if the passed-in path has no proper filename.
pub fn add_texinput<P: Into<PathBuf>>(&mut self, input_path: P) -> &mut Self
[src]
Adds a path to list of texinputs.
pub fn latex_mk_path<P: Into<PathBuf>>(&mut self, latex_mk_path: P) -> &mut Self
[src]
Sets the path of latexmk
.
If not set, will look for latexmk
on the current PATH
.
pub fn render(&self) -> Result<Vec<u8>, RenderingError>
[src]
Renders the given source as PDF.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for TexRender
impl Send for TexRender
impl Sync for TexRender
impl Unpin for TexRender
impl UnwindSafe for TexRender
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,