-
Notifications
You must be signed in to change notification settings - Fork 131
Newlines #2700
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Newlines #2700
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
76ea6b7
Revert change to Explode/ExplodeText from Spaces(#2646) to convert ne…
brucemiller 73027e0
Make \string only use Explode for CS, avoiding blurring distinctions …
brucemiller 81ab845
Have \meaning normalize SPACE tokens to ' ' to avoid blurring newline…
brucemiller 2ce27a8
Enhance meaning testcase to also probe \string & \detokenize; check n…
brucemiller File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,68 +1,63 @@ | ||
| \documentclass{article} | ||
| \usepackage[T1]{fontenc} | ||
| \def\tester#1{% | ||
| \par\noindent% | ||
| [\string #1]% | ||
| [\meaning #1]% | ||
| [\expandafter\meaning\string #1]% | ||
| [\detokenize{#1}]% | ||
| .} | ||
| \def\xtester#1{% | ||
| \expandafter\tester\expandafter{#1}} | ||
|
|
||
| \begin{document} | ||
|
|
||
| \def\A#1{saaa#1} | ||
| \def\Aa#1{#1saaa} | ||
| \def\Aaa#1{sa#1aa} | ||
| \def\b{bb} | ||
| \def\c a#1b#2c{one#1c#2} | ||
| \edef\foo{% | ||
| \csname A\endcsname% | ||
| \csname expl:n\endcsname% | ||
| \csname B\endcsname% | ||
| \csname *\endcsname% | ||
| \csname C\endcsname} | ||
|
|
||
| \meaning A | ||
|
|
||
| \meaning_ | ||
|
|
||
| \meaning% | ||
| \meaning\ | ||
|
|
||
| \meaning{ | ||
|
|
||
| %\meaning ~ | ||
| \meaning} | ||
|
|
||
| \tester{$} | ||
| \tester{&} | ||
| \tester{ | ||
| } | ||
| \tester{#} | ||
| \tester{^} | ||
| \tester{_} | ||
| \tester{ } | ||
| \tester{A} | ||
| \tester{@} | ||
| {\catcode`\@=\active\let@\A | ||
| \meaning @} | ||
|
|
||
| \meaning ^ | ||
|
|
||
| \meaning * | ||
|
|
||
| \meaning ( | ||
|
|
||
| \meaning \ | ||
|
|
||
| \meaning 1 | ||
|
|
||
| \meaning ! | ||
|
|
||
| \meaning @ | ||
|
|
||
| \meaning # | ||
|
|
||
| \meaning & | ||
|
|
||
| \meaning \A | ||
|
|
||
| \meaning \Aa | ||
|
|
||
| \meaning \Aaa | ||
|
|
||
| \meaning \b | ||
|
|
||
|
|
||
| \meaning \c | ||
|
|
||
| \meaning \bla | ||
|
|
||
| \meaning { | ||
|
|
||
| \meaning } | ||
|
|
||
| \meaning $ | ||
|
|
||
| \meaning\foo | ||
|
|
||
| \tester{@}} | ||
| \tester{*} | ||
| \tester{(} | ||
| \tester{1} | ||
| \tester{!} | ||
|
|
||
| \tester{\A} | ||
| \tester{\Aa} | ||
| \tester{\Aaa} | ||
| \tester{\b} | ||
| \tester{\c} | ||
| \tester{\bla} | ||
|
|
||
| \tester{^^J} | ||
| { \catcode`\^^J=\active | ||
| \tester{^^J} } | ||
| { \catcode`\Z=9\relax | ||
| \tester{Z} } | ||
|
|
||
| \def\aspace{ } | ||
| \def\carriagereturn{ | ||
| } | ||
| \def\linefeed{^^J} | ||
| \xtester{\aspace} | ||
| \xtester{\carriagereturn} | ||
| \xtester{\linefeed} | ||
| \end{document} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,77 +1,96 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <?latexml class="article"?> | ||
| <?latexml package="fontenc" options="T1"?> | ||
| <?latexml RelaxNGSchema="LaTeXML"?> | ||
| <document xmlns="http://dlmf.nist.gov/LaTeXML"> | ||
| <resource src="LaTeXML.css" type="text/css"/> | ||
| <resource src="ltx-article.css" type="text/css"/> | ||
| <para xml:id="p1"> | ||
| <p>the letter A</p> | ||
| <p>macro:-¿“</p> | ||
| </para> | ||
| <para xml:id="p2"> | ||
| <p>subscript character _</p> | ||
| <p>begin-group character –</p> | ||
| </para> | ||
| <para xml:id="p3"> | ||
| <p>\par</p> | ||
| <p>end-group character ˝</p> | ||
| </para> | ||
| <para xml:id="p4"> | ||
| <p>macro:#1->saaa#1</p> | ||
| <para class="ltx_noindent" xml:id="p4"> | ||
| <p>[$][math shift character $][the character $][$].</p> | ||
| </para> | ||
| <para xml:id="p5"> | ||
| <p>superscript character ˆ</p> | ||
| <para class="ltx_noindent" xml:id="p5"> | ||
| <p>[&][alignment tab character &][the character &][&].</p> | ||
| </para> | ||
| <para xml:id="p6"> | ||
| <p>the character *</p> | ||
| <para class="ltx_noindent" xml:id="p6"> | ||
| <p>[ | ||
| ][blank space ][blank space ][ ].</p> | ||
| </para> | ||
| <para xml:id="p7"> | ||
| <p>the character (</p> | ||
| <para class="ltx_noindent" xml:id="p7"> | ||
| <p>[#][macro parameter character #][the character #][##].</p> | ||
| </para> | ||
| <para xml:id="p8"> | ||
| <p>macro:->\</p> | ||
| <para class="ltx_noindent" xml:id="p8"> | ||
| <p>[ˆ][superscript character ˆ][the character ˆ][ˆ].</p> | ||
| </para> | ||
| <para xml:id="p9"> | ||
| <p>the character 1</p> | ||
| <para class="ltx_noindent" xml:id="p9"> | ||
| <p>[˙][subscript character ˙][the character ˙][˙].</p> | ||
| </para> | ||
| <para xml:id="p10"> | ||
| <p>the character !</p> | ||
| <para class="ltx_noindent" xml:id="p10"> | ||
| <p>[ ][blank space ][blank space ][ ].</p> | ||
| </para> | ||
| <para xml:id="p11"> | ||
| <p>the character @</p> | ||
| <para class="ltx_noindent" xml:id="p11"> | ||
| <p>[A][the letter A][the character A][A].</p> | ||
| </para> | ||
| <para xml:id="p12"> | ||
| <p>macro parameter character #</p> | ||
| <para class="ltx_noindent" xml:id="p12"> | ||
| <p>[@][the character @][the character @][@].</p> | ||
| </para> | ||
| <para xml:id="p13"> | ||
| <p>alignment tab character &</p> | ||
| <para class="ltx_noindent" xml:id="p13"> | ||
| <p>[@][macro:#1-¿saaa#1][the character @][@].</p> | ||
| </para> | ||
| <para xml:id="p14"> | ||
| <p>macro:#1->saaa#1</p> | ||
| <para class="ltx_noindent" xml:id="p14"> | ||
| <p>[*][the character *][the character *][*].</p> | ||
| </para> | ||
| <para xml:id="p15"> | ||
| <p>macro:#1->#1saaa</p> | ||
| <para class="ltx_noindent" xml:id="p15"> | ||
| <p>[(][the character (][the character (][(].</p> | ||
| </para> | ||
| <para xml:id="p16"> | ||
| <p>macro:#1->sa#1aa</p> | ||
| <para class="ltx_noindent" xml:id="p16"> | ||
| <p>[1][the character 1][the character 1][1].</p> | ||
| </para> | ||
| <para xml:id="p17"> | ||
| <p>macro:->bb</p> | ||
| <para class="ltx_noindent" xml:id="p17"> | ||
| <p>[!][the character !][the character !][!].</p> | ||
| </para> | ||
| <para xml:id="p18"> | ||
| <p>macro:a#1b#2c->one#1c#2</p> | ||
| <para class="ltx_noindent" xml:id="p18"> | ||
| <p>[“A][macro:#1-¿saaa#1][the character “A][“A ].</p> | ||
| </para> | ||
| <para xml:id="p19"> | ||
| <p>undefined</p> | ||
| <para class="ltx_noindent" xml:id="p19"> | ||
| <p>[“Aa][macro:#1-¿#1saaa][the character “Aa][“Aa ].</p> | ||
| </para> | ||
| <para xml:id="p20"> | ||
| <p>begin-group character {</p> | ||
| <para class="ltx_noindent" xml:id="p20"> | ||
| <p>[“Aaa][macro:#1-¿sa#1aa][the character “Aaa][“Aaa ].</p> | ||
| </para> | ||
| <para xml:id="p21"> | ||
| <p>end-group character }</p> | ||
| <para class="ltx_noindent" xml:id="p21"> | ||
| <p>[“b][macro:-¿bb][the character “b][“b ].</p> | ||
| </para> | ||
| <para xml:id="p22"> | ||
| <p>math shift character $</p> | ||
| <para class="ltx_noindent" xml:id="p22"> | ||
| <p>[“c][macro:a#1b#2c-¿one#1c#2][the character “c][“c ].</p> | ||
| </para> | ||
| <para xml:id="p23"> | ||
| <p>macro:->saaa\expl:n \B \*\C</p> | ||
| <para class="ltx_noindent" xml:id="p23"> | ||
| <p>[“bla][undefined][the character “bla][“bla ].</p> | ||
| </para> | ||
| <para class="ltx_noindent" xml:id="p24"> | ||
| <p>[Ω][the character Ω][the character Ω][Ω].</p> | ||
| </para> | ||
| <para class="ltx_noindent" xml:id="p25"> | ||
| <p>[Ω][undefined][the character Ω][Ω].</p> | ||
| </para> | ||
| <para class="ltx_noindent" xml:id="p26"> | ||
| <p>[][the character ][the character ][].</p> | ||
| </para> | ||
| <para class="ltx_noindent" xml:id="p27"> | ||
| <p>[ ][blank space ][blank space ][ ].</p> | ||
| </para> | ||
| <para class="ltx_noindent" xml:id="p28"> | ||
| <p>[ | ||
| ][blank space ][blank space ][ ].</p> | ||
| </para> | ||
| <para class="ltx_noindent" xml:id="p29"> | ||
| <p>[Ω][the character Ω][the character Ω][Ω].</p> | ||
| </para> | ||
| </document> | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably not essential, but this newline char in the XML for the
p28test is a regular space in the PDF output.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The intention was that they should have an equivalent effect in the xml/html, which seems to be the case.
I'd wondered whether the one's in
blank space \nshould also keep the newline, rather than normalize to space, but that would have required a lot of changes & complication in\meaningto keep the right newlines and decode the wrong ones, so I opted to revertExplode.