Skip to content

Commit

Permalink
src/sage/misc/latex.py: default the "engine" option to None
Browse files Browse the repository at this point in the history
This delays probing the default engine (which tries to compile some
LaTeX code in a temporary directory) when you merely wish to query
e.g. the matrix delimiters. A later commit will re-insert the probe
at a later point.

The doctest for the options dict was updated to print a sorted list of
items, so now its output is no longer random.
  • Loading branch information
orlitzky committed Feb 2, 2025
1 parent 744fda6 commit ff24ef5
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/sage/misc/latex.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,7 @@ def __init__(self, bb=False, delimiters=["(", ")"],
self.__option["matrix_column_alignment"] = matrix_column_alignment
self.__option["macros"] = ""
self.__option["preamble"] = ""
self.__option["engine"] = None

@lazy_attribute
def _option(self):
Expand All @@ -528,16 +529,16 @@ def _option(self):
EXAMPLES::
sage: from sage.misc.latex import _Latex_prefs_object
sage: _Latex_prefs_object()._option # random
{'blackboard_bold': False,
'matrix_delimiters': ['(', ')'],
'vector_delimiters': ['(', ')'],
'matrix_column_alignment': 'r',
'macros': '',
'preamble': '',
'engine': 'lualatex'}
sage: sorted(_Latex_prefs_object()._option.items())
[('blackboard_bold', False),
('engine', None),
('macros', ''),
('matrix_column_alignment', 'r'),
('matrix_delimiters', ['(', ')']),
('preamble', ''),
('vector_delimiters', ['(', ')'])]
"""
self.__option["engine"] = default_engine()
return self.__option


Expand Down

0 comments on commit ff24ef5

Please sign in to comment.