[][src]Struct texrender::TexRender

pub struct TexRender { /* fields omitted */ }

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]

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

impl Debug for TexRender[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.