#[non_exhaustive]pub struct Options {
pub form: Form,
pub labels: Labels,
pub open: OpenGoal,
pub align: bool,
pub ebproof: String,
pub preamble: Option<String>,
pub lambda: Option<Options>,
}Expand description
The choices of the LaTeX output.
Start from Options::default() and change the fields you want, by
assignment or with the with_* methods. The struct is
#[non_exhaustive], so a field added later breaks no caller.
§Examples
A sequent as a document that compiles on its own:
use deduxit::export::{Form, latex};
use deduxit::{Limits, linear::{Mode, Sequent}};
let sequent: Sequent = "A |- A".parse()?;
let options = latex::Options::default().with_form(Form::Standalone);
let document = latex::sequent(&sequent, Mode::CLASSICAL, &options, &Limits::default())?;
assert_eq!(
document,
r"\documentclass[border=5pt]{standalone}
\usepackage{amssymb}
\usepackage{cmll}
\begin{document}
$\vdash A^\bot, A$
\end{document}"
);Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.form: FormA fragment to paste, or a document that compiles on its own.
labels: LabelsThe labels of the rules.
open: OpenGoalHow an open goal is drawn: under \vdots, bare (\hypo), under a
line labelled with a mark, or under ebproof’s dashed line.
align: boolWhether the turnstiles of a two-sided tree line up (ebproof’s &).
ebproof: StringThe options of every prooftree environment, as ebproof reads
them between brackets. Empty for none.
preamble: Option<String>What a standalone document starts with, before
\begin{document}.
None gives the standalone class, cropped to the content, with
amssymb, cmll and, for a tree, ebproof. A preamble of your
own must load those packages itself.
lambda: Option<Options>The derivation’s lambda-term, written under its conclusion as its
typing judgement (lambda), with these options.
None, the default, writes no term.
The term is in LaTeX’s notation, whatever
notation says. Before anything
is written, write() refuses a derivation that has no term
(Error::NoTerm), and a term whose text would pass the default
output bound
(Limits::DEFAULT_DERIVATION_BYTES).
Implementations§
Source§impl Options
impl Options
Sourcepub fn with_labels(self, labels: Labels) -> Self
pub fn with_labels(self, labels: Labels) -> Self
Returns the options with another labels.
Sourcepub fn with_align(self, align: bool) -> Self
pub fn with_align(self, align: bool) -> Self
Returns the options with another align.
Sourcepub fn with_ebproof(self, ebproof: String) -> Self
pub fn with_ebproof(self, ebproof: String) -> Self
Returns the options with another ebproof.
Sourcepub fn with_preamble(self, preamble: Option<String>) -> Self
pub fn with_preamble(self, preamble: Option<String>) -> Self
Returns the options with another preamble.
Sourcepub fn with_lambda(self, lambda: Option<Options>) -> Self
pub fn with_lambda(self, lambda: Option<Options>) -> Self
Returns the options with another lambda.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Options
impl<'de> Deserialize<'de> for Options
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Options
impl StructuralPartialEq for Options
Auto Trait Implementations§
impl Forget for Options
impl Freeze for Options
impl Move for Options
impl RefUnwindSafe for Options
impl Send for Options
impl Sync for Options
impl Unpin for Options
impl UnsafeUnpin for Options
impl UnwindSafe for Options
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
T, using the provided data to resolve any offsets.