[Tex/LaTex] Getting TexLive installation to work

installingtikz-pgfUbuntu

In the launchpad website it is mentioned that the version in the repositories is hopelessly outdated (by two years, even in the oncoming october release). I was trying to install TeXLive 2011 (in Ubuntu) and succesfully followed all the instructions given in the linked blog.

However, when I make a tex file containing the header

\usetikzlibrary{calc,through, intersections,decorations.text}

I think it is not able to load the package. I get the error message

! I can't find file `tikzlibrary'.

I am wondering this was probably because of the final statement in the aforementioned blog

That should be that. Remember that ktikz needs to load up the PGF
packages you want to use. Common ones for me are loaded as follows:

\usetikzlibrary{calc,through, intersections,decorations.text, decorations.pathreplacing}

I didn't really understand what this meant, so I presumed he meant to add this as the header to the latex file, as normal. Apparently, that is not the case.

Could someone tell me how to get my installation to work? How do I load up the packages I want to use?

Additional info: I added the following files to my .bashrc (and even .profile)

cat >> ./.bashrc << "EOF"
PATH= /usr/local/texlive/2011/bin/x86_64-linux/:$PATH
export PATH MANPATH=/usr/local/texlive/2011/bin/x86_64-linux/:$MANPATH
INFOPATH=/usr/local/texlive/2011/bin/x86_64-linux/:$INFOPATH 
export MANPATH export INFOPATH
EOF

When I do a which pdflatex I get /usr/bin/pdflatex while it should tell me something like /usr/local/texlive/2011/bin/x86_64-linux/pdflatex
`


Disclaimer: This code is not mine. I am just testing to see if TikZ works.

\usepackage{tikz}


\usetikzlibrary{calc,through, intersections,decorations.text}


\begin{tikzpicture} [scale=3]
\def\myangle{117};
\clip (-1.5,-1.5) rectangle (1.5,1.5);
\coordinate (A) at (0,0);
\coordinate (B) at (1,0);
\node [blue, name path=blue_circle,draw,circle through=(B)] at (A) {};
\draw [black, fill] (A) circle (1pt) node [below] {\tiny centre};
\draw [red, dashed] (A) -- (B);
\path [name path=radius, rotate=\myangle] (A) -- ++(1.5,0);
\draw [red, ->] ($(A)+(0.5,0)$) arc (0:\myangle:0.5cm);
\path [decorate,decoration={raise=-5pt, text along path, text={|\tiny|angle ||}, text align=center, text color=red, reverse path}](0.5,0) arc (0:\myangle:0.5cm);
\draw [name intersections={of=blue_circle and radius, by=C}] [orange, ->] (A) --  (C) node [pos=0.7, sloped, above] {\tiny radius};

\end{tikzpicture}

Best Answer

I've had the same frustrations as you, yayu, with respect to the pitiful state of TexLive on Ubuntu. By forcing people to use Google for solutions rather than rely on Ubuntu to actually maintain their packages in a timely fashion mistakes are inevitable. In my case, similar problems were caused by my TeX tree not being installed in the correct location. I had chosen a "portable" installation intending to be queried as to where I would like to install it. However, that never happened. Why? I have no idea. I followed Andrew Stacey's advice of trying to install a non-portable version. I did and it now works fine on your example and some others I checked. Perhaps this explains your problem, too.

I was told to make sure my umask was 022 first. The TL2011 documentation says something about making sure it "is sufficiently permissive, for instance, umask 002". I found Ubuntu default is umask 022 so there is nothing to change. I did a "sudo texhash" just to make sure the info was up to date.

The final challenge was with respect to changing the PATH/MANPATH. The TL2011 documentation tells you "the file to edit might be $HOME/.profile". You're on your own again, so I Googled, found various conflicting information, made changes, and nothing worked. I still don't know what the problem is but I did find that TeXworks allows me to specifically configure the path. Start TeXworks, go to the Edit tab, select Preferences and under the Typesetting tab you can use the "+" key to specify the path to your TeX tree. I used the "-" key to remove other options. For me that meant adding /usr/local/texlive/2011/bin/x86_64-linux but since I am using a 64-bit machine, that last item for you might differ. Using TeXworks runs TL2011, the other editors run TL2009. Not a complete solution, but I'm happy. I will look into finding a distro that does a better job keeping TeX packages up to date.

How do you install packages on Ubuntu? It's supposed to be through Synaptic Package manager, but since the "current" Ubuntu packages are so out of date this isn't what you want. The second option is the package manager tlmgr if you can find some way to get it onto Ubuntu. The third option is to install the packages manually which means downloading the files to your computer and then moving them (via a sudo command) to the appropriate area of the TeX tree and a texhash command to update the TeX tree. A major headache! I'll leave you to Google for those annoying details although I'll point out a helpful link for getting style files onto Ubuntu here. Installing TeXLive 2011 to /usr/local bypasses Ubuntu and will give you a system which is reasonably up to date.