[Tex/LaTex] How to install tikz/pgf libraries

tikz-pgftikzlibrary

I am trying to run a rather simple code using tikz and a pgf library. My simple code is

\documentclass{book}
\usepackage[explicit]{titlesec}
\usepackage{fourier}
\usepackage{tikz}
\usepackage{epigraph}
\usepgflibrary{qrr.shapes.openrectangle}

\begin{document}

    This is a test document

\end{document}

This code was copied from Gonzalo Medina's answer in Customizing chapter style with tikz. When I run this code I get the error

'!Package pgf Error: I did not find the pgf library qrr.shapes.openrectangle'.

I am using TeXLive-2014 (actually I installed it yesterday) but nonetheless I updated all packages just in case, but that didn't seem to help.

Any idea how to use this specific library and why it cannot be found in the texmf trees?

Best Answer

Check the location of your personal texmf tree: tlmgr conf texmf TEXMFHOME. Usually the result will be ~/texmf. The rest of the answer assumes this is the case. If the directory does not exist, you can create it. You might as well call mkdir -p ~/texmf/tex/generic/pgf right away, which will create a directory tree conforming to TeX Directory Structure (TDS). Without a proper structure, files will not be found during compilation.

Go to the newly created directory: cd ~/texmf/tex/generic/pgf. Then clone the GitHub repository containing the required PGF library: git clone https://github.com/Qrrbrbirlbel/pgf.git qrr. If the command is successful, the files will be found in a subdirectory called qrr. The directory can be named freely. I found the location of the repository by following a chain of links starting from the question and ending in this answer by Qrrbrbirlbel.

The example document should then compile. The instructions assume a Unix / Linux system. Some modifications would be required for Windows. On Mac OS X, only the default value of TEXMFHOME would be different, but the rest of the procedure should be the same.