mirror of
https://github.com/jgm/pandoc.git
synced 2026-09-24 15:44:59 +08:00
LaTeX writer: Protect VERB in caption (#11139)
Also apply hlint suggestions for fewer imports and moving brackets to avoid $.
This commit is contained in:
@@ -0,0 +1,80 @@
|
||||
```
|
||||
% pandoc -f native -t latex
|
||||
[ Para [ Code ( "" , [ "python" ] , [] ) "x = 5" ]
|
||||
, Figure
|
||||
( "" , [] , [] )
|
||||
(Caption
|
||||
Nothing
|
||||
[ Plain
|
||||
[ Str "This"
|
||||
, Space
|
||||
, Str "is"
|
||||
, Space
|
||||
, Str "a"
|
||||
, Space
|
||||
, Str "test"
|
||||
, Space
|
||||
, Code ( "" , [ "python" ] , [] ) "x = 5"
|
||||
]
|
||||
])
|
||||
[ Plain
|
||||
[ Image
|
||||
( "" , [] , [] )
|
||||
[ Str "This"
|
||||
, Space
|
||||
, Str "is"
|
||||
, Space
|
||||
, Str "a"
|
||||
, Space
|
||||
, Str "test"
|
||||
, Space
|
||||
, Code ( "" , [ "python" ] , [] ) "x = 5"
|
||||
]
|
||||
( "test.png" , "" )
|
||||
]
|
||||
]
|
||||
, Table
|
||||
( "" , [] , [] )
|
||||
(Caption
|
||||
Nothing
|
||||
[ Plain [ Code ( "" , [ "cpp" ] , [] ) "caption" ] ])
|
||||
[ ( AlignDefault , ColWidthDefault ) ]
|
||||
(TableHead ( "" , [] , [] ) [])
|
||||
[ TableBody ( "" , [] , [] ) (RowHeadColumns 0) [] [] ]
|
||||
(TableFoot
|
||||
( "" , [] , [] )
|
||||
[ Row
|
||||
( "" , [] , [] )
|
||||
[ Cell
|
||||
( "" , [] , [] )
|
||||
AlignDefault
|
||||
(RowSpan 1)
|
||||
(ColSpan 1)
|
||||
[ Plain [ Str "A" ] ]
|
||||
]
|
||||
])
|
||||
, Para [ Code ( "" , [ "cpp" ] , [] ) "caption" ]
|
||||
]
|
||||
^D
|
||||
\VERB|\NormalTok{x }\OperatorTok{=} \DecValTok{5}|
|
||||
|
||||
\begin{figure}
|
||||
\centering
|
||||
\pandocbounded{\includegraphics[keepaspectratio,alt={This is a test x = 5}]{test.png}}
|
||||
\caption{This is a test
|
||||
\protect\VERB|\NormalTok{x }\OperatorTok{=} \DecValTok{5}|}
|
||||
\end{figure}
|
||||
|
||||
\begin{longtable}[]{@{}l@{}}
|
||||
\caption{\protect\VERB|\NormalTok{caption}|}\tabularnewline
|
||||
\toprule\noalign{}
|
||||
\endfirsthead
|
||||
\endhead
|
||||
\midrule\noalign{}
|
||||
A \\
|
||||
\bottomrule\noalign{}
|
||||
\endlastfoot
|
||||
\end{longtable}
|
||||
|
||||
\VERB|\NormalTok{caption}|
|
||||
```
|
||||
Reference in New Issue
Block a user