Ticket #13713: trac_13713_engine_pdflatex-sl.patch

File trac_13713_engine_pdflatex-sl.patch, 3.2 KB (added by slabbe, 6 years ago)

tested on sage-5.7.beta4

  • sage/misc/latex.py

    # HG changeset patch
    # User Sebastien Labbe <slabqc at gmail.com>
    # Date 1364914741 -7200
    # Node ID 842596e7db945e48b9baa318845a615a73cb1d18
    # Parent  bd1c6e6420d4d96ceb54c836d06ae7682d2f161b
    view: change default value of engine from 'latex' to 'pdflatex' and improve doc
    
    diff --git a/sage/misc/latex.py b/sage/misc/latex.py
    a b class _Latex_prefs_object(SageObject): 
    602602        self._option["vector_delimiters"] = list(delimiters)
    603603        self._option["macros"] = ""
    604604        self._option["preamble"] = ""
    605         self._option["engine"] = "latex"
     605        self._option["engine"] = "pdflatex"
    606606        self._option["engine_name"] = "LaTeX"
    607607        self._option["mathjax_avoid"] = []
    608608
    def _run_latex_(filename, debug=False, d 
    657657    """
    658658    This runs LaTeX on the TeX file "filename.tex".  It produces files
    659659    "filename.dvi" (or "filename.pdf"` if engine is either ``pdflatex``
    660     or ``xelatex'') and if ``png`` is ``True``, "filename.png".  If ``png``
     660    or ``xelatex``) and if ``png`` is ``True``, "filename.png".  If ``png``
    661661    is ``True`` and dvipng can't convert the dvi file to png (because of
    662662    postscript specials or other issues), then dvips is called, and the
    663663    PS file is converted to a png file.
    Warning: `%s` is not part of this comput 
    16411641        EXAMPLES::
    16421642
    16431643            sage: latex.engine()
     1644            'pdflatex'
     1645            sage: latex.engine("latex")
     1646            sage: latex.engine()
    16441647            'latex'
    1645             sage: latex.engine("pdflatex")
    1646             sage: latex.engine()
    1647             'pdflatex'
    16481648            sage: latex.engine("xelatex")
    16491649            sage: latex.engine()
    16501650            'xelatex'
    def view(objects, title='Sage', debug=Fa 
    19861986    -  ``pdflatex`` -- bool (default: ``False``): use pdflatex. This is
    19871987       deprecated. Use ``'engine'`` option instead.
    19881988
    1989     -  ``engine`` -- ``'latex'``, ``'pdflatex'``, or ``'xelatex'``
     1989    -  ``engine`` -- string or ``None`` (default: ``None``). Can take the
     1990       following values:
     1991
     1992       - ``None`` -- the value defined in the LaTeX global preferences
     1993         ``latex.engine()`` is used.
     1994
     1995       - ``'pdflatex'`` -- compilation does tex -> pdf
     1996
     1997       - ``'xelatex'`` -- compilation does tex -> pdf
     1998
     1999       - ``'latex'`` -- compilation first tries tex -> dvi -> png and if an
     2000         error occurs then tries dvi -> ps -> pdf. This is slower than
     2001         ``'pdflatex'`` and known to be broken when overfull hbox are detected.
    19902002
    19912003    -  ``viewer`` -- string or ``None`` (default: ``None``): specify a viewer
    19922004       to use; currently the only options are ``None`` and ``'pdf'``.
    def view(objects, title='Sage', debug=Fa 
    20222034    inserts a page break between objects.
    20232035
    20242036    If ``pdflatex`` is ``True``, then the latex engine is set to
    2025     pdflatex. If the engine is either pdflatex or xelatex,  it produces
     2037    pdflatex.
     2038
     2039    If the ``engine`` is either ``pdflatex`` or ``xelatex``,  it produces
    20262040    a pdf file. Otherwise, it produces a dvi file, and if the program dvipng is
    20272041    installed, it checks the dvi file by trying to convert it to a png
    20282042    file.  If this conversion fails, the dvi file probably contains