diff options
author | Karl Berry <karl@freefriends.org> | 2011-04-20 23:08:58 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-04-20 23:08:58 +0000 |
commit | e719033c1c0b7088ce96bb0c0d0511f8fcce8bbd (patch) | |
tree | 028b8c8c0cc4776d4699fbefdac87ee98790dd2b | |
parent | c0c324eaf2ab0b54bffd1eeba0abe6083c75250e (diff) |
fancytabs (20apr11)
git-svn-id: svn://tug.org/texlive/trunk@22141 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/doc/latex/fancytabs/README | 7 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/fancytabs/fancytabs.pdf | bin | 160927 -> 161179 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/fancytabs/fancytabs.dtx | 167 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/fancytabs/fancytabs.sty | 81 |
4 files changed, 147 insertions, 108 deletions
diff --git a/Master/texmf-dist/doc/latex/fancytabs/README b/Master/texmf-dist/doc/latex/fancytabs/README index dfa71be0479..7c7d6bb71c4 100644 --- a/Master/texmf-dist/doc/latex/fancytabs/README +++ b/Master/texmf-dist/doc/latex/fancytabs/README @@ -1,7 +1,6 @@ - - - LICENSE ======= -s material is subject to the LaTeX Project Public License. See http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html for the details of that license +This material is subject to the LaTeX Project Public License. + See http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html + for the details of that license diff --git a/Master/texmf-dist/doc/latex/fancytabs/fancytabs.pdf b/Master/texmf-dist/doc/latex/fancytabs/fancytabs.pdf Binary files differindex a610c8319b2..35649c0eb92 100644 --- a/Master/texmf-dist/doc/latex/fancytabs/fancytabs.pdf +++ b/Master/texmf-dist/doc/latex/fancytabs/fancytabs.pdf diff --git a/Master/texmf-dist/source/latex/fancytabs/fancytabs.dtx b/Master/texmf-dist/source/latex/fancytabs/fancytabs.dtx index 25539c7b088..49b155b5484 100644 --- a/Master/texmf-dist/source/latex/fancytabs/fancytabs.dtx +++ b/Master/texmf-dist/source/latex/fancytabs/fancytabs.dtx @@ -17,10 +17,11 @@ % \iffalse %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01] %<package>\ProvidesPackage{fancytabs} -%<package> [2011/04/17 1.2 Fancy page border tabs] +%<package> [2011/04/20 1.4 Fancy page border tabs] % %<*driver> \documentclass{ltxdoc} +\usepackage{fancytabs} \EnableCrossrefs \CodelineIndex \RecordChanges @@ -33,6 +34,7 @@ % % \CheckSum{0} % +% \changes{v1.4}{2011/04/20}{Protect internal macros. Display a fancytab in documentation. Make it babel-safe.} % \changes{v1.3}{2011/04/18}{Add tabfloor and accessors} % \changes{v1.2}{2011/04/17}{Add tabgap. Fix tabtop by adding tabheight/2} % \changes{v1.1}{2011/04/16}{Add tabtextvpos and tabtexthpos macros} @@ -48,8 +50,8 @@ % \maketitle % % \begin{abstract} -% The \textsf{fancytabs} package allows to insert tabs -% on the border of pages. +% The \textsf{fancytabs} package allows to insert tabs +% on the border of pages. % \end{abstract} % % \section{Usage} @@ -57,10 +59,10 @@ % \subsection{Adding a tab} % % \DescribeMacro{\fancytab} -% The |\fancytab| macro adds a new tab. -% It takes two arguments: -% |\fancytab{<text>}{<position>}| -% and displays the text in the tab, on given vertical position. +% The |\fancytab| macro adds a new tab. +% It takes two arguments: +% |\fancytab{<text>}{<position>}| +% and displays the text in the tab, on given vertical position. % % \subsection{Adding a tab to all odd pages with scrpage2} % @@ -90,7 +92,7 @@ % \pagestyle{scrheadings} % % \begin{document} -% \chapter{My sample chapter} +% \chapter{A chapter} % % \lipsum % \lipsum @@ -101,55 +103,55 @@ % \subsection{Parameters} % % \DescribeMacro{\fancytabsStyle} -% The style of for the text in the tab. -% Default is |\Large\scshape|. +% The style of the text in the tab. +% Default is |\Large\scshape|. % % \DescribeMacro{\fancytabsHeight} -% Define the height of the tab. -% Default is |4cm|. +% Define the height of the tab. +% Default is |4cm|. % % \DescribeMacro{\fancytabsWidth} -% Define the height of the tab. -% Default is |1cm|. +% Define the height of the tab. +% Default is |1cm|. % % \DescribeMacro{\fancytabsCount} -% Define the maximum amount of tabs on a page. -% After |\tabcount| tabs are displayed, -% the next tab is displayed on top of the page again. -% Default is |6|. +% Define the maximum amount of tabs on a page. +% After |\tabcount| tabs are displayed, +% the next tab is displayed on top of the page again. +% Default is |6|. % % \DescribeMacro{\fancytabsLeftColor} -% Define the left color for the tab gradient. -% Default is |white|. +% Define the left color for the tab gradient. +% Default is |white|. % % \DescribeMacro{\fancytabsRightColor} -% Define the right color for the tab gradient. -% Default is |gray!50|. +% Define the right color for the tab gradient. +% Default is |gray!50|. % % \DescribeMacro{\fancytabsTop} -% Define margin on top of the top tab. -% Default is |\tabheight|. +% Define margin on top of the top tab. +% Default is |\tab@height|. % % \DescribeMacro{\fancytabsTextVPos} -% Define the relative vertical position -% of the text in the tab. -% Default is |0.5|. +% Define the relative vertical position +% of the text in the tab. +% Default is |0.5|. % % \DescribeMacro{\fancytabsTextHPos} -% Define the relative horizontal position -% of the text in the tab. -% Default is |\tabtextvpos|. +% Define the relative horizontal position +% of the text in the tab. +% Default is |\tab@textvpos|. % % \DescribeMacro{\fancytabsGap} -% Define the gap between two tabs. -% Default is |0in|. +% Define the gap between two tabs. +% Default is |0in|. % % \DescribeMacro{\fancytabsFloor} -% Define the starting number for incrementation. -% This is useful if you want to pass for example -% |\arabic{chapter}| as counter but not put tabs -% for previous chapters. -% Default is |0|. +% Define the starting number for incrementation. +% This is useful if you want to pass for example +% |\arabic{chapter}| as counter but not put tabs +% for previous chapters. +% Default is |0|. % % \StopEventually{\PrintIndex} % @@ -159,57 +161,82 @@ % % \begin{macrocode} \RequirePackage{tikz} -\newcommand{\tabstyle}{\Large\scshape} -\newcommand{\tabheight}{4cm} -\newcommand{\tabwidth}{1cm} -\newcommand{\tabcount}{6} -\newcommand{\tableftcolor}{white} -\newcommand{\tabrightcolor}{gray!50} -\newcommand{\tabtop}{\tabheight} -\newcommand{\tabtextvpos}{0.5} -\newcommand{\tabtexthpos}{\tabtextvpos} -\newcommand{\tabgap}{0in} -\newcommand{\tabfloor}{0} +\makeatletter +\newcommand{\tab@style}{\Large\scshape} +\newcommand{\tab@height}{4cm} +\newcommand{\tab@width}{1cm} +\newcommand{\tab@count}{6} +\newcommand{\tab@leftcolor}{white} +\newcommand{\tab@rightcolor}{gray!50} +\newcommand{\tab@top}{\tab@height} +\newcommand{\tab@textvpos}{0.5} +\newcommand{\tab@texthpos}{\tab@textvpos} +\newcommand{\tab@gap}{0in} +\newcommand{\tab@floor}{0} % \end{macrocode} % % \subsection{Accessors} % % \begin{macrocode} -\newcommand{\fancytabsStyle}[1]{\renewcommand{\tabstyle}{#1}} -\newcommand{\fancytabsHeight}[1]{\renewcommand{\tabheight}{#1}} -\newcommand{\fancytabsWidth}[1]{\renewcommand{\tabwidth}{#1}} -\newcommand{\fancytabsCount}[1]{\renewcommand{\tabcount}{#1}} -\newcommand{\fancytabsLeftColor}[1]{\renewcommand{\tableftcolor}{#1}} -\newcommand{\fancytabsRightColor}[1]{\renewcommand{\tabrightcolor}{#1}} -\newcommand{\fancytabsTop}[1]{\renewcommand{\tabtop}{#1}} -\newcommand{\fancytabsTextVPos}[1]{\renewcommand{\tabtextvpos}{#1}} -\newcommand{\fancytabsTextHPos}[1]{\renewcommand{\tabtexthpos}{#1}} -\newcommand{\fancytabsGap}[1]{\renewcommand{\tabgap}{#1}} -\newcommand{\fancytabsFloor}[1]{\renewcommand{\tabfloor}{#1}} +\newcommand{\fancytabsStyle}[1]{\renewcommand{\tab@style}{#1}} +\newcommand{\fancytabsHeight}[1]{\renewcommand{\tab@height}{#1}} +\newcommand{\fancytabsWidth}[1]{\renewcommand{\tab@width}{#1}} +\newcommand{\fancytabsCount}[1]{\renewcommand{\tab@count}{#1}} +\newcommand{\fancytabsLeftColor}[1]{\renewcommand{\tab@leftcolor}{#1}} +\newcommand{\fancytabsRightColor}[1]{\renewcommand{\tab@rightcolor}{#1}} +\newcommand{\fancytabsTop}[1]{\renewcommand{\tab@top}{#1}} +\newcommand{\fancytabsTextVPos}[1]{\renewcommand{\tab@textvpos}{#1}} +\newcommand{\fancytabsTextHPos}[1]{\renewcommand{\tab@texthpos}{#1}} +\newcommand{\fancytabsGap}[1]{\renewcommand{\tab@gap}{#1}} +\newcommand{\fancytabsFloor}[1]{\renewcommand{\tab@floor}{#1}} +% \end{macrocode} +% +% \subsection{Babel safety} +% +% Some |babel| packages (such as |frenchb|) handle semi-colons which +% is incompatible with |tikz|. This part disables semi-colon handling +% by babel locally. +% +% \begin{macrocode} +\AtBeginDocument{\@ifpackageloaded{babel} + {% + \g@addto@macro\tikz@installcommands{% + \shorthandoff{;}% + }% + \g@addto@macro\tikz@uninstallcommands{% + \shorthandon{;}% + }% + }% + {}% +} % \end{macrocode} % % \begin{macro}{\fancytab} % We define the |\fancytab| macro to generate a new tab. % \begin{macrocode} \newcommand{\fancytab}[2]{% - \begin{tikzpicture}[remember picture,overlay] - \node[yshift={-1*(\tabtop+\tabheight/2+ - mod(#2-1-\tabfloor,\tabcount)* - (\tabheight+\tabgap))}, - xshift=-0.5*\tabwidth] + \begin{tikzpicture}[remember picture,overlay]% + \node[yshift={-1*(\tab@top+\tab@height/2+ + mod(#2-1-\tab@floor,\tab@count)* + (\tab@height+\tab@gap))}, + xshift=-0.5*\tab@width] at (current page.north east) { - \tikz\shade[shading=axis,bottom color=\tableftcolor, - top color=\tabrightcolor,shading angle=-90] - (0,0) rectangle (\tabwidth,\tabheight) + \tikz\shade[shading=axis,bottom color=\tab@leftcolor, + top color=\tab@rightcolor,shading angle=-90] + (0,0) rectangle (\tab@width,\tab@height) node[rotate=90] - at (\tabtexthpos*\tabwidth,\tabtextvpos*\tabheight) - {\tabstyle#1}; - }; + at (\tab@texthpos*\tab@width,\tab@textvpos*\tab@height) + {\tab@style#1};% + };% \end{tikzpicture}% } % \end{macrocode} % \end{macro} % +% \begin{macrocode} +\makeatother +% \end{macrocode} +% % \Finale \endinput diff --git a/Master/texmf-dist/tex/latex/fancytabs/fancytabs.sty b/Master/texmf-dist/tex/latex/fancytabs/fancytabs.sty index 36b66225b57..b97ec5cddc2 100644 --- a/Master/texmf-dist/tex/latex/fancytabs/fancytabs.sty +++ b/Master/texmf-dist/tex/latex/fancytabs/fancytabs.sty @@ -22,46 +22,59 @@ %% \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesPackage{fancytabs} - [2011/04/17 1.2 Fancy page border tabs] + [2011/04/20 1.4 Fancy page border tabs] \RequirePackage{tikz} -\newcommand{\tabstyle}{\Large\scshape} -\newcommand{\tabheight}{4cm} -\newcommand{\tabwidth}{1cm} -\newcommand{\tabcount}{6} -\newcommand{\tableftcolor}{white} -\newcommand{\tabrightcolor}{gray!50} -\newcommand{\tabtop}{\tabheight} -\newcommand{\tabtextvpos}{0.5} -\newcommand{\tabtexthpos}{\tabtextvpos} -\newcommand{\tabgap}{0in} -\newcommand{\tabfloor}{0} -\newcommand{\fancytabsStyle}[1]{\renewcommand{\tabstyle}{#1}} -\newcommand{\fancytabsHeight}[1]{\renewcommand{\tabheight}{#1}} -\newcommand{\fancytabsWidth}[1]{\renewcommand{\tabwidth}{#1}} -\newcommand{\fancytabsCount}[1]{\renewcommand{\tabcount}{#1}} -\newcommand{\fancytabsLeftColor}[1]{\renewcommand{\tableftcolor}{#1}} -\newcommand{\fancytabsRightColor}[1]{\renewcommand{\tabrightcolor}{#1}} -\newcommand{\fancytabsTop}[1]{\renewcommand{\tabtop}{#1}} -\newcommand{\fancytabsTextVPos}[1]{\renewcommand{\tabtextvpos}{#1}} -\newcommand{\fancytabsTextHPos}[1]{\renewcommand{\tabtexthpos}{#1}} -\newcommand{\fancytabsGap}[1]{\renewcommand{\tabgap}{#1}} -\newcommand{\fancytabsFloor}[1]{\renewcommand{\tabfloor}{#1}} +\makeatletter +\newcommand{\tab@style}{\Large\scshape} +\newcommand{\tab@height}{4cm} +\newcommand{\tab@width}{1cm} +\newcommand{\tab@count}{6} +\newcommand{\tab@leftcolor}{white} +\newcommand{\tab@rightcolor}{gray!50} +\newcommand{\tab@top}{\tab@height} +\newcommand{\tab@textvpos}{0.5} +\newcommand{\tab@texthpos}{\tab@textvpos} +\newcommand{\tab@gap}{0in} +\newcommand{\tab@floor}{0} +\newcommand{\fancytabsStyle}[1]{\renewcommand{\tab@style}{#1}} +\newcommand{\fancytabsHeight}[1]{\renewcommand{\tab@height}{#1}} +\newcommand{\fancytabsWidth}[1]{\renewcommand{\tab@width}{#1}} +\newcommand{\fancytabsCount}[1]{\renewcommand{\tab@count}{#1}} +\newcommand{\fancytabsLeftColor}[1]{\renewcommand{\tab@leftcolor}{#1}} +\newcommand{\fancytabsRightColor}[1]{\renewcommand{\tab@rightcolor}{#1}} +\newcommand{\fancytabsTop}[1]{\renewcommand{\tab@top}{#1}} +\newcommand{\fancytabsTextVPos}[1]{\renewcommand{\tab@textvpos}{#1}} +\newcommand{\fancytabsTextHPos}[1]{\renewcommand{\tab@texthpos}{#1}} +\newcommand{\fancytabsGap}[1]{\renewcommand{\tab@gap}{#1}} +\newcommand{\fancytabsFloor}[1]{\renewcommand{\tab@floor}{#1}} +\AtBeginDocument{\@ifpackageloaded{babel} + {% + \g@addto@macro\tikz@installcommands{% + \shorthandoff{;}% + }% + \g@addto@macro\tikz@uninstallcommands{% + \shorthandon{;}% + }% + }% + {}% +} \newcommand{\fancytab}[2]{% - \begin{tikzpicture}[remember picture,overlay] - \node[yshift={-1*(\tabtop+\tabheight/2+ - mod(#2-1-\tabfloor,\tabcount)* - (\tabheight+\tabgap))}, - xshift=-0.5*\tabwidth] + \begin{tikzpicture}[remember picture,overlay]% + \node[yshift={-1*(\tab@top+\tab@height/2+ + mod(#2-1-\tab@floor,\tab@count)* + (\tab@height+\tab@gap))}, + xshift=-0.5*\tab@width] at (current page.north east) { - \tikz\shade[shading=axis,bottom color=\tableftcolor, - top color=\tabrightcolor,shading angle=-90] - (0,0) rectangle (\tabwidth,\tabheight) + \tikz\shade[shading=axis,bottom color=\tab@leftcolor, + top color=\tab@rightcolor,shading angle=-90] + (0,0) rectangle (\tab@width,\tab@height) node[rotate=90] - at (\tabtexthpos*\tabwidth,\tabtextvpos*\tabheight) - {\tabstyle#1}; - }; + at (\tab@texthpos*\tab@width,\tab@textvpos*\tab@height) + {\tab@style#1};% + };% \end{tikzpicture}% } +\makeatother \endinput %% %% End of file `fancytabs.sty'. |