diff options
author | Karl Berry <karl@freefriends.org> | 2013-01-14 23:31:24 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-01-14 23:31:24 +0000 |
commit | 197d3a0cb48dbe363ae5a4793309e3574717f298 (patch) | |
tree | a0b4acf1e1614f70ce1ae31021945fe88c4e68ce /Master/texmf-dist/tex/latex/hf-tikz | |
parent | 83ab36942c3d01dd5b31e6b5d43b41c986ef0730 (diff) |
hf-tikz (14jan13)
git-svn-id: svn://tug.org/texlive/trunk@28831 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/hf-tikz')
-rw-r--r-- | Master/texmf-dist/tex/latex/hf-tikz/hf-tikz.sty | 121 |
1 files changed, 104 insertions, 17 deletions
diff --git a/Master/texmf-dist/tex/latex/hf-tikz/hf-tikz.sty b/Master/texmf-dist/tex/latex/hf-tikz/hf-tikz.sty index ac3e67aaef4..1e35ed19aa5 100644 --- a/Master/texmf-dist/tex/latex/hf-tikz/hf-tikz.sty +++ b/Master/texmf-dist/tex/latex/hf-tikz/hf-tikz.sty @@ -16,12 +16,24 @@ %% * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * %% \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{hf-tikz}[2012/12/18 v0.1a A simple way to highlight formulas and formula parts.] +\ProvidesPackage{hf-tikz}[2013/01/13 v0.2 A simple way to highlight formulas and formula parts.] \RequirePackage{tikz} \usetikzlibrary{shadings} \RequirePackage{xparse} \RequirePackage{etoolbox} +\AtEndDocument{% +\let\oldpgfsyspdfmark\pgfsyspdfmark +\def\pgfsyspdfmark#1#2#3{% + \expandafter\let\expandafter\tmp\csname pgf@sys@pdf@mark@pos@#1\endcsname + \oldpgfsyspdfmark{#1}{#2}{#3}% + \expandafter\ifx\csname pgf@sys@pdf@mark@pos@#1\endcsname\tmp\else + \let\oldsavepointas\savepointas + \def\savepointas##1##2{% + \immediate\write\@auxout{hf-TikZ Warning: Mark '##1' changed. Rerun to get mark in right position.}% + } + \fi +}} %% Colors \definecolor{fancybrown}{RGB}{255,216,197} @@ -49,7 +61,22 @@ \boolfalse{beamer} \DeclareOption{beamer}{\booltrue{beamer}} +\newbool{norndcorners} +\boolfalse{norndcorners} +\DeclareOption{norndcorners}{\booltrue{norndcorners}} + \ProcessOptions +\pgfkeys{/tikz/.cd,% + not use rounded corners/.is choice,% + not use rounded corners/true/.style={rounded corners=0pt},% + not use rounded corners/false/.style={rounded corners},% +}% + +\tikzset{disable rounded corners/.estyle={% + not use rounded corners=#1,% + },% + disable rounded corners/.default=false,% +} %% Settings \ifbool{beamer}{%true @@ -169,68 +196,128 @@ \advance\pgf@y by -\pgf@ya }% } -\ifbool{beamer}{%true - \ifbool{fill}{%true-fill +\ifbool{norndcorners}{%true-norndcorners + \ifbool{beamer}{%true-beamer + \ifbool{fill}{%true-fill \ifbool{shade}{%true-shade \NewDocumentCommand{\tikzmarkin}{r<> d[] m D(){0.1,-0.18} D(){-0.1,0.35}}{% \IfNoValueTF{#2}{%true-val \only<#1>{\tikz[remember picture,overlay] - \draw[line width=1pt,rectangle,rounded corners,fill=\fcol,draw=\bcol] + \draw[line width=1pt,rectangle,fill=\fcol,draw=\bcol] (pic cs:#3) ++(#4) rectangle (#5) node [anchor=base] (#3){} ;} }{%false-val \only<#1>{\tikz[remember picture,overlay] - \draw[line width=1pt,rectangle,rounded corners,fill=\fcol,#2,draw=\bcol] + \draw[line width=1pt,rectangle,fill=\fcol,#2,draw=\bcol] (pic cs:#3) ++(#4) rectangle (#5) node [anchor=base] (#3){} ;}} } }{%false-shade \NewDocumentCommand{\tikzmarkin}{r<> m D(){0.1,-0.18} D(){-0.1,0.35}}{% \only<#1>{\tikz[remember picture,overlay] - \draw[line width=1pt,rectangle,rounded corners,fill=\fcol,draw=\bcol] + \draw[line width=1pt,rectangle,fill=\fcol,draw=\bcol] (pic cs:#2) ++(#3) rectangle (#4) node [anchor=base] (#2){} ;}} } - }{%false-fill + }{%false-fill \NewDocumentCommand{\tikzmarkin}{r<> m D(){0.075,-0.18} D(){-0.075,0.35}}{% \only<#1>{\tikz[remember picture,overlay] - \draw[line width=1pt,rectangle,rounded corners,draw=\bcol] + \draw[line width=1pt,rectangle,draw=\bcol] (pic cs:#2) ++(#3) rectangle (#4) node [anchor=base] (#2){} ;}} - } -}{%false-beamer - \ifbool{fill}{%true-fill + } + }{%false-beamer + \ifbool{fill}{%true-fill \ifbool{shade}{%true-shade \NewDocumentCommand{\tikzmarkin}{d[] m D(){0.1,-0.18} D(){-0.1,0.35}}{% \IfNoValueTF{#1}{%true-val \tikz[remember picture,overlay] - \draw[line width=1pt,rectangle,rounded corners,fill=\fcol,draw=\bcol] + \draw[line width=1pt,rectangle,fill=\fcol,draw=\bcol] (pic cs:#2) ++(#3) rectangle (#4) node [anchor=base] (#2){} ; }{%false-val \tikz[remember picture,overlay] - \draw[line width=1pt,rectangle,rounded corners,fill=\fcol,#1,draw=\bcol] + \draw[line width=1pt,rectangle,fill=\fcol,#1,draw=\bcol] (pic cs:#2) ++(#3) rectangle (#4) node [anchor=base] (#2){} ;}} }{%false-shade \NewDocumentCommand{\tikzmarkin}{m D(){0.1,-0.18} D(){-0.1,0.35}}{% \tikz[remember picture,overlay] - \draw[line width=1pt,rectangle,rounded corners,fill=\fcol,draw=\bcol] + \draw[line width=1pt,rectangle,fill=\fcol,draw=\bcol] (pic cs:#1) ++(#2) rectangle (#3) node [anchor=base] (#1){} ;} } - }{%false-fill + }{%false-fill \NewDocumentCommand{\tikzmarkin}{m D(){0.075,-0.18} D(){-0.075,0.35}}{% \tikz[remember picture,overlay] - \draw[line width=1pt,rectangle,rounded corners,draw=\bcol] + \draw[line width=1pt,rectangle,draw=\bcol] (pic cs:#1) ++(#2) rectangle (#3) node [anchor=base] (#1){} ;} + } + } +}{%false-norndcorners +\ifbool{beamer}{%true-beamer + \ifbool{fill}{%true-fill +\ifbool{shade}{%true-shade + \NewDocumentCommand{\tikzmarkin}{r<> d[] m D(){0.1,-0.18} D(){-0.1,0.35}}{% + \IfNoValueTF{#2}{%true-val + \only<#1>{\tikz[remember picture,overlay] + \draw[line width=1pt,rectangle,disable rounded corners,fill=\fcol,draw=\bcol] + (pic cs:#3) ++(#4) rectangle (#5) node [anchor=base] (#3){} + ;} + }{%false-val + \only<#1>{\tikz[remember picture,overlay] + \draw[line width=1pt,rectangle,disable rounded corners,fill=\fcol,#2,draw=\bcol] + (pic cs:#3) ++(#4) rectangle (#5) node [anchor=base] (#3){} + ;}} + } +}{%false-shade + \NewDocumentCommand{\tikzmarkin}{r<> m D(){0.1,-0.18} D(){-0.1,0.35}}{% + \only<#1>{\tikz[remember picture,overlay] + \draw[line width=1pt,rectangle,disable rounded corners,fill=\fcol,draw=\bcol] + (pic cs:#2) ++(#3) rectangle (#4) node [anchor=base] (#2){} + ;}} +} + }{%false-fill +\NewDocumentCommand{\tikzmarkin}{r<> m D(){0.075,-0.18} D(){-0.075,0.35}}{% +\only<#1>{\tikz[remember picture,overlay] +\draw[line width=1pt,rectangle,disable rounded corners,draw=\bcol] +(pic cs:#2) ++(#3) rectangle (#4) node [anchor=base] (#2){} +;}} } +}{%false-beamer + \ifbool{fill}{%true-fill +\ifbool{shade}{%true-shade + \NewDocumentCommand{\tikzmarkin}{d[] m D(){0.1,-0.18} D(){-0.1,0.35}}{% + \IfNoValueTF{#1}{%true-val + \tikz[remember picture,overlay] + \draw[line width=1pt,rectangle,disable rounded corners,fill=\fcol,draw=\bcol] + (pic cs:#2) ++(#3) rectangle (#4) node [anchor=base] (#2){} + ; + }{%false-val + \tikz[remember picture,overlay] + \draw[line width=1pt,rectangle,disable rounded corners,fill=\fcol,#1,draw=\bcol] + (pic cs:#2) ++(#3) rectangle (#4) node [anchor=base] (#2){} + ;}} +}{%false-shade + \NewDocumentCommand{\tikzmarkin}{m D(){0.1,-0.18} D(){-0.1,0.35}}{% + \tikz[remember picture,overlay] + \draw[line width=1pt,rectangle,disable rounded corners,fill=\fcol,draw=\bcol] + (pic cs:#1) ++(#2) rectangle (#3) node [anchor=base] (#1){} + ;} +} + }{%false-fill +\NewDocumentCommand{\tikzmarkin}{m D(){0.075,-0.18} D(){-0.075,0.35}}{% +\tikz[remember picture,overlay] +\draw[line width=1pt,rectangle,disable rounded corners,draw=\bcol] +(pic cs:#1) ++(#2) rectangle (#3) node [anchor=base] (#1){} +;} + } +} } \newcommand\tikzmarkend[2][]{% \tikz[remember picture with id=#2] #1;} - %% %% Copyright (C) 2012 by Claudio Fiandrino <claudio.fiandrino@gmail.com> %% |