summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/hf-tikz
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-01-14 23:31:24 +0000
committerKarl Berry <karl@freefriends.org>2013-01-14 23:31:24 +0000
commit197d3a0cb48dbe363ae5a4793309e3574717f298 (patch)
treea0b4acf1e1614f70ce1ae31021945fe88c4e68ce /Master/texmf-dist/source/latex/hf-tikz
parent83ab36942c3d01dd5b31e6b5d43b41c986ef0730 (diff)
hf-tikz (14jan13)
git-svn-id: svn://tug.org/texlive/trunk@28831 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/hf-tikz')
-rw-r--r--Master/texmf-dist/source/latex/hf-tikz/hf-tikz.dtx268
-rw-r--r--Master/texmf-dist/source/latex/hf-tikz/hf-tikz.ins1
2 files changed, 198 insertions, 71 deletions
diff --git a/Master/texmf-dist/source/latex/hf-tikz/hf-tikz.dtx b/Master/texmf-dist/source/latex/hf-tikz/hf-tikz.dtx
index cf5517b1981..831621d28a7 100644
--- a/Master/texmf-dist/source/latex/hf-tikz/hf-tikz.dtx
+++ b/Master/texmf-dist/source/latex/hf-tikz/hf-tikz.dtx
@@ -83,7 +83,7 @@ and the derived files hf-tikz.ins and
%</internal>
%<*package>
\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.]
%</package>
%<*driver>
\documentclass{ltxdoc}
@@ -91,11 +91,12 @@ and the derived files hf-tikz.ins and
\usepackage{csquotes}
\usepackage{lmodern}
\usepackage{amsmath,amssymb}
+\usepackage[width=14cm]{geometry}
\usepackage{charter,pxfonts}
\usepackage[customcolors,shade]{\jobname}
\usetikzlibrary{calc}
\usepackage{hypdoc}
-\EnableCrossrefs
+\EnableCrossrefs
\CodelineIndex
\RecordChanges
\begin{document}
@@ -104,7 +105,7 @@ and the derived files hf-tikz.ins and
%</driver>
% \fi
%
-% \CheckSum{271}
+% \CheckSum{359}
%
% \CharacterTable
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -122,6 +123,9 @@ and the derived files hf-tikz.ins and
% Grave accent \` Left brace \{ Vertical bar \|
% Right brace \} Tilde \~}
%
+% \changes{v0.1}{2012/08/17}{Initial version}
+% \changes{v0.1a}{2012/12/18}{Fixed bug \pgfpointorigin}
+% \changes{v0.2}{2013/01/13}{Added norndcorners and warning second run}
%
% \GetFileInfo{hf-tikz.sty}
%
@@ -300,7 +304,7 @@ and the derived files hf-tikz.ins and
% \hfsetbordercolor{red}
% \[
% \tikzmarkin{a}(0.2,-0.4)(-0.2,0.6)
-% \dfrac{100}{x}
+% \dfrac{100}{x}
% \tikzmarkend{a}
% \]
% \end{verbatim}
@@ -331,7 +335,11 @@ and the derived files hf-tikz.ins and
% \subsubsection*{Example with vertical shading}
% Code:
% \begin{verbatim}
-% \[\tikzmarkin[top color=white, bottom color=blue!20]{vshade}x+y=400\tikzmarkend{vshade}\]
+% \[
+% \tikzmarkin[top color=white, bottom color=blue!20]{vshade}
+% x+y=400
+% \tikzmarkend{vshade}
+% \]
% \end{verbatim}
% Result:
% \[\tikzmarkin[top color=white, bottom color=blue!20]{vshade}x+y=400\tikzmarkend{vshade}\]
@@ -339,7 +347,11 @@ and the derived files hf-tikz.ins and
% \subsubsection*{Example with horizontal shading}
% Code:
% \begin{verbatim}
-% \[\tikzmarkin[left color=white, right color=blue!20]{hoshade}x+y=400\tikzmarkend{hoshade}\]
+% \[
+% \tikzmarkin[left color=white, right color=blue!20]{hoshade}
+% x+y=400
+% \tikzmarkend{hoshade}
+% \]
% \end{verbatim}
% Result:
% \[\tikzmarkin[left color=white, right color=blue!20]{hoshade}x+y=400\tikzmarkend{hoshade}\]
@@ -347,7 +359,11 @@ and the derived files hf-tikz.ins and
% % \subsubsection*{Example with radial shading}
% Code:
% \begin{verbatim}
-% \[\tikzmarkin[outer color=white, inner color=blue!20]{rshade}x+y=400\tikzmarkend{rshade}\]
+% \[
+% \tikzmarkin[outer color=white, inner color=blue!20]{rshade}
+% x+y=400
+% \tikzmarkend{rshade}
+% \]
% \end{verbatim}
% Result:
% \[\tikzmarkin[outer color=white, inner color=blue!20]{rshade}x+y=400\tikzmarkend{rshade}\]
@@ -356,21 +372,56 @@ and the derived files hf-tikz.ins and
% \DescribeMacro{nofill}^^A
% Using the \texttt{nofill} option allows to simply not introduce the background color.
% When the option is active, you can not change this behaviour inside the document. Another option to remove the background color, is to set the fill color by means of \cs{hfsetfillcolor} with the same color of the page.
+% \subsection{Disable rounded corners}
+% \DescribeMacro{norndcorners}^^A
+% To disable the rounded corners, there are actually two ways. The first one, which is general, is the option \texttt{norndcorners}: as the other options it should be provided when loading the package.
+%
+% There is also a second way, which actually disables the rounded corners locally; you should proceed as follows:
+% \begin{itemize}
+% \item load the package with the \verb|shade| option;
+% \item use the \verb|disable rounded corners| key set to \verb|true|.
+% \end{itemize}
+% For example:
+% \begin{verbatim}
+% \[
+% \tikzmarkin[disable rounded corners=true]{mark 1}
+% x+y=400
+% \tikzmarkend{mark 1}
+% \]
+% \end{verbatim}
+% The result:
+% \[\tikzmarkin[disable rounded corners=true]{mark 1}x+y=400\tikzmarkend{mark 1}\]
%
% \StopEventually{\PrintChanges}
-% \iffalse
-%<*package>
-% \fi
+%
% \section{Implementation}
+%
% \iffalse
-% <*hf-tikz>
+%<*package>
% \fi
+%
% \begin{macrocode}
\RequirePackage{tikz}
\usetikzlibrary{shadings}
\RequirePackage{xparse}
\RequirePackage{etoolbox}
% \end{macrocode}
+% This warning is arised at first compilation run, to inform that a second run is necessary to get the final result. The code
+% used as base is taken from \href{http://tex.stackexchange.com/a/82072/13304}{this answer in TeX.SX}.
+% \begin{macrocode}
+\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
+}}
+% \end{macrocode}
% \subsection{Options definition}
% In this subsection the definitions of pre-defined colors and options are shown.
% \begin{macrocode}
@@ -402,8 +453,26 @@ and the derived files hf-tikz.ins and
\boolfalse{beamer}
\DeclareOption{beamer}{\booltrue{beamer}}
+\newbool{norndcorners}
+\boolfalse{norndcorners}
+\DeclareOption{norndcorners}{\booltrue{norndcorners}}
+
\ProcessOptions
% \end{macrocode}
+% This is the keys definition of the way in which it is possible to locally disable rounded corners.
+% \begin{macrocode}
+\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,%
+}
+% \end{macrocode}
% \subsection{General settings}
% In this subsection the general settings that allow the highlighing are shown.
% \begin{macrocode}
@@ -528,75 +597,134 @@ and the derived files hf-tikz.ins and
}
% \end{macrocode}
% \subsection{The highlighting commands}
-% In this subsection the definition of the highlighing commands in \texttt{beamer} mode and not are shown.
+% In this subsection the definition of the highlighing commands in \texttt{beamer} mode and not are shown. Thanks to \textsf{etoolbox} it is possible to perform a check on the options active, then the commands are consequently declared.
% \begin{macrocode}
-\ifbool{beamer}{%true
- \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]
- (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]
- (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]
- (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,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,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,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,rounded corners,fill=\fcol,draw=\bcol]
- (pic cs:#1) ++(#2) rectangle (#3) node [anchor=base] (#1){}
- ;}
+\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,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,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,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,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,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,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,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,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,rounded corners,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;}
% \end{macrocode}
-%
% \iffalse
%</package>
% \fi
%
% \Finale
-
\endinput
diff --git a/Master/texmf-dist/source/latex/hf-tikz/hf-tikz.ins b/Master/texmf-dist/source/latex/hf-tikz/hf-tikz.ins
index bf390664e52..6bd2725452a 100644
--- a/Master/texmf-dist/source/latex/hf-tikz/hf-tikz.ins
+++ b/Master/texmf-dist/source/latex/hf-tikz/hf-tikz.ins
@@ -56,7 +56,6 @@ and the derived files hf-tikz.ins and
}
\endbatchfile
-
%%
%% Copyright (C) 2012 by Claudio Fiandrino <claudio.fiandrino@gmail.com>
%%