annProg / PanBook

Pandoc LaTeX,Epub模板,用于生成书籍,幻灯片(beamer),简历,论文等(cv, thesis, ebook,beamer)
BSD 3-Clause "New" or "Revised" License
263 stars 28 forks source link

表格内容自动换行 #23

Closed annProg closed 5 years ago

annProg commented 5 years ago

未自动换行。

https://tex.stackexchange.com/questions/166743/automatic-line-break-in-tabular

annProg commented 5 years ago

https://inf.ethz.ch/personal/markusp/teaching/guides/guide-tables.pdf

annProg commented 5 years ago

使用 pipe_tables 可以支持自动换行,示例

fruit| price
-----|-----:
apple apple apple apple apple apple apple apple apple apple apple apple apple apple apple apple apple apple apple |2.05
pear|1.37
orange|3.09

参考: https://pandoc.org/MANUAL.html#tables

The cells of pipe tables cannot contain block elements like paragraphs and lists, and cannot span multiple lines. If a pipe table contains a row whose printable content is wider than the column width (see --columns), then the table will take up the full text width and the cell contents will wrap, with the relative cell widths determined by the number of dashes in the line separating the table header from the table body. (For example ---|- would make the first column 3/4 and the second column 1/4 of the full text width.) On the other hand, if no lines are wider than column width, then cell contents will not be wrapped, and the cells will be sized to their contents.