Open GoogleCodeExporter opened 9 years ago
I wonder whether this would be a way to enable language tagging when converting
from
LaTeX to HTML.
Original comment by google-c...@pragmata.tk
on 10 Jan 2010 at 11:20
I was just thinking about this too. Specifically I'd like to get label and ref
tags and use javascript for cross referencing figs and math with numbering.
Original comment by mpastell
on 7 Jan 2011 at 11:21
Handling \ref and \label in a cross-platform way is very complicated.
If you just want automatic numbering of equations, with the ability to refer
back, you should try the auto-numbered examples in pandoc's markdown:
(@myeqn) $e=mc^2$
As shown in ___, (@myeqn) is a refinement of ...
Original comment by fiddloso...@gmail.com
on 7 Jan 2011 at 5:16
Thanks for the quick comment. Numbered examples are nice, but not quite enough
for what I need in all cases.
Would you still consider adding ref and label support to pandoc extended
markdown syntax and reader? Latex and texinfo
(http://www.gnu.org/software/hello/manual/texinfo/ref.html) can do this and in
HTML you could use the ID tag for labels and refs would be fairly easy to
handle with javascript.
Of course using labels would require the ability to specify the label for
figures, tables, equations and code so I know this requires some changes.
Original comment by mpastell
on 10 Jan 2011 at 10:24
What would \ref{foo} and \label{foo} be rendered as in HTML?
In LaTeX you might have:
In figure~\ref{fig1} in section~\ref{sec1}, ...
To render this properly, pandoc would have to know that fig1 is a label for a
figure, and sec1 for a section, and pandoc would have to keep track of
numbering for both. In addition there's the problem that default HTML and
LaTeX output in pandoc doesn't number sections.
Original comment by fiddloso...@gmail.com
on 10 Jan 2011 at 4:10
I think \ref{foo} could be rendered as <span class="ref">foo</a> as suggested
by bpjonsson above. And \label{foo} could become <div id="foo">. Then
pandoc would not need to handle the numbering and cross-refences and
they could be later processed e.g. with javascript to produce figure
numbers and references.
For figures Pandoc could use the title argument as label and ID as follows:
![Some caption](myfig.png "mylabel")
In HTML:
<div class="figure">
<img src="myfig.png" title="mylabel" alt="Some caption"/>
<p class="caption" id="mylabel">Some caption</p>
</div>
And in Latex:
\begin{figure}[htb]
\centering
\includegraphics{myfig.png}
\label{mylabel}
\caption{Some caption}
\end{figure}
I guess tables and equations would need some additional syntax to add
labels and table and fig captions need to have a different class in HTML.
I think I should be able to produce the required javascript and I'm
also willing to help out otherwise, but I'm just beginning with Haskell.
Original comment by mpastell
on 10 Jan 2011 at 6:35
[deleted comment]
Has there been any further discussion on the topic of embedding \ref constructs
in Pandoc markdown text? I am using the markdown2pdf wrapper and Pandoc v1.8.2.
Not able to get reference numbers other than 1 from the following:
Figure \ref{fig:NIARM-TEST1} test for "Figure 1" label.
![Caption for FIG TEST1](../images/TBD.png "fig:NIARM-TEST1")
Figure \ref{fig:NIARM-TEST2} test for "Figure 2" label.
![Caption for FIG TEST2](../images/TBD.png "fig:NIARM-TEST2")
Figure \ref{fig:NIARM-TEST3} test for "Figure 3" label.
\label{fig:NIARM-TEST3}
![Caption for FIG TEST3](../images/TBD.png "fig:NIARM-TEST3")
The first 2 figure references generate ?? as in:
Figure ?? test for "Figure 2" label.
This caused me to try an explicit \label on Test3, which generates:
Figure 1 test for "Figure 3" label.
instead of:
Figure 3 test for "Figure 3" label.
I am new to using Pandoc - maybe I am not using the current syntax.
Original comment by ralp...@gmail.com
on 13 Sep 2011 at 6:20
Did you find an answer to this. I'm trying to get the figure referencing thing
working too.
thanks
Original comment by IvoJimenez
on 22 Oct 2011 at 5:11
Original issue reported on code.google.com by
bpjonsson@gmail.com
on 7 Jan 2010 at 4:48