Features for testing the presence of latex and equivalent programs

class sage.features.latex.LaTeX(*args, **kwds)[source]

Bases: Executable

A Feature describing the presence of latex.

EXAMPLES:

sage: from sage.features.latex import latex
sage: latex().is_present()             # optional - latex
FeatureTestResult('latex', True)
>>> from sage.all import *
>>> from sage.features.latex import latex
>>> latex().is_present()             # optional - latex
FeatureTestResult('latex', True)
is_functional()[source]

Return whether latex in the path is functional.

EXAMPLES:

sage: from sage.features.latex import latex
sage: latex().is_functional()             # optional - latex
FeatureTestResult('latex', True)
>>> from sage.all import *
>>> from sage.features.latex import latex
>>> latex().is_functional()             # optional - latex
FeatureTestResult('latex', True)

When the feature is not functional, more information on the reason can be obtained as follows:

sage: result = latex().is_functional()    # not tested
sage: print(result.reason)                # not tested
Running latex on a sample file
(with command='latex -interaction=nonstopmode tmp_wmpos8ak.tex')
returned nonzero exit status='1' with stderr=''
and stdout='This is pdfTeX,
...
Runaway argument?
{document
! File ended while scanning use of \end.
...
No pages of output.
Transcript written on tmp_wmpos8ak.log.'
>>> from sage.all import *
>>> result = latex().is_functional()    # not tested
>>> print(result.reason)                # not tested
Running latex on a sample file
(with command='latex -interaction=nonstopmode tmp_wmpos8ak.tex')
returned nonzero exit status='1' with stderr=''
and stdout='This is pdfTeX,
...
Runaway argument?
{document
! File ended while scanning use of \end.
...
No pages of output.
Transcript written on tmp_wmpos8ak.log.'
class sage.features.latex.LaTeXPackage(*args, **kwds)[source]

Bases: TeXFile

A sage.features.Feature describing the presence of a LaTeX package (.sty file).

EXAMPLES:

sage: from sage.features.latex import LaTeXPackage
sage: LaTeXPackage('graphics').is_present()  # optional - latex
FeatureTestResult('latex_package_graphics', True)
>>> from sage.all import *
>>> from sage.features.latex import LaTeXPackage
>>> LaTeXPackage('graphics').is_present()  # optional - latex
FeatureTestResult('latex_package_graphics', True)
class sage.features.latex.TeXFile(*args, **kwds)[source]

Bases: StaticFile

A sage.features.Feature describing the presence of a TeX file.

EXAMPLES:

sage: from sage.features.latex import TeXFile
sage: TeXFile('x', 'x.tex').is_present()  # optional - latex
FeatureTestResult('x', True)
>>> from sage.all import *
>>> from sage.features.latex import TeXFile
>>> TeXFile('x', 'x.tex').is_present()  # optional - latex
FeatureTestResult('x', True)
absolute_filename()[source]

The absolute path of the file.

EXAMPLES:

sage: from sage.features.latex import TeXFile
sage: feature = TeXFile('latex_class_article', 'article.cls')
sage: feature.absolute_filename()  # optional - latex
'.../latex/base/article.cls'
>>> from sage.all import *
>>> from sage.features.latex import TeXFile
>>> feature = TeXFile('latex_class_article', 'article.cls')
>>> feature.absolute_filename()  # optional - latex
'.../latex/base/article.cls'
sage.features.latex.all_features()[source]
class sage.features.latex.dvips(*args, **kwds)[source]

Bases: Executable

A Feature describing the presence of dvips.

EXAMPLES:

sage: from sage.features.latex import dvips
sage: dvips().is_present()             # optional - dvips
FeatureTestResult('dvips', True)
>>> from sage.all import *
>>> from sage.features.latex import dvips
>>> dvips().is_present()             # optional - dvips
FeatureTestResult('dvips', True)
class sage.features.latex.latex(*args, **kwds)[source]

Bases: LaTeX

A Feature describing the presence of latex.

EXAMPLES:

sage: from sage.features.latex import latex
sage: latex().is_present()             # optional - latex
FeatureTestResult('latex', True)
>>> from sage.all import *
>>> from sage.features.latex import latex
>>> latex().is_present()             # optional - latex
FeatureTestResult('latex', True)
class sage.features.latex.lualatex(*args, **kwds)[source]

Bases: LaTeX

A Feature describing the presence of lualatex.

EXAMPLES:

sage: from sage.features.latex import lualatex
sage: lualatex().is_present()             # optional - lualatex
FeatureTestResult('lualatex', True)
>>> from sage.all import *
>>> from sage.features.latex import lualatex
>>> lualatex().is_present()             # optional - lualatex
FeatureTestResult('lualatex', True)
class sage.features.latex.pdflatex(*args, **kwds)[source]

Bases: LaTeX

A Feature describing the presence of pdflatex.

EXAMPLES:

sage: from sage.features.latex import pdflatex
sage: pdflatex().is_present()             # optional - pdflatex
FeatureTestResult('pdflatex', True)
>>> from sage.all import *
>>> from sage.features.latex import pdflatex
>>> pdflatex().is_present()             # optional - pdflatex
FeatureTestResult('pdflatex', True)
class sage.features.latex.xelatex(*args, **kwds)[source]

Bases: LaTeX

A Feature describing the presence of xelatex.

EXAMPLES:

sage: from sage.features.latex import xelatex
sage: xelatex().is_present()             # optional - xelatex
FeatureTestResult('xelatex', True)
>>> from sage.all import *
>>> from sage.features.latex import xelatex
>>> xelatex().is_present()             # optional - xelatex
FeatureTestResult('xelatex', True)