From 2845ab59769709cbc250aa4ac116efbdcdf3412b Mon Sep 17 00:00:00 2001 From: schrieveslaach Date: Sun, 13 Aug 2017 19:58:45 +0200 Subject: =?UTF-8?q?Put=20content=20of=20\ref,=20\label=20commands=20into?= =?UTF-8?q?=20span=E2=80=A6=20(#3639)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Put content of `\ref` and `\label` commands into Span elements so they can be used in filters. * Add support for `\eqref` --- test/command/refs.md | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 test/command/refs.md (limited to 'test/command') diff --git a/test/command/refs.md b/test/command/refs.md new file mode 100644 index 000000000..d933235d7 --- /dev/null +++ b/test/command/refs.md @@ -0,0 +1,54 @@ +``` +% pandoc -f latex -t native +Figure \ref{fig:1} +^D +[Para [Str "Figure",Space,Span ("",[],[("reference-type","ref"),("reference","fig:1")]) [Str "[fig:1]"]]] +``` + +``` +% pandoc -f latex -t native +Figure \cref{fig:1} +^D +[Para [Str "Figure",Space,Span ("",[],[("reference-type","ref"),("reference","fig:1")]) [Str "[fig:1]"]]] +``` + +``` +% pandoc -f latex -t native +Figure \vref{fig:1} +^D +[Para [Str "Figure",Space,Span ("",[],[("reference-type","ref+page"),("reference","fig:1")]) [Str "[fig:1]"]]] +``` + +``` +% pandoc -f latex -t native +Accuracy~\eqref{eq:Accuracy} is the proportion, measuring true results among all results. + +\begin{equation} + \label{eq:Accuracy} + Accuracy = \frac{t_p + t_n}{t_p + f_p + f_n + t_n} +\end{equation} +^D +[Para [Str "Accuracy\160",Span ("",[],[("reference-type","eqref"),("reference","eq:Accuracy")]) [Str "[eq:Accuracy]"],Space,Str "is",Space,Str "the",Space,Str "proportion,",Space,Str "measuring",Space,Str "true",Space,Str "results",Space,Str "among",Space,Str "all",Space,Str "results."] +,Para [Math DisplayMath "\\label{eq:Accuracy}\n Accuracy = \\frac{t_p + t_n}{t_p + f_p + f_n + t_n}"]] +``` + +``` +% pandoc -f latex -t native +\begin{figure} + \includegraphics{command/SVG_logo.svg} + \caption{Logo} + \label{fig:Logo} +\end{figure} + +Figure \ref{fig:Logo} illustrated the SVG logo +^D +[Para [Image ("",[],[]) [Str "Logo",Span ("",[],[("label","fig:Logo")]) []] ("command/SVG_logo.svg","fig:")] +,Para [Str "Figure",Space,Span ("",[],[("reference-type","ref"),("reference","fig:Logo")]) [Str "[fig:Logo]"],Space,Str "illustrated",Space,Str "the",Space,Str "SVG",Space,Str "logo"]] +``` + +``` +% pandoc -f latex -t native +\label{section} Section \ref{section} +^D +[Para [Span ("",[],[("label","section")]) [Str "[section]"],Space,Str "Section",Space,Span ("",[],[("reference-type","ref"),("reference","section")]) [Str "[section]"]]] +``` -- cgit v1.2.3