Skip to content
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

{quote} environment breaks list environments ({itemize}, {enumerate} etc.) #1018

Closed
siegfriedzoetzsche opened this issue Jul 16, 2018 · 1 comment
Labels
Milestone

Comments

@siegfriedzoetzsche
Copy link

@siegfriedzoetzsche siegfriedzoetzsche commented Jul 16, 2018

Converting listquote.tex:

\documentclass{article}
\begin{document}
\begin{quote}
  \begin{itemize}
  \item A
  \item B
  \end{itemize}
\end{quote}
\begin{itemize}
\item a
\item b
\end{itemize}
\end{document}

with

latexml --strict --destination listquote.xml listquote.tex

results in

[...]
  <para xml:id="p1">
    <quote>
      <itemize xml:id="S0.I1">
        <item>
          <para xml:id="S0.I1.p1">
            <break/>
          </para>
        </item>
        <item xml:id="S0.I1.i1">
          <tags>
            <tag>•</tag>
            <tag role="typerefnum">1st item</tag>
          </tags>
          <para xml:id="S0.I1.i1.p1">
            <p>A
<break/></p>
          </para>
        </item>
        <item xml:id="S0.I1.i2">
          <tags>
            <tag>•</tag>
            <tag role="typerefnum">2nd item</tag>
          </tags>
          <para xml:id="S0.I1.i2.p1">
            <p>B
<break/></p>
          </para>
        </item>
      </itemize>
    </quote>
    <itemize xml:id="S0.I2">
      <item xml:id="S0.I2.i1">
        <tags>
          <tag>•</tag>
          <tag role="typerefnum">1st item</tag>
        </tags>
        <para xml:id="S0.I2.i1.p1">
          <p>a</p>
        </para>
      </item>
      <item xml:id="S0.I2.i2">
        <tags>
          <tag>•</tag>
          <tag role="typerefnum">2nd item</tag>
        </tags>
        <para xml:id="S0.I2.i2.p1">
          <p>b</p>
        </para>
      </item>
    </itemize>
  </para>
[...]

Note

<item>
  <para xml:id="S0.I1.p1">
   <break/>
  </para>
</item>

and the other two added <break/> compared to the {itemize} outside of the quote.

I guess the reason for this are the Let('\par', '\@block@cr') in:

DefEnvironment('{quotation}',
  '<ltx:quote>#body</ltx:quote>',
  beforeDigest => sub { Let('\\\\', '\@block@cr'); Let('\par', '\@block@cr') },
  mode => 'text');

and the \par:

DefMacro('\itemize@item', '\par\itemize@item@');

in LaTeX.pool.ltxml.

@dginev dginev added this to the LaTeXML-0.8.4 milestone Jul 16, 2018
@brucemiller

This comment has been minimized.

Copy link
Owner

@brucemiller brucemiller commented Jul 17, 2018

Yep, you're exactly right. So now quote proactively rebinds \par to the normal one (which there was a more clever way of DWIM). Anyway; it's fixed now. Thanks for the report!

@dginev dginev modified the milestones: LaTeXML-0.8.4, LaTeXML-0.8.3 Jul 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.