Repository: numpy/numpy

Issue:
DOC,BLD: Switch to `xelatex` engine for latex docs?
When building the latex/pdf version of the documentation, sphinx is currently configured to use `pdflatex` (the default) to build the pdfs of the user/reference manuals. There are several places in the documentation where the use of unicode characters causes `inputenc` warnings when building the pdf. In some cases these can be resolved by ensuring that extra latex packages are installed (e.g. `texlive-langgreek` adds the necessary mappings for some Greek Unicode characters), but in other cases (e.g. U+22EE vertical dots) it is more difficult to find an appropriate package (or the mapping can be done manually via `\DeclareUnicodeCharacter`).

In addition, there seem to be some URL ref problems that are avoided by `xelatex` (see sphinx-doc/sphinx#7723).

Please share any thoughts and possible pros/cons of switching to `xelatex` for the NumPy latex/pdf docs. Note that sphinx provides a `latex_engine` configuration option that makes this simple to try.


Discussion:
Could be a good idea, isn't the `textcomp` package good enough to use all of those unicode characters, though? In general I like `xelatex`, etc. though, and it gives some nice freedoms around fonts as well...
I like `xelatex` personally, but it can be much slower than `pdflatex`. Could that impact the docs build time significantly or is that irrelevant here?
@rossbar I assume this is the issue you discussed in the community meeting. Keep me informed, I'd like to get 1.19.0rc2 out this weekend. 
@charris - correct, I will make sure everything is updated/labelled appropriately before Friday
> I like xelatex personally, but it can be much slower than pdflatex. Could that impact the docs build time significantly or is that irrelevant here?

Great point - I did some quick profiling to get an idea of the build times. The results of `time make -C build/latex` on my system

with `pdflatex`:
```
real    0m43.972s                                                               
user    0m43.154s                                                               
sys     0m0.552s
```

with `xelatex`:
```
real    1m13.522s                                                               
user    1m19.858s                                                               
sys     0m2.205s
```
So `xelatex` is definitely slower, but the total build time still isn't so bad, especially since I don't think building the latex docs from source is very common for most users. Note that in each case, the `latex->pdf` step is still shorter than the initial `rST->latex` step (~2m30s on my system).
Oh, then if it's irrelevant I'd say we go for it. `xelatex` is available in every major `LaTeX` distribution on whatever OS, and it does make everything easier with respect to unicode and font issues.

Resolving patch:
diff --git a/doc/source/conf.py b/doc/source/conf.py
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -155,6 +155,9 @@ def setup(app):
 # The font size ('10pt', '11pt' or '12pt').
 #latex_font_size = '10pt'
 
+# XeLaTeX for better support of unicode characters
+latex_engine = 'xelatex'
+
 # Grouping the document tree into LaTeX files. List of tuples
 # (source start file, target name, title, author, document class [howto/manual]).
 _stdauthor = 'Written by the NumPy community'


Test patch: