From b87a85274cfe6465d3a6c6dce560c8134f63b57c Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 27 Jun 2016 20:38:01 +0000 Subject: fancytabs (27jun16) git-svn-id: svn://tug.org/texlive/trunk@41549 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/doc/latex/fancytabs/fancytabs.pdf | Bin 179526 -> 184207 bytes .../source/latex/fancytabs/fancytabs.dtx | 41 ++++++++++++++++----- .../texmf-dist/tex/latex/fancytabs/fancytabs.sty | 24 +++++++++--- 3 files changed, 49 insertions(+), 16 deletions(-) diff --git a/Master/texmf-dist/doc/latex/fancytabs/fancytabs.pdf b/Master/texmf-dist/doc/latex/fancytabs/fancytabs.pdf index a7f8d8df394..05cb9903521 100644 Binary files a/Master/texmf-dist/doc/latex/fancytabs/fancytabs.pdf and b/Master/texmf-dist/doc/latex/fancytabs/fancytabs.pdf differ diff --git a/Master/texmf-dist/source/latex/fancytabs/fancytabs.dtx b/Master/texmf-dist/source/latex/fancytabs/fancytabs.dtx index bbb311b6968..133c4fc02d3 100644 --- a/Master/texmf-dist/source/latex/fancytabs/fancytabs.dtx +++ b/Master/texmf-dist/source/latex/fancytabs/fancytabs.dtx @@ -26,13 +26,16 @@ %\NeedsTeXFormat{LaTeX2e}[1999/12/01] %\ProvidesPackage{fancytabs} %<*package> - [2012/09/17 1.8 Fancy page border tabs with Tikz] + [2016/03/29 1.9 Fancy page border tabs with Tikz] % % %<*driver> \documentclass{ltxdoc} \usepackage{fancytabs} \usepackage{scrpage2} +\makeatletter +\global\let\tikz@ensure@dollar@catcode=\relax +\makeatother \EnableCrossrefs \CodelineIndex \RecordChanges @@ -44,7 +47,7 @@ % % \fi % -% \CheckSum{123} +% \CheckSum{142} % % \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 @@ -63,6 +66,7 @@ % Right brace \} Tilde \~} % % +% \changes{v1.9}{2016/03/29}{Add RTL support (thanks to Zvika Haramaty)} % \changes{v1.8}{2012/09/17}{Use lengths were fit} % \changes{v1.7}{2011/09/04}{Add Makefile} % \changes{v1.6}{2011/09/03}{Bugfix: Fix babel for non-frenchb users (thanks to Marco Daniel)} @@ -102,9 +106,10 @@ % % \DescribeMacro{\fancytab} % The |\fancytab| macro adds a new tab. -% It takes two arguments: -% |\fancytab{}{}| -% and displays the text in the tab, on given vertical position. +% It takes two mandatory arguments, and one optional: +% |\fancytab[]{}{}| +% and displays the text in the tab, on given vertical position, +% at LEFT or RIGHT horizontal position. Default is RIGHT. % % \subsection{Adding a tab to all odd pages with scrpage2} % @@ -195,6 +200,10 @@ % for previous chapters. % Default is |0|. % +% \DescribeMacro{\fancytabsRotate} +% Define the text rotation. +% Default is |90|. +% % \StopEventually{} % % \section{Implementation} @@ -206,6 +215,7 @@ % \begin{macrocode} \ProvidesPackage{fancytabs} \RequirePackage{tikz} +\RequirePackage{etoolbox} % \end{macrocode} % % \begin{macro}{Variables} @@ -225,6 +235,7 @@ \newlength{\tab@gap} \setlength{\tab@gap}{0in} \newcommand{\tab@floor}{0} +\newcommand{\tab@rotate}{90} % \end{macrocode} % \end{macro} % @@ -242,6 +253,7 @@ \newcommand{\fancytabsTextHPos}[1]{\renewcommand{\tab@texthpos}{#1}} \newcommand{\fancytabsGap}[1]{\setlength{\tab@gap}{#1}} \newcommand{\fancytabsFloor}[1]{\renewcommand{\tab@floor}{#1}} +\newcommand{\fancytabsRotate}[1]{\renewcommand{\tab@rotate}{#1}} % \end{macrocode} % \end{macro} % @@ -268,19 +280,28 @@ % \begin{macro}{\fancytab} % We define the |\fancytab| macro to generate a new tab. % \begin{macrocode} -\newcommand{\fancytab}[2]{% +\newcommand{\fancytab}[3][RIGHT]{% + \ifstrequal{#1}{LEFT} + { + \newcommand{\eastwest}{west} + \newcommand{\multiplier}{0.5} + } + { %else + \newcommand{\eastwest}{east} + \newcommand{\multiplier}{-0.5} + } \begin{tikzpicture}[remember picture,overlay]% \node[yshift={-1*(\the\tab@top+\the\tab@height/2+ - mod(#2-1-\tab@floor,\tab@count)* + mod(#3-1-\tab@floor,\tab@count)* (\the\tab@height+\the\tab@gap))}, - xshift=-0.5*\the\tab@width] - at (current page.north east) { + xshift=\multiplier*\the\tab@width] + at (current page.north \eastwest) { \tikz\shade[shading=axis,bottom color=\tab@leftcolor, top color=\tab@rightcolor,shading angle=-90] (0,0) rectangle (\the\tab@width,\the\tab@height) node[rotate=0] at (\tab@texthpos*\the\tab@width,\tab@textvpos*\the\tab@height) - {\rotatebox{90}{\tab@style#1}};% + {\rotatebox{\tab@rotate}{\tab@style#2}};% };% \end{tikzpicture}% } diff --git a/Master/texmf-dist/tex/latex/fancytabs/fancytabs.sty b/Master/texmf-dist/tex/latex/fancytabs/fancytabs.sty index 18c6439a2a5..24b712b9080 100644 --- a/Master/texmf-dist/tex/latex/fancytabs/fancytabs.sty +++ b/Master/texmf-dist/tex/latex/fancytabs/fancytabs.sty @@ -22,10 +22,11 @@ %% \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesPackage{fancytabs} - [2012/09/17 1.8 Fancy page border tabs with Tikz] + [2016/03/29 1.9 Fancy page border tabs with Tikz] \ProvidesPackage{fancytabs} \RequirePackage{tikz} +\RequirePackage{etoolbox} \newcommand{\tab@style}{\Large\scshape} \newlength{\tab@height} \setlength{\tab@height}{4cm} @@ -41,6 +42,7 @@ \newlength{\tab@gap} \setlength{\tab@gap}{0in} \newcommand{\tab@floor}{0} +\newcommand{\tab@rotate}{90} \newcommand{\fancytabsStyle}[1]{\renewcommand{\tab@style}{#1}} \newcommand{\fancytabsHeight}[1]{\setlength{\tab@height}{#1}} \newcommand{\fancytabsWidth}[1]{\setlength{\tab@width}{#1}} @@ -52,6 +54,7 @@ \newcommand{\fancytabsTextHPos}[1]{\renewcommand{\tab@texthpos}{#1}} \newcommand{\fancytabsGap}[1]{\setlength{\tab@gap}{#1}} \newcommand{\fancytabsFloor}[1]{\renewcommand{\tab@floor}{#1}} +\newcommand{\fancytabsRotate}[1]{\renewcommand{\tab@rotate}{#1}} \AtBeginDocument{\@ifpackageloaded{babel} {\@ifundefined{active@char;}{}{% \g@addto@macro\tikz@installcommands{% @@ -61,19 +64,28 @@ }% }{}% } -\newcommand{\fancytab}[2]{% +\newcommand{\fancytab}[3][RIGHT]{% + \ifstrequal{#1}{LEFT} + { + \newcommand{\eastwest}{west} + \newcommand{\multiplier}{0.5} + } + { %else + \newcommand{\eastwest}{east} + \newcommand{\multiplier}{-0.5} + } \begin{tikzpicture}[remember picture,overlay]% \node[yshift={-1*(\the\tab@top+\the\tab@height/2+ - mod(#2-1-\tab@floor,\tab@count)* + mod(#3-1-\tab@floor,\tab@count)* (\the\tab@height+\the\tab@gap))}, - xshift=-0.5*\the\tab@width] - at (current page.north east) { + xshift=\multiplier*\the\tab@width] + at (current page.north \eastwest) { \tikz\shade[shading=axis,bottom color=\tab@leftcolor, top color=\tab@rightcolor,shading angle=-90] (0,0) rectangle (\the\tab@width,\the\tab@height) node[rotate=0] at (\tab@texthpos*\the\tab@width,\tab@textvpos*\the\tab@height) - {\rotatebox{90}{\tab@style#1}};% + {\rotatebox{\tab@rotate}{\tab@style#2}};% };% \end{tikzpicture}% } -- cgit v1.2.3