From 7a3c1bb4f092d9c52ae665dc0ec92c289b3fc818 Mon Sep 17 00:00:00 2001 From: Filip Gralinski Date: Thu, 2 Jan 2025 11:46:38 +0100 Subject: [PATCH] Add optional presentation cntd. --- cookiecutter.json | 3 ++- hooks/post_gen_project.sh | 4 ++++ {{cookiecutter.paper_repo_name}}/.cookiecutter.yml | 1 + {{cookiecutter.paper_repo_name}}/.gitignore | 1 + {{cookiecutter.paper_repo_name}}/Makefile | 9 ++++++++- 5 files changed, 16 insertions(+), 2 deletions(-) diff --git a/cookiecutter.json b/cookiecutter.json index 061d8f1..397aeaa 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -17,5 +17,6 @@ "supervisor": "none", "album_no": "none", "beeminder_support": "no", - "contribution_declaration": "{{ 'yes' if cookiecutter.latex_template != 'pw-thesis' and cookiecutter.latex_template != 'amu' else 'no' }}" + "contribution_declaration": "{{ 'yes' if cookiecutter.latex_template != 'pw-thesis' and cookiecutter.latex_template != 'amu' else 'no' }}", + "with_presentation": "no" } diff --git a/hooks/post_gen_project.sh b/hooks/post_gen_project.sh index cac3291..79449f4 100755 --- a/hooks/post_gen_project.sh +++ b/hooks/post_gen_project.sh @@ -155,6 +155,10 @@ if [ "{{ cookiecutter.contribution_declaration }}" = "yes" ]; then cp -r _optional_files/_contribution_declaration/* . fi +if [ "{{ cookiecutter.with_presentation }}" = "yes" ]; then + cp -r _optional_files/_presentation/presentation.tex {{cookiecutter.paper_id}}-presentation.tex +fi + rm -rf _latex-templates _optional_files if [ -e .git ]; then diff --git a/{{cookiecutter.paper_repo_name}}/.cookiecutter.yml b/{{cookiecutter.paper_repo_name}}/.cookiecutter.yml index 0239563..1e1315c 100644 --- a/{{cookiecutter.paper_repo_name}}/.cookiecutter.yml +++ b/{{cookiecutter.paper_repo_name}}/.cookiecutter.yml @@ -18,3 +18,4 @@ default_context: album_no: '{{ cookiecutter.album_no }}' beeminder_support: '{{ cookiecutter.beeminder_support }}' contribution_declaration: '{{ cookiecutter.contribution_declaration }}' + contribution_declaration: '{{ cookiecutter.with_presentation }}' diff --git a/{{cookiecutter.paper_repo_name}}/.gitignore b/{{cookiecutter.paper_repo_name}}/.gitignore index 00e9b2a..60c8358 100644 --- a/{{cookiecutter.paper_repo_name}}/.gitignore +++ b/{{cookiecutter.paper_repo_name}}/.gitignore @@ -153,6 +153,7 @@ vcs.xml *.run.xml /auto {{cookiecutter.paper_id}}.pdf +{{cookiecutter.paper_id}}-presentation.pdf {{cookiecutter.paper_id}}.zip autozoil-log.txt stats.txt diff --git a/{{cookiecutter.paper_repo_name}}/Makefile b/{{cookiecutter.paper_repo_name}}/Makefile index f3472be..52ad6bf 100644 --- a/{{cookiecutter.paper_repo_name}}/Makefile +++ b/{{cookiecutter.paper_repo_name}}/Makefile @@ -7,7 +7,7 @@ HAS_APPENDIX={{cookiecutter.with_appendix}} LATEX_TEMPLATE={{cookiecutter.latex_template}} WITH_ARXIV_PACKAGE={{cookiecutter.with_arxiv_package}} -CONTENT_TEX_SOURCES=$(filter-out $(PAPER_ID).tex config.tex extras.tex metadata.tex preamble.tex the-appendix.tex, $(shell find . -name '*.tex')) +CONTENT_TEX_SOURCES=$(filter-out $(PAPER_ID).tex $(PAPER_ID)-presentation.tex config.tex extras.tex metadata.tex preamble.tex the-appendix.tex, $(shell find . -name '*.tex')) CURRENT_DIR=$(shell pwd) AUTOZOIL_DIR?=/opt/autozoil @@ -70,6 +70,13 @@ $(PAPER_ID).pdf: $(PAPER_ID).tex preamble.tex metadata.tex $(CONTENT_TEX_SOURCES pdflatex $< pdflatex $< +{% if cookiecutter.with_presentation == 'yes' %} +$(PAPER_ID)-presentation.pdf: $(PAPER_ID)-presentation.tex + pdflatex $< + pdflatex $< + pdflatex $< +{% endif %} + # to be copied and pasted as plain text (without LaTeX stuff) abstract.txt: abstract.tex cat $< | perl -pne 's/noqa\{[^}]+\}//g' | detex > $@