mirror of
https://github.com/jgm/pandoc.git
synced 2026-09-21 23:15:52 +00:00
LaTeX writer: don't use footnotehyper for notes in longtable.
Instead, generate them manually as we do for floating tables. This removes our dependency on footnotehyper, and solves a compatibility problem with `endfloat`. Closes #11857.
This commit is contained in:
@@ -88,9 +88,6 @@ $else$
|
||||
\makeatletter
|
||||
\patchcmd\longtable{\par}{\if@noskipsec\mbox{}\fi\par}{}{}
|
||||
\makeatother
|
||||
% Allow footnotes in longtable head/foot
|
||||
\IfFileExists{footnotehyper.sty}{\usepackage{footnotehyper}}{\usepackage{footnote}}
|
||||
\makesavenoteenv{longtable}
|
||||
$endif$
|
||||
$endif$
|
||||
$--
|
||||
|
||||
@@ -53,7 +53,6 @@ tableToLaTeX inlnsToLaTeX blksToLaTeX tbl = do
|
||||
$ lookup "latex-placement" kvs
|
||||
-- if the float class is included in table attributes, we generate a floating
|
||||
-- table environment; otherwise we use longtable
|
||||
beamer <- gets stBeamer
|
||||
let float = "float" `elem` classes
|
||||
let renderTable = do
|
||||
let unnumbered = "unnumbered" `elem` classes
|
||||
@@ -83,11 +82,7 @@ tableToLaTeX inlnsToLaTeX blksToLaTeX tbl = do
|
||||
then makeUnnumbered
|
||||
else id) <$>
|
||||
makeTable colDesc mkHead mkRow capt thead tbodies tfoot
|
||||
-- See #5367 -- footnotehyper/footnote don't work in beamer,
|
||||
-- so we need to produce the notes outside the table...
|
||||
if float || beamer
|
||||
then ($$) <$> withExternalNotes renderTable <*> getAccumulatedNotes
|
||||
else renderTable
|
||||
($$) <$> withExternalNotes renderTable <*> getAccumulatedNotes
|
||||
|
||||
tableToLaTeXTable :: PandocMonad m
|
||||
=> Doc Text
|
||||
|
||||
@@ -14,7 +14,7 @@ is used.
|
||||
\begin{longtable}[]{@{}ll@{}}
|
||||
\caption{a table}\tabularnewline
|
||||
\toprule\noalign{}
|
||||
x & y\footnote{a footnote} \\
|
||||
x & y\footnotemark{} \\
|
||||
\midrule\noalign{}
|
||||
\endfirsthead
|
||||
\toprule\noalign{}
|
||||
@@ -25,4 +25,5 @@ x & y{} \\
|
||||
\endlastfoot
|
||||
1 & 2 \\
|
||||
\end{longtable}
|
||||
\footnotetext{a footnote}
|
||||
```
|
||||
|
||||
@@ -22,10 +22,10 @@ hello\footnote{doc footnote}
|
||||
|
||||
\begin{longtable}[]{@{}
|
||||
>{\centering\arraybackslash}p{(\linewidth - 0\tabcolsep) * \real{0.1667}}@{}}
|
||||
\caption[Sample table.]{Sample table.\footnote{caption footnote}}\tabularnewline
|
||||
\caption[Sample table.]{Sample table.\footnotemark{}}\tabularnewline
|
||||
\toprule\noalign{}
|
||||
\begin{minipage}[b]{\linewidth}\centering
|
||||
Fruit\footnote{header footnote}
|
||||
Fruit\footnotemark{}
|
||||
\end{minipage} \\
|
||||
\midrule\noalign{}
|
||||
\endfirsthead
|
||||
@@ -37,8 +37,14 @@ Fruit{}
|
||||
\endhead
|
||||
\bottomrule\noalign{}
|
||||
\endlastfoot
|
||||
Bans\footnote{table cell footnote} \\
|
||||
Bans\footnotemark{} \\
|
||||
\end{longtable}
|
||||
\addtocounter{footnote}{-2}
|
||||
\footnotetext{caption footnote}
|
||||
\addtocounter{footnote}{1}
|
||||
\footnotetext{header footnote}
|
||||
\addtocounter{footnote}{1}
|
||||
\footnotetext{table cell footnote}
|
||||
|
||||
dolly\footnote{doc footnote}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user