-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Xelatex for PDF generation #1556
Comments
That's a question for @agjohnson or @ericholscher. Let's see what they say :) |
Ubuntu offers the
|
Locally, I had to modify the Make.bat to give an option for xelatex and then script changes to the makefile using SED. RFTD is calling the pdflatex option and a new option would need to be created for xelatex. For this to work I am guessing an advanced option preference would need to be added to select pdflatex (recommended) and xelatex. Based on that option there would be scripting to correct the makefile then build using xelatex. BTW - It would also be nice to add in some "preprocessing" capabilities. I currently use SED to make changes to the "whateverthefilenameis.tex". Some changes I do before calling the makefile is Thank you for the help. |
BTW - here is my xelatex section of make.bat:
|
Running xelatex would require special processing in our build environments. Our build environments disregard makefiles completely, you would probably want to implement your special processing as a sphinx extension. The changes you are describing are slightly outside the realm of RTD though. Marking this community support if anyone wants to take this on, it's off our roadmap for now. |
I think that no severe changes would be needed. Just a replacement pdflatex -> xelatex - will work for most cases. @agjohnson, what about extending yml config with options to allow this? I see following variants:
|
Blocking agda/agda#2153. |
@agjohnson, there is a patch that sits in queue for month. Apparently, this is an important issue for several projects and require minimal changes. How else I can help to get it fixed? BTW, another possible option (other than those mentioned above) is to query conf.py for 'latex_engine' value. Let me know if you prefer this. |
It seems that the |
Yes, because readthedocs doesn't use it now, which I suggest.
To select correct binary, we can query 'latex_engine' option. |
@skirpichev it seems the purposed fix would be to simply just replace the binary executed with the binary name from the |
Yes. But after "from" - a number of options.
But can we be sure that xelatex doesn't disappear from the environment in future? |
Sphinx allows the use of following: make PDFLATEX=xelatex -e SPHINXOPTS="-D language='gu'" latexpdf All we need on readthedocs is the way to set PDFLATEX=xelatex |
To add more info to this issue, I did this stupid change in my local instance and it built the PDF from #2620 (https://readthedocs.org/projects/mss-doc-gu) diff --git a/readthedocs/doc_builder/backends/sphinx.py b/readthedocs/doc_builder/backends/sphinx.py
index c6bd529e..45ad7e32 100644
--- a/readthedocs/doc_builder/backends/sphinx.py
+++ b/readthedocs/doc_builder/backends/sphinx.py
@@ -292,7 +292,7 @@ class PdfBuilder(BaseSphinx):
# Run LaTeX -> PDF conversions
pdflatex_cmds = [
- ['pdflatex',
+ ['xelatex', # 'pdflatex',
'-interaction=nonstopmode',
tex_file]
for tex_file in tex_files] Besides, I uncommented the lines from The result, that wasn't linked in the Downloads section of the project for some reason, but I opened it from |
@humitos, please see readthedocs/readthedocs-build#18
I don't know you local settings, but perhaps that could be #2582 (which also has patch, awaiting for review). |
@humitos good point. Seems we'll need more logic on the RTD side than just swapping out the binary used. The download path is probably because of some difference in the output, and may take a patch to fix the sphinx builder in RTD. |
@agjohnson, what about conf.py option? Should we add something to yml config or just utilize 'latex_engine'? Correct me, but rtd now don't parse & query for any conf.py settings, right? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Wow, an original method of fixing issues. |
Indeed! |
This is still valid, but we haven't had the time to check in to this yet. |
(You had a working PR (or PRs) year ago (or more?), but prefer the Code of Conduct, instead of code...) |
This will be a problem. If the user is executing code that writes a file, calculate something or whatever this will be executed twice and, besides it's a waste of resources, it could bring other issues. |
Feature flag is a good direction temporarily. How we arrive at a binary to use will probably end up being a config file change, as it seems we can't automate this before we execute the conf.py. We can't rely on the makefile, but there might be a third option such as using a custom RTD builder that is a wrapper for pdflatex/xelatex depending on the conf. Keeping this out of our config would be helpful. Either way PRs welcome here. Our code of conduct is not going to be removed, please stop implying we should remove it. |
Sorry, unsubscribed. |
and ditch the fancy UTF-8 sharp/flat chars because of readthedocs/readthedocs.org#1556 ... again
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Please remove the There is some relevant discussion taking place in #4454 about how to avoid a makefile. |
New versions of Sphinx use `latexmk` to build the PDF files. This command uses a file called `latexmkrc` (or `latexmkjarc` for Japanese) which contains all the proper commands that needs to be ran depending on different Sphinx configurations. `latexmk` will take care by itself on the amount of phases that need to be ran without us worrying about it. Currently, this is not considering LATEXMKOPTS and XINDYOPTS environment variables configured by Sphinx. This feature is implemented under a Feature flag so we can test it easily without breaking other working projects. References: - #1556 - #4454 - #5405 - toppers/tecs-docs#7 - https://github.com/sphinx-doc/sphinx/blob/master/sphinx/texinputs/Makefile_t - https://www.sphinx-doc.org/en/master/usage/builders/index.html#sphinx.builders.latex.LaTeXBuilder
New versions of Sphinx use `latexmk` to build the PDF files. This command uses a file called `latexmkrc` (or `latexmkjarc` for Japanese) which contains all the proper commands that needs to be ran depending on different Sphinx configurations. `latexmk` will take care by itself on the amount of phases that need to be ran without us worrying about it. Currently, this is not considering LATEXMKOPTS and XINDYOPTS environment variables configured by Sphinx. This feature is implemented under a Feature flag so we can test it easily without breaking other working projects. References: - #1556 - #4454 - #5405 - toppers/tecs-docs#7 - https://github.com/sphinx-doc/sphinx/blob/master/sphinx/texinputs/Makefile_t - https://www.sphinx-doc.org/en/master/usage/builders/index.html#sphinx.builders.latex.LaTeXBuilder
New versions of Sphinx use `latexmk` to build the PDF files. This command uses a file called `latexmkrc` (or `latexmkjarc` for Japanese) which contains all the proper commands that needs to be ran depending on different Sphinx configurations. `latexmk` will take care by itself on the amount of phases that need to be ran without us worrying about it. Currently, this is not considering LATEXMKOPTS and XINDYOPTS environment variables configured by Sphinx. This feature is implemented under a Feature flag so we can test it easily without breaking other working projects. References: - #1556 - #4454 - #5405 - toppers/tecs-docs#7 - https://github.com/sphinx-doc/sphinx/blob/master/sphinx/texinputs/Makefile_t - https://www.sphinx-doc.org/en/master/usage/builders/index.html#sphinx.builders.latex.LaTeXBuilder
@ericholscher, you closed this issue. Unless I misunderstood something, new feature (from #5437) is not working on the https://readthedocs.org/, it may be enabled only for custom installations. If so, I don't think the original issue was solved. Or this is closed as "will not fix" and the https://readthedocs.org/ will never support xelatex? |
I followed this issue in hopes that it would resolve Pylons/pyramid#3290. Although #5437 was merged, this issue was not resolved, unless I have missed some configuration or other user-configurable option. Should I open a new issue or is there another that I should follow? |
Please see #5453 |
@stsewd, it seems - it's impossible to use xelatex on the readthedocs.org, I don't think your reference to #5453 could help. For example, I set latex_engine="xelatex" in |
The issue was closed automatically because the PR was merged. If you want to test/try this new feature in your project, please open a new issue asking to enable Thanks! |
Ok, thank you for the explanation, see #5494. |
I was wondering if xelatex is supported for PDF generation? If so is the font Symobla.ttf installed as well? If not do you know when it will be supported.
Thank you
The text was updated successfully, but these errors were encountered: