Pandoc can be installed in anaconda by
conda install pandoc
or in brew.
brew install pandoc
I strongly recommand to use brew version. For brew, switch to the brew environment first.
swt_brew # custom command in .bash_profile
Then go to the folder where you have .tex files to convert. Run the following command:
pandoc --citeproc -f latex -s FeSH-JGR.tex -o FeSH-JGR.docx --bibliography=FeSH.bib
Change the file names appropriately.
- The command works only with
brewversion ofpandocfor me. - Note that the order betweeen
pandoc-crossrefandciteprocshould not change. - Run multiples of time (unconfirmed).
Pandocknows how to deal withbibunitsand\input{}.- Note that
line numberreferencing and citing do not work withpandoc. - Do not place both
-F pandoc-crossrefand--citeprocat the same time, it will repeat the figure and table caption titles. - Note that renumbering for figures and tables (for example S1 for supplementary contents) are all ignored. So be careful if this is important.
pandoc --citeproc -f latex -s Nature-main\ text.tex --csl=../ieee.csl -o main.docx --bibliography=B30.bib
ieee.csl can be donwloaded from: https://github.com/citation-style-language/styles
If you have track change commands from the TrackChanges package (not the changes package), the commands can be removed by:
python ../acceptchanges.py -c -n --infile=0-main.tex --outfile=0-main-no-track.tex
- Note that
acceptchanges.pyworks only withpython v2.7. - The
acceptchanges.pycan be found underTrackChangesfolder or it comes with the latex package. acceptchanges.pydoes not automatically deal with\input{}or\include{}files. So I have to process withacceptchanges.pyall associated files individually.- For the command above to work, copy entire latex folder under
/trackchanges-0.7.0/PythonPackage/folder.
For latex changes package was used for track change, use pyMergeChanges.py.
python ../pyMargeChanges.py -a input.tex output.tex # python 3
Under the base environment of anaconda, I installed arxiv_latex_cleaner (https://github.com/google-research/arxiv-latex-cleaner).
arxiv_latex_cleaner Hydrogen_FeS_paper/ --im_size 500
- This will create organized package in a new folder,
Hydrogen_FeS_paper_arXiv. arxiv_latex_cleanerseems to know how to deal with\include{}and\input{}. It also deals well withbibunits.
pandoc -t latex -f docx in.docx -o out.tex
pandoc -F pandoc-crossref --citeproc --mathjax -f latex -t html -s FeSH-JGR.tex -o FeSH-JGR.html --bibliography=FeSH.bib
For better outcome to html:
- convert all pdf figures to png figures
\multicolumnis not compatible withpandoc- Figure labelings are properly done, but not for table labeling. I try everything but so far the line above is the best. If you remove any of
-F pandoc-crossrefand--citeprocfrom the line above, it will mess up the citations.