I have a commutative diagram written as a diagram environment defined using the package pb-diagram
. I'm very satisfied with the appearance of the diagram.
However I need to change some arrows to dashed arrows.
In the pb-diagram
manual it is stated that the option for the shaft of an arrow are:
.. | dotted or dashed arrow shaft
= | double line shaft* (“equals sign”)
! | invisible arrow shaft
For instance the command \arrow{e,..}
should draw a dotted or dashed arrow shaft.
My question is? How can I make sure that the arrow is dashed instead of dotted? In all examples I tried, the arrow becomes dotted.
I would appreciate any suggestions on how to solve this issue in pb-diagrams
. A minimal example is the following.
\documentclass[12pt]{article}
\usepackage{pb-diagram}
\begin{document}
\begin{equation}
\begin{diagram}
\node{A}
\arrow{e,t,..}{a}
\arrow{s,l,..}{c}
\arrow{ese,b,1,..}{u}
\node{B}
\arrow{e,t,..}{b}
\node{C}
\arrow{s,r}{d}
\arrow{wsw,b,1}{v} \\
\node{D}
\arrow[2]{e,b}{e}
\node[2]{H}
\end{diagram}
\end{equation}
\end{document}
All dotted arrows should be dashed arrows.
OBS: I'm aware of the existence of a more advanced package called TikZ, which is more expressive and apparently allows one to have great control of the diagrams. But in this question I'm only interested in how to solve the problem with respect to the package pb-diagram
, since the diagram, which is pretty large, is already coded and I just need to add some dashed arrows to finalize it. Additionally, I'm having some trouble to install TikZ on my computer.
Best Answer
Here I found the routine in
pb-diagram
that placed dots, named\dg@dotvector
and made several modifications to it. I replaced the\circle
macro that placed each dot with a\rule
. However, I needed to have the\rule
tilted at the proper angle, so I used\FPdiv
and\FParctan
and\FPmul
to calculate the angle tangent, take the arctangent, and convert to degrees. Then I used\rotatebox
to angle the aforementioned\rule
to that angle.EDITED to take advantage of LaRiFaRi's excellent suggestion, thus allowing the simultaneous use of both dot
..
and dash--
syntax. In the following MWE, I show both dot and dash lines (and solid lines) in the graph.For comparison, here is the default behavior of the routine, without modification: