Skip to content

Commit

Permalink
LaTeX writer: Fix regression.
Browse files Browse the repository at this point in the history
In 3.1.7, pandoc added two labels to LaTeX figure environments,
one with a phantomsection.

Closes #9045.
  • Loading branch information
jgm committed Sep 1, 2023
1 parent fc0beae commit 632e3c1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/Text/Pandoc/Writers/LaTeX.hs
Original file line number Diff line number Diff line change
Expand Up @@ -569,8 +569,7 @@ blockToLaTeX (Figure (ident, _, _) captnode body) = do
[b] -> blockToLaTeX b
bs -> mconcat . intersperse (cr <> "\\hfill") <$>
mapM (toSubfigure (length bs)) bs
target <- hypertarget ident
let innards = target $$ "\\centering" $$ contents $$ caption <> cr
let innards = "\\centering" $$ contents $$ caption <> cr
modify $ \st ->
st{ stInFigure = isSubfigure
, stSubfigure = stSubfigure st || isSubfigure
Expand Down
10 changes: 10 additions & 0 deletions test/command/9045.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
```
% pandoc -t latex
![hi](there.jpg){#foo}
^D
\begin{figure}
\centering
\includegraphics{there.jpg}
\caption{hi}\label{foo}
\end{figure}
```

0 comments on commit 632e3c1

Please sign in to comment.