In Python 3, the default encoding of source files is utf-8. The encoding
cookie is now unnecessary and redundant so remove it. For more details,
see the docs:
https://docs.python.org/3/howto/unicode.html#the-string-type
> The default encoding for Python source code is UTF-8, so you can
> simply include a Unicode character in a string literal ...
Includes a fix for the flake8 header checks to stop expecting an
encoding cookie.
0. do not escape Unicode Greek letters via LaTeX math mark-up: pass them
through un-modified to LaTeX document,
1. if "fontenc" receives extra option LGR, then pdflatex will support
Unicode Greek letters (not in math), and with extra option T2A it
will support (most) Unicode Cyrillic letters.
2. for pdflatex with LGR, this will use "textalpha" LaTeX package and
"substitutefont" package to set up some automatic font substitution
to work around the unavailability of Greek with "times"
package (which is default font package chosen by Sphinx for
pdflatex), same with T2A and "substitutefont" for Cyrillic.
3. for xelatex/lualatex, set up Computer Modern Unicode as default font,
as it supports Cyrillic and Greek scripts,
4. for platex, don't do anything special as the engine already has
its default font supporting Cyrillic and Greek (even in math mode!)
Closes: #5251
Fixes: #5248
Fixes: #5247
Since #2627 (1.4.4), `\code`, and then again at #3116 (1.5)
`\sphinxcode` which is the new name has become more complicated than the
original `\texttt{#1}`. This was to obtain straight quotes in PDF output,
and to allow long inline literals to break across lines.
This means though that users who want to customize `\sphinxcode`, for
example to not only do `\texttt` but to use some colour, have to copy
about 10 lines of complicated LaTeX macros which should be not modified
in any way. This commit moves all the code out of `\sphinxcode` into a
separate macro `\sphinxupquote`.
The LaTeX writer will output `\sphinxcode{\sphinxupquote{foo}}` in place
of former `\sphinxcode{foo}`. Moving the `\texttt` from innermost to
outermost level is with no consequence.
Instead rely on docutils’ ‘smart_quotes’ option which is available
since docutils 0.10.
This adds support for internationalization: our code supported only
English quotes, while docutils code supports 27 different languages.
Closes#498, #580, #3345, #3472.
The cause of the issue was a clash about ``\titleref`` macro being already
defined in memoir class context. To avoid similar problems, this makes
the text styling macros
``\strong``, ``\code``, ``\bfcode``, ``\email``, ``\tablecontinued``,
``\titleref``, ``\menuselection``, ``\accelerator``, ``\crossref``,
``\termref``, ``\optional``,
also available with ``\sphinx`` prefix, with a conf.py boolean option to
let sphinx.sty only define ``\sphinx``-prefixed macros. As default value
is False, backwards compatibility is maintained.
On this occasion, some internal non-public macros have been renamed with
prefix ``\spx@``. The command
find . -name '*.sty' -exec grep -l \\\\spx@ {} \;
has been executed in TeXLive 2015 and 2016 installations to check no
package defines macros starting with ``\spx@``.
Some internal macros having public names (because they are written by
latex.py into the body of the latex document) have been renamed to have
``\sphinx`` prefix. The macros in sphinx.sty starting with \py@, or \DU,
or \PYG have not been modified. Similarly ``\release``, ``\version``,
``\releasename``, etc... have not been renamed.