nalgebra_latex 0.1.18

A library with several robust formatters for nalgebra::Matrix, LaTeX environments, and more
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::latex_modes::{DisplayMathMode, InnerParagraphMode};
use mime_typed::{evcxr_support::TextMarkdown, MimeStrExt};

use super::{EvcxrOutputFormatter, LatexFormatter};

impl<F, I> EvcxrOutputFormatter<TextMarkdown, I> for F
where
    F: LatexFormatter<InnerParagraphMode, DisplayMathMode, I>,
{
    fn write_evcxr_output<W: core::fmt::Write>(
        dest: &mut W,
        input: &I,
    ) -> Result<(), core::fmt::Error> {
        writeln!(dest, "EVCXR_BEGIN_CONTENT {}", TextMarkdown::MIME_STR)?;
        F::write_latex(dest, input)?;
        dest.write_str("\nEVCXR_END_CONTENT\n")
    }
}