summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.tikz.code.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.tikz.code.tex')
-rw-r--r--Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.tikz.code.tex48
1 files changed, 46 insertions, 2 deletions
diff --git a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.tikz.code.tex b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.tikz.code.tex
index 9524d14d734..8d70a4ac0ba 100644
--- a/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.tikz.code.tex
+++ b/Master/texmf-dist/tex/latex/chemmacros/chemmacros.module.tikz.code.tex
@@ -11,7 +11,7 @@
% If you have any ideas, questions, suggestions or bugs to report, please
% feel free to contact me.
% --------------------------------------------------------------------------
-% Copyright 2011-2015 Clemens Niederberger
+% Copyright 2011-2016 Clemens Niederberger
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
@@ -28,7 +28,7 @@
\ChemModule*{tikz}{2015/07/24 upright greek symbols}
\RequirePackage{tikz}
-\usetikzlibrary{calc}%,arrows}
+\usetikzlibrary{calc,decorations.pathmorphing}
\ExplSyntaxOn
@@ -141,3 +141,47 @@
\pgfusepathqfillstroke
}
% --------------------------------------------------------------------------
+% http://tex.stackexchange.com/a/25689/
+\ChemCompatibilityFrom{5.3}
+\pgfdeclaredecoration{wave}{initial}{
+ \state{initial}[
+ width = +0pt ,
+ next~ state = sine,
+ persistent~ precomputation = {
+ \pgfmathsetmacro\matchinglength{
+ \pgfdecoratedinputsegmentlength /
+ int(\pgfdecoratedinputsegmentlength/\pgfdecorationsegmentlength)
+ }
+ \setlength{\pgfdecorationsegmentlength}{\matchinglength pt}
+ }
+ ]{}
+ \state{sine}[width=\pgfdecorationsegmentlength]{
+ \pgfpathsine{
+ \pgfpoint
+ {0.25\pgfdecorationsegmentlength}
+ {0.5\pgfdecorationsegmentamplitude}
+ }
+ \pgfpathcosine{
+ \pgfpoint
+ {0.25\pgfdecorationsegmentlength}
+ {-0.5\pgfdecorationsegmentamplitude}
+ }
+ \pgfpathsine{
+ \pgfpoint
+ {0.25\pgfdecorationsegmentlength}
+ {-0.5\pgfdecorationsegmentamplitude}
+ }
+ \pgfpathcosine{
+ \pgfpoint
+ {0.25\pgfdecorationsegmentlength}
+ {0.5\pgfdecorationsegmentamplitude}
+ }
+ }
+ \state{final}{}
+}
+\EndChemCompatibility
+
+% --------------------------------------------------------------------------
+\tex_endinput:D
+
+2015/10/26 - add decoration `wave' (complete sines)