14

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
 ***********
CarLaTeX
  • 62,716
  • 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 '19 at 19:59
  • I supposed that all TikZ libraries would have the same version as TikZ, in your case, 3.1.1. – Sigur Feb 14 '19 at 20:01
  • 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. –  Feb 14 '19 at 20:01
  • @marmot Not in File List, but il the log there is File: tikzlibrarycalc.code.tex 2019/02/02 v3.1.1 (3.1.1) for calc. – CarLaTeX Feb 14 '19 at 20:08
  • @UlrikeFischer I'm asking because of a user which uses Overleaf, looking in the dtx file in that case is difficult. – CarLaTeX Feb 14 '19 at 20:10
  • If the code has a version typeout it could be coerced in to adding it to the file list but there is no version string in the tikzmark code not even in a comment, it has no version or date. – David Carlisle Feb 14 '19 at 20:17
  • @DavidCarlisle A simple texdoc tikzmark on my machine gives me v1.6 from 2018/10/18 .... what do you get? –  Feb 14 '19 at 20:18
  • @DavidCarlisle So, the only solution is to write to the author... – CarLaTeX Feb 14 '19 at 20:19
  • @marmot texdoc ? what a radical notion I just looked at tikzlibrarytikzmark.code.tex in emacs ... – David Carlisle Feb 14 '19 at 20:20
  • @DavidCarlisle This shows once more that one should not use emacs.... ;-) –  Feb 14 '19 at 20:21
  • @CarLaTeX Yes, texdoc gives you the documentation. (I am still not sure I understand the question. We agree that \listfiles does not give you the version of any library, do we? This suggests that you may want to resort to other means. Looking at the documentation works, doesn't it?) –  Feb 14 '19 at 20:22
  • But then "Invoke texdoc tikzmark" is a valid answer to your question (or can't overleaf users access the manual of the current version of the libraries/packages they are using?)? –  Feb 14 '19 at 20:26
  • @marmot I think they cannot – CarLaTeX Feb 14 '19 at 20:27
  • 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....) –  Feb 14 '19 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. – Andrew Stacey Feb 14 '19 at 20:51
  • @LoopSpace I will be very happy to remove my answer below if you want to write one. –  Feb 14 '19 at 20:53
  • @marmot The point of my remark is that I suspect that there isn't an answer (at least, for users of overleaf) because I don't provide that information in the file that gets actually loaded (tikzlibrarytikzmark.code.tex). However, I don't know the right way to provide that information (as it isn't included via \usepackage) hence if someone does know, I'd be grateful and add it to the next release. – Andrew Stacey Feb 14 '19 at 20:55
  • 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 '19 at 21:00
  • @LoopSpace I do not know, but there seem to be some line \ProvidesFileRCS{tikzlibrarycalc.code.tex} in the tikz libraries, and this makes use of stuff defined in pgfrcs.code.tex if I am not mistaken. –  Feb 14 '19 at 21:03
  • @PhelypeOleinik Thanks for the hint. I'll put that in the next version. – Andrew Stacey Feb 14 '19 at 21:13
  • @LoopSpace You're welcome :) However I think marmot's suggestion is better. PGF has it's own file version handling system, and the \ProvidesPackageRCS macro seems to be a wrapper around \ProvidesPackage. I'd try that first. – Phelype Oleinik Feb 14 '19 at 21:17
  • @PhelypeOleinik I'll have a play around with the variations and see what I can come up with. Thanks for all the pointers. – Andrew Stacey Feb 14 '19 at 21:40
  • Hey! Regarding your last edit: Overleaf should never replace any LaTeX distribution because the last has the latest updates and you can have different outputs. – manooooh May 18 '19 at 07:10
  • 1
    @manooooh They do not do it, the date of your project identifies the distribution to use. My edit means that since I don't have a distribution tool on Overleaf I can't find the version simply typing texdoc on my terminal. – CarLaTeX May 18 '19 at 07:21

3 Answers3

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 '19 at 21:03
  • 2
    Sneaky! (and some more characters) – Andrew Stacey Feb 14 '19 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): https://ctan.org/ctan-ann/pkg/biblatex, that could give a slightly incorrect pcture of the version history. I also noticed that https://ctan.org/ctan-ann/pkg/biblatex-ext doesn't show all announced versions (v0.6, v0.7), either. – moewe Feb 15 '19 at 06:29
6

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).

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}
schtandard
  • 14,892