mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
latex_engine
template variable, check luatex85 only if lualatex engine
This commit is contained in:
parent
7325f8fe8c
commit
cf246d09c0
@ -1,5 +1,14 @@
|
||||
%% Generated by Sphinx.
|
||||
\def\sphinxdocclass{<%= docclass %>}
|
||||
<% if latex_engine == 'lualatex' -%>
|
||||
\IfFileExists{luatex85.sty}
|
||||
{\RequirePackage{luatex85}}
|
||||
{\ifdefined\luatexversion\ifnum\luatexversion>84\relax
|
||||
\PackageError{sphinx}
|
||||
{** With this LuaTeX (\the\luatexversion),Sphinx requires luatex85.sty **}
|
||||
{** Add the LaTeX package luatex85 to your TeX installation, and try again **}
|
||||
\endinput\fi\fi}
|
||||
<% endif -%>
|
||||
\documentclass[<%= papersize %>,<%= pointsize %><%= classoptions %>]{<%= wrapperclass %>}
|
||||
\ifdefined\pdfpxdimen
|
||||
\let\sphinxpxdimen\pdfpxdimen\else\newdimen\sphinxpxdimen
|
||||
|
@ -5,12 +5,6 @@
|
||||
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
|
||||
\ProvidesClass{sphinxhowto}[2016/10/12 v1.5 Document class (Sphinx HOWTO)]
|
||||
|
||||
\ifx\directlua\undefined\else
|
||||
% if compiling with lualatex 0.85 or later load compatibility patch issued by
|
||||
% the LaTeX team for older packages relying on \pdf<name> named primitives.
|
||||
\IfFileExists{luatex85.sty}{\RequirePackage{luatex85}}{}
|
||||
\fi
|
||||
|
||||
% 'oneside' option overriding the 'twoside' default
|
||||
\newif\if@oneside
|
||||
\DeclareOption{oneside}{\@onesidetrue}
|
||||
|
@ -5,12 +5,6 @@
|
||||
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
|
||||
\ProvidesClass{sphinxmanual}[2016/10/12 v1.5 Document class (Sphinx manual)]
|
||||
|
||||
\ifx\directlua\undefined\else
|
||||
% if compiling with lualatex 0.85 or later load compatibility patch issued by
|
||||
% the LaTeX team for older packages relying on \pdf<name> named primitives.
|
||||
\IfFileExists{luatex85.sty}{\RequirePackage{luatex85}}{}
|
||||
\fi
|
||||
|
||||
% chapters starting at odd pages (overridden by 'openany' document option)
|
||||
\PassOptionsToClass{openright}{\sphinxdocclass}
|
||||
|
||||
|
@ -46,6 +46,7 @@ URI_SCHEMES = ('mailto:', 'http:', 'https:', 'ftp:')
|
||||
SECNUMDEPTH = 3
|
||||
|
||||
DEFAULT_SETTINGS = {
|
||||
'latex_engine': 'pdflatex',
|
||||
'papersize': 'letterpaper',
|
||||
'pointsize': '10pt',
|
||||
'pxunit': '49336sp',
|
||||
@ -56,12 +57,10 @@ DEFAULT_SETTINGS = {
|
||||
'sphinxpackageoptions': '',
|
||||
'sphinxsetup': '',
|
||||
'passoptionstopackages': '',
|
||||
'geometry': '\\usepackage[margin=1in,marginparwidth=0.5in]'
|
||||
'{geometry}',
|
||||
'geometry': ('\\usepackage[margin=1in,marginparwidth=0.5in]'
|
||||
'{geometry}'),
|
||||
'inputenc': '',
|
||||
'utf8extra': ('\\ifdefined\\DeclareUnicodeCharacter\n'
|
||||
' \\DeclareUnicodeCharacter{00A0}{\\leavevmode\\nobreak\\ }\n'
|
||||
'\\fi'),
|
||||
'utf8extra': '',
|
||||
'cmappkg': '\\usepackage{cmap}',
|
||||
'fontenc': '\\usepackage[T1]{fontenc}',
|
||||
'amsmath': '\\usepackage{amsmath,amssymb,amstext}',
|
||||
@ -103,13 +102,23 @@ DEFAULT_SETTINGS = {
|
||||
ADDITIONAL_SETTINGS = {
|
||||
'pdflatex': {
|
||||
'inputenc': '\\usepackage[utf8]{inputenc}',
|
||||
'utf8extra': '\\DeclareUnicodeCharacter{00A0}{\\nobreakspace}',
|
||||
},
|
||||
'xelatex': {
|
||||
'utf8extra': ('\\catcode`^^^^00a0\\active\\protected\\def^^^^00a0'
|
||||
'{\\leavevmode\\nobreak\\ }'),
|
||||
'latex_engine': 'xelatex',
|
||||
'polyglossia': '\\usepackage{polyglossia}',
|
||||
'fontenc': '\\usepackage{fontspec}',
|
||||
'fontpkg': '',
|
||||
'utf8extra': ('\\catcode`^^^^00a0\\active\\protected\\def^^^^00a0'
|
||||
'{\\leavevmode\\nobreak\\ }'),
|
||||
},
|
||||
'lualatex': {
|
||||
'latex_engine': 'lualatex',
|
||||
'utf8extra': ('\\catcode`^^^^00a0\\active\\protected\\def^^^^00a0'
|
||||
'{\\leavevmode\\nobreak\\ }'),
|
||||
},
|
||||
'platex': {
|
||||
'latex_engine': 'platex',
|
||||
},
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user