5

From question and answer in Using color with braces employing the TikZ calligraphy library I learned about library calligraphy. From test about it use I observe two things:

  • the library 'calligraphy' had to be loaded after library decorations.pathreplacing,
  • if you use it together with library paths.ortho some of options in drawing of lines lost its function (without warning or errors, just don't appear):

An example:

\documentclass[tikz,border=10pt,multi]{standalone}
\usetikzlibrary{arrows.meta,decorations.pathreplacing,calligraphy}
\usetikzlibrary{paths.ortho}

\begin{document}
    \begin{tikzpicture}
\draw[<->]  (0,1.5) -- + (3,0);
\draw[|->]  (0,1.0) -- + (3,0);
\draw[|-|]  (0,0.5) -- + (3,0);
\draw[{Bar[]}-{Bar[]}]  (0,0) -- + (3,0);
    %

\draw[decorate,
      decoration={calligraphic brace, mirror,
      pre =moveto, pre  length=1pt,
      post=moveto, post length=1pt,
      raise=3pt, amplitude=6pt},
      thick, pen colour={red}]  (0,0) -- (3,0);
    \end{tikzpicture}
\end{document}

As you can see, bar ends on third line are not presented. How to resolve this (minor) problem?

6

Firstly, this is nothing to do with the calligraphy package. I get the same behaviour from the following MWE:

\documentclass{article}
%\url{http://tex.stackexchange.com/q/315739/86}
\usepackage{tikz}
\usetikzlibrary{paths.ortho}

\begin{document}
    \begin{tikzpicture}
\draw[<->]  (0,1.5) -- + (3,0);
\draw[|->]  (0,1.0) -- + (3,0);
\draw[|-|]  (0,0.5) -- + (3,0);
    \end{tikzpicture}
\end{document}

Missing bars

I don't know why it is happening, because I don't know anything about the paths.ortho package. But I can fix it with some judicious braces:

\documentclass{article}
%\url{http://tex.stackexchange.com/q/315739/86}
\usepackage{tikz}
\usetikzlibrary{paths.ortho}

\begin{document}
    \begin{tikzpicture}
\draw[<->]  (0,1.5) -- + (3,0);
\draw[|->]  (0,1.0) -- + (3,0);
\draw[{|}-{|}]  (0,0.5) -- + (3,0);
    \end{tikzpicture}
\end{document}

So I can only assume that the option |-| means something special for the paths.ortho package and it is picking up on that first before the arrow syntax gets a look at it. Knowing how arrows are interpreted (i.e. quite late in the key parsing), this is not all that surprising.

Reappearing bars

  • 1
    |-|/.style={% /utils/exec=\pgfmathsetmacro\qrr@tikz@hvvh@ratio{#1},% to path={|-| (\tikztotarget) \tikztonodes}},% – cfr Jun 20 '16 at 21:40
  • I see! Package paths.ortho introduce syntax as -|- and |-| for paths between two points. For example \draw[red] (2,1) |-| (1,0);. Apparently this syntax influence on syntax of \draw options. Before testing of calligraphic brace it newer happen this case (because I normally use arrows.meta package). Thank you for this finding. – Zarko Jun 20 '16 at 21:43
  • @cfr, can you explain your comment? Is it contain fix for paths.ortho? – Zarko Jun 20 '16 at 22:13
  • @Zarko No. That's from the library. It is just the concrete evidence substantiating what Loop Space surmised. – cfr Jun 20 '16 at 22:26

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.