summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/fancytabs
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-06-27 20:38:01 +0000
committerKarl Berry <karl@freefriends.org>2016-06-27 20:38:01 +0000
commitb87a85274cfe6465d3a6c6dce560c8134f63b57c (patch)
tree69581f92e8811cd37c344a6bc6a28dbdb7dae1b5 /Master/texmf-dist/source/latex/fancytabs
parent3dfeceb17846d1431ce48f9774ecef028533293e (diff)
fancytabs (27jun16)
git-svn-id: svn://tug.org/texlive/trunk@41549 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/fancytabs')
-rw-r--r--Master/texmf-dist/source/latex/fancytabs/fancytabs.dtx41
1 files changed, 31 insertions, 10 deletions
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 @@
%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<package>\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]
%</package>
%
%<*driver>
\documentclass{ltxdoc}
\usepackage{fancytabs}
\usepackage{scrpage2}
+\makeatletter
+\global\let\tikz@ensure@dollar@catcode=\relax
+\makeatother
\EnableCrossrefs
\CodelineIndex
\RecordChanges
@@ -44,7 +47,7 @@
%</driver>
% \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{<text>}{<position>}|
-% and displays the text in the tab, on given vertical position.
+% It takes two mandatory arguments, and one optional:
+% |\fancytab[<LEFT,RIGHT>]{<text>}{<position>}|
+% 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}%
}