13

With \listfiles we can easily list the current version of all the packages loaded.

But it doesn't tell anything about the version of the TikZlibrary tikzmark.

How can I detect it?

The problem is, in particular, when I'm using Overleaf and I can't find the version using a distribution tool like texdoc tikzmark or similar.

MWE:

\listfiles
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{tikzmark}

\begin{document}
    Something with \tikzmarknode{A}{TikZ Mark}
    \begin{tikzpicture}[remember picture, overlay]
        \draw[<-, red] (A) -- ++(1,-1);
    \end{tikzpicture}   
\end{document}

File list in the log:

 *File List*
 article.cls    2018/09/03 v1.4i Standard LaTeX document class
  size10.clo    2018/09/03 v1.4i Standard LaTeX file (size option)
    tikz.sty    2019/02/02 v3.1.1 (3.1.1)
     pgf.sty    2019/02/02 v3.1.1 (3.1.1)
  pgfrcs.sty    2019/02/02 v3.1.1 (3.1.1)
everyshi.sty    2001/05/15 v3.00 EveryShipout Package (MS)
  pgfrcs.code.tex
 pgfcore.sty    2019/02/02 v3.1.1 (3.1.1)
graphicx.sty    2017/06/01 v1.1a Enhanced LaTeX Graphics (DPC,SPQR)
  keyval.sty    2014/10/28 v1.15 key=value parser (DPC)
graphics.sty    2017/06/25 v1.2c Standard LaTeX Graphics (DPC,SPQR)
    trig.sty    2016/01/03 v1.10 sin cos tan (DPC)
graphics.cfg    2016/06/04 v1.11 sample graphics configuration
  pdftex.def    2018/01/08 v1.0l Graphics/color driver for pdftex
  pgfsys.sty    2019/02/02 v3.1.1 (3.1.1)
  pgfsys.code.tex
pgfsyssoftpath.code.tex    2019/02/02 v3.1.1 (3.1.1)
pgfsysprotocol.code.tex    2019/02/02 v3.1.1 (3.1.1)
  xcolor.sty    2016/05/11 v2.12 LaTeX color extensions (UK)
   color.cfg    2016/01/02 v1.6 sample color configuration
 pgfcore.code.tex
pgfcomp-version-0-65.sty    2019/02/02 v3.1.1 (3.1.1)
pgfcomp-version-1-18.sty    2019/02/02 v3.1.1 (3.1.1)
  pgffor.sty    2019/02/02 v3.1.1 (3.1.1)
 pgfkeys.sty    
 pgfkeys.code.tex
 pgfmath.sty    
 pgfmath.code.tex
  pgffor.code.tex
    tikz.code.tex
   expl3.sty    2019-01-28 L3 programming layer (loader) 
expl3-code.tex    2019-01-28 L3 programming layer 
l3pdfmode.def    2019-01-28 v L3 Experimental driver: PDF mode
l3keys2e.sty    2018-10-17 LaTeX2e option processing using LaTeX3 keys
  xparse.sty    2018-10-17 L3 Experimental document command parser
supp-pdf.mkii
epstopdf-base.sty    2016/05/15 v2.6 Base part for package epstopdf
infwarerr.sty    2016/05/16 v1.4 Providing info/warning/error messages (HO)
  grfext.sty    2016/05/16 v1.2 Manage graphics extensions (HO)
kvdefinekeys.sty    2016/05/16 v1.4 Define keys (HO)
 ltxcmds.sty    2016/05/16 v1.23 LaTeX kernel commands for general use (HO)
kvoptions.sty    2016/05/16 v3.12 Key value format for package options (HO)
kvsetkeys.sty    2016/05/16 v1.17 Key value parser (HO)
etexcmds.sty    2016/05/16 v1.6 Avoid name clashes with e-TeX commands (HO)
ifluatex.sty    2016/05/16 v1.4 Provides the ifluatex switch (HO)
pdftexcmds.sty    2018/09/10 v0.29 Utility functions of pdfTeX for LuaTeX (HO)
   ifpdf.sty    2018/09/07 v3.3 Provides the ifpdf switch
epstopdf-sys.cfg    2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Live
 ***********
  • 1
    by looking in the dtx source, the docu or by asking the author to put some version info in the file ;-) – Ulrike Fischer Feb 14 at 19:59
  • 1
    Do you get the version for any TikZ library? What does \usetikzlibrary{tikzmark,calc} give you? @Sigur No, the libraries are by different authors. tikzmark is by LoopSpace, and is not documented in the pgfmanual whereas many other libraries go back to the creators or maintainers of TikZ and are thus tied to the pgfmanual. – marmot Feb 14 at 20:01
  • 1
    Revised answer: "Invoke texdoc tikzmark, and if you are using overleaf, quit overleaf and then invoke texdoc tikzmark". ;-) (According to this they are using the 2016 version of TeXLive....) – marmot Feb 14 at 20:28
  • 2
    If there's a way that I can add version information to the file so that it gets logged via either \listfiles or the log file, please do tell me what that should be. – Loop Space Feb 14 at 20:51
  • 2
    @LoopSpace The \ProvidesPackage macro does that. For instance: \ProvidesPackage{tikzmark}[2018-10-20 <version> TikZ mark library]. But it's not loaded by \usepackage, so I guess it should be \ProvidesFile. – Phelype Oleinik Feb 14 at 21:00
5

I recently had similar problem trying to find the Inkscape version used on Overleaf. Following this, I found the following approach:


First, you can use

\input|"texdoc -l tikzmark"

