2

My system is Ubuntu 20.04 and I am trying to compile a LaTeX file with newer tikz features

\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=1.17}

but it complains with

! Package pgfplots Error: Sorry, 'compat=1.17' is unknown in this context. Please use at most 'compat=1.16'.

and if I ignore this then it compiles but is missing certain plots. If I change the line to \pgfplotsset{compat=1.16} then it does not compile at all, tons of errors.

My question: How do I get pgfplots version 1.17?

I clearly only have version 1.16 on my system, because /usr/share/doc/texlive-doc/latex/pgfplots/pgfplots.pdf starts with Manual for Package pgfplots 2D/3D Plots in LATEX, Version 1.16

 sudo apt install texlive

tells me

texlive is already the newest version (2019.20200218-1).

and

 sudo apt install pgf

Package pgf is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package 'pgf' has no installation candidate

and at

https://github.com/pgf-tikz/pgfplots

there are no installation instructions (I can clone the git repository alright) and it says helpfully

Please take a look at doc/latex/pgfplots/pgfplots.pdf and doc/latex/pgfplots/pgfplotstable.pdf.

but these files do not exist, not in

https://github.com/pgf-tikz/pgfplots/tree/master/doc/latex/pgfplots

or anywhere else in the repository. I can try to upgrade to pgfplots 1.17 manually somehow, by copying the directories from the git repository to /usr/share/texlive/texmf-dist/, but would obviously prefer a proper and safer method. Any help is appreciated.

ebosi
  • 11,692
  • 3
    Debian/Ubuntu’s TeX packages are several versions behind. You can install the latest version on top of it, or you can use the one you have. – Davislor Mar 11 '21 at 23:34
  • And now you know why a lot of us on linux use the upstream texlive (tug.org/texlive) instead of the copy that comes from the Linux dist. – daleif Mar 12 '21 at 09:12
  • Thank you for these comments. I did install a completely new TeX version via the link by Davislor above, but it is now sitting, all 7.4GB, under a separate self-chosen path that I have not been trying to tell my system to recognize. Instead, I found pgfplots_1.17.tds.zip to replace the older version of pgfplots in the existing tree as described in my comment to the answer below. – Bernhard von Stengel Mar 12 '21 at 20:12
  • Is there a resource that would describe what e.g. tlmgr (presumably a TeX installation manager) does, and which environment variables etc. have to be set and where? – Bernhard von Stengel Mar 12 '21 at 20:19

1 Answers1

2

Ubuntu 20.04:

θ64° [romano:~] % grep version $(kpsewhich pgfplots.revision.tex)
\gdef\pgfplotsversion{1.16}
\gdef\pgfplotsversiondatetime{2018-03-28 20:42:04 +0200}
\xdef\pgfplotsversiondate{\expandafter\pgfplots@glob@TMPa\pgfplotsversiondatetime\relax}

So the version that comes with Ubuntu 20.04 is 1.16

To install locally a new version: simply go to CTAN, download the *.tds.zip file, and unpack it under ~/texmf (if you didn't change your default TeX paths).

Rmano
  • 40,848
  • 3
  • 64
  • 125
  • 1
    Thank you for this. I indeed did get hold of pgfplots_1.17.tds.zip and unzipped it under my location /usr/share/texlive/texmf-dist which I found by first unzipping elsewhere and carefully matching the directory structure to know that this is the right place (the zip file contains only a few sparse branches of the full tree). I never chose my TeX path and it would be good to know where the information about it can be found, presumably in some environment variable. – Bernhard von Stengel Mar 12 '21 at 19:59