diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/mycv/mycv_dec.tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/mycv/mycv_dec.tex | 226 |
1 files changed, 226 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/mycv/mycv_dec.tex b/Master/texmf-dist/tex/latex/mycv/mycv_dec.tex new file mode 100644 index 00000000000..8283a678587 --- /dev/null +++ b/Master/texmf-dist/tex/latex/mycv/mycv_dec.tex @@ -0,0 +1,226 @@ +% ------------------------------------------------------- +% start of file 'mycv_dec.tex'. +% Copyright 2012 Ghersi Andrea (ghanhawk@gmail.com). +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License version +% 1.3c, available at 'http://www.latex-project.org/lppl'. +% ------------------------------------------------------- + +\ProvidesFile{mycv_dec.tex} + +\RequirePackage{tikz} % for graphics +\usetikzlibrary{shapes,decorations,shadows,fadings} +\usetikzlibrary{decorations.pathmorphing} +\usetikzlibrary{decorations.fractals} +\usetikzlibrary{decorations.shapes} +\usetikzlibrary{calc} +\RequirePackage{xparse} + +%%%%%%%%%%%% +% % +% Settings % +% % +%%%%%%%%%%%% + +\def\@segmentLengthString{} +\def\@segmentLengthValue{} +\def\@lineWidthString{} +\def\@lineWidthValue{} +\def\@segmentAmplitudeString{} +\def\@segmentAmplitudeValue{} +\def\@xBottomRight{-1cm} +\def\@yBottomRight{1cm} +\def\@xTopLeft{1cm} +\def\@yTopLeft{-1cm} + +\tikzfading[% + name=fade out, inner color=transparent!0, + outer color=transparent!100% +] + +\tikzset{ + define mycolor/.code 2 args={\definecolor{#1}{rgb}{#2}}, + DecoratewithShape/.style={% + decorate,decoration={shape backgrounds,shape=#1}% + }, + DecoratewithPathMorphing/.style={% + decorate,decoration=#1% + }, + Mainstyle/.style={ + define mycolor={myred}{0.43,0.06,0,13}, + define mycolor={dpred}{0.80,0.35,0} + } +} + +%%%%%%%%%%%% +% % +% Commands % +% % +%%%%%%%%%%%% + +\newcommand{\versionBasedSettings}[2]{% + \IfBooleanTF#1{% + % --------------------------------------------------------- + % From <xstring> package + % --------------------------------------------------------- + % Macros of this package take the catcodes of tokens into + % account. To avoid unexpected behaviour (particulary with + % tests), you should keep in mind that tokens and their + % catcodes are examined. + % For instance, these two arguments: {\string a\string b} + % and {ab} do not expand into equal strings for xstring! + % Because of the command \string, the first expands into + % ab with catcodes 12 while the second have characters + % with their natural catcodes 11. Catcodes do not match! + % Starred macros do not take catcodes into account. They + % simply convert some arguments into arguments with + % catcodes 10, 11 and 12, and call the non-starred macros + % with these modified arguments. + % --------------------------------------------------------- + \IfStrEqCase*{#2}{% + {radial}{\def\@colorStr{inner color}}% + {ball}{\def\@colorStr{ball color}}% + {none}{\relax}% + }% + [mycv: Unknown option <#2>!!!]% + }{\relax}% +} + +% ----------------------------------------------------- +% Pathmorphing decoration values: +% shape, straight zigzag, random steps, saw, zigzag, +% bent, bumps, coil, snake, Koch snowflake +% Shadings: radial, ball +% ----------------------------------------------------- + +\DeclareDocumentCommand{\mydecorationsPathmorphing}% + {s O{1} m O{gray} D<>{radial} D<>{white}}% +{% + \begingroup + \versionBasedSettings{#1}{#5}% + \begin{tikzpicture}[overlay,remember picture]% + \IfBooleanTF#1{% version with a star (shading) + \shade[ + Mainstyle, + \@lineWidthString=\@lineWidthValue, + \@segmentAmplitudeString=\@segmentAmplitudeValue, + \@segmentLengthString=\@segmentLengthValue, + DecoratewithPathMorphing=#3, + color=#4, + shading=#5, + \@colorStr=#6, + \ifnum#2>0draw\fi + ]}% + {% version without a star (not shading) + \path[ + Mainstyle, + \@lineWidthString=\@lineWidthValue, + \@segmentAmplitudeString=\@segmentAmplitudeValue, + \@segmentLengthString=\@segmentLengthValue, + DecoratewithPathMorphing=#3, + color=#4, + fill=#6, + \ifnum#2>0draw\fi + ]}% + ($ (current page.north west)+ + (\@xTopLeft,\@yTopLeft) $) + rectangle % -- oppure circle (4), ... + ($ (current page.south east)+ + (\@xBottomRight,\@yBottomRight) $); + \end{tikzpicture} + \endgroup +} + +% -------------------------------------- +% Shapes: dart, diamond, rectangle, star +% -------------------------------------- + +\DeclareDocumentCommand{\mydecorationsShape}% + {O{1} m O{gray}} +{% + \begingroup + \begin{tikzpicture}[overlay,remember picture] + \path[ + Mainstyle, + \@lineWidthString=\@lineWidthValue, + \@segmentAmplitudeString=\@segmentAmplitudeValue, + \@segmentLengthString=\@segmentLengthValue, + DecoratewithShape=#2, + color=#3, + \ifnum#1>0draw\fi + ]% + ($ (current page.north west)+ + (\@xTopLeft,\@yTopLeft) $) + rectangle + ($ (current page.south east)+ + (\@xBottomRight,\@yBottomRight) $); + \end{tikzpicture} + \endgroup +} + +\DeclareDocumentCommand{\mydecorationsFading}% + {O{north} m O{80} O{black} D<>{1.0}} +{% + \begin{tikzpicture}[overlay,remember picture] + \draw[path fading=#1,fill=#2!#3!#4,opacity=#5] + ($ (current page.north west)+ + (\@xTopLeft,\@yTopLeft) $) + rectangle % -- oppure circle (4), ... + ($ (current page.south east)+ + (\@xBottomRight,\@yBottomRight) $); + \end{tikzpicture}% +} + +\DeclareRobustCommand{\mydecorationsSetPosXTL}[1]% + [1cm]% +{% + \def\@xTopLeft{#1}% +} + +\DeclareRobustCommand{\mydecorationsSetPosYTL}[1]% + [-1cm]% +{% + \def\@yTopLeft{#1}% +} + +\DeclareRobustCommand{\mydecorationsSetPosXBR}[1]% + [-1cm]% +{% + \def\@xBottomRight{#1}% +} + +\DeclareRobustCommand{\mydecorationsSetPosYBR}[1]% + [1cm]% +{% + \def\@yBottomRight{#1}% +} + +\DeclareDocumentCommand{\mydecorationsSetLineWidth}% + {s O{}}% +{% + \IfBooleanTF#1% + {\def\@lineWidthString{}} % starred + {\def\@lineWidthString{line width}} % not starred + + \def\@lineWidthValue{#2}% +} + +\DeclareDocumentCommand{\mydecorationsSetSegmentAmplitude}% + {s O{}}% +{% + \IfBooleanTF#1% + {\def\@segmentAmplitudeString{}} % starred + {\def\@segmentAmplitudeString{segment amplitude}} % not starred + + \def\@segmentAmplitudeValue{#2}% +} + +\DeclareDocumentCommand{\mydecorationsSetSegmentLength}% + {s O{}}% +{% + \IfBooleanTF#1% + {\def\@segmentLengthString{}} % starred + {\def\@segmentLengthString{segment length}} % not starred + + \def\@segmentLengthValue{#2}% +}
\ No newline at end of file |