/latex_draft_example

A simple working example to show how to add a "draft" annotation to a paper written with LaTeX

Primary LanguageMakefileMIT LicenseMIT

LaTeX DRAFT Watermark Example

A simple working example to show how to add a "draft" annotation to a paper written with LaTeX.

Usage

Just do this:

  1. put the hooks in the .git directory of your repo
  2. input the file draft.tex file in your source, e.g.
\input{imports/draft.tex}

More info on my blog.

Setup

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

Commands and Options

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.

Compile

latex_draft_example$ make

Cleaning

To clean the temporary file and the target PDF file you can use the cleaning script:

latex_draft_example$ ./clean