Reputation: 372
How can I make pandoc create a cell with the first thing being a line break in a grid table?
The following makes latex say ! LaTeX Error: There's no line here to end.
+-----------------------------------+------------------------------------+
| X | Y |
+===================================+====================================+
|Total revenue:\ | \ |
| - Current year\ | YYY\ |
| - Previous year\ | XXX\ |
|Total profit/loss:\ | \ |
| - Current year\ | TTT\ |
| - Previous year | ZZZ |
+-----------------------------------+------------------------------------+
Upvotes: 0
Views: 968
Reputation: 372
Using \mbox{} \
will create the expected line breaks and no latex errors
+-----------------------------------+------------------------------------+
| X | Y |
+===================================+====================================+
|Total revenue:\ | \mbox{} \ |
| - Current year\ | YYY\ |
| - Previous year\ | XXX\ |
|Total profit/loss:\ | \mbox{} \ |
| - Current year\ | TTT\ |
| - Previous year | ZZZ |
+-----------------------------------+------------------------------------+
I have created an issue at github https://github.com/jgm/pandoc/issues/1733
Upvotes: 0
Reputation: 39189
Using linebreaks for layouting is frowned upon in Markdown and HTML. Because it's not semantic, but also because it often doesn't work well (like in your example).
I would make the table.... well, more tabular:
X Y
-------------- -------------- ---- ----
Total revenue:
Current year XXX YYY
Previous year XXX YYY
Total profit:
Current year XXX YYY
Previous year XXX YYY
Upvotes: 1