move "copy additional files" after "copying TeX support files" in latex builder.

It enables the user to override TeX support files such as sphinx.sty by setting latex_additional_files.
This commit is contained in:
shirou 2013-03-05 22:17:05 +09:00
parent 35c44b63fb
commit 8bec3b8777
2 changed files with 11 additions and 7 deletions

View File

@ -1147,6 +1147,9 @@ These options influence LaTeX output.
.. versionadded:: 0.6
.. versionchanged:: 1.1.3
This overrides the files which is provided from Sphinx such as sphinx.sty.
.. confval:: latex_preamble
Additional LaTeX markup for the preamble.

View File

@ -157,6 +157,14 @@ class LaTeXBuilder(Builder):
path.join(self.outdir, dest))
self.info()
# copy TeX support files from texinputs
self.info(bold('copying TeX support files...'))
staticdirname = path.join(package_dir, 'texinputs')
for filename in os.listdir(staticdirname):
if not filename.startswith('.'):
copyfile(path.join(staticdirname, filename),
path.join(self.outdir, filename))
# copy additional files
if self.config.latex_additional_files:
self.info(bold('copying additional files...'), nonl=1)
@ -171,11 +179,4 @@ class LaTeXBuilder(Builder):
logobase = path.basename(self.config.latex_logo)
copyfile(path.join(self.confdir, self.config.latex_logo),
path.join(self.outdir, logobase))
self.info(bold('copying TeX support files... '), nonl=True)
staticdirname = path.join(package_dir, 'texinputs')
for filename in os.listdir(staticdirname):
if not filename.startswith('.'):
copyfile(path.join(staticdirname, filename),
path.join(self.outdir, filename))
self.info('done')