Skip to content

Commit f5818a5

Browse files
committed
Update readme.
1 parent 1631a37 commit f5818a5

File tree

1 file changed

+21
-24
lines changed

1 file changed

+21
-24
lines changed

README.md

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -51,46 +51,45 @@ Compiling your PDF can be as simple as writing the following task.
5151

5252
```python
5353
from pathlib import Path
54-
import pytask
54+
from pytask import mark
5555

5656

57-
@pytask.mark.latex(script=Path("document.tex"), document=Path("document.pdf"))
57+
@mark.latex(script=Path("document.tex"), document=Path("document.pdf"))
5858
def task_compile_latex_document():
5959
pass
6060
```
6161

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.
6565

6666
### Dependencies and Products
6767

6868
Dependencies and products can be added as usual. Read this
6969
[tutorial](https://pytask-dev.readthedocs.io/en/stable/tutorials/defining_dependencies_products.html).
7070

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.)
7373

7474
```python
75-
import pytask
75+
from pytask import mark
7676
from pytask import task
7777
from pathlib import Path
7878

7979

8080
@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"))
8282
def task_compile_latex_document():
8383
pass
8484
```
8585

8686
### Customizing the compilation
8787

8888
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.
9190

9291
```python
93-
@pytask.mark.latex(
92+
@mark.latex(
9493
script=Path("document.tex"),
9594
document=Path("document.pdf"),
9695
compilation_steps="latexmk",
@@ -99,16 +98,16 @@ def task_compile_latex_document():
9998
...
10099
```
101100

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.
106105

107106
```python
108107
from pytask_latex import compilation_steps as cs
109108

110109

111-
@pytask.mark.latex(
110+
@mark.latex(
112111
script=Path("document.tex"),
113112
document=Path("document.pdf"),
114113
compilation_steps=cs.latexmk(
@@ -126,7 +125,7 @@ You can pass different options to change the compilation process with latexmk. H
126125
an example for generating a `.dvi`.
127126

128127
```python
129-
@pytask.mark.latex(
128+
@mark.latex(
130129
script=Path("document.tex"),
131130
document=Path("document.pdf"),
132131
compilation_steps=cs.latexmk(
@@ -170,10 +169,8 @@ The following task compiles two latex documents.
170169
```python
171170
for i in range(2):
172171

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"))
177174
def task_compile_latex_document():
178175
pass
179176
```
@@ -185,8 +182,8 @@ compilation steps and their options.
185182
```python
186183
for format_ in ("pdf", "dvi"):
187184

188-
@pytask.mark.task
189-
@pytask.mark.latex(
185+
@task
186+
@mark.latex(
190187
script=Path("document.tex"),
191188
document=Path(f"document.{format_}"),
192189
compilation_steps=cs.latexmk(

0 commit comments

Comments
 (0)