mirror of
https://github.com/jgm/pandoc.git
synced 2026-08-24 09:16:43 +00:00
LaTeX writer: Use \endhead after \toprule in headerless tables.
Closes #4207.
This commit is contained in:
@@ -699,10 +699,9 @@ blockToLaTeX (Table caption aligns widths heads rows) = do
|
||||
then return empty
|
||||
else ($$ text "\\endfirsthead") <$> toHeaders heads
|
||||
head' <- if all null heads
|
||||
then return empty
|
||||
then return "\\toprule"
|
||||
-- avoid duplicate notes in head and firsthead:
|
||||
else ($$ text "\\endhead") <$>
|
||||
toHeaders (if isEmpty firsthead
|
||||
else toHeaders (if isEmpty firsthead
|
||||
then heads
|
||||
else walk removeNote heads)
|
||||
let capt = if isEmpty captionText
|
||||
@@ -717,8 +716,8 @@ blockToLaTeX (Table caption aligns widths heads rows) = do
|
||||
-- the @{} removes extra space at beginning and end
|
||||
$$ capt
|
||||
$$ firsthead
|
||||
$$ (if all null heads then "\\toprule" else empty)
|
||||
$$ head'
|
||||
$$ "\\endhead"
|
||||
$$ vcat rows'
|
||||
$$ "\\bottomrule"
|
||||
$$ "\\end{longtable}"
|
||||
|
||||
@@ -136,6 +136,7 @@ Table without column headers:
|
||||
|
||||
\begin{longtable}[]{@{}rlcr@{}}
|
||||
\toprule
|
||||
\endhead
|
||||
12 & 12 & 12 & 12\tabularnewline
|
||||
123 & 123 & 123 & 123\tabularnewline
|
||||
1 & 1 & 1 & 1\tabularnewline
|
||||
@@ -146,6 +147,7 @@ Multiline table without column headers:
|
||||
|
||||
\begin{longtable}[]{@{}clrl@{}}
|
||||
\toprule
|
||||
\endhead
|
||||
\begin{minipage}[t]{0.13\columnwidth}\centering
|
||||
First\strut
|
||||
\end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright
|
||||
|
||||
Reference in New Issue
Block a user