1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
//! The `latex` feature ([`LatexFamily`]): the registration of the LaTeX
//! family, the parts every LaTeX backend shares ([`super`]).
//!
//! The feature ([`FlmFeature`]) registers no backend of its own. It registers:
//!
//! - the four LaTeX construct elements ([`super::construct`]);
//! - the two service slots through which a LaTeX backend resolves the
//! requirements a lowering rule records: [`super::packages::SLOT`]
//! (`flm.latex.packages`) for package requests and
//! [`super::preamble::SLOT`] (`flm.latex.preamble`) for definition pieces;
//! - the standard contributions to both slots: the standard package
//! definitions ([`super::packages::standard_packages`]) and the family's own
//! definition pieces ([`super::preamble::standard_pieces`]);
//! - the placeholder rule ([`super::construct::placeholder_rule`]), which
//! writes the LaTeX text a copied template carries at one of its
//! placeholders ([`LatexPoint`](super::LatexPoint)): for example the
//! parameter `#1` that a placeholder of a kept user definition
//! ([`kept`](crate::stdlib::features::userdefs::kept)) becomes, or the
//! `enumitem` command that a number format of a list label template
//! becomes.
//!
//! The placeholder rule is the default on the `latex-recomposed` backend
//! only. The feature makes a peer declaration
//! ([`PeerName`](crate::core::registry::PeerName)) of that backend, which
//! the `latex-recomposed` feature
//! ([`LatexRecomposed`](crate::stdlib::backends::latex_recomposed::LatexRecomposed))
//! registers. A registry that holds this feature without the
//! `latex-recomposed` backend therefore still builds, with the placeholder
//! rule set aside (excluded from rule selection; see
//! [`PeerName`](crate::core::registry::PeerName)).
//!
//! Each LaTeX backend is registered by a feature of its own: its native set
//! (the elements its emitter writes directly, [`BackendDef::native`]) holds
//! the construct elements, and its lowering rules require packages and
//! definition pieces by identifier. The registry checks each backend's native
//! set (a backend must write `flm.pres.unsupported` natively, and
//! `flm.pres.deco-mark` when its native set holds an element carrying the
//! decoration aspect); this feature registers no backend, so the check does
//! not apply to it.
//!
//! [`FlmFeature`]: crate::core::registry::FlmFeature
//! [`BackendDef::native`]: crate::core::registry::BackendDef::native
use Arc;
use crate;
use crateArity;
use crateBACKEND as RECOMPOSED_BACKEND;
use construct;
use ;
use ;
/// The name the feature is registered under, `latex`.
pub const FEATURE_NAME: &str = "latex";
/// The `latex` feature, which registers the parts every LaTeX backend
/// shares (see the [module documentation](self)).
///
/// A LaTeX backend is registered beside this feature: the backend's native
/// set and lowering rules refer to the construct elements this feature
/// registers, and its stages resolve requirements through the service slots
/// this feature declares. The standard features
/// ([`stdlib::add_features`](crate::stdlib::add_features)) include it. Use
/// [`feature()`] to obtain it as a value that a package entry
/// ([`PackageEntry`](crate::core::registry::PackageEntry)) can list.
;
/// The [`LatexFamily`] feature as a shared value, ready to be listed in a
/// package entry ([`PackageEntry`](crate::core::registry::PackageEntry)).
///
/// # Examples
///
/// ```
/// use flm_core::stdlib::backends::latex;
///
/// assert_eq!(latex::feature().info().name.as_str(), latex::FEATURE_NAME);
/// ```