mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #3034 from jfbu/use_sphinxoption_forkeepoldnames
make sphinx latex style file use a package option
This commit is contained in:
commit
54d2084fc4
@ -1,6 +1,6 @@
|
||||
%% Generated by Sphinx.
|
||||
\def\sphinxdocclass{<%= docclass %>}
|
||||
\newif\ifsphinxKeepOldNames <%= keepoldnames %>
|
||||
<%= keepoldnames %>
|
||||
\documentclass[<%= papersize %>,<%= pointsize %><%= classoptions %>]{<%= wrapperclass %>}
|
||||
\ifdefined\pdfpxdimen
|
||||
\let\sphinxpxdimen\pdfpxdimen\else\newdimen\sphinxpxdimen
|
||||
|
@ -7,6 +7,10 @@
|
||||
|
||||
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
|
||||
\ProvidesPackage{sphinx}[2016/06/10 LaTeX package (Sphinx markup)]
|
||||
\newif\ifsphinxKeepOldNames \sphinxKeepOldNamestrue
|
||||
\DeclareOption{dontkeepoldnames}{\sphinxKeepOldNamesfalse}
|
||||
\DeclareOption*{\PackageWarning{sphinx}{Unknown option `\CurrentOption'}}
|
||||
\ProcessOptions\relax
|
||||
|
||||
% this is the \ltx@ifundefined of ltxcmds.sty, which is loaded by
|
||||
% hyperref.sty, but we need it before, and initial ltxcmds.sty
|
||||
|
@ -350,9 +350,10 @@ class LaTeXTranslator(nodes.NodeVisitor):
|
||||
})
|
||||
# set-up boolean for sphinx.sty
|
||||
if builder.config.latex_keep_old_macro_names:
|
||||
self.elements['keepoldnames'] = '\\sphinxKeepOldNamestrue'
|
||||
self.elements['keepoldnames'] = ''
|
||||
else:
|
||||
self.elements['keepoldnames'] = '\\sphinxKeepOldNamesfalse'
|
||||
self.elements['keepoldnames'] = ('\\PassOptionsToPackage'
|
||||
'{dontkeepoldnames}{sphinx}')
|
||||
if document.settings.docclass == 'howto':
|
||||
docclass = builder.config.latex_docclass.get('howto', 'article')
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user