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
\newcommand not recognised for org conversion #8158
Comments
I can reproduce with the odt format. I can't seem to get it to do any custom latex in odt though, so I can't reproduce your success in word (with markdown). I would love to see your native output Try exporting to latex through pandoc as well to see if it gives you the output you think it should. Also, emacs has a .odt converter, which in your case would export to:
pandoc should be able to convert odt to docx so that might be a good workaround. |
This will require changes to the Org reader. The OrgParserState already has a field for macros, but the LaTeX probably isn't parsed. |
Sorry for the slow reply.
Here are the outputs: $ cat test.org
#+latex_header: \newcommand\foo{\ensuremath{\mathit{foo}}\xspace}
a \foo b $\foo c
$ pandoc -f markdown -t native test.org -s
Pandoc
Meta { unMeta = fromList [] }
[ Plain [ Str "#+latex_header:" ]
, RawBlock
(Format "tex")
"\\newcommand\\foo{\\ensuremath{\\mathit{foo}}\\xspace}"
, Para
[ Str "a"
, Space
, RawInline (Format "tex") "\\ensuremath{\\mathit{foo}} "
, Str "b"
, Space
, Str "$"
, RawInline (Format "tex") "\\ensuremath{\\mathit{foo}} "
, Str "c"
]
]
$ cat test.md
\newcommand\foo{\ensuremath{\mathit{foo}}\xspace}
a \foo b $\foo$ c
$ pandoc -f markdown -t native test.md -s
Pandoc
Meta { unMeta = fromList [] }
[ RawBlock
(Format "tex")
"\\newcommand\\foo{\\ensuremath{\\mathit{foo}}\\xspace}"
, Para
[ Str "a"
, Space
, RawInline (Format "tex") "\\ensuremath{\\mathit{foo}} "
, Str "b"
, Space
, Math InlineMath "\\ensuremath{\\mathit{foo}}"
, Space
, Str "c"
]
]
These days org → pandoc → docx works better than ox-odt... For starters the standalone mathml parsers just aren't working that well anymore (in my experience). ox-odt works decently for simple documents, though. Another killer feature of pandoc is that it can use templates for getting formatting approximately right. Templating with ox-odt is somewhat more time consuming. |
Explain the problem.
I am using latex symbols like
\newcommand\foo{\ensuremath{\mathit{foo}}\xspace}
and ultimately exporting todocx
(and latex/pdf via Emacs Org).LaTeX math commands like
\foo
work reasonably well when exporting frommd
but not fromorg
.md
exampleWord output (sorry image upload doesn't seem to work atm):
org
exampleOrg file:
I have also tried to use
#+latex: \newcommand...
,@@latex:\newcommand...@@
,# \newcomand...
, and\newcommand...
(on its on line without a prefix).Pandoc error log:
Word output:
aside: latex output / expected output
just as a reference this is the expected output.
Pandoc version?
I use a corporate win10 and Pandoc version:
The text was updated successfully, but these errors were encountered: