summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/bondgraphs
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-03-23 21:02:28 +0000
committerKarl Berry <karl@freefriends.org>2015-03-23 21:02:28 +0000
commitce27c8aca1292ca719fadce8c94af1e46d7ca9aa (patch)
tree40980cb82a54c79f42f67688d89ae3942eb78659 /Master/texmf-dist/source/latex/bondgraphs
parent5a7b46d87247a8300bfc24c93bdbbec8b32d0872 (diff)
bondgraphs (23mar15)
git-svn-id: svn://tug.org/texlive/trunk@36605 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/bondgraphs')
-rw-r--r--Master/texmf-dist/source/latex/bondgraphs/bondgraphs.dtx15
1 files changed, 8 insertions, 7 deletions
diff --git a/Master/texmf-dist/source/latex/bondgraphs/bondgraphs.dtx b/Master/texmf-dist/source/latex/bondgraphs/bondgraphs.dtx
index 84ff435c33a..b97a3170827 100644
--- a/Master/texmf-dist/source/latex/bondgraphs/bondgraphs.dtx
+++ b/Master/texmf-dist/source/latex/bondgraphs/bondgraphs.dtx
@@ -603,7 +603,7 @@
% \begin{macrocode}
%<*package>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{bondgraphs}[2014/11/27 v1.0 TikZ-based Bond graphs formatting package]
+\ProvidesPackage{bondgraphs}[2015/03/23 v1.0.1 TikZ-based Bond graphs formatting package]
% \end{macrocode}
% \begin{macro}{TikZ}
% \tkz does all the drawing for the \bgspkg{}, using a number of libraries: the bond half-arrow is from |arrows|/|arrows.meta| and is drawn using |pathreplacing|; |positioning| isn't really required, but very useful when aligning bondgraph elements; |shapes| is used for the ellipse around word-bondgraph elements.
@@ -655,12 +655,12 @@
% \subsection{Bonds}\label{sec:implementation-bonds}
% \begin{macro}{bonds}
% All bonds are drawn as a (straight or curly) half-arrow with TikZ. The switch/case statement makes sure that the half-arrow stroke always points down (credits to Mark Wibrow at \url{http://tex.stackexchange.com/questions/208313/tikz-pgf-half-arrow-stroke-always-down-left}). This orientation can be changed to make the stroke always go left or down, never right, by changing the |-1| in |\pgfdecoratedangle-1| to a |+45|. TODO: make this a package option. The argument to this TikZ stile is passed to the draw command, to allow different colour/line width/etc.
+% \changes{v1.0.1}{2015/03/23}{Better bond and bond label drawing}
% \begin{macrocode}
\tikzset{bond/.style args={#1}{
- thick,
decoration={show path construction,
lineto code={
- \draw[#1,shorten <=1pt]
+ \draw[#1,thick]
\pgfextra{% +45 i.s.o. -1 for to left or to under, always
\pgfmathparse{int((\pgfdecoratedangle-1)/90)}
\ifcase\pgfmathresult
@@ -697,9 +697,9 @@ bond/.default={}
}
% \end{macrocode}
% \begin{macro}{mbond}
-% A multi-bond is simply a bond with a double draw, and lengthened a bit for better-looking result
+% A multi-bond is simply a bond with a double draw
% \begin{macrocode}
-\tikzset{mbond/.style={bond={double,shorten >=-1pt}}}
+\tikzset{mbond/.style={bond={double,#1}}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{draw[bonds]}
@@ -710,12 +710,13 @@ bond/.default={}
% \end{macro}
% \begin{macro}{bond labels}
% Provide labelling for effort (above) and flow (below) the bond.
-% TODO: What happens when bond is vertical?
+% Labels are sloped, so ``above'' is always defined from bond point-of-view
% \begin{macrocode}
\tikzset{
bondlabel/.style={
font=\small,
- color=\bondgraphs@bondlabelcolour
+ color=\bondgraphs@bondlabelcolour,
+ sloped,
},
effort/.style args={#1}{
edge node={node [bondlabel,above]{#1}}