mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
refactor: latex: Initialize 'logofilename' on context
This commit is contained in:
parent
db02ae1b81
commit
a2ec232c71
1
CHANGES
1
CHANGES
@ -90,6 +90,7 @@ Deprecated
|
|||||||
* ``sphinx.writers.text.TextTranslator._make_depart_admonition()``
|
* ``sphinx.writers.text.TextTranslator._make_depart_admonition()``
|
||||||
* template variables for LaTeX template
|
* template variables for LaTeX template
|
||||||
|
|
||||||
|
- ``logo``
|
||||||
- ``pageautorefname``
|
- ``pageautorefname``
|
||||||
- ``translatablestrings``
|
- ``translatablestrings``
|
||||||
|
|
||||||
|
@ -198,6 +198,9 @@ class LaTeXBuilder(Builder):
|
|||||||
self.context['date'] = format_date(self.config.today_fmt or _('%b %d, %Y'),
|
self.context['date'] = format_date(self.config.today_fmt or _('%b %d, %Y'),
|
||||||
language=self.config.language)
|
language=self.config.language)
|
||||||
|
|
||||||
|
if self.config.latex_logo:
|
||||||
|
self.context['logofilename'] = path.basename(self.config.latex_logo)
|
||||||
|
|
||||||
# for compatibilities
|
# for compatibilities
|
||||||
self.context['indexname'] = _('Index')
|
self.context['indexname'] = _('Index')
|
||||||
if self.config.release:
|
if self.config.release:
|
||||||
|
@ -48,7 +48,11 @@
|
|||||||
\date{<%= date %>}
|
\date{<%= date %>}
|
||||||
\release{<%= release %>}
|
\release{<%= release %>}
|
||||||
\author{<%= author %>}
|
\author{<%= author %>}
|
||||||
\newcommand{\sphinxlogo}{<%= logo %>}
|
<%- if logofilename %>
|
||||||
|
\newcommand{\sphinxlogo}{\sphinxincludegraphics{<%= logofilename %>}\par}
|
||||||
|
<%- else %>
|
||||||
|
\newcommand{\sphinxlogo}{\vbox{}}
|
||||||
|
<%- endif %>
|
||||||
<%- if releasename or release %>
|
<%- if releasename or release %>
|
||||||
\renewcommand{\releasename}{<%= releasename or _('Release') | e %>}
|
\renewcommand{\releasename}{<%= releasename or _('Release') | e %>}
|
||||||
<%- else %>
|
<%- else %>
|
||||||
|
@ -157,7 +157,6 @@ DEFAULT_SETTINGS = {
|
|||||||
'title': '',
|
'title': '',
|
||||||
'release': '',
|
'release': '',
|
||||||
'author': '',
|
'author': '',
|
||||||
'logo': '\\vbox{}',
|
|
||||||
'releasename': '',
|
'releasename': '',
|
||||||
'makeindex': '\\makeindex',
|
'makeindex': '\\makeindex',
|
||||||
'shorthandoff': '',
|
'shorthandoff': '',
|
||||||
@ -578,11 +577,6 @@ class LaTeXTranslator(SphinxTranslator):
|
|||||||
except AttributeError:
|
except AttributeError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if self.config.latex_logo:
|
|
||||||
# no need for \\noindent here, used in flushright
|
|
||||||
self.elements['logo'] = '\\sphinxincludegraphics{%s}\\par' % \
|
|
||||||
path.basename(self.config.latex_logo)
|
|
||||||
|
|
||||||
if (self.config.language not in {None, 'en', 'ja'} and
|
if (self.config.language not in {None, 'en', 'ja'} and
|
||||||
'fncychap' not in self.config.latex_elements):
|
'fncychap' not in self.config.latex_elements):
|
||||||
# use Sonny style if any language specified (except English)
|
# use Sonny style if any language specified (except English)
|
||||||
|
Loading…
Reference in New Issue
Block a user