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
export MANPATH export INFOPATH

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.


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

\begin{tikzpicture} [scale=3]
\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};

  • 2
    Are you trying to use ktikz (which is a TikZ editor), or are you trying to use TikZ in a normal LaTeX document? In the latter case, have you loaded TikZ using \usepackage{tikz} before \usetikzlibrary{...}? – Jake Aug 20 '11 at 6:06
  • @Jake yes, I loaded tikz. I am editing the example I working with into my question. – yayu Aug 20 '11 at 6:09
  • 1
    The problem is that you are still using the version of tex that came with Ubuntu. I get exactly the same error when I disable TeXLive2011 and revert to the system version of TeX. The actual form of the error is due to the space in the list of libraries (early versions of PGF did not allow spaces, I surmise). If you remove the space, it complains about missing the intersections library. If there were no obvious errors with the installation, and the paths are correct for your architecture, then my best guess is that you didn't log out and log back in again! – Loop Space Aug 20 '11 at 18:21
  • 1
    Crosspost askubuntu.com/questions/57924/… – N.N. Aug 21 '11 at 9:11
  • 1
    @yayu : For my installation I chose the "portable" option and nothing TeX related went in to \usr\local. Installing normally (not portable) put it \usr\local. It runs fine now! You might want to check that you have a TeX tree in \usr\local. – DJP Aug 22 '11 at 2:20

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.

  1. Uninstall TeXlive from the Ubuntu repositories:

    sudo apt-get remove texlive

    sudo apt-get autoremove

  2. Install a dummy package so Ubuntu will never ever try to install TeXlive again. See http://www.tug.org/texlive/debian.html#vanilla ("Vanilla TeX Live on Debian")

  3. Make sure perl-tk and perl-doc are installed:

    sudo apt-get install perl-tk perl-doc

  4. There is no need to modify .bashrc or anything else. When starting the TeXlive manager GUI (with cd /usr/local/texlive/2011/bin/x86_64-linux and sudo tlmgr --gui) you can set symbolic links to /usr/local/bin or /usr/bin.

  5. See if the correct TeXlive installation will be used


    should print something like This is pdfTeX, Version 3.1415926-2.3-1.40.12 (TeX Live 2011)

  • 2
    Regarding step 2: Since the instructions are for Debian, you have to modify them for Ubuntu a bit. Just take a look which commands are marked # as root. These have to be called with sudo prefaced. – Axel Sommerfeldt Aug 20 '11 at 6:34
  • 1
    I did that :) I actually did not understand "you should change some information in the file..." so I just copied the example they linked. – yayu Aug 20 '11 at 6:36
  • 1
    That's ok, I did it just the same way. – Axel Sommerfeldt Aug 20 '11 at 6:50
  • 1
    See also: latex-community.org/forum/… Please note that there is no option "Create symlinks to standard directories" in the TL2011 installer, but one can easily do this in the TeXlive Manager GUI after installation. – Axel Sommerfeldt Aug 20 '11 at 6:53
  • 4
    Steps 1 and 2 aren't technically necessary; so long as the TL2011 binaries are earlier in the path than the ones installed by Ubuntu, the Ubuntu packages will simply be ignored. As TL installs under /usr/local it won't get overwritten by any Ubuntu packages. – Loop Space Aug 20 '11 at 9:09

TeX Live 2011 should work without having to uninstall the Ubuntu packages, as Andrew states in his comment, if the user's PATH environment is correct.

If you run env at a command prompt its output includes your current PATH. The path to your TeX Live 2011 installation must be before /usr/bin. For example, my path is "PATH=/home/mas/texlive/2011/bin/x86_64-linux:/home/mas/bin:/usr/local/sbin:/usr/local/bin: ..." (I have TeX Live 2011 installed in my own user directory, not under /usr/local) and I can run the sample above without error. If /usr/bin is before the TeX Live path I get the same error as you.

A further check is to use the which command. For example, again using one of my own machines:

mas@ents:~$ which tlmgr
mas@ents:~$ which pdftex

but some tools are in other directories:

mas@ents:~$ which texworks
mas@ents:~$ which LaTeXTidy

Finally, the test Alex suggested in his answer:

mas@ents:~$ pdftex
This is pdfTeX, Version 3.1415926-2.3-1.40.12 (TeX Live 2011)
 restricted \write18 enabled.

FYI, the lines added at the end of my .profile are:

PATH=/home/mas/texlive/2011/bin/x86_64-linux:$PATH; export PATH
MANPATH=/home/mas/texlive/2011/doc/man:$MANPATH; export MANPATH
INFOPATH=/home/mas/texlive/2011/doc/info:$INFOPATH; export INFOPATH

but these are, of course, specific to where I have installed TeX Live 2011 and the machine's architecture.

You also need to check that any IDE or other tool you use that has its own path settings in its configuration is set appropriately. For example, TeXworks has the path to use configured internally, see under Edit->Preferences->Typesetting.


I wrote the instructions and code that yayu has been trying to follow. In the main I have absolutely no idea what I am doing.

Yayu, as a number of much cleverer people than me have identified, you need the texlive PATH to be at the beginning of your %PATH. The commands I wrote to edit the .bashrc file are supposed to achieve that, but looking at the text you have pasted in above something has gone wrong:

export PATH MANPATH=/usr/local/texlive/2011/bin/x86_64-linux/:$MANPATH

That should be two lines. There should be a line break after the first PATH. So it should look like this:

export PATH

What the commands are supposed to do are to take whatever the system variable PATH is, and to reset it. The "export" command then dumps the changed variable back out into the system at large. The problem is that the two commands there are getting smooshed together, so they are probably not working.

The commands should look like this:

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

As I said on the blog though, I still have PATH related problems doing this. it works fine if I run commands from the terminal, but if I run them from icons it gets lost again.

If you remember to run

source ~/.bashrc

then it should work without rebooting.

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.