@@ -51,46 +51,45 @@ Compiling your PDF can be as simple as writing the following task.
51
51
52
52
``` python
53
53
from pathlib import Path
54
- import pytask
54
+ from pytask import mark
55
55
56
56
57
- @pytask. mark.latex (script = Path(" document.tex" ), document = Path(" document.pdf" ))
57
+ @mark.latex (script = Path(" document.tex" ), document = Path(" document.pdf" ))
58
58
def task_compile_latex_document ():
59
59
pass
60
60
```
61
61
62
- Use ` @pytask. mark.latex ` to indicate that this task compiles a LaTeX document. The
63
- ` script ` and the ` document ` keywords provide absolute paths or paths relative to the
64
- task module to the LaTeX file and the compiled document.
62
+ Use ` @mark.latex ` to indicate that this task compiles a LaTeX document. The ` script ` and
63
+ the ` document ` keywords provide absolute paths or paths relative to the task module to
64
+ the LaTeX file and the compiled document.
65
65
66
66
### Dependencies and Products
67
67
68
68
Dependencies and products can be added as usual. Read this
69
69
[ tutorial] ( https://pytask-dev.readthedocs.io/en/stable/tutorials/defining_dependencies_products.html ) .
70
70
71
- For example, with the ` @pytask. task ` decorator. (The choice of the kwarg name, here
72
- ` path ` , is arbitrary.)
71
+ For example, with the ` @task ` decorator. (The choice of the kwarg name, here ` path ` , is
72
+ arbitrary.)
73
73
74
74
``` python
75
- import pytask
75
+ from pytask import mark
76
76
from pytask import task
77
77
from pathlib import Path
78
78
79
79
80
80
@task (kwargs = {" path" : Path(" path_to_another_dependency.tex" )})
81
- @pytask. mark.latex (script = Path(" document.tex" ), document = Path(" document.pdf" ))
81
+ @mark.latex (script = Path(" document.tex" ), document = Path(" document.pdf" ))
82
82
def task_compile_latex_document ():
83
83
pass
84
84
```
85
85
86
86
### Customizing the compilation
87
87
88
88
pytask-latex uses latexmk by default to compile the document because it handles most
89
- use-cases automatically. The following is equivalent to a bare ` @pytask.mark.latex `
90
- decorator.
89
+ use-cases automatically. The following is equivalent to a bare ` @mark.latex ` decorator.
91
90
92
91
``` python
93
- @pytask. mark.latex (
92
+ @mark.latex (
94
93
script = Path(" document.tex" ),
95
94
document = Path(" document.pdf" ),
96
95
compilation_steps = " latexmk" ,
@@ -99,16 +98,16 @@ def task_compile_latex_document():
99
98
...
100
99
```
101
100
102
- The ` @pytask. mark.latex ` decorator has a keyword argument called ` compilation_steps `
103
- which accepts which accepts strings or list of strings pointing to internally
104
- implemented compilation steps. Using strings will use the default configuration of this
105
- compilation step. It is equivalent to the following.
101
+ The ` @mark.latex ` decorator has a keyword argument called ` compilation_steps ` which
102
+ accepts which accepts strings or list of strings pointing to internally implemented
103
+ compilation steps. Using strings will use the default configuration of this compilation
104
+ step. It is equivalent to the following.
106
105
107
106
``` python
108
107
from pytask_latex import compilation_steps as cs
109
108
110
109
111
- @pytask. mark.latex (
110
+ @mark.latex (
112
111
script = Path(" document.tex" ),
113
112
document = Path(" document.pdf" ),
114
113
compilation_steps = cs.latexmk(
@@ -126,7 +125,7 @@ You can pass different options to change the compilation process with latexmk. H
126
125
an example for generating a ` .dvi ` .
127
126
128
127
``` python
129
- @pytask. mark.latex (
128
+ @mark.latex (
130
129
script = Path(" document.tex" ),
131
130
document = Path(" document.pdf" ),
132
131
compilation_steps = cs.latexmk(
@@ -170,10 +169,8 @@ The following task compiles two latex documents.
170
169
``` python
171
170
for i in range (2 ):
172
171
173
- @pytask.mark.task
174
- @pytask.mark.latex (
175
- script = Path(f " document_ { i} .tex " ), document = Path(f " document_ { i} .pdf " )
176
- )
172
+ @task
173
+ @mark.latex (script = Path(f " document_ { i} .tex " ), document = Path(f " document_ { i} .pdf " ))
177
174
def task_compile_latex_document ():
178
175
pass
179
176
```
@@ -185,8 +182,8 @@ compilation steps and their options.
185
182
``` python
186
183
for format_ in (" pdf" , " dvi" ):
187
184
188
- @pytask.mark. task
189
- @pytask. mark.latex (
185
+ @task
186
+ @mark.latex (
190
187
script = Path(" document.tex" ),
191
188
document = Path(f " document. { format_} " ),
192
189
compilation_steps = cs.latexmk(
0 commit comments