readthedocs / readthedocs.org

The source code that powers readthedocs.org
https://readthedocs.org/
MIT License
8.02k stars 3.58k forks source link

PDF creation build failure for Gujarati language #2620

Closed cyberorg closed 7 years ago

cyberorg commented 7 years ago

Details

Building pdf fails with many of these kind of errors: ! Package inputenc Error: Unicode char \u8:ત not set up for use with LaTeX.

Building epub and html completes successfully.

Expected Result

PDF build should complete successfully

Actual Result

PDF build failure

humitos commented 7 years ago

@cyberorg where you able to build the PDF in your own computer? I just downloaded the code and was able to build the HTML but I had a different problem with the PDF:

******** ERROR !! PLEASE UPDATE titlesec.sty !!********
******** THIS VERSION SWALLOWS SECTION NUMBERS.********.
cyberorg commented 7 years ago

Yes, using this in conf.py

latex_elements = { 'preamble': '''

\usepackage{fontspec} \setsansfont{FreeSans} \setromanfont{FreeSerif} \setmonofont{FreeMono} ''', } and then running the following:

make -e SPHINXOPTS="-D language='gu'" latex cd build/latex/ xelatex *.tex

This creates the pdf.

humitos commented 7 years ago

I see. That seems to be a very custom way to generate your PDF file which is not setup in RTD. You could try to do some magic in your conf.py that RTD will execute by you and try different options.

cyberorg commented 7 years ago

Using xelatex instead of pdflatex seems to be the only way to generate pdfs of "non-english" language, I am sure this affects every Indian languages(there are 15 official ones) and all other languages using unicode characters.

Is there way to add that magic of using xelatex in place of pdflatex to conf.py?

Here is the less custom option that also works, we just need option to set PDFLATEX=xelatex on readthedocs:

make PDFLATEX=xelatex -e SPHINXOPTS="-D language='gu'" latexpdf

This issue is duplicate of https://github.com/rtfd/readthedocs.org/issues/1556