New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Converting .tex to .docx causes equation numbers to be lost, and more #742
Comments
No version of pandoc handles equation numbering. (You can use As for the problem with +++ lanceboyle [Feb 08 13 01:55 ]:
|
OK. Thanks. |
Thanks for the new version of pandoc, 1.10.1, which I have now installed. Numbered (labeled, I guess) equations are now being rendered in tex to docx conversions as you know. Thanks! I'd like to report these minor bugs, as the converted docx files are rendered in Word for Mac 2011:
FWIW, my tex is exported from LyX and looks different for the two cases of the same equation, one with label and one without. I don't understand TeX deeply and so the problems I mentioned above could be with LyX. So here is the TeX that LyX is exporting, first for the... Labeled equation: \begin{equation} and the unlabeled equation: [ Finally, as a suggestion, I wonder if it makes sense to you to display equation labels in the docx side as literal strings. For example, I gave the above equation the label "DFT" so that its full label is "eq:DFT". I also had a cross-reference to it, so in the docx file that cross-reference survived as the literal string "([eq:DFT])" in which I have included the () for normal equation referencing style. So if that string were also displayed alonside the labeled equation, in Word, one could do a one-time global search on that string and replace it a desired equation number. Just a thought. Jerry |
Display math inside a paragraph is now put in a separate paragraph, so it will render properly (centered and without extra blank lines around it). Partially addresses #742.
I'm going to close this bug. I haven't acted on the "suggestion" (@lanceboyle). Given the way pandoc interacts with the texmath library, it's a bit hard to see how to do that. Some time in the future I'd like to support equation numbering, but it will require more extensive changes to both pandoc and texmath. |
Thanks for looking into this, John. Jerry |
I just want to make the current version does not support the reference to a number equation like ([eq:MassEnergy]), right?
|
+++ pengyu [Jun 19 13 21:51 ]:
Right. |
On Thu, Jun 20, 2013 at 2:47 PM, John MacFarlane
Thanks. I think that this feature is important especially for people Regards, |
Hi; this feature is still not supported? |
This feature can be simulated easily enough with the
|
When converting from LaTeX to docx,
pandoc -o somefile.docx anotherfile.tex
pandoc does not properly convert numbered (display) equations. There are two variations:
(1) The LaTeX equation is numbered but has no label. (I'm not a LaTeX expert—I use LyX—but it seems that a label is required in order to create a cross reference to the equation.) In this case, the equation is rendered correctly in docx but the equation number is lost.
(2) The LaTeX equation is both numbered and has a label (and a cross reference elsewhere in the document). In this case, in the docx file, the equation is _not_rendered but instead the raw LaTeX code appears in its place, followed by the label text, all enclosed in$...$ ; that is, the code appears in the place where the corresponding display equation should have appeared. For example, with Einstein's famous equation with the label MassEnergy, this line appears in docx:
$e=mc^{2}\label{eq:MassEnergy}$
Also, the equation number is lost, and the cross reference is not "rendered" meaning that the raw text appears. For example, if the equation had a label MassEnergy, then the cross reference is shown in docx as the text, ([eq:MassEnergy]).
(1 and 2) In both of these cases, there is an extra blank line above and below each equation in docx.
Unnumbered display equations and inline equations get translated without problems, and there is no extra white space. All equations that are correctly rendered (i.e., not raw LaTeX) are editable in the docx document.
I suspect that other labels are also similarly problematic. For instance, if a label is attached to a section title, then in docx, where the section title is displayed, the label is also displayed alongside, as text.
I am using pandoc 1.9.4.2. (I know it's not the latest but I had trouble with the OS X .dmg installer last time and I'm not eager to update just yet.)
I am using:
OS X 10.7.5
docx is interpreted by Word for Mac 2011.
As far as I'm concerned pandoc is some sort of magic. I hope that these important problems in translating to Word format aren't too hard to fix.
I don't see a way to upload files here (except apparently an image file). If there is a way to do so please let me know—I have very short example in .tex, .docx, and a .pdf rendered from each of them that show the problem.
Jerry
The text was updated successfully, but these errors were encountered: