File: index.rst

package info (click to toggle)
python-pylatexenc 2.10-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 9,104 kB
  • sloc: xml: 146,133; python: 10,734; makefile: 30; sh: 7
file content (63 lines) | stat: -rw-r--r-- 1,404 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
.. pylatexenc documentation master file, created by
   sphinx-quickstart on Mon Apr 24 16:32:21 2017.
   You can adapt this file completely to your liking,
   but it should at least contain the root `toctree` directive.

Welcome to pylatexenc's documentation!
======================================

[pylatexenc version: |version|]

A simple LaTeX parser providing latex-to-unicode and unicode-to-latex conversion.

Quick example::

    >>> from pylatexenc.latex2text import LatexNodes2Text
    >>> latex = r"""\textbf{Hi there!} Here is \emph{an equation}:
    ... \begin{equation}
    ...     \zeta = x + i y
    ... \end{equation}
    ... where $i$ is the imaginary unit.
    ... """
    >>> print(LatexNodes2Text().latex_to_text(latex))
    Hi there! Here is an equation:

        ζ = x + i y
    
    where i is the imaginary unit.

And the other way around::

    >>> from pylatexenc.latexencode import unicode_to_latex
    >>> text = "À votre santé!"
    >>> print(unicode_to_latex(text))
    \`A votre sant\'e!


You can also use these utilities directly in command line, e.g.::

    $ echo 'À votre santé!' | latexencode
    \`A votre sant\'e!


Documentation
=============


.. toctree::
   :maxdepth: 2
   :caption: Contents:

   latexwalker
   macrospec
   latex2text
   latexencode
   changes


Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`