-
Notifications
You must be signed in to change notification settings - Fork 969
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
Table rows are too wide. #29
Comments
Hello, As I have a hard time reading Haskell, I only created the following proof-of-concept to ask you about your opinion. When the following lua-filter is applied, all tables get replaced by the hardcoded table from the filter. function Table(table)
return pandoc.RawBlock('tex', hardCodedTable(table))
end
function hardCodedTable(alignment)
rawLatex = "\\begin{longtable}[]{rllc}\n" ..
"\\caption{Some hardcoded table}\\tabularnewline\n" ..
"\\toprule\n" ..
"\\textbf{Right} & Left & Default & Center\\tabularnewline\n" ..
"\\midrule\n" ..
"\\endfirsthead\n" ..
"\\toprule\n" ..
"\\textbf{Right} & Left & Default & Center\\tabularnewline\n" ..
"\\midrule\n" ..
"\\endhead\n" ..
"4711 & 12 & 12 & 12\\tabularnewline\n" ..
"4711 & 123 & 123 & 123\\tabularnewline\n" ..
"4711 & 1 & 1 & 1\\tabularnewline\n" ..
"\\bottomrule\n" ..
"\\end{longtable}\n"
return rawLatex
end Therefore the following Markdown file, results in the following LaTeX file. # Header 1
| **Right** | Left | Default | Center |
|------:|:-----|---------|:------:|
| 12 | 12 | 12 | 12 |
| 123 | 123 | 123 | 123 |
| 1 | 1 | 1 | 1 |
: Table 1
| **Right** | Left | Default | Center |
|------:|:-----|---------|:------:|
| 12 | 12 | 12 | 12 |
| 123 | 123 | 123 | 123 |
| 1 | 1 | 1 | 1 |
: Table 2 \hypertarget{header-1}{%
\section{Header 1}\label{header-1}}
\begin{longtable}[]{rllc}
\caption{Some hardcoded table}\tabularnewline
\toprule
\textbf{Right} & Left & Default & Center\tabularnewline
\midrule
\endfirsthead
\toprule
\textbf{Right} & Left & Default & Center\tabularnewline
\midrule
\endhead
4711 & 12 & 12 & 12\tabularnewline
4711 & 123 & 123 & 123\tabularnewline
4711 & 1 & 1 & 1\tabularnewline
\bottomrule
\end{longtable}
\begin{longtable}[]{rllc}
\caption{Some hardcoded table}\tabularnewline
\toprule
\textbf{Right} & Left & Default & Center\tabularnewline
\midrule
\endfirsthead
\toprule
\textbf{Right} & Left & Default & Center\tabularnewline
\midrule
\endhead
4711 & 12 & 12 & 12\tabularnewline
4711 & 123 & 123 & 123\tabularnewline
4711 & 1 & 1 & 1\tabularnewline
\bottomrule
\end{longtable} This is of course a nonsensical filter, but the
|
Yes, I thought about that but I don't have much experience with pandoc filters or Lua. I would have made a bash script that replaces the string A filter seems much nicer and could potentially solve more than one problem as you mentioned. Unfortunately I don't have much time at the moment so a workaround with filters has to wait. |
I didn't see it mentioned anywhere, but I believe that this commit is the root of this issue: Mind you, I haven't reverted it and recompiled I started typing my notes up using markdown instead of LaTeX, and began using your awesome template as a result. (@Wandmalfarbe you did a fantastic job -- I really appreciate you sharing it!) The overlap between the coloring and the rules bothered me, which led me to this issue. I thought about writing a filter (which would have been apt considering I'm currently self-teaching Haskell, and that As far as I can tell, we could do any of the following
I think my favorite option is the first, because it would extend The second option doesn't seem viable because, (and this is still speculation because I haven't recompiled The third option definitely works, and might possibly be implemented by a simple bash script or something similar... but I feel that this signals a failure in tooling. Anyway, apologies if this was all already known. I didn't see it anywhere and thought I'd share my findings. |
@Wandmalfarbe Until a better solution (fix to pandoc, lua filter, ...) is implemented, couldn't it be a simple workaround to disable column colours via an option to the eisvogel template?! |
…ption `table-use-row-colors: true`.
thanks :) |
See also jgm/pandoc#3929
A current workaround is to embed raw latex tables in the markdown document.
The text was updated successfully, but these errors were encountered: