-
-
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
Width of table containing math is based on width of LaTeX commands #6254
Comments
Actually it depends on the separator lines, not the content. See the manual under pipe tables for how it works. |
Look at the example. The separator lines are identical. The second table is correct, but the first table is rendered too wide. In the docs, it is written:
In this case, the printable content of the two tables are identical except for the characters ( So I think the way that pandoc is computing the line length is based on the LaTeX length. If I look at the resulting LaTeX source, the first table has each cell in a |
Read the manual more carefully:
This is saying that the "relative widths based on the separator lines" feature only kicks in when you've got at least one content line that exceeds "columnwidth". That happens in your first table but not your second. If you want narrower columns in the first table, just use narrower separators (e.g. |
But the content lines do not exceed the "columnwidth". Even with separators that are Look at the picture and you'll see. The only difference between the math in each cell is that the first table uses |
Yes: what's meant by "column width" is column width in the markdown source. (There's no way for pandoc to compute the column width in the rendered version; it would have to do TeX typesetting to know that. I know that this leads to odd results occasionally.) But I was wrong to suggest that changes the separators to A workaround for you would be to define a tex macro for the math so you can make the source shorter. |
Another workaround would be to specify a larger columnwidth on the command line. |
I did try the macro thing, and that didn't help. If I use I'd suggest writing something in the docs about how characters are counted (i.e., the characters in math mode count towards line width), or maybe when you count the width, you count each LaTeX token as a single character (but maybe that won't work since you don't parse the math) |
The macro trick should work if you specify
|
I still had to get the line shorter than 72 chars for it to work right (or just use One note that might help. In the docs about
What is confusing here is the phrase "printable content". Maybe it should say "number of characters" or something like that |
Yes, that's what I meant: the idea was to use a macro to help do this. |
When creating a table in markdown and the table has math in the cells, and then converting to PDF, the width of the table is influenced by the length of the LaTeX commands that create the math.
Here's markdown text for 2 tables. The first one is using
\mathcal
around some of the letters, while the second one doesn't. When rendered, the tables should be of the same width.Here is a pic of the output:
Version Info:
The text was updated successfully, but these errors were encountered: