Reserve saveboxes declared in the body
This commit is contained in:
1 parent
eaebb1edbf
commit
3087a9a116
3 files changed
+14
-2
No files matched your search
@@ -4255,6 +4255,11 @@ fn capture_body_definitions(
|
||||
for line in body.lines() {
|
||||
let trimmed = line.trim_start();
|
||||
let definition_line = strip_definition_prefixes(trimmed);
|
||||
if trimmed.starts_with("\\newsavebox") {
|
||||
handle_savebox_line(trimmed, macros);
|
||||
changed = true;
|
||||
continue;
|
||||
}
|
||||
if let Some(name) = newif_definition(definition_line) {
|
||||
conditionals.push(ConditionalDefinition { name, value: false });
|
||||
changed = true;
|
||||
@@ -12736,6 +12741,13 @@ See \ref{fig:a} and \ref{tab:b}.";
|
||||
assert_eq!(body.trim(), "Value 3.");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn body_newsavebox_declarations_are_reserved() {
|
||||
let source = "\\newsavebox{\\boxa}\n\\sbox{\\boxa}{Stored}\n\nFirst \\usebox{\\boxa}.";
|
||||
let (body, _geometry) = geometry_and_body(source);
|
||||
assert_eq!(body.trim(), "First Stored.");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn body_definitions_expand_later_in_the_document() {
|
||||
let source = "\\def\\greet{Hello}\n\n\\greet world.";
|
||||
|
||||
Reference in new issue
Block a user