pub struct RefsRecomposeOptions {
pub safe_label_types: BTreeMap<String, SafeLabelMode>,
pub protect: bool,
}Expand description
The render options of the refs feature’s recomposition rules: how the
recomposed LaTeX writes labels and references (see the module
documentation). An option type (crate::model::options) declared with
Bind::Render: its value is set per
render request.
§Examples
use flm_core::stdlib::features::refs::{RefsRecomposeOptions, SafeLabelMode};
let options = RefsRecomposeOptions::default();
assert!(options.safe_label_types.is_empty());
assert!(!options.protect);
let raw_sections = RefsRecomposeOptions {
safe_label_types: [(String::from("sec"), SafeLabelMode::Raw)].into_iter().collect(),
..RefsRecomposeOptions::default()
};
assert_eq!(raw_sections.safe_label_types["sec"], SafeLabelMode::Raw);Fields§
§safe_label_types: BTreeMap<String, SafeLabelMode>Per label type (sec, eq), how its labels are written; a type not
listed is Safe. Empty by default. A label
with no type belongs to none of these and is always written by its
safe label.
You own this: a type set to Raw. Its labels
are written as the document spelled them instead of as a generated
safe label. You must ensure that those labels are spellings LaTeX can
carry through its auxiliary file: a label holding a character LaTeX
treats specially cannot be read back, which the safe labels exist to
avoid.
protect: boolWhether a reference is wrapped in \NoCaseChange{\protect …}, which
keeps it out of a command that changes the case of its argument
(\MakeUppercase). Off by default; when on, the style file requests
the textcase package, which supplies \NoCaseChange on every LaTeX
kernel.
A reference left unwrapped inside such a command is uppercased whole,
its options and its safe label alike, and it fails in two ways,
neither of which raises an error.
\MakeUppercase{… \flmRef[noprefix]{ref1} …} passes the hook
NOPREFIX, a key it does not translate, so it is dropped and the name
the author left out comes back. And the safe label itself is
uppercased, so LaTeX looks for a label REF1, finds none, and prints
?? with only a warning. Turn this on for a document whose headings
or captions are uppercased.
Trait Implementations§
Source§impl Clone for RefsRecomposeOptions
impl Clone for RefsRecomposeOptions
Source§impl Debug for RefsRecomposeOptions
impl Debug for RefsRecomposeOptions
Source§impl Default for RefsRecomposeOptions
impl Default for RefsRecomposeOptions
Source§impl<'de> Deserialize<'de> for RefsRecomposeOptionswhere
RefsRecomposeOptions: Default,
impl<'de> Deserialize<'de> for RefsRecomposeOptionswhere
RefsRecomposeOptions: Default,
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 RefsRecomposeOptions
Source§impl Hash for RefsRecomposeOptions
impl Hash for RefsRecomposeOptions
Source§impl JsonSchema for RefsRecomposeOptions
impl JsonSchema for RefsRecomposeOptions
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for RefsRecomposeOptions
impl PartialEq for RefsRecomposeOptions
impl StructuralPartialEq for RefsRecomposeOptions
Auto Trait Implementations§
impl Forget for RefsRecomposeOptions
impl Freeze for RefsRecomposeOptions
impl Move for RefsRecomposeOptions
impl RefUnwindSafe for RefsRecomposeOptions
impl Send for RefsRecomposeOptions
impl Sync for RefsRecomposeOptions
impl Unpin for RefsRecomposeOptions
impl UnsafeUnpin for RefsRecomposeOptions
impl UnwindSafe for RefsRecomposeOptions
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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 more