1

I know that I can insert a watermark containing information about the git revision into my document using the gitinfo2 package like this:

\documentclass{article}

\usepackage{lipsum}
\usepackage[mark]{gitinfo2}
%You need to install gitinfo2 as described in the manual before compiling this

\begin{document}

\lipsum

\end{document}

enter image description here

How can I modify this that the git watermark occurs vertically on the left or on the right margin (similar to the watermark of arxiv papers).

2
\documentclass{article}

\usepackage{lipsum}
\usepackage{gitinfo2}% Don't pass mark option here
%You need to install gitinfo2 as described in the manual before compiling this

\usepackage{graphicx}

\makeatletter
\AddToShipoutPictureBG{%
    \AtPageLowerLeft{%
      \kern1cm
      \raisebox{\dimexpr.5\paperheight-.5\height}
        {\rotatebox{90}{\gitMarkFormat\gitMarkPref{} \textbullet{} \gitMark}}%
    }%
}%
\makeatother

\begin{document}

\lipsum

\end{document}

(Image is ready but upload failed due to some unspecified error at imgur; ok it works 10 hours later)

enter image description here

And with some customizing of \gitMarkFormat (in particular \small was not quite adapted to a vertical mark in left margin).

enter image description here

This is with

\renewcommand{\gitMarkFormat}{\color{blue}\Large\sffamily\bfseries}

added to preamble.

  • you may prefer LaTeX markup \hspace{1cm}% in place of \kern 1cm. Actually that's what I had in source code for blue example but I did not copy paster it to answer. – user4686 Sep 15 '18 at 8:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.