Dear all,
I Installed the latest available Ubuntu deb package pandoc-1.14.0.1-1-amd64.deb. According to the documentation it should support the conversion from docx to pdf. However, the conversion fails for me with the following error:
pandoc input.docx -o output.pdf
! Font T1/cmr/m/n/10=ecrm1000 at 10.0pt not loadable: Metric (TFM) file not fou
nd.
<to be read again>
relax
l.100 \fontencoding\encodingdefault\selectfont
Does someone have any advice for me?
Thankfully,
Robert
@orschiro Could you try
you need to install texlive-fonts-recommended using your package manager
http://tex.stackexchange.com/questions/116332/latex-compilation-of-simple-document-fails
@nkalvi
Thanks, I appreciate your quick help! Indeed I didn't have the the texlive-fonts-recommended package installed. I installed this alongside other packages but the conversion fails with a different error message.
Installed packages:
ii latex-beamer 3.24-1 all LaTeX class to produce presentations
ii latex-xcolor 2.11-1.1 all Easy driver-independent TeX class for color
ii libpod-latex-perl 0.61-1 all module to convert Pod data to formatted LaTeX
ii libreoffice-writer2latex 1.0.2-10ubuntu1 all Writer/Calc to LaTeX converter extension for LibreOffice
ii preview-latex-style 11.87-1ubuntu2 all extraction of elements from LaTeX documents as graphics
ii texlive-latex-base 2013.20140215-1 all TeX Live: LaTeX fundamental packages
ii texlive-latex-base-doc 2013.20140215-1 all TeX Live: Documentation files for texlive-latex-base
ii texlive-latex-extra 2013.20140215-2 all TeX Live: LaTeX additional packages
ii texlive-latex-extra-doc 2013.20140215-2 all TeX Live: Documentation files for texlive-latex-extra
ii texlive-latex-recommended 2013.20140215-1 all TeX Live: LaTeX recommended packages
ii texlive-latex-recommended-doc 2013.20140215-1 all TeX Live: Documentation files for texlive-latex-recommended
Error message:
! Package inputenc Error: Unicode char \u8:― not set up for use with LaTeX.
See the inputenc package documentation for explanation.
Type H <return> for immediate help.
...
l.129 We invite diverse participation―
Try running pandoc with --latex-engine=xelatex.
pandoc: Error producing PDF from TeX source
Try what the output/error message recommends:
pandoc input.docx -o output.pdf --latex-engine=xelatex
​
On Tue, Jun 2, 2015 at 4:50 PM, Robert Orzanna [email protected]
wrote:
@nkalvi https://github.com/nkalvi
Thanks, I appreciate your quick help! Indeed I didn't have the the
texlive-fonts-recommended package installed. I installed this alongside
other packages but the conversion fails with a different error message.Installed packages:
ii latex-beamer 3.24-1 all LaTeX class to produce presentations
ii latex-xcolor 2.11-1.1 all Easy driver-independent TeX class for color
ii libpod-latex-perl 0.61-1 all module to convert Pod data to formatted LaTeX
ii libreoffice-writer2latex 1.0.2-10ubuntu1 all Writer/Calc to LaTeX converter extension for LibreOffice
ii preview-latex-style 11.87-1ubuntu2 all extraction of elements from LaTeX documents as graphics
ii texlive-latex-base 2013.20140215-1 all TeX Live: LaTeX fundamental packages
ii texlive-latex-base-doc 2013.20140215-1 all TeX Live: Documentation files for texlive-latex-base
ii texlive-latex-extra 2013.20140215-2 all TeX Live: LaTeX additional packages
ii texlive-latex-extra-doc 2013.20140215-2 all TeX Live: Documentation files for texlive-latex-extra
ii texlive-latex-recommended 2013.20140215-1 all TeX Live: LaTeX recommended packages
ii texlive-latex-recommended-doc 2013.20140215-1 all TeX Live: Documentation files for texlive-latex-recommendedError message:
! Package inputenc Error: Unicode char \u8:― not set up for use with LaTeX.
See the inputenc package documentation for explanation.
Type Hfor immediate help.
...l.129 We invite diverse participation―
Try running pandoc with --latex-engine=xelatex.
pandoc: Error producing PDF from TeX source—
Reply to this email directly or view it on GitHub
https://github.com/jgm/pandoc/issues/2206#issuecomment-107980127.
If it still fails after trying with --latex-engine=xelatex, could you add --verbose flag and post the output (please remove any sensitive info).
Thanks to both of you. It compiles with the parameter --latex-engine=xelatex. Two remaining questions:
texlive-xetex. Can xetex run independently from texlive-latex and can I thus uninstall all texlive-latex packages?pandoc input.docx --latex-engine=xelatex -o output.pdf does not preserve the original style of the docx file. Rather it restyles it using a texlive design. Is it possible to preserve the original style?On Tue, Jun 2, 2015 at 5:32 PM, Robert Orzanna [email protected]
wrote:
Thanks to both of you. It compiles with the parameter
--latex-engine=xelatex. Two remaining questions:
- I had to install an additional package texlive-xetex. Can xetex run
independently from texlive-latex and can I thus uninstall all
texlive-latex packages?- The command pandoc input.docx --latex-engine=xelatex -o output.pdf
does not preserve the original style of the docx file. Rather it
restyles it using a texlive design. Is it possible to preserve the original
style?No, it isn't.
If you want the original style in the PDF, why even convert it with the
help of Pandoc?
You can use Word to export the DOCX as PDF (with 100% of the original
style), or LibreOffice to import the DOCX and export as PDF with 90%-95% of
your style(s) preserved (if you have the same local fonts installed),
working in 85%-90% of all cases...
LibreOffice to import the DOCX and export as PDF with 90%-95% of
your style(s) preserved (if you have the same local fonts installed),
working in 85%-90% of all cases...
This is exactly the hotspot. I was looking for a way on Linux to preserve 100% of the style. I came across the tip using pandoc on unix stackexchange where it was mentioned that pandoc does a pretty good job converting docx to pdf.
Pandoc only preserves document structure, not style.
Most helpful comment
@orschiro Could you try
http://tex.stackexchange.com/questions/116332/latex-compilation-of-simple-document-fails