-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem removing table top or bottom rules with latex command in pandoc 2.19 #8223
Comments
See #8001 for the reasons behind this change, but maybe we can make that work again: For the time being, you can use |
In this connection we should also consider Revisiting my decision to add the |
Oh. I guess this issue should be closed then. I don't know why I missed the empty line, or why I got a different result. |
I'd like to keep this open until I can understand why the |
I found my mistake: I was experimenting in a raw tex file and had removed the |
See also #8242. |
The reason
And then \documentclass{article}
\usepackage{booktabs}
\usepackage{longtable}
\begin{document}
\begin{longtable}{@{}lll@{}}
\toprule\noalign{}
\endhead
(1) & 2 & 3 \\
a & b & c \\
\bottomrule\noalign{}
\end{longtable}
\begin{longtable}{@{}lll@{}}
\toprule\noalign{}
(1) & 2 & 3 \\
\endhead
a & b & c \\
\bottomrule\noalign{}
\end{longtable}
\end{document} |
It seems like all questions around this issue have been answered. Closing. |
I was thinking we should keep this open in order to explore the solution proposed here:
Unless I was misunderstanding and this isn't a potential solution? |
Oh, I had missed that! |
I've been trying to implement zebra shading in a longtable following the discussion here. I managed to get something that looked good by adding this before the table in my markdown file:
The only problem was that two parentheses "()" were added into the top of the table. I then found my way to this thread. Following the discussion here, I discovered that if I used pandoc to compile my markdown file to LaTeX, I could get rid of the parentheses by replacing the instance of "\toprule()" to "\toprule\noalign{}" in the LaTeX file. I guess my question is: what (and where) can I include in my markdown file so that Pandoc produces a PDF without the parentheses? I mean, I guess I can compile to LaTeX and make that change manually, but it'd be great if there were another way. Thanks! |
There's no way to get this fix with pandoc itself. You could pipe output through sed or perl. |
@jpk3333 As a workaround you can also modify your code to look like this \rowcolors{2}{}{gray!25}
\setlength{\tabcolsep}{0pt}
% \apptocmd{\toprule}{\hiderowcolors}{}{}
\makeatletter
\NewCommandCopy\@oldtoprule\toprule
\RenewExpandableDocumentCommand\toprule{d()m}{\@oldtoprule\hiderowcolors#2}
\makeatother
\apptocmd{\endhead}{\showrowcolors}{}{}
\apptocmd{\endfirsthead}{\showrowcolors}{}{} though it's a bit hacky, so double check that it works as expected. (You may have to add |
@marcin-serwin It worked! Thanks! |
Pandoc 2.19, macOS 12.5
With previous pandoc versions, table top/mid/bottom rules could be removed by including appropriate latex commands under header-includes. The following example with pandoc 2.19 removes top and bottom rules but adds two parentheses (), as shown in attached pdf. Same with grid tables.
test.pdf
test.md
The text was updated successfully, but these errors were encountered: