Skip to content

Reproduce any tricks used in native pandoc table in the example of inserting midrules in LaTeX #60

Answered by ickc
pbsds asked this question in Q&A
Discussion options

You must be logged in to vote

It can be done: I turned this into a discussion and show you how it find out how to do this.

First, say in ex1.md

| 1	| 2	| 3	|  
| --	| --	| --	|  
| 4	| 5	| 6	|  
| 7	| 8	| 9	|  
| \midrule 10	| 11	| 12	|  

assuming this native pandoc table can achieve what you want to do (in this case inject a certain TeX command to the LaTeX output.)

To see what should be written as a pantable, use

pandoc ex1.md -F pantable2csv -o ex2.md

where ex2.md now has

``` {.table}
---
markdown: true
...
1,2,3
4,5,6
7,8,9
`\midrule 10`{=tex},11,12
```

So you see the key idea is to mark explicitly the \midrule as raw tex.

To see that ex1.md and ex2.md produces identical native AST:

comm -3 <(pandoc ex1.md -F pan…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ickc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #59 on June 08, 2021 23:39.