Skip to content

Commit

Permalink
src/sage/misc/latex.py: drop the "engine_name" option
Browse files Browse the repository at this point in the history
This does nothing, except waste your time trying to ensure that it is
consistent with the "engine" property and that It iS PrOpErLy
CapItALizEd.
  • Loading branch information
orlitzky committed Feb 2, 2025
1 parent dc99dc8 commit 744fda6
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions src/sage/misc/latex.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,16 +485,16 @@ def default_engine():
sage: from sage.misc.latex import default_engine
sage: default_engine() # random
('lualatex', 'LuaLaTeX')
'lualatex'
"""
from sage.features.latex import pdflatex, xelatex, lualatex
if lualatex().is_present():
return 'lualatex', 'LuaLaTeX'
return 'lualatex'
if xelatex().is_present():
return 'xelatex', 'XeLaTeX'
return 'xelatex'
if pdflatex().is_present():
return 'pdflatex', 'pdfLaTeX'
return 'latex', 'LaTeX'
return 'pdflatex'
return 'latex'


class _Latex_prefs_object(SageObject):
Expand Down Expand Up @@ -535,11 +535,9 @@ def _option(self):
'matrix_column_alignment': 'r',
'macros': '',
'preamble': '',
'engine': 'lualatex',
'engine_name': 'LuaLaTeX'}
'engine': 'lualatex'}
"""
self.__option["engine"] = default_engine()[0]
self.__option["engine_name"] = default_engine()[1]
self.__option["engine"] = default_engine()
return self.__option


Expand Down Expand Up @@ -1535,16 +1533,12 @@ def engine(self, e=None):

if e == "latex":
_Latex_prefs._option["engine"] = "latex"
_Latex_prefs._option["engine_name"] = "LaTeX"
elif e == "pdflatex":
_Latex_prefs._option["engine"] = "pdflatex"
_Latex_prefs._option["engine_name"] = "PDFLaTeX"
elif e == "xelatex":
_Latex_prefs._option["engine"] = e
_Latex_prefs._option["engine_name"] = "XeLaTeX"
elif e == "lualatex":
_Latex_prefs._option["engine"] = e
_Latex_prefs._option["engine_name"] = "LuaLaTeX"
else:
raise ValueError("%s is not a supported LaTeX engine. Use latex, pdflatex, xelatex, or lualatex" % e)

Expand Down

0 comments on commit 744fda6

Please sign in to comment.