Skip to content

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

Description

@siegfriedzoetzsche

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.

Activity

  1. added this to the LaTeXML-0.8.4 milestone on Jul 16, 2018
  2. brucemiller commented on Jul 17, 2018

    @brucemiller
    Owner

    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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions