-
Hi, i'm touching up my thesis and could use some midrules in my tables. example: |1 | 1|1 |
|--|--|--|
|1 | 1|1 |
|1 | 1|1 |
|\midrule 1 | 1|1 |
|1 | 1|1 |
```table
---
markdown: false
---
1,1,1,1,1
1,1,1,1,1
1,1,1,1,1
\midrule 1,1,1,1,1
1,1,1,1,1
1,1,1,1,1
```
```table
---
markdown: true
---
1,1,1,1,1
1,1,1,1,1
1,1,1,1,1
\midrule 1,1,1,1,1
1,1,1,1,1
1,1,1,1,1
``` command:
output: \begin{longtable}[]{@{}lll@{}}
\toprule
1 & 1 & 1 \\
\midrule
\endhead
1 & 1 & 1 \\
1 & 1 & 1 \\
\midrule 1 & 1 & 1 \\
1 & 1 & 1 \\
\bottomrule
\end{longtable}
\begin{longtable}[]{@{}lllll@{}}
\toprule
1 & 1 & 1 & 1 & 1 \\
\midrule
\endhead
1 & 1 & 1 & 1 & 1 \\
1 & 1 & 1 & 1 & 1 \\
\textbackslash midrule 1 & 1 & 1 & 1 & 1 \\
1 & 1 & 1 & 1 & 1 \\
1 & 1 & 1 & 1 & 1 \\
\bottomrule
\end{longtable}
\begin{longtable}[]{@{}
>{\raggedright\arraybackslash}p{(\columnwidth - 8\tabcolsep) * \real{0.20}}
>{\raggedright\arraybackslash}p{(\columnwidth - 8\tabcolsep) * \real{0.20}}
>{\raggedright\arraybackslash}p{(\columnwidth - 8\tabcolsep) * \real{0.20}}
>{\raggedright\arraybackslash}p{(\columnwidth - 8\tabcolsep) * \real{0.20}}
>{\raggedright\arraybackslash}p{(\columnwidth - 8\tabcolsep) * \real{0.20}}@{}}
\toprule
1 & 1 & 1 & 1 & 1 \\
\midrule
\endhead
1 & 1 & 1 & 1 & 1 \\
1 & 1 & 1 & 1 & 1 \\
\begin{minipage}[t]{\linewidth}\raggedright
\midrule 1
\end{minipage} & 1 & 1 & 1 & 1 \\
1 & 1 & 1 & 1 & 1 \\
1 & 1 & 1 & 1 & 1 \\
\bottomrule
\end{longtable} My use-case is |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
It can be done: I turned this into a discussion and show you how it find out how to do this. First, say in | 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
So you see the key idea is to mark explicitly the To see that comm -3 <(pandoc ex1.md -F pantable2csv -t native -F pantable) <(pandoc ex1.md -t native) as it shows no difference, it means it has identical AST. qed. Edit: A few interesting points: Look at the native of
The problem is that the cell Another worth noting thing is, it would be tempted to think the more native way to produce a table like that in pantable is
But pandoc currently does not put draw a midrule before the foot row. This is an upstream issue and is subjective to say which is right. |
Beta Was this translation helpful? Give feedback.
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
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
where
ex2.md
now hasSo you see the key idea is to mark explicitly the
\midrule
as raw tex.To see that
ex1.md
andex2.md
produces identical native AST:comm -3 <(pandoc ex1.md -F pan…