LoginSignup
7
7

More than 5 years have passed since last update.

pandocでmarkdownをtexに変換するとtableがおかしくなる件

Posted at

概要

markdownのtebalをpandocでtexにコンバートすると、他の図などが変にはみ出てしまうことがある。

どうやら変換後のlongtableの問題らしいが、texは詳しくないのでよく分からないし、pandocの処理を変える方法も分からない。

解決方法

普段pipe tableを使っていたのだが、

| Right | Left | Default | Center |
|------:|:-----|---------|:------:|
|   12  |  12  |    12   |    12  |
|  123  |  123 |   123   |   123  |
|    1  |    1 |     1   |     1  |

  : Demonstration of pipe table syntax.

multiline tablesやgrid tableなら上手く処理される。


-------------------------------------------------------------
 Centered   Default           Right Left
  Header    Aligned         Aligned Aligned
----------- ------- --------------- -------------------------
   First    row                12.0 Example of a row that
                                    spans multiple lines.

  Second    row                 5.0 Here's another one. Note
                                    the blank line between
                                    rows.
-------------------------------------------------------------

Table: Here's the caption. It, too, may span
multiple lines.

: Sample grid table.

+---------------+---------------+--------------------+
| Fruit         | Price         | Advantages         |
+===============+===============+====================+
| Bananas       | $1.34         | - built-in wrapper |
|               |               | - bright color     |
+---------------+---------------+--------------------+
| Oranges       | $2.10         | - cures scurvy     |
|               |               | - tasty            |
+---------------+---------------+--------------------+

各tableの詳しい記法はPandoc User’s Guideを参照。

マジか。なんでpipeだけ駄目なんだろう。気に入ってたのに。仕方ないからmutilineを使うことにするか。
pan

7
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
7