Skip to content

Commit

Permalink
Fixup \write to expand argument; enhance testcase (Thanks adhilton)
Browse files Browse the repository at this point in the history
  • Loading branch information
brucemiller committed Jun 25, 2019
1 parent 241ce2e commit 41ff0d7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/LaTeXML/Package/TeX.pool.ltxml
Original file line number Diff line number Diff line change
Expand Up @@ -2231,7 +2231,7 @@ DefPrimitive('\write Number {}', sub {
if (my $filename = LookupValue('output_file:' . $port)) {
my $handle = $filename . '_contents';
my $contents = LookupValue($handle);
AssignValue($handle => $contents . UnTeX($tokens) . "\n", 'global'); }
AssignValue($handle => $contents . UnTeX(Expand($tokens)) . "\n", 'global'); }
else {
print STDERR UnTeX(Expand($tokens)) . "\n"; }
return; });
Expand Down
Binary file modified t/digestion/io.pdf
Binary file not shown.
4 changes: 3 additions & 1 deletion t/digestion/io.tex
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,14 @@

\paragraph{Writing a file}
\findfile{generated.data}

\def\timing{Before}
\immediate\openout\file = generated.data
\immediate\write\file {First line}
\immediate\write\file {Second line}
\immediate\write\file {Timing \timing.}
\immediate\write\file {Last line}
\immediate\closeout\file
\def\timing{After}

\findfile{generated.data}
\readfile{generated.data}
Expand Down
3 changes: 3 additions & 0 deletions t/digestion/io.xml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ Line: “First line
Line: “Second line
”<break/>

Line: “Timing Before.
”<break/>

Line: “Last line
”<break/>

Expand Down

0 comments on commit 41ff0d7

Please sign in to comment.