-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
LaTeX Reader and multirow, part 2 #6603
Comments
Damn, my initial patch (#6470) really missed the mark. Let me summarize the problems:
@kysko you refer to documentation. Can you specify if that is documentation that is provided with I'm sorry for the problems that the initial patch created! I'll make sure to add tests to explore various scenarios beyond small simple examples. |
Sorry for not providing a TLDR ! And it is the Another detail about the second issue: the native output of
seems ok through your reader, the "B" is not lost. I was still able to process a biggish complex table with your reader (after a few adjustments, so your work has a huge benefit! |
Ok thanks @kysko, I'll put together a patch. |
Firstly, thanks to LRDC for his latex reader, and fixing a little problem recently.
But there's a few more issues with it that escaped me last time,
multirow
being particularly problematic. I prefer to combine them here rather as separate issues, even if it make a long text.(Below, I was using pandoc-nightly-windows-2020-08-08 which includes LRDC's latest fix for issue #6596.)
multirow's second argument
From the documentation,
multirow
's second curly-braced argument iswidth
, the width in which to set the text.However it seems the latex reader interprets the second argument as an alignment.
will give the (simplified!) native output:
Notice how the Cell is centered, although I demanded a right align.
The proper notation
will give a
Para
in the native output, not aTable
.Maybe the confusion comes from the fact that in
\multicolumn{2}{r}
, the second argument is an alignment, and perhaps one thoughtmultirow
behaved the same way.Note that trying to compile with
pdflatex
, the first example will give out an error ("missing number"), while the second won't (although here also there is something to say below).multirow and proper cell inputs in rows
The documentation says:
While not explicit, one can verify that litteraly empty cells must be written, as in the following:
Notice how the
&
is present to separate from a preceding empty cell.However, in the tests for the LaTex reader, one can see the following format is used:
that is, by omitting the
&
.The Native output is almost the same for both inputs, except that the "B" above is missing when written in the correct format.
As for compilation with
pdflatex
(once {c} is replaced by {5em} for example), both compile, but it is evident that the "B" is overwritten in the later format.(/edited part reverted back, the above stands)
(
/Another edit!: on that note, the last example from the previous issue should then be written
indicating an empty row, which upon compilation with pdflatex gives a better output (visible when you put vertical lines).
)
Mixing multirow and multicolumn
The documentation says:
However, the nested
\multirow
and\multicolumn
in the LaTeX test has the second within the first:The proper notation should be something like (accounting for the other points above):
With the LaTeX reader, both Native outputs are the same (replacing the "5em" by "c" in the 2nd one).
However,
pdflatex
only compiles the second one (even after replacing the "c" by "5em" in the first'smultirow
).(/Edited: well, this third one might not be a real problem, since the reader reads both formats, and the latex tables that compile will work fine. But still worth noticing.)
The text was updated successfully, but these errors were encountered: