diff --git a/.gitignore b/.gitignore index 934c872..e0abf32 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,5 @@ __pycache__/ .pixi/ .vscode/ .quarto/ + +/.quarto/ diff --git a/Snakefile b/Snakefile index 70feb5b..2b0b6e1 100644 --- a/Snakefile +++ b/Snakefile @@ -1,22 +1,28 @@ from os.path import splitext, basename, dirname -from src.util.makeutils import find_input_files +from src.util.makeutils import find_input_files, find_opened_files, find_quarto_images SESSION_CODES = ["ykdzfw2h", "5r4374w0", "v0bpsxm2", "m7xcm95f"] PAPERS = ["theory", "application", "experiment"] +PRESENTATIONS = ["defense"] rule prepare_to_publish: input: dissertation = "out/paper/dissertation.pdf", papers = expand("out/paper/{paper}.pdf", paper=PAPERS), + presentations = expand( + "out/presentation/{presentation}.html", + presentation=PRESENTATIONS + ), output: dissertation = "dist/dissertation.pdf", papers = expand("dist/{paper}.pdf", paper=PAPERS), + presentations = expand("dist/{presentation}.html", presentation=PRESENTATIONS), nojekyll = "dist/.nojekyll" run: from shutil import copy2 from pathlib import Path - for file in input.papers + [input.dissertation]: + for file in input.papers + input.presentations + [input.dissertation]: copy2(file, "dist") Path(output.nojekyll).touch() @@ -31,6 +37,11 @@ rule dissertation: dissertation = "out/paper/dissertation.pdf" +rule presentations: + input: + expand("out/presentation/{presentation}.html", presentation=PRESENTATIONS) + + rule update_latex_deps: input: deps = expand("out/paper/{paper}.dep", paper=PAPERS + ["dissertation"]), @@ -63,6 +74,25 @@ rule paper: -interaction=nonstopmode {input.tex}" +rule presentation: + input: + qmd = "src/presentation/{presentation}.qmd", + python_input = lambda wildcard: find_opened_files( + f"src/presentation/{wildcard.presentation}.qmd" + ), + images = lambda wildcard: find_quarto_images( + f"src/presentation/{wildcard.presentation}.qmd" + ), + bib = "src/paper/references.bib", + css = "src/presentation/include/custom.scss", + marhjax_js = "src/presentation/include/mathjax-settings.html", + section_js = "src/presentation/include/sections-in-footer.html", + output: + "out/presentation/{presentation}.html", + shell: + "quarto render {input.qmd}" + + rule figure_equilibrium: input: script = "src/figures/equilibrium_symbolic.py" diff --git a/_quarto.yml b/_quarto.yml new file mode 100644 index 0000000..e322cb2 --- /dev/null +++ b/_quarto.yml @@ -0,0 +1,6 @@ +project: + output-dir: out/presentation + execute-dir: project + post-render: src/util/move_quarto_output.py + +bibliography: src/paper/references.bib diff --git a/src/presentation/defense.qmd b/src/presentation/defense.qmd new file mode 100644 index 0000000..c506076 --- /dev/null +++ b/src/presentation/defense.qmd @@ -0,0 +1,31 @@ +--- +title: "Essays on Cooperative Bargaining" +author: + - Martin Stancsics +format: + revealjs: + embed-resources: true + theme: + - default + - include/custom.scss + include-in-header: + - include/mathjax-settings.html + - include/sections-in-footer.html + toc: true + toc-depth: 1 + toc-title: Agenda +--- + +# Introduction + +## Motivation + +# Thank you {.unnumbered .unlisted} + +## References + +::: {#refs} +::: + +## Appendix + diff --git a/src/presentation/include/custom.scss b/src/presentation/include/custom.scss new file mode 100644 index 0000000..df3edb6 --- /dev/null +++ b/src/presentation/include/custom.scss @@ -0,0 +1,120 @@ +$highlight: #5692e4; + + +/*-- scss:rules --*/ + +#section-title { + color: #666666; + font-size: 16px; + bottom: 10px; + position: fixed; + left: 50%; + transform: translate(-50%, -50%); + margin: 0 0; + font-family: Helvetica, sans-serif; + + @media screen and (max-width: 800px) { + font-size: 12px; + bottom: 7px; + } + +} + +.reveal .crossref { + text-align: right; + font-size: smaller; +} + +.reveal div.slide-number { + font-size: 16px; + @media screen and (max-width: 800px) { + font-size: 12px; + } +} + +h1.title { + font-size: calc(var(--r-heading1-size) * 0.7); +} + +nav[role="doc-toc"] li { + margin: 20px 0; +} + +nav[role="doc-toc"] a { + color: inherit; +} + +nav[role="doc-toc"] a:hover { + color: $highlight; +} + +.reveal .citation a[role="doc-biblioref"] { + color: inherit; +} + +.reveal .citation a[role="doc-biblioref"][aria-expanded=true] { + color: $highlight; +} + +.reveal .citation { + color: inherit; +} + +.reveal ul li li { + font-size: 0.75em; + line-height: 1.2em; +} + +.reveal strong { + color: $highlight; +} + +.reveal strong .citation { + color: $highlight; +} + +.reveal strong .citation a[role="doc-biblioref"] { + color: $highlight; +} + +.reveal .smaller { + font-size: 0.75em; + line-height: 1.2em; +} + +.reveal .highlight-block { + display: block; + text-align: left; + font-style: normal; + border-style: solid; + border-color: $highlight; + padding-left: 30px; + padding-right: 30px; + padding-top: 10px; + padding-bottom: 10px; + margin-left: 30px; + margin-right: 30px; + border-width: 5px; +} + +.reveal .proposition:before { + content: "Proposition. "; + font-weight: bold; + color: $highlight; + font-style: normal; +} + +.reveal .idea:before { + content: "Idea. "; + font-weight: bold; + color: $highlight; + font-style: normal; +} + +.chatlog { + padding: 10px; + border-style: solid; + border-radius: 10px; + border-color: black; + border-width: 2px; +} \ No newline at end of file diff --git a/src/presentation/include/mathjax-settings.html b/src/presentation/include/mathjax-settings.html new file mode 100644 index 0000000..fcc61ae --- /dev/null +++ b/src/presentation/include/mathjax-settings.html @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/src/presentation/include/sections-in-footer.html b/src/presentation/include/sections-in-footer.html new file mode 100644 index 0000000..0c937be --- /dev/null +++ b/src/presentation/include/sections-in-footer.html @@ -0,0 +1,69 @@ + diff --git a/src/util/move_quarto_output.py b/src/util/move_quarto_output.py new file mode 100644 index 0000000..ed5ce87 --- /dev/null +++ b/src/util/move_quarto_output.py @@ -0,0 +1,14 @@ +import os +import pathlib + +out_dir = pathlib.Path(os.environ["QUARTO_PROJECT_OUTPUT_DIR"]) +src_dir = out_dir / "src" +output_files = src_dir.glob("presentation/*.html") +output_files = [ + pathlib.Path(file) for file + in os.environ["QUARTO_PROJECT_OUTPUT_FILES"].split() +] +for output_file in output_files: + output_file.rename(out_dir / output_file.name) +(src_dir / "presentation").rmdir() +src_dir.rmdir()