Skip to content

Commit

Permalink
Fixed Sphinx pdflatex compilation. Fixed incorrect index link.
Browse files Browse the repository at this point in the history
Also: moved the pretty printing customization doc to the very end (this
should be rarely needed).
  • Loading branch information
lebigot committed Jul 11, 2021
1 parent 365f93f commit 1785801
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 19 deletions.
7 changes: 5 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,11 @@
# Additional stuff for the LaTeX preamble.
#latex_preamble = r'\DeclareUnicodeCharacter{207B}{$^-$}'
latex_elements = {
# Superscript -, for pdflatex (unnecessary, with xelatex):
'preamble': r'\DeclareUnicodeCharacter{207B}{$^-$}'
# Superscript -, etc. for pdflatex (unnecessary, with xelatex):
'preamble': r'''
\DeclareUnicodeCharacter{207B}{$^-$}
\DeclareUnicodeCharacter{22C5}{$\cdot$}
'''
}

# Documents to append as an appendix to all manuals.
Expand Down
34 changes: 17 additions & 17 deletions doc/user_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ completely **transparently**.
Access to the uncertainty and to the nominal value
==================================================

.. index::
pair: nominal value; scalar
pair: uncertainty; scalar

The nominal value and the uncertainty (standard deviation) can also be
accessed independently:

Expand Down Expand Up @@ -504,20 +508,6 @@ formatting options. They can be added at the end of the format string:

These custom formatting options **can be combined** (when meaningful).

Customization of the pretty print and LaTeX outputs
---------------------------------------------------

The pretty print and LaTeX outputs themselves can be customized.

For example, the pretty-print representation of numbers with uncertainty can
display multiplication with a centered dot (⋅) instead of the default symbol
(×), like in `(2.00±0.10)⋅10⁻¹`; this is easily done through the global setting
`uncertainties.core.PRETTY_PRINT_TIMES["pretty-print"] = "⋅"`.

Beyond this multiplication symbol, the "±" symbol, the parentheses and the
exponent can also be customized globally. The details can be found in the
documentation of `uncertainties.core.format_num()`.

Details
-------

Expand Down Expand Up @@ -602,9 +592,19 @@ use the shorthand notation for numbers with uncertainties:
prints with the shorthand notation: ``Result = 0.20(1)``.


.. index::
pair: nominal value; scalar
pair: uncertainty; scalar
Customization of the pretty print and LaTeX outputs
---------------------------------------------------

The pretty print and LaTeX outputs themselves can be customized.

For example, the pretty-print representation of numbers with uncertainty can
display multiplication with a centered dot (⋅) instead of the default symbol
(×), like in ``(2.00±0.10)⋅10⁻¹``; this is easily done through the global
setting ``uncertainties.core.MULT_SYMBOLS["pretty-print"] = "⋅"``.

Beyond this multiplication symbol, the "±" symbol, the parentheses and the
exponent representations can also be customized globally. The details can be
found in the documentation of :func:`uncertainties.core.format_num`.

Making custom functions accept numbers with uncertainties
=========================================================
Expand Down

0 comments on commit 1785801

Please sign in to comment.