Context
I am using Sphinx and latexpdf to build reStructured documentation for my project. The documentation draws in remote data that it cannot control (only escape/parse etc).
My current build command is:
make latexpdf; make html;
I recently encountered errors which were stopping my Bitbucket Pipelines when latexpdf was encountering certain UTF-8 characters in the rst files it was trying to parse.
I found that the solution to the UTF-8 issue is:
- to set some preamble 'commands'...
- via an update to the
latex_elementsin the sphinx/readthedocs config.yml using this formatting.
Which solved the problem with the following DeclareUnicodeCharacter 'commands':
#conf.py
...
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#
#'preamble': r'\DeclareUnicodeCharacter{FF08}{$\bullet$}',
'preamble': r'''
\DeclareUnicodeCharacter{FF08}{$\bullet$}
\DeclareUnicodeCharacter{FF09}{$\bullet$}
\DeclareUnicodeCharacter{FF0C}{$\bullet$}
\DeclareUnicodeCharacter{2161}{$\bullet$}
''',
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
...
}
...
The setting above converts the following UTF-8 Characters to a bullet point:
- U+FF08
- U+FF09
- U+FF0C
- U+2161
So, I have fixed the problem by suppressing it.
The only reason why I replace it with a bullet is that I borrowed that code from one of the solutions found on the net.
Aside from {$\bullet$}, what other values can be inserted into the second 'parameter' of the DeclareUnicodeCharacter 'commands'?
Where can I discover the list of values that are available here?
$\bullet$? – John Walker Dec 31 '19 at 15:11