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?

Zarko
  • 296,517
  • Where is paths.ortho to be found? – cfr Jun 20 '16 at 17:41
  • 2
    package wrote Qrrbrbirlbel, avaliable is https://github.com/Qrrbrbirlbel/pgf/blob/master/tikzlibrarypaths.ortho.code.tex and https://github.com/Qrrbrbirlbel/pgf/blob/master/tikzlibrarypaths.ortho.tex. Information about it I find in his answer on question http://tex.stackexchange.com/questions/45347/vertical-and-horizontal-lines-in-pgf-tikz – Zarko Jun 20 '16 at 17:50
  • They are probably using the same letters to branch off in @nextchar. Also if I remember correctly, calligraphy is old. – percusse Jun 20 '16 at 17:51
  • 3
    @percusse The calligraphy standalone package is old, but the calligraphy tikz library (which is part of the spath3 package) is most definitely not. – Andrew Stacey Jun 20 '16 at 18:18
  • @LoopSpace Thanks. Then, I don't remember correctly :) – percusse Jun 20 '16 at 18:21

1 Answers1

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

Andrew Stacey
  • 153,724
  • 43
  • 389
  • 751
  • 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