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

Incorrect newline command in parbox and minipage #1004

Closed
teepeemm opened this issue Jun 2, 2018 · 1 comment
Labels
bug
Milestone

Comments

@teepeemm
Copy link
Contributor

@teepeemm teepeemm commented Jun 2, 2018

Normally, LaTeXML discards the optional vertical skip argument to the newline command \\. I suppose this makes sense for separating style and content. I've found, however, that in parbox and minipage, \\ no longer takes an optional argument and prematurely ends the container. This means that the optional [Dimension] becomes output in the document.

I think this is because LaTeX.pool.ltxml has Let('\\\\', '\par'); in its definitions for parbox and minipage, and \par doesn't accept an optional argument. I can't decipher how LaTeX does the redefinitions that it does.

Here's a minimal example.

\documentclass{article}

\begin{document}

Line 1\\[1in]
Line 2 ok

\begin{minipage}{100pt}
Line 3\\[1in]
Line 4 not ok. It has the dimension, and doesn't follow the defined width.
\end{minipage}

\parbox{100pt}{Line 5\\[1in]
Line 6 not ok. It has the dimension, and doesn't follow the defined width.}

\end{document}

resulting in the xml:

  <para xml:id="p1">
    <p>Line 1<break/>
Line 2 ok</p>
  </para>
  <para xml:id="p2">
    <p class="ltx_minipage" vattach="middle" width="100.0pt">Line 3</p>
  </para>
  <para xml:id="p3">
    <p>[1in]
Line 4 not ok. It has the dimension, and doesn’t follow the defined width.</p>
  </para>
  <para xml:id="p4">
    <p class="ltx_parbox" vattach="middle" width="100.0pt">Line 5</p>
  </para>
  <para xml:id="p5">
    <p>[1in]
Line 6 not ok. It has the dimension, and doesn’t follow the defined width.</p>
  </para>

Specifically, the latter two [1in] have appeared in the xml, and show up in the resulting html. The \\ has also caused the next paragraph to no longer be part of the fixed width p tag.

@dginev dginev added the bug label Jun 2, 2018
@dginev dginev added this to the LaTeXML-0.8.4 milestone Jun 2, 2018
@brucemiller

This comment has been minimized.

Copy link
Owner

@brucemiller brucemiller commented Jun 5, 2018

Slightly related to a couple of previous issues here, but mainly the wrong local redefinition of \\. Should work better now. Thanks for the report!

@brucemiller brucemiller closed this Jun 5, 2018
@dginev dginev modified the milestones: LaTeXML-0.8.4, LaTeXML-0.8.3 Jun 5, 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.