to get the texmf path, which already tells us a bit about the TeX Live version. Currently, Overleaf produces

/usr/local/texlive/2017/texmf-dist/doc/latex/tikzmark/tikzmark.pdf

so they are using some 2017 version of TeX Live.


At this point I wanted to just include (the first page of) the documentation via graphicx or pdfpages to include the manual into the document, but that didn't work. I also tried to copy the manual file to the project directory using cp with no luck. Trying to use inkscape (which can be used to convert .svg files to .pdf in Overleaf*) to do the same (using the -A or -e option) did not succeed either. Seems like the have their system secured against mischief of this sort..

* I don't know where the .pdf and .pdf_tex files are put when doing this (via the svg package). The user doesn't seem to have access to them. Having this information may reveal another route to do this in the right directory, where the permissions are different.


What we do have access to, however, is the tikzmark source code. We can just print it using

\verbatiminput{/usr/local/texlive/2017/texmf-dist/source/latex/tikzmark/tikzmark.dtx}

(or one of the listing packages). And, lo and behold, some pages down we find the version:

% \date{v1.3~from 2017/06/01}

As pointed out by Phelype Oleinik in the comments, we can use kpsewhich to directly obtain the path to the .dtx file:

\documentclass{article}

\usepackage{verbatim}
\usepackage{catchfile}

\begin{document}

\CatchFileDef\filepath{|"kpsewhich tikzmark.dtx"}{}
\verbatiminput{\filepath}

\end{document}
  • 2
    Nice, I didn't know about that | thingy. You could, however, use kpsewhich instead and find the source directly: \input|"kpsewhich tikzmark.dtx". – Phelype Oleinik May 17 at 14:15
  • 1
    @PhelypeOleinik: Thanks for the hint. I improved the MWE accordingly. – schtandard May 17 at 14:42
12

This is a pretty stupid check, but it works :)

According to CTAN, there were three versions of tikzmark, so probably no one (including Overleaf users) has a version other than these three.

These three versions were released on 2016, 2017, and 2018. Luckily I could have access to all three of them. Comparing the sources, I found macros which are/are not present in each version. The following macro checks the existence of these macros and prints the version date:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{tikzmark}

\makeatletter
\newcommand\tikzmarkversion{%
  \@ifundefined{tikzmark@inside}%
    {2016-04-09}%
    {%
      \@ifundefined{tikzmarknode}%
        {2017-06-02}%
        {2018-10-20}%
    }%
}
\makeatother

\begin{document}
    I have Ti\emph{k}Zmark version \tikzmarkversion

    Something with \tikzmarknode{A}{TikZ Mark}
    \begin{tikzpicture}[remember picture, overlay]
        \draw[<-, red] (A) -- ++(1,-1);
    \end{tikzpicture}
\end{document}

in my machine it prints:

enter image description here

and Overleaf reports: I have TikZmark version 2017-06-02.

The other versions complained about \tikzmarknode not existing, but the version date came out correct.


Update: I got the archived versions of tikzmark the frozen TeXLive versions back to 2013. The first appearance of tikzmark in TeXLive was in 2013. This release remained unchanged for 3 years. It was updated in TeXLive 2016 and was kept unchanged in TeXLive 2017. The third update was for TeXLive 2018. Thus a more fitting check is (until today, of course):

\makeatletter
\newcommand\tikzmarkversion{%
  \@ifundefined{tikzmark@inside}%
    {TL 2013--2015}%
    {%
      \@ifundefined{tikzmarknode}%
        {TL 2016--2017}%
        {TL >2018}%
    }%
}
\makeatother

Of course this shows only frozen versions of TeXLive. The package might have been updated twice in a single year, so a version in between might exist somewhere which was overwritten and did not live to the freeze. There might have been many un-annouced updates as moewe said, so it's hard to know for sure. However, I'd go for this second test because usually if one doesn't have the current TeXLive, their version is the frozen one, so this one is probably more certain than CTAN's announcements.

And Overleaf reports I have TikZmark version TL 2016–2017 in this one (which fits their claim of using TeXLive 2016 :).

I guess I'm a tikzmark historian now :)

  • @CarLaTeX I just tested and Overleaf reports I have TikZmark version 2017-06-02... – Phelype Oleinik Feb 14 at 21:03
  • 2
    Sneaky! (and some more characters) – Loop Space Feb 14 at 21:14
  • 2
    Nice detective work. But note that a package author can instruct CTAN to conduct a "silent" update, which means that the new version will not be announced and is not logged on its ctan-ann page. This is sometimes done for minor updates, but some packages like biblatex (yes, I only know that one) have not been announced for a very long time (don't know why): ctan.org/ctan-ann/pkg/biblatex, that could give a slightly incorrect pcture of the version history. I also noticed that ctan.org/ctan-ann/pkg/biblatex-ext doesn't show all announced versions (v0.6, v0.7), either. – moewe Feb 15 at 6:29
5

Provided you have a local TeX installation, a simple look at the manual reveals the version. E.g. on my Mac all I have to do is to type

 texdoc tikzmark

on the console to find out that my machine is blessed (I really mean blessed here!) with v1.6 from 2018/10/18.

If you do not have a LaTeX installation since you are working with overleaf, say, I have no clue. However, I feel that there should be an answer to the question

How can one access the manuals of the version of a package that is used on overleaf?

yet it might be that the overleaf help center (and not this site) says more about this. At least I have nothing to say about this (and would like to argue that if some company bases its services on freely available packages, the very least this company should do is to make it easy for their users to get the information on the package version).

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.