3

So I am trying to draw barred arrow in tikzcd, and following the answer of for example here :https://tex.stackexchange.com/a/493140/236919 . It does not work because of marking. The other (much more complicated) solutions work for my problem

The minimal code is :

\documentclass{article}
\listfiles
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}[]
    a \arrow[r,"|" marking] & b
\end{tikzcd}
\end{document}

The expected result is : https://i.sstatic.net/ISB5L.png

Using pdfTeX, Version 3.14159265-2.6-1.40.18, I have the following warning :

! Package pgfkeys Error: I do not know the key '/tikz/marking' and I am going to ignore it. Perhaps you misspelled it.

See the pgfkeys package documentation for explanation. Type H for immediate help ... l.5 I think the culprit is a tikzcd arrow in cell 1-1. \errmessage ...currentrow -\tikzcd@currentcolumn } l.6 \end{tikzcd} ]

? H This error message was generated by an \errmessage command, so I can't give any explicit help. Pretend that you're Hercule Poirot: Examine all clues, and deduce the truth by order and method.

?

and the pdf produced is as follows:

the arrow is drawn, but the marking is ignored, thus the bar "|" is treated as a label and drawn above.

Could there be an issue with my pgfkeys package? I don't remember manually installing it, or how I installed latex/pdftex/..., but for what it's worth, I installed latex along TeXstudio 2.12.6 (hg 6631:16db084dae24)

Edit : after adding \listfiles to have the versions of my packages, here is a pastebin of the full log file :

https://pastebin.com/66d4q7pe

I am not sure what to look for, but here is the result of $ grep Package: barred_arrow.log (plus some line breaks) :

Package: tikz-cd 2014/10/30 v0.9e Commutative diagrams with tikz

Package: everyshi 2001/05/15 v3.00 EveryShipout Package (MS)

Package: pgfrcs 2015/08/07 v3.0.1a (rcs-revision 1.31)

Package: pgf 2015/08/07 v3.0.1a (rcs-revision 1.15)

Package: graphicx 2017/06/01 v1.1a Enhanced LaTeX Graphics (DPC,SPQR)

Package: keyval 2014/10/28 v1.15 key=value parser (DPC)

Package: graphics 2017/06/25 v1.2c Standard LaTeX Graphics (DPC,SPQR)

Package: trig 2016/01/03 v1.10 sin cos tan (DPC)

Package: pgfsys 2014/07/09 v3.0.1a (rcs-revision 1.48)

Package: xcolor 2016/05/11 v2.12 LaTeX color extensions (UK)

Package: pgfcore 2010/04/11 v3.0.1a (rcs-revision 1.7)

Package: pgfcomp-version-0-65 2007/07/03 v3.0.1a (rcs-revision 1.7)

Package: pgfcomp-version-1-18 2007/07/23 v3.0.1a (rcs-revision 1.1)

Package: pgffor 2013/12/13 v3.0.1a (rcs-revision 1.25)

Package: tikz 2015/08/07 v3.0.1a (rcs-revision 1.151)

Package: epstopdf-base 2016/05/15 v2.6 Base part for package epstopdf

Package: infwarerr 2016/05/16 v1.4 Providing info/warning/error messages (HO)

Package: grfext 2016/05/16 v1.2 Manage graphics extensions (HO)

Package: kvdefinekeys 2016/05/16 v1.4 Define keys (HO)

Package: ltxcmds 2016/05/16 v1.23 LaTeX kernel commands for general use (HO)

Package: kvoptions 2016/05/16 v3.12 Key value format for package options (HO)

Package: kvsetkeys 2016/05/16 v1.17 Key value parser (HO)

Package: etexcmds 2016/05/16 v1.6 Avoid name clashes with e-TeX commands (HO)

Package: ifluatex 2016/05/16 v1.4 Provides the ifluatex switch (HO)

Package: pdftexcmds 2018/01/21 v0.26 Utility functions of pdfTeX for LuaTeX (HO

Package: ifpdf 2017/03/15 v3.2 Provides the ifpdf switch

2
  • 2
    Your code works as expected in my setup (current TeXLive 2022). So you should state the versions of your packages... tex.stackexchange.com/questions/13304/…
    – Rmano
    Commented Jun 13, 2022 at 10:58
  • 4
    You have a very old installation. Mine says pgfsys.sty 2021/05/15 v3.1.9a (3.1.9a) tikz-cd.sty 2021/05/04 v1.0 Commutative diagrams with TikZ etc... so probably simply your version has no marking option. You need to upgrade your LaTeX system.
    – Rmano
    Commented Jun 13, 2022 at 15:57

1 Answer 1

2

Your code works perfectly with a recent version of TeX Live (since 2018 on).

In case you can't update your distribution, you can adjust the position of the | with other options: shift, yshift, xshift, rotate, as appropriate.

For example, here I've used yshift:

\documentclass{article}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}
    a \arrow[r,"|" yshift={-6pt}] & b
\end{tikzcd}
\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .