Skip to content

Commit

Permalink
Use sensible LaTeX pipeline for typical installations, remove changin…
Browse files Browse the repository at this point in the history
…g of paths.
  • Loading branch information
hmgaudecker committed Nov 12, 2022
1 parent a40bfcb commit 9338ce4
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
13 changes: 5 additions & 8 deletions {{cookiecutter.project_slug}}/paper/task_paper.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import shutil

import pytask
from pytask_latex import compilation_steps as cs

from {{cookiecutter.project_slug}}.config import BLD
from {{cookiecutter.project_slug}}.config import PAPER_DIR
Expand All @@ -11,16 +12,12 @@
for document in documents:


@pytask.mark.depends_on(
[
BLD / "figures" / "marital_status-figure.png",
PAPER_DIR / "refs.bib",
BLD / "latex" / "estimation_table.tex",
]
)
@pytask.mark.latex(
script=PAPER_DIR / f"{document}.tex",
document=BLD / "latex" / f"{document}.pdf"
document=BLD / "latex" / f"{document}.pdf",
compilation_steps=cs.latexmk(
options=("--pdf", "--interaction=nonstopmode", "--synctex=1", "--cd")
)
)
@pytask.mark.task(id=document)
def task_compile_documents():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ \section{Introduction} % (fold)
\end{figure}


\input{../bld/latex/estimation_table}
\input{../tables/estimation_table.tex}

% section introduction (end)

Expand Down
2 changes: 1 addition & 1 deletion {{cookiecutter.project_slug}}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ requires = ["setuptools>=45", "wheel", "setuptools_scm[toml]>=6.0"]
write_to = "src/{{ cookiecutter.project_slug }}/_version.py"

[tool.pytask.ini_options]
paths = ["./src/{{ cookiecutter.project_slug }}", "./paper"]
infer_latex_dependencies = true

{% if cookiecutter.add_mypy == "yes" %}
[tool.mypy]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
TEST_DIR = SRC.joinpath("..", "..", "tests").resolve()
PAPER_DIR = SRC.joinpath("..", "..", "paper").resolve()

FIGURES_DIR = BLD.joinpath("figures").resolve())
TABLES_DIR = BLD.joinpath("tables").resolve())
FIGURES_DIR = BLD.joinpath("figures").resolve()
TABLES_DIR = BLD.joinpath("tables").resolve()


GROUPS = ["marital_status", "qualification"]
Expand Down

0 comments on commit 9338ce4

Please sign in to comment.