A simple working example to show how to add a "draft" annotation to a paper written with LaTeX.
Just do this:
- put the hooks in the
.git
directory of your repo - input the file
draft.tex
file in your source, e.g.
\input{imports/draft.tex}
More info on my blog.
To use this example you need to create some git hooks in your repo. Clone the repo and launch the setup script:
~$ git clone https://github.com/CristianCantoro/latex_draft_example.git
~$ cd latex_draft_example
latex_draft_example$ ./setup.sh
this will simply copy the files from latex_draft_example/.hooks/
in latex_draft_example/.git/
.
Play around with the \draft
command, you can use \draft{long}` if you want to display
the latest commit date and time in the DRAFT stamp.
You can use the command \iftoggle
with the global toggle IsDraft
to change what is
visualized when in "draft mode" or not.
For example the following:
\iftoggle{isDraft}{Draft}{Final}
will visualize the test "Draft" when the command \draft
is used and "Final" otherwise.
latex_draft_example$ make
To clean the temporary file and the target PDF file you can use the cleaning script:
latex_draft_example$ ./clean