Skip to content
Snippets Groups Projects
Commit 2b253f73 authored by Thomas Kluyver's avatar Thomas Kluyver Committed by Karim Ahmed
Browse files

Fix setting output file name for Sphinx & latex

parent 39a688b0
No related branches found
No related tags found
1 merge request!984Try updating to Python 3.11 & update all deps
......@@ -250,20 +250,17 @@ def make_report(run_path: Path, cal_work_dir: Path, project: str,
logo_path))
mf.write("latex_additional_files = ['titlepage.tex.txt']\n")
# Set name of the .tex file & thus also the .pdf output
# https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-latex_documents
latex_doc = ('index', f'{report_name}.tex', tex_escape(project),
tex_escape(author), 'manual', False)
mf.write(f"latex_documents = [{latex_doc!r}]\n")
for var in l_var:
if var in ['latex_elements', 'latex_logo',
'latex_additional_files']:
'latex_additional_files', 'latex_documents']:
continue
tmpl = '{} = {}\n'
v = getattr(conf, var, None)
if isinstance(v, str):
tmpl = '{} = "{}"\n'
# Set name of the latex document
if var == 'latex_documents' and len(v[0]) > 1:
v[0] = v[0][:1] + ('{}.tex'.format(report_name), ) + v[0][2:]
mf.write(tmpl.format(var, v))
mf.write(f'{var} = {getattr(conf, var, None)!r}\n')
conf_fn.unlink()
move(str(tmp_conf_fn), str(conf_fn))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment