diff options
author | Karl Berry <karl@freefriends.org> | 2006-01-13 00:02:16 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-01-13 00:02:16 +0000 |
commit | d7dd51fd716e6c78e75e2e8bef4cade6ebaf58de (patch) | |
tree | 4db2daa58b8694ea924a80589775f394679a5d35 /Master/texmf-dist/tex/latex | |
parent | 6c3ff73a2106fc5bd13c599df0384a224791b311 (diff) |
pdfwin
git-svn-id: svn://tug.org/texlive/trunk@1185 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r-- | Master/texmf-dist/tex/latex/pdfwin/pdfwin.cfg | 6 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/pdfwin/pdfwin.sty | 2025 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/pdfwin/truncate.sty | 158 |
3 files changed, 2189 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/pdfwin/pdfwin.cfg b/Master/texmf-dist/tex/latex/pdfwin/pdfwin.cfg new file mode 100644 index 00000000000..cbb5068dd80 --- /dev/null +++ b/Master/texmf-dist/tex/latex/pdfwin/pdfwin.cfg @@ -0,0 +1,6 @@ +% pdfwin.cfg +% +% this file is read by pdfwin.sty +% if you want to modify pdfwin's default behavior, you should do it here. +% +% EOF diff --git a/Master/texmf-dist/tex/latex/pdfwin/pdfwin.sty b/Master/texmf-dist/tex/latex/pdfwin/pdfwin.sty new file mode 100644 index 00000000000..36a140b3f6b --- /dev/null +++ b/Master/texmf-dist/tex/latex/pdfwin/pdfwin.sty @@ -0,0 +1,2025 @@ +%% -*- TeX -*- +%% (top line is for WinEdt: TeX file) +%% +%% This is file `pdfwin.sty'. It provides three widely +%% customizable windows for screen output of TeX documents. +%% +%% Copyright (C) 2001,02,03 Matthias M\"{u}hlich +%% muehlich@iap.uni-frankfurt.de +%% +%% NOTES: +%% * I prefer readability to achieving maximum effectivity, i.e. I +%% tried to avoid macros like \hb@xt@, \z@, \p@ or \xixt@@n and +%% wrote \hbox to, 0, 1pt and 16 instead. +%% * The package "pdfscreen.sty" by C.V. Radhakrishnan provided a +%% nice inspiration of what is possible with pdf output - at least +%% if you use default configuration and are content with the +%% package and its many bugs. +%% The pdfwin package was completely coded from scratch and its +%% features and flexibility extend pdfscreen considerably. Only a +%% bug fix in "pdfscreen.sty" (provided by D. P. Story) and +%% some foreign language names were copied. +%% +%% This program may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.2 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.2 or later is part of all distributions of LaTeX +%% version 1999/12/01 or later. +%% +%% History: +%% JAN-FEB 2001 1.0 MM first version +%% JUL 2001 1.1 MM I added some macros for a upcoming +%% presentation at a conference +%% SEP-OCT 2001 1.2 MM some cosmetics; adapted to a lecture script; +%% chapterpanel functionality +%% MAR-APR 2003 1.3 MM some functionality removed (temporarily); +%% first official release +%% +%% ===================================================================== +%% This program package contains the following files: +%% * pdfwin.sty style file +%% (to be included with \UsePackage{pdfwin}) +%% * pdfwin.cfg configuration file (empty) +%% ------------------------------------------------------------------ +%% * truncate.sty style file not included in all LaTeX +%% distributions; needed for panel TOC +%% ------------------------------------------------------------------ +%% * Bucuresti2003.tex sample document, main file +%% * Buc*.pdf graphics for sample document +%% * marble.png background graphics for sample document +%% * JWGU-Logo.png logo of my university +%% * shortvec.tex abbreviations for vectors and matrices +%% ===================================================================== +%% +%% feel free to experiment with the code! But remember: +%% modification means change of filename (and be fair and give reference +%% to the original author :-). See LaTeX Project Public +%% License for details. +%% +%% please report bugs to: muehlich@iap.uni-frankfurt.de Thanks! + +\NeedsTeXFormat{LaTeX2e} + +% ============== +% identification +% ============== +% +\ProvidesPackage{pdfwin}% + [2003/04/04 v1.3 This is package pdfwin. It provides widely % + customizable windows for screen output of TeX documents.] + +% ================= +% required packages +% ================= +% +% NOTE: all packages listed here are standard packages. +% However, if paneltoc is activated you have to get +% truncate.sty from CTAN (e.g. ftp://ftp.dante.de/tex-archive) +\RequirePackage{amssymb} % black triangles +\RequirePackage{keyval} % user interface +\RequirePackage{graphicx} +\RequirePackage{color} + +% ======================== +% preliminary declarations +% ======================== +% +\newif\if@nocfg \@nocfgfalse +\newif\if@paneltoc \@paneltocfalse +\newif\if@chapterpanel \@chapterpanelfalse +\newif\if@coloremph \@coloremphfalse +\newif\if@pdftexdriver \@pdftexdriverfalse +% +\def\PDFWIN@Warning#1{\PackageWarning{pdfwin}{#1}} +\def\PDFWIN@Info#1{\PackageInfo{pdfwin}{#1}} +\def\PDFWIN@Error#1#2{\PackageError{pdfwin}{#1}{#2}} +\def\PDFWIN@langwarn#1{\PackageWarningNoLine{pdfwin}{% + Sorry, language `#1' not supported\MessageBreak% + in this version. English strings are used instead.\MessageBreak% + However you can give all the strings in the pdfwin.cfg\MessageBreak% + file which will be read by the package. \MessageBreak\MessageBreak% + If you can suggest translations for this language,\MessageBreak% + please mail them to the author of this package}} +% +\def\paneltitlepagename#1{\gdef\@Paneltitlepagename{#1}} +\def\panelabstractname#1{\gdef\@Panelabstractname{#1}} +\def\panelcontentsname#1{\gdef\@Panelcontentsname{#1}} +\def\panelindexname#1{\gdef\@Panelindexname{#1}} +\def\panelhomepagename#1{\gdef\@Panelhomepagename{#1}} +\def\panelfullscreenname#1{\gdef\@Panelfullscreenname{#1}} +\def\panelgobackname#1{\gdef\@Panelgobackname{#1}} +\def\panelgoforwardname#1{\gdef\@Panelgoforwardname{#1}} +\def\panelsearchname#1{\gdef\@Panelsearchname{#1}} +\def\panelquitname#1{\gdef\@Panelquitname{#1}} +\def\panelclosename#1{\gdef\@Panelclosename{#1}} +\def\panelpagename#1{\gdef\@Panelpagename{#1}} +\def\panelofname#1{\gdef\@Panelofname{#1}} +\let\@Paneltitlepagename\@empty +\let\@Panelabstractname\@empty +\let\@Panelcontentsname\@empty +\let\@Panelindexname\@empty +\let\@Panelhomepagename\@empty +\let\@Panelfullscreenname\@empty +\let\@Panelgobackname\@empty +\let\@Panelgoforwardname\@empty +\let\@Panelsearchname\@empty +\let\@Panelquitname\@empty +\let\@Panelclosename\@empty +\let\@Panelpagename\@empty +\let\@Panelofname\@empty + +% ================================= +% option declaration and processing +% ================================= +% +\DeclareOption{nocfg}{\@nocfgtrue} +\DeclareOption{paneltoc}{\@paneltoctrue} +\DeclareOption{chapterpanel}{\@chapterpaneltrue} +\DeclareOption{coloremph}{\@coloremphtrue} +\DeclareOption{pdftex}{\@pdftexdrivertrue} +\DeclareOption{sectionbreak}{% + \let\org@section\section\def\section{\clearpage\org@section}% +} +% +\DeclareOption{catalan}{% + \paneltitlepagename{Inici} + \panelabstractname{Resum} + \panelcontentsname{Contingut} + \panelindexname{Index} % ??? + \panelfullscreenname{Full Screen} + \panelhomepagename{Plana personal} + \panelgobackname{Tornar} + \panelgoforwardname{->} + \panelclosename{Tancar} + \panelsearchname{???} + \panelquitname{Sortir} + \panelpagename{P\`agina} + \panelofname{de} +} +\DeclareOption{czech}{% + \paneltitlepagename{Tituln\'{\i} strana} + \panelabstractname{Abstrakt} + \panelcontentsname{Obsah} + \panelindexname{Index} % ??? + \panelfullscreenname{Full Screen} + \panelhomepagename{\'Uvodn\'{\i} strana} + \panelgobackname{Zp\v{e}t} + \panelgoforwardname{->} + \panelclosename{Zav\v{r}\'{\i}t} + \panelsearchname{???} + \panelquitname{Konec} + \panelpagename{Strana} + \panelofname{z} +} +\DeclareOption{danish}{% + \paneltitlepagename{Forside} + \panelabstractname{Resum\'e} + \panelcontentsname{Indhold} + \panelindexname{Index} % ??? + \panelfullscreenname{Full Screen} + \panelhomepagename{Hjemmeside} + \panelgobackname{G\aa\ tilbage} + \panelgoforwardname{->} + \panelclosename{Luk} + \panelsearchname{???} + \panelquitname{Afslut} + \panelpagename{Side} + \panelofname{af} +} +\DeclareOption{dutch}{ + \paneltitlepagename{Titel Pagina} + \panelabstractname{Samenvatting} + \panelcontentsname{Inhoudsopgave} + \panelindexname{Index} % ??? + \panelfullscreenname{Full Screen} + \panelhomepagename{Startpagina} + \panelgobackname{Ga terug} + \panelgoforwardname{->} + \panelclosename{Sluiten} + \panelsearchname{???} + \panelquitname{Be\"eindigen} + \panelpagename{Pagina} + \panelofname{van} +} +\DeclareOption{english}{% + \paneltitlepagename{Title Page} + \panelabstractname{Abstract} + \panelcontentsname{Contents} + \panelindexname{Index} % ??? + \panelfullscreenname{Full Screen} + \panelhomepagename{Home Page} + \panelgobackname{Go Back} + \panelgoforwardname{Go Forward} + \panelclosename{Close} + \panelsearchname{Search} + \panelquitname{Quit} + \panelpagename{Page} + \panelofname{of} +} +\DeclareOption{french}{% + \paneltitlepagename{Page de Titre} + \panelabstractname{R\'esum\'e} + \panelcontentsname{Sommaire} + \panelindexname{Index} % ??? + \panelfullscreenname{Full Screen} + \panelhomepagename{Page d\'accueil} + \panelgobackname{Retour} + \panelgoforwardname{->} + \panelclosename{Fermer} + \panelsearchname{???} + \panelquitname{Quitter} + \panelpagename{Page} + \panelofname{de} +} +\DeclareOption{german}{% + \paneltitlepagename{Titelseite} + \panelabstractname{Zusammenfassung} + \panelcontentsname{Inhalt} + \panelindexname{Index} + \panelfullscreenname{Vollbild} + \panelhomepagename{WWW-Startseite} + \panelgobackname{Zur\"uck} + \panelgoforwardname{Vor} + \panelclosename{Schlie\ss en} + \panelsearchname{Suchen} + \panelquitname{Beenden} + \panelpagename{Seite} + \panelofname{von} +} +\DeclareOption{norsk}{% + \paneltitlepagename{Forside} + \panelabstractname{Sammendrag} + \panelcontentsname{Innhold} + \panelindexname{Index} % ??? + \panelfullscreenname{Full Screen} + \panelhomepagename{Hjemmeside} + \panelgobackname{G\aa\ tilbake} + \panelgoforwardname{->} + \panelclosename{Lukk} + \panelsearchname{???} + \panelquitname{Avslutt} + \panelpagename{Side} + \panelofname{av} +} +\DeclareOption{nynorsk}{% + \paneltitlepagename{Forside} + \panelabstractname{Samandrag} + \panelcontentsname{Innhald} + \panelindexname{Index} % ??? + \panelfullscreenname{Full Screen} + \panelhomepagename{Heimeside} + \panelgobackname{G\aa\ tilbake} + \panelgoforwardname{->} + \panelclosename{Lat att} + \panelsearchname{???} + \panelquitname{Avslutt} + \panelpagename{Side} + \panelofname{av} +} +\DeclareOption{polish}{% + \paneltitlepagename{Strona tytu\l owa} + \panelabstractname{Streszczenie} + \panelcontentsname{Spis tre\'sci} + \panelindexname{Index} % ??? + \panelfullscreenname{Full Screen} + \panelhomepagename{Strona g\l \'owna} + \panelgobackname{Powr\'ot} + \panelgoforwardname{->} + \panelclosename{Zamknij} + \panelsearchname{???} + \panelquitname{Koniec} + \panelpagename{Strona} + \panelofname{z} +} +\DeclareOption{portuges}{% + \paneltitlepagename{P\'agina de Rosto} + \panelabstractname{Sum\'ario} + \panelcontentsname{\'Indice Geral} + \panelindexname{Index} % ??? + \panelfullscreenname{Full Screen} + \panelhomepagename{Homepage} + \panelgobackname{Voltar} + \panelgoforwardname{->} + \panelclosename{Fechar} + \panelsearchname{???} + \panelquitname{Desistir} + \panelpagename{P\'agina} + \panelofname{de} +} +\DeclareOption{russian}{% + \paneltitlepagename{\cyr\CYRT\cyri\cyrt\cyru\cyrl\cyrsftsn\cyrn\cyra\cyrya{} + \cyrs\cyrt\cyrr\cyra\cyrn\cyri\cyrc\cyra} + \panelabstractname{\cyr\CYRA\cyrn\cyrn\cyro\cyrt\cyra\cyrc\cyri\cyrya} + \panelcontentsname{\cyr\CYRS\cyro\cyrd\cyre\cyrr\cyrzh\cyra\cyrn\cyri\cyre} + \panelindexname{Index} % ??? + \panelfullscreenname{Full Screen} + \panelhomepagename{Home Page} + \panelgobackname{\cyr\CYRN\cyra\cyrz\cyra\cyrd} + \panelgoforwardname{->} + \panelclosename{\cyr\CYRZ\cyra\cyrk\cyrr\cyrery\cyrt\cyrsftsn} + \panelsearchname{???} + \panelquitname{\cyr\CYRV\cyrery\cyrh\cyro\cyrd} + \panelpagename{\cyr\CYRS\cyrt\cyrr\cyra\cyrn\cyri\cyrc\cyra} + \panelofname{\cyr\cyri\cyrz} +} +\DeclareOption{slovak}{% + \paneltitlepagename{Tituln\'a strana} + \panelabstractname{Abstrakt} + \panelcontentsname{Obsah} + \panelindexname{Index} % ??? + \panelfullscreenname{Full Screen} + \panelhomepagename{Domovsk\'a str\'anka} + \panelgobackname{Sp\"a\v t} + \panelgoforwardname{->} + \panelclosename{Zatvori\v t} + \panelsearchname{???} + \panelquitname{Koniec} + \panelpagename{Strana} + \panelofname{z} +} +\DeclareOption{slovene}{% + \paneltitlepagename{Naslovnica} + \panelabstractname{Povzetek} + \panelcontentsname{Kazalo} + \panelindexname{Index} % ??? + \panelfullscreenname{Full Screen} + \panelhomepagename{Spletna stran} + \panelgobackname{Nazaj} + \panelgoforwardname{->} + \panelclosename{Zapri} + \panelsearchname{???} + \panelquitname{Kon\v{c}aj} + \panelpagename{Stran} + \panelofname{od} +} +\DeclareOption{spanish}{% + \paneltitlepagename{P\'agina de Abertura} + \panelabstractname{Resumen} + \panelcontentsname{Contenido} + \panelindexname{Index} % ??? + \panelfullscreenname{Full Screen} + \panelhomepagename{P\'agina www} + \panelgobackname{Regresar} + \panelgoforwardname{->} + \panelclosename{Cerrar} + \panelsearchname{???} + \panelquitname{Abandonar} + \panelpagename{P\'agina} + \panelofname{de} +} +\DeclareOption{swedish}{% + \paneltitlepagename{F\"ors\"attsblad} + \panelabstractname{Sammanfattning} + \panelcontentsname{Inneh\aa{}ll} + \panelindexname{Index} % ??? + \panelfullscreenname{Full Screen} + \panelhomepagename{Hemsida} + \panelgobackname{Tillbaka} + \panelgoforwardname{->} + \panelclosename{St\"ang} + \panelsearchname{???} + \panelquitname{Avsluta} + \panelpagename{Sida} + \panelofname{av} +} +% define all other languages of babel package as non existent +\DeclareOption{bahasa}{\PDFSCR@langwarn{bahasa}\ExecuteOptions{english}} +\DeclareOption{breton}{\PDFSCR@langwarn{breton}\ExecuteOptions{english}} +\DeclareOption{croatian}{\PDFSCR@langwarn{croatian}\ExecuteOptions{english}} +\DeclareOption{esperanto}{\PDFSCR@langwarn{esperanto}\ExecuteOptions{english}} +\DeclareOption{finnish}{\PDFSCR@langwarn{finnish}\ExecuteOptions{english}} +\DeclareOption{galician}{\PDFSCR@langwarn{galician}\ExecuteOptions{english}} +\DeclareOption{greek}{\PDFSCR@langwarn{greek}\ExecuteOptions{english}} +\DeclareOption{hebrew}{\PDFSCR@langwarn{hebrew}\ExecuteOptions{english}} +\DeclareOption{hungarian}{\PDFSCR@langwarn{hungarian}\ExecuteOptions{english}} +\DeclareOption{magyar}{\PDFSCR@langwarn{magyar}\ExecuteOptions{english}} +\DeclareOption{irish}{\PDFSCR@langwarn{irish}\ExecuteOptions{english}} +\DeclareOption{italian}{\PDFSCR@langwarn{italian}\ExecuteOptions{english}} +\DeclareOption{lowersorbian}{\PDFSCR@langwarn{lowersorbian}\ExecuteOptions{english}} +\DeclareOption{uppersorbian}{\PDFSCR@langwarn{uppersorbian}\ExecuteOptions{english}} +\DeclareOption{romanian}{\PDFSCR@langwarn{romanian}\ExecuteOptions{english}} +\DeclareOption{scottish}{\PDFSCR@langwarn{scottish}\ExecuteOptions{english}} +\DeclareOption{turkish}{\PDFSCR@langwarn{turkish}\ExecuteOptions{english}} +\DeclareOption{ukrainian}{\PDFSCR@langwarn{ukrainian}\ExecuteOptions{english}} +\DeclareOption{welsh}{\PDFSCR@langwarn{welsh}\ExecuteOptions{english}} + +% some replacements +\DeclareOption{american}{\ExecuteOptions{english}} +\DeclareOption{USenglish}{\ExecuteOptions{english}} +\DeclareOption{UKenglish}{\ExecuteOptions{english}} +\DeclareOption{british}{\ExecuteOptions{english}} +\DeclareOption{austrian}{\ExecuteOptions{german}} +\DeclareOption{germanb}{\ExecuteOptions{german}} +\DeclareOption{brazil}{\ExecuteOptions{portuges}} +\DeclareOption{portuguese}{\ExecuteOptions{portuges}} +\DeclareOption{brazilian}{\ExecuteOptions{portuges}} +\DeclareOption{francais}{\ExecuteOptions{french}} +\DeclareOption{ngerman}{\typeout{****** Igitt! Neue Beliebigkeits-Rechtschreibung!% + Na, meinetwegen... ;-) ******}\ExecuteOptions{german}} +\DeclareOption{naustrian}{\typeout{****** Igitt! Neue Beliebigkeits-Rechtschreibung!% + Na, meinetwegen... ;-) ******}\ExecuteOptions{german}} +\ExecuteOptions{english} +\ProcessOptions\relax + + + +% ======================= +% BEGIN OF IMPLEMENTATION +% ======================= +% +% NOTE: all identifiers containing an '@' symbol are internal +% identifiers. Please do not write code that relies on these +% functions because they might change in future versions. + +% -------------------------------------------------------------- +% HYPERREF SETUP +% +\if@paneltoc\RequirePackage[breakall]{truncate}\fi +% +\@ifundefined{hyperref}{% + \if@pdftexdriver% + \RequirePackage[pdftex,backref,pagebackref,colorlinks,plainpages=false,% + menucolor=menucolor,% +% pdfpagemode=FullScreen,% + pdfmenubar=false,pdftoolbar=false,% + pdffitwindow=true,pdfcenterwindow=true,pdfwindowui=false,pdfview=Fit,% + pdfstartview=Fit]{hyperref}% + \else% (no pdftex => try to setup hyperref now) + \hypersetup{% + backref,pagebackref,colorlinks,plainpages=false,menucolor=menucolor,% + pdfpagemode=none,pdfmenubar=false,pdftoolbar=false,pdffitwindow=true,% + pdfcenterwindow=true,pdfwindowui=false,pdfview=Fit,pdfstartview=Fit% + } + \fi% +}{ % (else hyperref undefined) + \PDFWIN@Error{Please load hyperref package first}{hyperref must be loaded before pdfwin}% +} + + +% -------------------------------------------------------------- +% COUNTERS +% +% window types +% 0: disabled +% 1: transparent +% 2: colored background +% 3: graphics +% 4: colored background + graphics +\newcount\@Screen@Type \@Screen@Type=2 +\newcount\@Text@WinType \@Text@WinType=2 +\newcount\@Panel@WinType \@Panel@WinType=2 +\newcount\@User@WinType \@User@WinType=0 +% +% define chapter counter for small classes (!!!) +\ifx\c@chapter\@undefined\newcount\c@chapter\fi +% +% RealPage is necessary to allow different page numberings, +% e.g. roman for titlepage, abstract, contents and foreword +% and arabic numbering (starting with 1!) for the rest +\newcounter{RealPage} +\setcounter{RealPage}{1} +% +% Three windows are predefined - text, panel, user. Additional windows +% can be defined by the user if he/she needs them. +\newcounter{WindowCount} +\setcounter{WindowCount}{3} +% +% PanelTocLine is a counter for the lines in the panel TOC +\newcounter{PanelTocLine}[page] +\newcounter{TocChapterCount}[page] +\newcounter{ptocsection}\setcounter{ptocsection}{0} + + +% -------------------------------------------------------------- +% BOOLEANS +% +\newif\if@PanelTocHighlight \@PanelTocHighlightfalse +\newif\if@PTocNTransparent \@PTocNTransparentfalse +\newif\if@PTocHTransparent \@PTocHTransparentfalse +\newif\if@InPreamble \@InPreambletrue +\AtBeginDocument{\@InPreamblefalse} + + +% -------------------------------------------------------------- +% COLORS --- these colors can be modified (i.e. redefined) by the user +% +% screen and window colors +\definecolor{ScreenBackgroundColor}{rgb}{.0,.2,.8} +\definecolor{TextBackgroundColor}{rgb}{.8,.9,1.0} +\definecolor{PanelBackgroundColor}{rgb}{.7,.75,.8} +\definecolor{UserBackgroundColor}{rgb}{1.0,1.0,1.0} +\definecolor{TextBorderColor}{rgb}{.0,.0,.0} +\definecolor{PanelBorderColor}{rgb}{.0,.0,.0} +\definecolor{UserBorderColor}{rgb}{.0,.0,.0} +% button colors +\definecolor{ButtonTextColor}{rgb}{.0,.0,.3} +\definecolor{ButtonHighlightedTextColor}{rgb}{.8,.0,.2} +\definecolor{ButtonDisabledTextColor}{rgb}{.5,.55,.6} +\definecolor{ButtonBackgroundColor}{rgb}{.7,.75,.8} +\definecolor{ButtonUpperShadowColor}{rgb}{.85,.9,.95} +\definecolor{ButtonShadowColor}{rgb}{.5,.55,.6} +% logo colors +\definecolor{LogoShadowColor}{rgb}{.85,.9,.95} +\definecolor{LogoUpperShadowColor}{rgb}{.5,.55,.6} +% panel toc colors +\definecolor{PanelTocNormalTextColor}{rgb}{.0,.0,.3} +\definecolor{PanelTocNormalBackgroundColor}{rgb}{.7,.75,.8} +\definecolor{PanelTocHighlightedTextColor}{rgb}{.8,.8,.0} +\definecolor{PanelTocHighlightedBackgroundColor}{rgb}{.0,.0,.3} +% text colors +\definecolor{TextEmphColor}{rgb}{.0,.0,.8}% +\definecolor{TextGrayedOutColor}{rgb}{.5,.5,.5}% +\definecolor{TextHighlightedColor}{rgb}{.9,.0,.2}% +\definecolor{TextRevealedColor}{rgb}{.0,.0,.5}% +% section headings +\definecolor{Section0Color}{rgb}{.7,.7,.0} +\definecolor{Section1Color}{rgb}{.75,.6,.1} +\definecolor{Section2Color}{rgb}{.7,.4,.2} +\definecolor{Section3Color}{rgb}{.65,.2,.3} +\definecolor{Section4Color}{rgb}{.6,.1,.5} +\definecolor{Section5Color}{rgb}{.55,.0,.7} +% chapter panel colors: 0 - title, contents, index, ... +% 1 - normal chapters +% a/b/c/d: background/text/upper shadow/lower shadow +\definecolor{ChapterPanelColor0a}{rgb}{.9,.9,.9} +\definecolor{ChapterPanelColor0b}{rgb}{0,0,0} +\definecolor{ChapterPanelColor0c}{rgb}{1,1,1} +\definecolor{ChapterPanelColor0d}{rgb}{.4,.4,.4} +\definecolor{ChapterPanelColor1a}{rgb}{.15,.2,.5} +\definecolor{ChapterPanelColor1b}{rgb}{.95,.95,.95} +\definecolor{ChapterPanelColor1c}{rgb}{.6,.7,.95} +\definecolor{ChapterPanelColor1d}{rgb}{.0,.05,.3} + +% -------------------------------------------------------------- +% LENGTHS +% +\setlength{\headheight}{0pt} +\setlength{\headsep}{0pt} +\setlength{\footskip}{0pt} +\hoffset=0pt +\voffset=0pt +\paperwidth=20cm +\paperheight=15cm +\pagestyle{empty} +% +% NOTE: +% We will use the \put command for displaying graphics. Therefore,% +% the origin is in the LOWER left corner at (0pt/0pt). +% +% - text window position (lower left corner) and size +\newlength{\@Text@LLX} \setlength{\@Text@LLX}{.02\paperwidth} +\newlength{\@Text@LLY} \setlength{\@Text@LLY}{.02\paperheight} +\newlength{\@Text@DimX} \setlength{\@Text@DimX}{.79\paperwidth} +\newlength{\@Text@DimY} \setlength{\@Text@DimY}{.96\paperheight} +% - panel position (lower left corner) and size +\newlength{\@Panel@LLX} \setlength{\@Panel@LLX}{.83\paperwidth} +\newlength{\@Panel@LLY} \setlength{\@Panel@LLY}{.02\paperheight} +\newlength{\@Panel@DimX} \setlength{\@Panel@DimX}{.15\paperwidth} +\newlength{\@Panel@DimY} \setlength{\@Panel@DimY}{.96\paperheight} +% - user window position (lower left corner) and size +\newlength{\@User@LLX} \setlength{\@User@LLX}{.02\paperwidth} +\newlength{\@User@LLY} \setlength{\@User@LLY}{.92\paperheight} +\newlength{\@User@DimX} \setlength{\@User@DimX}{.79\paperwidth} +\newlength{\@User@DimY} \setlength{\@User@DimY}{.06\paperheight} +% - window borders +\newlength{\@Text@BorderThickness} \setlength{\@Text@BorderThickness}{2.0pt} +\newlength{\@Text@BorderArcRadius} \setlength{\@Text@BorderArcRadius}{12pt} +\newlength{\@Panel@BorderThickness} \setlength{\@Panel@BorderThickness}{2.0pt} +\newlength{\@Panel@BorderArcRadius} \setlength{\@Panel@BorderArcRadius}{12pt} +\newlength{\@User@BorderThickness} \setlength{\@User@BorderThickness}{2.0pt} +\newlength{\@User@BorderArcRadius} \setlength{\@User@BorderArcRadius}{12pt} +% - margins (apply for text window) +\newlength{\@LeftMargin} \setlength{\@LeftMargin}{1cm} +\newlength{\@RightMargin} \setlength{\@RightMargin}{1cm} +\newlength{\@TopMargin} \setlength{\@TopMargin}{1cm} +\newlength{\@BottomMargin} \setlength{\@BottomMargin}{1cm} +% - button shape +\newlength{\@ButtonShadowDepth}\setlength{\@ButtonShadowDepth}{2pt} +\newlength{\@ButtonWidth} \setlength{\@ButtonWidth}{.8\@Panel@DimX} +\newlength{\@SmallButtonWidth} \setlength{\@SmallButtonWidth}{.4\@Panel@DimX} +\addtolength{\@SmallButtonWidth}{-\@ButtonShadowDepth} +% - logo shape +\newlength{\@LogoWidth} \setlength{\@LogoWidth}{.7\@Panel@DimX} +\newlength{\@LogoShadowDepth} \setlength{\@LogoShadowDepth}{3.0pt} +% - panel toc height (usually automatic; fixed only if >0) +\newlength{\@PanelTOCHeight} \setlength{\@PanelTOCHeight}{0cm} +% +% temporary help registers +\newdimen\Win@DimX +\newdimen\Win@DimY +\newdimen\Win@LLX +\newdimen\Win@LLY +\newdimen\Win@BT +\newdimen\Win@BR + +% -------------------------------------------------------------- +% LAYOUT +% +\newcommand{\InitLayout}{% + % NOTE: both \oddsidemargin and \evensidemargin define + % LEFT margins (on odd/even pages). In one-sided + % documents only \oddsidemargin is used. + \if@InPreamble% + \else% + \PDFWIN@Warning{***** Page Layout changed outside of % + Preamble - this might not work as expected! *****} + \fi% + \global\setlength{\textwidth}{\@Text@DimX}% + \global\addtolength{\textwidth}{-\@LeftMargin}% + \global\addtolength{\textwidth}{-\@RightMargin}% + \global\setlength{\textheight}{\@Text@DimY}% + \global\addtolength{\textheight}{-\@TopMargin}% + \global\addtolength{\textheight}{-\@BottomMargin}% + \global\addtolength{\textheight}{-\headheight}% + \global\addtolength{\textheight}{-\headsep}% + \global\addtolength{\textheight}{-\footskip}% + \global\setlength{\oddsidemargin}{\@LeftMargin}% + \global\addtolength{\oddsidemargin}{\@Text@LLX}% + \global\addtolength{\oddsidemargin}{-1in}% + \global\setlength{\evensidemargin}{\@LeftMargin}% + \global\addtolength{\evensidemargin}{\@Text@LLX}% + \global\addtolength{\evensidemargin}{-1in}% + \global\setlength{\topmargin}{\@TopMargin}% + \global\addtolength{\topmargin}{\paperheight}% + \global\addtolength{\topmargin}{-\@Text@DimY}% + \global\addtolength{\topmargin}{-\@Text@LLY}% + \global\addtolength{\topmargin}{-1in}% +} +\InitLayout % initialize with default values + +% -------------------------------------------------------------- +% GENERAL DEFINITIONS +% +\renewcommand\floatpagefraction{1} +\renewcommand\textfraction{0} +% +% Overwrite page styles. Can be modified by user to make use of +% explicit or implicit (e.g. "empty" for title page or "plain" for +% first page of chapters) page style modifications +\def\ps@plain{} +\def\ps@empty{} +\def\ps@firstpage{} +\def\ps@headings{} +\def\ps@myheadings{} +\def\ps@title{} +% +\def\@linkcolor{red} +\def\@anchorcolor{blue} +\def\@citecolor{red} +\def\@filecolor{red} +\def\@urlcolor{magenta} +\def\@menucolor{red} +\def\@pagecolor{red} +% +\def\Top@Text@{\relax} +\def\@Text@{\relax} +\def\@Panel@{\relax} +\def\@User@{\relax} +% +\let\@Screen@Overlay\@empty +\let\@Text@Overlay\@empty +\let\@Panel@Overlay\@empty +\let\@User@Overlay\@empty +% +\def\emptystring{empty} +\edef\@paneltext{\emptystring} +\edef\@LogoFile{\emptystring} +\def\@LogoWidth{2cm} +\edef\@HomepageURL{\emptystring} +\edef\@LogoURL{\emptystring} + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% USER INTERFACE +% +\long\def\SetUnderTextWin#1{\gdef\@Text@{#1}} +\long\def\SetOverTextWin#1{\gdef\Top@Text@{#1}} +\long\def\SetPanelContents#1{\gdef\@Panel@{#1}} +\long\def\SetUserContents#1{\gdef\@User@{#1}} +% +\newcommand{\SetMargins}[4]{% + \global\setlength{\@LeftMargin}{#1}% + \global\setlength{\@RightMargin}{#2}% + \global\setlength{\@TopMargin}{#3}% + \global\setlength{\@BottomMargin}{#4}% + \InitLayout% +} +\newcommand{\SetPaneltext}[1]{\gdef\@paneltext{#1}} +% +\expandafter\def\csname WindowName1\endcsname{Text} +\expandafter\def\csname WindowName2\endcsname{Panel} +\expandafter\def\csname WindowName3\endcsname{User} +\expandafter\def\csname WindowRef1\endcsname{text} +\expandafter\def\csname WindowRef2\endcsname{panel} +\expandafter\def\csname WindowRef3\endcsname{user} +% +% MACROS USING KEYVAL PACKAGE +\def\SetScreen#1{\setkeys{pdfwinScreen}{#1}} +\def\SetLogo#1{\setkeys{pdfwinLogo}{#1}} +\def\SetButtons#1{\setkeys{pdfwinButtons}{#1}} +\def\SetPanelTOC#1{\setkeys{pdfwinPanelTOC}{#1}} +\def\SetWindow#1#2{% + \def\@WinName{error}% + \@tempcnta=\c@WindowCount% + \loop% + \ifnum\@tempcnta>0% + \def\tempa{#1}% + \edef\tempb{\csname WindowRef\number\@tempcnta\endcsname}% + \ifx\tempa\tempb% + \xdef\@WinName{\csname WindowName\number\@tempcnta\endcsname}% + \fi% + \advance\@tempcnta by -1% + \repeat% + \def\tempb{error}% + \ifx\@WinName\tempb% + \PDFWIN@Error{SetWindow called with wrong window name specifier '#1'}% + {you can only use 'text', 'panel' or 'user' (or your user-created% + additional specifiers) as window identifiers % + (first argument of SetWindow command)}% + \fi% + \setkeys{pdfwin}{#2}% +} +% +% SCREEN KEYS +\define@key{pdfwinScreen}{width}{\global\paperwidth=#1} +\define@key{pdfwinScreen}{height}{\global\paperheight=#1\InitLayout} +\define@key{pdfwinScreen}{filename}{\xdef\@Screen@Overlay{#1}} +\define@key{pdfwinScreen}{backgroundcolor}% + {\definecolor{ScreenBackgroundColor}{rgb}{#1}} +\define@key{pdfwinScreen}{type}{% + \def\tempa{#1}% + \def\tempb{disabled}% + \ifx\tempa\tempb\PDFWIN@Error{Disabling screen?! NO!}{\PDFWIN@ScreenErr}% + \else\def\tempb{transparent}% + \ifx\tempa\tempb\PDFWIN@Error{transparent screen?! NO!}{\PDFWIN@ScreenErr}% + \else\def\tempb{colored}% + \ifx\tempa\tempb\global\@Screen@Type=2% + \else\def\tempb{graphics}% + \ifx\tempa\tempb\global\@Screen@Type=3% + \else\def\tempb{extended}% + \ifx\tempa\tempb\global\@Screen@Type=4% + \else\def\tempb{wallpaper}% + \ifx\tempa\tempb\global\@Screen@Type=5% + \else\PDFWIN@Error{SetScreen called with wrong type specifier '#1'}{\PDFWIN@ScreenErr}% + \fi\fi\fi\fi\fi\fi% +} +\def\PDFWin@ScreenErr{Only 'colored', 'graphics', 'extended' and 'wallpaper' are % + allowed for the screen type. In contrast to windows, 'disabled' and % + 'transparent' are forbidden.} +% +% LOGO KEYS +\define@key{pdfwinLogo}{shadowcolor}% + {\definecolor{LogoShadowColor}{rgb}{#1}} +\define@key{pdfwinLogo}{uppershadowcolor}% + {\definecolor{LogoUpperShadowColor}{rgb}{#1}} +\define@key{pdfwinLogo}{filename}{\xdef\@LogoFile{#1}} +\define@key{pdfwinLogo}{width}{\xdef\@LogoWidth{#1}} +\define@key{pdfwinLogo}{shadowdepth}{\global\@LogoShadowDepth=#1} +\define@key{pdfwinLogo}{url}{\xdef\@LogoURL{#1}} +% +% BUTTONS KEYS +\def\Init@Buttons{% + \global\setlength{\@SmallButtonWidth}{.5\@ButtonWidth}% + \global\addtolength{\@SmallButtonWidth}{-\@ButtonShadowDepth}} +\define@key{pdfwinButtons}{width}{\global\@ButtonWidth=#1\Init@Buttons} +\define@key{pdfwinButtons}{shadowdepth}% + {\global\@ButtonShadowDepth=#1\Init@Buttons} +\define@key{pdfwinButtons}{backgroundcolor}% + {\definecolor{ButtonBackgroundColor}{rgb}{#1}} +\define@key{pdfwinButtons}{textcolor}% + {\definecolor{ButtonTextColor}{rgb}{#1}} +\define@key{pdfwinButtons}{htextcolor}% + {\definecolor{ButtonHighlightedTextColor}{rgb}{#1}} +\define@key{pdfwinButtons}{dtextcolor}% + {\definecolor{ButtonDisabledTextColor}{rgb}{#1}} +\define@key{pdfwinButtons}{shadowcolor}% + {\definecolor{ButtonShadowColor}{rgb}{#1}} +\define@key{pdfwinButtons}{uppershadowcolor}% + {\definecolor{ButtonUpperShadowColor}{rgb}{#1}} +\define@key{pdfwinButtons}{url}{\xdef\@HomepageURL{#1}} +% +% PANELTOC KEYS +\define@key{pdfwinPanelTOC}{textcolor}% + {\definecolor{PanelTocNormalTextColor}{rgb}{#1}} +\define@key{pdfwinPanelTOC}{backgroundcolor}% + {\definecolor{PanelTocNormalBackgroundColor}{rgb}{#1}} +\define@key{pdfwinPanelTOC}{htextcolor}% + {\definecolor{PanelTocHighlightedTextColor}{rgb}{#1}} +\define@key{pdfwinPanelTOC}{hbackgroundcolor}% + {\definecolor{PanelTocHighlightedBackgroundColor}{rgb}{#1}} +\define@key{pdfwinPanelTOC}{height}% + {\global\@PanelTOCHeight=#1} +\define@key{pdfwinPanelTOC}{transparency}{% + \def\tempa{#1}% + \def\tempb{none}% + \ifx\tempa\tempb\@PTocNTransparentfalse\@PTocHTransparentfalse% + \else\def\tempb{normal}% + \ifx\tempa\tempb\@PTocNTransparenttrue\@PTocHTransparentfalse% + \else\def\tempb{highlighted}% + \ifx\tempa\tempb\@PTocNTransparentfalse\@PTocHTransparenttrue% + \else\def\tempb{both}% + \ifx\tempa\tempb\@PTocNTransparenttrue\@PTocHTransparenttrue% + \else\PDFWIN@Error{wrong specifier '#1' for panel TOC transparency mode}% + {Only the transparency modes 'none', 'normal', 'highlighted' and% + 'both' are possible}% + \fi\fi\fi\fi% +} +% +% WINDOW KEYS +\def\Adjust@Text@Win{\InitLayout} +\def\Adjust@Panel@Win{} +\def\Adjust@User@Win{} +\define@key{pdfwin}{basex}{\global\csname @\@WinName @LLX\endcsname=#1% + \csname Adjust@\@WinName @Win\endcsname} +\define@key{pdfwin}{basey}{\global\csname @\@WinName @LLY\endcsname=#1% + \csname Adjust@\@WinName @Win\endcsname} +\define@key{pdfwin}{width}{\global\csname @\@WinName @DimX\endcsname=#1% + \csname Adjust@\@WinName @Win\endcsname} +\define@key{pdfwin}{height}{\global\csname @\@WinName @DimY\endcsname=#1% + \csname Adjust@\@WinName @Win\endcsname} +\define@key{pdfwin}{borderthickness}% + {\global\csname @\@WinName @BorderThickness\endcsname=#1} +\define@key{pdfwin}{borderradius}% + {\global\csname @\@WinName @BorderArcRadius\endcsname=#1} +\define@key{pdfwin}{filename}% + {\expandafter\xdef\csname @\@WinName @Overlay\endcsname{#1}} +\define@key{pdfwin}{backgroundcolor}% + {\definecolor{\@WinName BackgroundColor}{rgb}{#1}} +\define@key{pdfwin}{bordercolor}% + {\definecolor{\@WinName BorderColor}{rgb}{#1}} +\define@key{pdfwin}{type}{% + \def\tempa{#1}% + \def\tempb{disabled}% + \ifx\tempa\tempb\global\csname @\@WinName @WinType\endcsname=0% + \else\def\tempb{transparent}% + \ifx\tempa\tempb\global\csname @\@WinName @WinType\endcsname=1% + \else\def\tempb{colored}% + \ifx\tempa\tempb\global\csname @\@WinName @WinType\endcsname=2% + \else\def\tempb{graphics}% + \ifx\tempa\tempb\global\csname @\@WinName @WinType\endcsname=3% + \else\def\tempb{extended}% + \ifx\tempa\tempb\global\csname @\@WinName @WinType\endcsname=4% + \else\PDFWIN@Error{SetWindow called with wrong window type specifier '#1'}% + {Only the window types 'disabled', 'transparent', 'colored',% + 'graphics' and 'extended' are allowed.}% + \fi\fi\fi\fi\fi% +} +% --- user interface finished --- +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + +%========================================================== +% +% --- internal realization part starts here --- +% +% NOTE: the following commands will be written to aux-file; +% the initial value defined here is overwritten when aux-file is read. +% NOTE: \LastPageString is not necessarily an arabic number +\newcommand*{\LastPageString}{?} % for page <x> of <y> +\newcommand*{\ChapterNumber}{10} % for chapter panel +\newcommand*{\LastPage}{999} % for disabling this button +\newcommand*{\AbstractPage}{0} % for disabling this button +\newcommand*{\ContentsPage}{0} % for disabling this button +\newcommand*{\IndexPage}{0} % for disabling this button +% +% chapter-specific version of \LastPageString: +\expandafter\def\csname LastPageC0String\endcsname{???} +\expandafter\def\csname LastPageC1String\endcsname{???} +\expandafter\def\csname LastPageC2String\endcsname{???} +\expandafter\def\csname LastPageC3String\endcsname{???} +\expandafter\def\csname LastPageC4String\endcsname{???} +\expandafter\def\csname LastPageC5String\endcsname{???} +\expandafter\def\csname LastPageC6String\endcsname{???} +\expandafter\def\csname LastPageC7String\endcsname{???} +\expandafter\def\csname LastPageC8String\endcsname{???} +\expandafter\def\csname LastPageC9String\endcsname{???} +\expandafter\def\csname LastPageC10String\endcsname{???} +\expandafter\def\csname LastPageC11String\endcsname{???} +\expandafter\def\csname LastPageC12String\endcsname{???} +\expandafter\def\csname LastPageC13String\endcsname{???} +\expandafter\def\csname LastPageC14String\endcsname{???} +\expandafter\def\csname LastPageC15String\endcsname{???} +% +% WARNING: AN EVIL HACK WILL FOLLOW NOW ... CONTINUE READING AT OWN RISK ;-) +% we have to fight a fierce battle against the babel package here: +% babel writes a \select@language command at the begin of the aux-file +% (and toc, lof, lot files, if they exist). This command overwrites +% \contentsname and \abstractname. Thus, a simple definition would +% not work. +% We have to change it \emph{at the beginning of the document}. +% And additionally, we have to modify \select@language (this is +% executed at the beginning of every toc, lof, lot or aux file!). +\newcommand*{\PDFWinFightsBabelSuccessfully}{% + \renewcommand*{\contentsname}{% + \protect\hypertarget{contents}{\@Panelcontentsname}% + \immediate\write\@auxout{\string\gdef\string\ContentsPage{\number\c@RealPage}}% + }% + \renewcommand*{\abstractname}{% + \protect\hypertarget{abstract}{\@Panelabstractname}% + \immediate\write\@auxout{\string\gdef\string\AbstractPage{\number\c@RealPage}}% + }% + \renewcommand*{\indexname}{% + \protect\hypertarget{index}{\@Panelindexname}% + \immediate\write\@auxout{\string\gdef\string\IndexPage{\number\c@RealPage}}% + }% +} +\AtBeginDocument{% + \PDFWinFightsBabelSuccessfully% + \let\org@select@language\select@language% + \def\select@language#1{% + \org@select@language{#1}\PDFWinFightsBabelSuccessfully}% +} + + +% -------------------------------------------------------------- +% NEW WINDOWS +% +\def\NewWindow#1#2{% + % increase window counter + \global\advance\c@WindowCount by 1\relax% + % + % window name and reference + \expandafter\gdef\csname WindowName\number\c@WindowCount\endcsname{#1}% + \expandafter\gdef\csname WindowRef\number\c@WindowCount\endcsname{#2}% + % + % append to \Draw@PDFWinWindows + \g@addto@macro\Draw@PDFWinWindows{\@ShowWindow{#1}}% + % + % new colors and variables + \definecolor{#1BackgroundColor}{rgb}{1.0,1.0,1.0}% + \definecolor{#1BorderColor}{rgb}{.0,.0,.0}% + \expandafter\newcount\csname @#1@WinType\endcsname% + \csname @#1@WinType\endcsname=0% + \expandafter\newlength\csname @#1@LLX\endcsname% + \csname @#1@LLX\endcsname=.02\paperwidth% + \expandafter\newlength\csname @#1@LLY\endcsname% + \csname @#1@LLY\endcsname=.92\paperheight% + \expandafter\newlength\csname @#1@DimX\endcsname% + \csname @#1@DimX\endcsname=.79\paperwidth% + \expandafter\newlength\csname @#1@DimY\endcsname% + \csname @#1@DimY\endcsname=.06\paperheight% + \expandafter\newlength\csname @#1@BorderThickness\endcsname% + \csname @#1@BorderThickness\endcsname=2.0pt% + \expandafter\newlength\csname @#1@BorderArcRadius\endcsname% + \csname @#1@BorderArcRadius\endcsname=12pt% + % + % misc + \expandafter\def\csname Adjust@#1@Win\endcsname{}% + \expandafter\def\csname @#1@\endcsname{\relax}% + \long\expandafter\def\csname Set#1Contents\endcsname##1{% + \expandafter\gdef\csname @#1@\endcsname{##1}% + }% +} + + +% -------------------------------------------------------------- +% INCREMENTAL PAGE NUMBERING (e.g. 10 - 11a - 11b - 11c - 12) +% +% mechanism: in order to avoid changes on internal functions as far +% as possible, two new counters are introduced. The first one +% memorizes the basic page number (i.e. 11 in the example given +% above) and the second one is computed as the difference between +% the normal page counter (not touched!) and the first counter, +% plus offset of one. +% NOTE: no \stepcounter or \addtocounter before/after page break +% necessary for new counters; normal page counter does the job! +% +% define new counters for incremental page counting +\newcount\c@incpagea +\newcount\c@incpageb +% +% redefine (i.e. patch) \pagenumbering: +% \pagenumbering{incremental} starts incremental numbering +% \pagenumbering{restore} restores old setting +% else: old \pagenumbering definition from latex.ltx +\def\pagenumbering#1{% + \def\tempa{#1}% + \def\tempb{incremental}% + \ifx\tempa\tempb + \global\c@incpagea=\c@page% + \let\org@thepage\thepage% + % NOTE: \thepage can be modified by user after \pagenumbering{incremental} + \gdef\thepage{\arabic{incpagea}\alph{incpageb}}% + \let\org@newpage\newpage% + \def\newpage{\org@newpage\computeincpage}% + \computeincpage + \else + \def\tempb{restore}% + \ifx\tempa\tempb + \let\newpage\org@newpage% + \let\thepage\org@thepage% + \global\c@page=\c@incpagea% + \stepcounter{page} + \else + \global\c@page \@ne \gdef\thepage{\csname @#1\endcsname\c@page} + \fi + \fi +} +\def\computeincpage{% + \c@incpageb=\c@page% + \advance\c@incpageb\@ne% + \advance\c@incpageb -\c@incpagea% +} + + +% -------------------------------------------------------------- +% FONTS (can be redefined by user) +% +% setting button text font and style (button height) +%\newcommand{\SetButtonTextStyle}{\rule[-4pt]{0pt}{13pt}% +% \footnotesize\sffamily\itshape\mdseries} +\newcommand{\SetButtonTextStyle}{\rule[-3pt]{0pt}{11pt}% + \scriptsize\sffamily\itshape\mdseries} +% +% setting page info ("page x of y") font and style +% (usually the same as button text) +%\newcommand{\SetPageInfoStyle}{\rule[-4pt]{0pt}{13pt}% +% \footnotesize\sffamily\itshape\mdseries} +\newcommand{\SetPageInfoStyle}{\rule[-3pt]{0pt}{11pt}% + \scriptsize\sffamily\itshape\mdseries} +% +% setting panel toc text font and style (button height) +%\newcommand{\SetTocNTextStyle}{\rule[-3pt]{0pt}{11pt}% +% \scriptsize\sffamily\itshape\mdseries} +%\newcommand{\SetTocHTextStyle}{\rule[-3pt]{0pt}{11pt}% +% \scriptsize\sffamily\itshape\bfseries} +\newcommand{\SetTocNTextStyle}{\rule[-2pt]{0pt}{7pt}% + \tiny\sffamily\itshape\mdseries} +\newcommand{\SetTocHTextStyle}{\rule[-2pt]{0pt}{7pt}% + \tiny\sffamily\itshape\bfseries} +% +% setting font and style of the chapter panel +\newcommand{\SetChapterTextStyle}{\rule[-2pt]{0pt}{9pt}% + \sffamily\bfseries\scriptsize} +\newcommand{\SetChapterTitelStyle}{\rule[-2pt]{0pt}{7pt}% + \sffamily\bfseries\tiny} + + +% -------------------------------------------------------------- +% SECTION AND \EMPH COLORING +% +\if@coloremph\renewcommand{\emph}[1]{\textcolor{TextEmphColor}{#1}}\fi +% +\let\org@startsection\@startsection +\renewcommand{\@startsection}[6]{% + \org@startsection{#1}{#2}{#3}{#4}{#5}{#6\color{Section#2Color}}} +% +% normally redefining \@startsection should be sufficient. +% But unfortunately, it's not. Sometimes, the internal color stack +% gets mixed up and the beginning of a new page is written in a +% wrong color. The color is fixed once a differently colored text +% is printed. A work-around for section headings (which are likely to +% be affected by this bug) is printing the section number in the +% correct color. +\let\org@seccntformat\@seccntformat +\def\@seccntformat#1{\protect\textcolor{Section\thesection@level Color}% + {\org@seccntformat{#1}}\quad}% + + +% -------------------------------------------------------------- +% DYNAMIC PAGES +% +% NOTE: if you are looking at this section in order to define new +% dynamic environments and you don't really understand what's +% going on here, then I have to apologize, but some things I need +% are only possible in plain TeX and not in LaTeX, e.g. global +% (and not local) counter settings. Notice that the LaTeX counter +% abc is equivalent to the TeX counter \c@abc. +% +\newcounter{dynamicpage} \setcounter{dynamicpage}{0} +\newcounter{maxdynamicpages} \setcounter{maxdynamicpages}{5} +% +\newcommand*{\copycolor}[2]{\expandafter\let\csname\string\color @#2% + \expandafter\endcsname\csname\string\color @#1\endcsname} +% +\newcommand{\store}[1]{\long\gdef\recall{#1}\global\c@dynamicpage=0} +% +\newcommand*{\revealnext}{% + \newpage% + \global\advance\c@dynamicpage by 1% + \relax% %% otherwise the FIRST color would not be changed. Mysterious... + \copycolor{TextRevealedColor}{color\number\c@dynamicpage}% + \recall% +} +\newcommand{\initreveal}[1]{% + \@tempcnta=\c@maxdynamicpages% + \loop \ifnum\@tempcnta>0% + \copycolor{TextBackgroundColor}{color\number\@tempcnta}% + \advance\@tempcnta by -1% + \repeat% + \store{#1}% +} +\newcommand*{\highlightnext}{% + \newpage% + \@tempcnta=\c@maxdynamicpages% + \loop \ifnum\@tempcnta>0% + \copycolor{TextGrayedOutColor}{color\number\@tempcnta}% + \advance\@tempcnta by -1% + \repeat% + \global\advance\c@dynamicpage by 1% + \relax% + \copycolor{TextHighlightedColor}{color\number\c@dynamicpage}% + \recall% +} +\newcommand{\inithighlight}[1]{\store{#1}} + + +% -------------------------------------------------------------- +% BUTTON MACROS +% +% setting button color +\newcommand{\NormalButtonCol}{\color{ButtonTextColor}} +\newcommand{\FirstButtonCol}{\ifnum\number\c@RealPage=1% + \color{ButtonDisabledTextColor}\else\NormalButtonCol\fi} +\newcommand{\LastButtonCol}{\ifnum\number\c@RealPage=\number\LastPage% + \color{ButtonDisabledTextColor}\else\NormalButtonCol\fi} +\newcommand{\AbstractButtonCol}{\ifnum\number\c@RealPage=\number\AbstractPage% + \color{ButtonDisabledTextColor}\else\NormalButtonCol\fi} +\newcommand{\ContentsButtonCol}{\ifnum\number\c@RealPage=\number\ContentsPage% + \color{ButtonDisabledTextColor}\else\NormalButtonCol\fi} +\newcommand{\IndexButtonCol}{\ifnum\number\c@RealPage=\number\IndexPage% + \color{ButtonDisabledTextColor}\else\NormalButtonCol\fi} +% +% #1: box contents #2,#3 : upper/lower border colors +% \fboxrule determines the thickness of the shadow +\newcommand*{\ThreeDimBox}[3]{\bgroup% + \fboxsep0pt% + \color{#2}% + \setbox\@tempboxa\hbox{\fbox{#1}}% + \copy\@tempboxa% + \@tempcnta=10% + \@tempdimc=\fboxrule% %% increment + \divide\@tempdimc by \@tempcnta% + \color{#3}% + \@tempdima=0pt% %% width + \@tempdimb=\ht\@tempboxa% %% height + \loop% + \ifnum\@tempcnta>0% + \advance\@tempcnta by -1% + \advance\@tempdimb by -\@tempdimc% + \advance\@tempdima by \@tempdimc% + \hbox to 0pt{\hss\vrule \@width\@tempdima \@height\@tempdimb \@depth\dp\@tempboxa}% + \repeat% + \@tempcnta=10% + \@tempdima=\wd\@tempboxa% %% width + \@tempdimb=-\dp\@tempboxa% %% -depth -> height + \loop% + \ifnum\@tempcnta>0% + \advance\@tempcnta by -1% + \advance\@tempdimb by \@tempdimc% + \advance\@tempdima by -\@tempdimc% + \hbox to 0pt{\hss\vrule \@width\@tempdima \@height\@tempdimb \@depth\dp\@tempboxa}% + \repeat% +\egroup} +% +% [#1]: width (optional; default: \@ButtonWidth) #2: button text +\newcommand{\AddButton}[2][\@ButtonWidth]{\bgroup% + \fboxrule=\@ButtonShadowDepth% + \ThreeDimBox{\colorbox{ButtonBackgroundColor}% + {\hbox to #1{\hfil\NormalButtonCol\SetButtonTextStyle#2\hfil}}}% + {ButtonUpperShadowColor}{ButtonShadowColor}% +\egroup} + + +% -------------------------------------------------------------- +% PANEL MACROS +% +\newcommand*{\btl}{\ensuremath{\blacktriangleleft}} +\newcommand*{\btr}{\ensuremath{\blacktriangleright}} +% +% The default panel consists of four parts: +% [graphical logo] +% [panel TOC] +% navigation buttons +% [some text] +% parts in square brackets are optional. +% +% The panel contents are composed vertically to build a minipage +% NOTE: background color is set later +\SetPanelContents{% + \begin{minipage}[t][\@Panel@DimY][c]{\@Panel@DimX}% + \normalcolor% + \normalfont% + \PanelContents% + \end{minipage}% +} +% \PanelContents can be modified by user. The user does not need +% to know anything about the internal realization of \@Panel@ +% or \Draw<Something>. The \PanelContents level is encapsulated. +% NOTE: all \Draw<Something> commands should end with \vfill +\newcommand{\PanelContents}{% + \centering% + \vspace*{5pt}\vfill% + \DrawLogo% + \DrawPanelTOC% + \DrawNavigationPanel% + \DrawPanelText% + \vspace*{5pt}% +} +% +\def\DrawLogo{\ifx\emptystring\@LogoFile\else% + \setbox0=\hbox{\bgroup% + \fboxrule=\@LogoShadowDepth% + \ThreeDimBox{\includegraphics[width=\@LogoWidth]% + {\@LogoFile}}{LogoUpperShadowColor}{LogoShadowColor}% + \egroup}% + \ifx\emptystring\@LogoURL\mbox{\box0}\else\href{\@LogoURL}{\box0}\fi% + \par\vfill\fi% +} +% +\def\DrawPanelTOC{% + \if@paneltoc% + \ifdim\@PanelTOCHeight>0cm% fixed size? + \begin{minipage}[t][1.5cm][t]{\@Panel@DimX}% + \@panel@toc% + \end{minipage}% + \else% + \@panel@toc% + \fi% + \vfill% + \else% + \relax% + \fi% +} +% +\def\DrawPanelText{\ifx\emptystring\@paneltext\else% + \parbox{.98\@Panel@DimX}{\centering \@paneltext}\par\vfill\fi} +% +% You can change \DrawNavigationPanel with \renewcommand. +% Just copy this definition here and (un)comment and reorder +% the items in the way you like. +\newcommand{\DrawNavigationPanel}{ +% \ShowPageInfo\par\vfill + \GoToPageButton\par\vfill +% \HomePageButton\par\vfill +% \TitlePageButton\par\vfill +% \AbstractPageButton\par\vfill +% \IndexPageButton\par\vfill +% \ContentsPageButton\par\vfill + \FirstLastButton\par\vfill + \PrevNextButton\par\vfill + \BackForwardButton\par\vfill +% \BackButton\par\vfill +% \ForwardButton\par\vfill + \FullScreenButton\par\vfill + \SearchButton\par\vfill + \CloseButton\par\vfill +% \QuitButton\par\vfill +} +% +% \ShowEmptyPageInfo needs exactly the same space as \ShowPageInfo. Use this +% if you want to turn off page info for certain pages without changing the +% positions of the other panel elements +\def\ShowEmptyPageInfo{% + \bgroup% + \SetPageInfoStyle% + \egroup% +} +\def\ShowPageInfo{% + \bgroup% + \SetPageInfoStyle% + \textcolor{ButtonTextColor}{\@Panelpagename}\space% + \textcolor{ButtonHighlightedTextColor}{\thepage}% + \space\textcolor{ButtonTextColor}{\@Panelofname}\space% + \if@chapterpanel% + \textcolor{ButtonHighlightedTextColor}% + {\csname LastPageC\arabic{chapter}String\endcsname}% + \else% + \textcolor{ButtonHighlightedTextColor}{\LastPageString}% + \fi% + \egroup% +} +\def\GoToPageButton{% + \Acrobatmenu{GoToPage}{\AddButton% + {\textcolor{ButtonTextColor}{\@Panelpagename}\space% + \textcolor{ButtonHighlightedTextColor}{\thepage}\space% + \textcolor{ButtonTextColor}{\@Panelofname}\space% + \if@chapterpanel% + \textcolor{ButtonHighlightedTextColor}% + {\csname LastPageC\arabic{chapter}String\endcsname}% + \else% + \textcolor{ButtonHighlightedTextColor}{\LastPageString}% + \fi% + }}% +} +\def\HomePageButton{% + \href{\@HomepageURL}{\AddButton{\@Panelhomepagename}} +} +\def\TitlePageButton{% + \Acrobatmenu{FirstPage}{\AddButton{\FirstButtonCol\@Paneltitlepagename}}% +} +\def\AbstractPageButton{% + \ifnum\number\AbstractPage=0% + \PDFWIN@Warning{no abstract! abstract page button not possible}% + \else% + \hyperlink{abstract}{\AddButton{\AbstractButtonCol\@Panelabstractname}}% + \fi% +} +\def\ContentsPageButton{% + \ifnum\number\ContentsPage=0% + \PDFWIN@Warning{no TOC found! contents page button not possible}% + \else% + \hyperlink{contents}{\AddButton{\ContentsButtonCol\@Panelcontentsname}}% + \fi% +} +\def\IndexPageButton{% + \ifnum\number\IndexPage=0% + \PDFWIN@Warning{no index found! index button not possible}% + \else% + \hyperlink{index}{\AddButton{\ContentsButtonCol\@Panelindexname}}% + \fi% +} +\def\FirstLastButton{% + \Acrobatmenu{FirstPage}{\AddButton[\@SmallButtonWidth]% + {\FirstButtonCol\scalebox{.8}[1.4]{\btl\btl}}}% + \Acrobatmenu{LastPage}{\AddButton[\@SmallButtonWidth]% + {\LastButtonCol\scalebox{.8}[1.4]{\btr\btr}}}% +} +\def\PrevNextButton{% + \Acrobatmenu{PrevPage}{\AddButton[\@SmallButtonWidth]% + {\FirstButtonCol\scalebox{.8}[1.4]{\btl}}}% + \Acrobatmenu{NextPage}{\AddButton[\@SmallButtonWidth]% + {\LastButtonCol\scalebox{.8}[1.4]{\btr}}}% +} +\def\BackForwardButton{% + \Acrobatmenu{GoBack}{\AddButton[\@SmallButtonWidth]% + {\raisebox{-2pt}{\scalebox{2}{$\hookleftarrow$}}}}% + \Acrobatmenu{GoForward}{\AddButton[\@SmallButtonWidth]% + {\raisebox{-2pt}{\scalebox{2}{$\hookrightarrow$}}}}% +} +\def\BackButton{% + \Acrobatmenu{GoBack}{\AddButton{\@Panelgobackname}}% +} +\def\ForwardButton{% + \Acrobatmenu{GoForward}{\AddButton{\@Panelgoforwardname}}% +} +\def\FullScreenButton{% + \Acrobatmenu{FullScreen}{\AddButton{\@Panelfullscreenname}}% +} +\def\SearchButton{% + \Acrobatmenu{Find}{\AddButton{\@Panelsearchname}}% +} +\def\CloseButton{% + \Acrobatmenu{Close}{\AddButton{\@Panelclosename}}% +} +\def\QuitButton{% + \Acrobatmenu{Quit}{\AddButton{\@Panelquitname}}% +} + + +% -------------------------------------------------------------- +% PANEL TOC SECTION COUNTING +% +\def\sectionstring{section} +\def\chapterstring{chapter} +% +\def\AddPanelTocEntry#1{% + \stepcounter{ptocsection}% + \hypertarget{ptoctarget\number\c@ptocsection}{}% + \addtocontents{toc}{\protect\PTocEntry{#1}{ptoctarget\number\c@ptocsection}}% +}% +% +\let\PTocEntry\@gobbletwo + + +% -------------------------------------------------------------- +% PANEL TOC MACROS +% +% for a panel TOC we have to modify: +% * the input of the *.toc file +% * the generation of the *.toc file +% the last thing is necessary because usually the \tableofcontents +% command does BOTH jobs: the display and the generation. And +% therefore, it must only be called once in a normal LaTeX +% document. +% But for a panel TOC (i.e. a TOC an EVERY page) we have to separate +% both tasks. +% +% The original \tableofcontents is (in article class): +% \newcommand\tableofcontents{% +% \section*{\contentsname\@mkboth{\MakeUppercase\contentsname}% +% {\MakeUppercase\contentsname}}\@starttoc{toc}% +% } +% and \@starttoc does (latex base): +% \def\@starttoc#1{% +% \begingroup +% \makeatletter +% \@input{\jobname.#1}% +% \if@filesw +% \expandafter\newwrite\csname tf@#1\endcsname +% \immediate\openout \csname tf@#1\endcsname \jobname.#1\relax +% \fi +% \@nobreakfalse +% \endgroup} +% +% We separate this in two parts: \tableofcontents is redefined to +% only SHOW the toc and the WRITE command is given at the end of +% the document. +% NOTE: \makeatletter is necessary if e.g. the babel package is used: +% this package writes a \select@language command via the *.aux file +% of the last LaTeX run. Without \makeatletter, a "undefined command" +% would result because '@' is no letter anymore. +\renewcommand{\tableofcontents}{% + \section*{\contentsname\@mkboth{\MakeUppercase\contentsname}% + {\MakeUppercase\contentsname}}% + \begingroup% + \makeatletter% + \@input{\jobname.toc}% + \endgroup% +} +% +\AtEndDocument{% + \if@filesw% + \clearpage% <-- otherwise the panel toc on the last page would be lost + \newwrite\tf@toc% + \immediate\openout\tf@toc\jobname.toc\relax% + \fi +} +% On reading the *.toc file for the panel TOC, we must modify the +% display (locally, of course!): +% - disable \numberline which would produce a dotted line with +% the page number at the end. +% - count the sections in order to switch between normal and +% highlighted display +\def\@panel@toc{% + \IfFileExists{\jobname.toc}{\vbox% + \bgroup% + \rightskip0pt plus 1fill% + \hbadness=10000% + \let\numberline\@gobble% + \let\contentsline\PanelTOC@ContentsLine% + \let\PTocEntry\PanelTOC@PTocEntry% + \makeatletter% + \@input{\jobname.toc}% + \PDFWIN@Info{TOC file read}% + \egroup}% + % ELSE (file does not exist) + {\PDFWIN@Warning{TOC file not available}}% +} +% +\long\def\PanelTOC@ContentsLine#1#2#3#4{% + \edef\temp{#1}% + \ifx\temp\chapterstring% + \stepcounter{TocChapterCount}% + \fi% + \ifnum\c@TocChapterCount=\c@chapter% + \ifx\temp\sectionstring% + \stepcounter{PanelTocLine}% + \@tempcnta=\c@section% + \advance\@tempcnta by \c@ptocsection% + \ifnum\@tempcnta=\c@PanelTocLine% + \global\@PanelTocHighlighttrue% + \else% + \global\@PanelTocHighlightfalse% + \fi% + \hyperlink{#4}{\makebox[\@Panel@DimX]% + {\TOC@Button{.97\@Panel@DimX}{\truncate{.96\@Panel@DimX}{#2}}}}% + \par% + \fi% section entry detected + \fi% in actual chapter +} +% +\long\def\PanelTOC@PTocEntry#1#2{% + \stepcounter{PanelTocLine}% + \@tempcnta=\c@section% + \advance\@tempcnta by \c@ptocsection% + \ifnum\@tempcnta=\c@PanelTocLine% + \global\@PanelTocHighlighttrue% + \else% + \global\@PanelTocHighlightfalse% + \fi% + \hyperlink{#2}{\makebox[\@Panel@DimX]% + {\TOC@Button{.97\@Panel@DimX}{\truncate{.96\@Panel@DimX}{#1}}}}% + \par% +} +% +% displaying the panel TOC buttons +\def\TOC@Button#1#2{\begingroup% + \fboxsep0pt + \fboxrule0pt% + \if@PanelTocHighlight% + \if@PTocHTransparent% + {\hbox to #1{\color{PanelTocHighlightedTextColor}% + \SetTocHTextStyle\hfill#2\hfill}}% + \else% + {\colorbox{PanelTocHighlightedBackgroundColor}{\hbox to #1% + {\color{PanelTocHighlightedTextColor}\SetTocHTextStyle\hfill#2\hfill}}}% + \fi% + \else% + \if@PTocNTransparent% + {\hbox to #1{\color{PanelTocNormalTextColor}% + \SetTocNTextStyle\hfill#2\hfill}}% + \else% + {\colorbox{PanelTocNormalBackgroundColor}{\hbox to #1% + {\color{PanelTocNormalTextColor}\SetTocNTextStyle\hfill#2\hfill}}}% + \fi% + \fi% +\endgroup} + + +% -------------------------------------------------------------- +% CHAPTER PANEL MACROS +% +% (!!!) einige Sachen noch fest verdrahtet! +% +\newcommand{\ChapterBox}{% + \normalfont\normalsize% + \bgroup% + \fboxrule1pt% + \@tempcnta=0% + \@tempcntb=\number\ChapterNumber% + \advance\@tempcntb by 1% + \loop% + \ifnum\@tempcnta<\@tempcntb% + \ifnum\c@chapter=\@tempcnta% + \ifnum\@tempcnta=0% + \Acrobatmenu{FirstPage}{\Big@NoChapterButton{\@Paneltitlepagename}} + \else \ifnum\@tempcnta=16% + \hyperlink{index}{\Big@NoChapterButton{\@Panelindexname}} + \else% + \hyperlink{chapter.\number\@tempcnta}{\Big@ChapterButton{\chaptertitle}} + \fi\fi% + \else % chapter not selected + \ifnum\@tempcnta=0% + \Acrobatmenu{FirstPage}{\Small@NoChapterButton{T}} + \else\ifnum\@tempcnta=16% + \hyperlink{index}{\Small@NoChapterButton{I}} + \else% + \hyperlink{chapter.\number\@tempcnta}{\Small@ChapterButton} + \fi\fi + \fi % chapter selected? + \advance\@tempcnta by 1% + \repeat + \egroup +} +% +\newcommand{\Big@NoChapterButton}[1]{% + \ThreeDimBox{\colorbox{ChapterPanelColor0a}{% + \begin{minipage}[c][5mm]{22mm}% + \centering\SetChapterTextStyle\color{ChapterPanelColor0b}#1% + \end{minipage}% + }}{ChapterPanelColor0c}{ChapterPanelColor0d}% +} +\newcommand{\Big@ChapterButton}[1]{% + \ThreeDimBox{\colorbox{ChapterPanelColor1a}{% + \begin{minipage}[c][5mm]{22mm}% + \offinterlineskip\centering\SetChapterTextStyle\color{ChapterPanelColor1b}% + \@chapapp\space\@Roman\@tempcnta\\ \SetChapterTitelStyle #1\\ % + \end{minipage}% + }}{ChapterPanelColor1c}{ChapterPanelColor1d}% +} +\newcommand{\Small@NoChapterButton}[1]{% + \ThreeDimBox{\colorbox{ChapterPanelColor0a}{% + \begin{minipage}[c][3mm]{3mm}% + \centering\SetChapterTextStyle\color{ChapterPanelColor0b}#1% + \end{minipage}% + }}{ChapterPanelColor0c}{ChapterPanelColor0d}% +} +\newcommand{\Small@ChapterButton}{% + \ThreeDimBox{\colorbox{ChapterPanelColor1a}{% + \begin{minipage}[c][3mm]{3mm}% + \centering\SetChapterTextStyle\color{ChapterPanelColor1b}% + \@Roman\@tempcnta% + \end{minipage}% + }}{ChapterPanelColor1c}{ChapterPanelColor1d}% +} +% +\if@chapterpanel\SetUserContents{\ChapterBox}\fi + +% -------------------------------------------------------------- +% OVERLAY MACROS +% +% TeX assembles a page and calls \shipout{...} then. +% Therefore, we have to interrupt \shipout +\AtBeginDocument{% + \let\org@shipout\shipout + \let\shipout\my@shipout +} +% +% now we have to steal shipout's argument in order +% to modify it as we like +\def\my@shipout{% + \afterassignment\Test@OutBox% + \global\setbox\@cclv= % +} +\newcommand{\Test@OutBox}{% + \ifvoid\@cclv% + \relax\aftergroup\My@Output% + \else% + \My@Output% + \fi% +} + +% -------------------------------------------------------------- +% PAGE COMPOSITION +% (original page is in box 255 [or \box\@cclv]) +% +\newcommand{\My@Output}{% + \bgroup% + \@tempdima=1in% + \@tempcnta=\@tempdima% % => unit: scaled points + \@tempcntb=\paperheight% + \advance\@tempcntb by -\@tempdima% + \global\setbox\@cclv\vbox{% + \offinterlineskip% + \vbox{% + \let\protect\relax% + \unitlength=1sp% + \pictur@(0,0)(\@tempcnta,\@tempcntb)% + {\bgroup% + \setlength{\unitlength}{1pt}% + % draw background + \Draw@ScreenBackground% + % draw other windows + \Draw@PDFWinWindows% + \egroup}% + \endpicture% + }% + \vbox to 0mm{\hbox to 0mm{\box\@cclv\hss}\vss}% + \vbox{% + \let\protect\relax% + \unitlength=1sp% + \pictur@(0,0)(\@tempcnta,\@tempcntb)% + {\bgroup% + \setlength{\unitlength}{1pt} + \Draw@TopTextWindow% + \egroup}% + \endpicture% + }% + }% + \egroup% + \addtocounter{RealPage}{1}% + \org@shipout\box\@cclv% +} + + +% -------------------------------------------------------------- +% WINDOW DRAWING +% +\def\Draw@PDFWinWindows{% + \normalcolor% + \normalfont% + \@ShowWindow{Text}% + \@ShowWindow{Panel}% + \@ShowWindow{User}% +} + +\def\Draw@ScreenBackground{% + \ifcase\@Screen@Type% + \or% + \or% + % 2 = colored + \put(0,0){\bgroup\color{ScreenBackgroundColor}\vrule% + height\paperheight depth0pt width\paperwidth\egroup}% + \or% + % 3 = graphics + \put(0,0){\includegraphics[width=\paperwidth,height=\paperheight]% + {\@Screen@Overlay}}% + \or% + % 4 = extended + \put(0,0){\bgroup\color{ScreenBackgroundColor}\vrule% + height\paperheight depth0pt width\paperwidth\egroup}% + \put(0,0){\includegraphics[width=\paperwidth,height=\paperheight]% + {\@Screen@Overlay}}% + \or% + % 5 = wallpaper + \bgroup% + \setbox0=\hbox{\includegraphics{\@Screen@Overlay}}% + \setlength{\unitlength}{1sp}% + \@tempcnta=\paperwidth% + \count255=\wd0% + \divide\@tempcnta by \count255% + \setbox2=\hbox{\count255=-1% + \loop\ifnum\count255<\@tempcnta\advance\count255 by 1\copy0\repeat\hss} + \@tempcntb=\paperheight% + \count255=\ht0% + \divide\@tempcntb by \count255% + \advance\@tempcntb by 1% + \multiput(0,0)(0,\count255){\@tempcntb}{\copy2}% + \egroup% + \fi% +} +% +% show window procedure +\def\@ShowWindow#1{% + \expandafter\Win@DimX\csname @#1@DimX\endcsname% + \expandafter\Win@DimY\csname @#1@DimY\endcsname% + \expandafter\Win@LLX\csname @#1@LLX\endcsname% + \expandafter\Win@LLY\csname @#1@LLY\endcsname% + \expandafter\Win@BT\csname @#1@BorderThickness\endcsname% + \expandafter\Win@BR\csname @#1@BorderArcRadius\endcsname% + \ifcase\csname @#1@WinType\endcsname% + % 0 = disabled + \relax% + \or% + % 1 = transparent => frame+contents + \ShowWindow@Frame{#1}% + \ShowWindow@Contents{#1}% + \or% + % 2 = colored => frame+box+contents + \ShowWindow@FrameBox{#1}% + \ShowWindow@Contents{#1}% + \or% + % 3 = graphics => graphics+contents + \ShowWindow@Frame{#1}% + \ShowWindow@Graphics{#1}% + \ShowWindow@Contents{#1}% + \or% + % 4 = extended => frame+box+graphics+contents + \ShowWindow@FrameBox{#1}% + \ShowWindow@Graphics{#1}% + \ShowWindow@Contents{#1}% + \fi% +} +% +\def\ShowWindow@Frame#1{% + \bgroup + \color{#1BorderColor}% + \@tempdimb=\Win@DimY \advance\@tempdimb by \Win@BT% + \put(\strip@pt\Win@LLX,\strip@pt\Win@LLY)% + {\vrule width\Win@DimX height\@tempdimb depth-\Win@DimY}% + \put(\strip@pt\Win@LLX,\strip@pt\Win@LLY)% + {\vrule width\Win@DimX height0pt depth\Win@BT}% + \@tempdima=\Win@LLX \advance\@tempdima by -\Win@BT% + \@tempdimc=\Win@LLX \advance\@tempdimc by \Win@DimX% + \put(\strip@pt\@tempdima,\strip@pt\Win@LLY)% + {\vrule width\Win@BT height\@tempdimb depth\Win@BT}% + \put(\strip@pt\@tempdimc,\strip@pt\Win@LLY)% + {\vrule width\Win@BT height\@tempdimb depth\Win@BT}% + \egroup +} +\def\ShowWindow@FrameBox#1{% + \ifdim\Win@BR=0pt% + \ShowWindow@Frame{#1}% + \put(\strip@pt\Win@LLX,\strip@pt\Win@LLY)% + {\color{#1BackgroundColor}\vrule height\Win@DimY% + depth0pt width\Win@DimX}% + \else + \@tempdima=\Win@LLX \advance\@tempdima by -\Win@BT% + \@tempdimb=\Win@LLY \advance\@tempdimb by \Win@BR% + \@tempdimc=\Win@DimX \advance\@tempdimc by -2.0\Win@BR% + % bottom line: corners and bottom border + \dimen0\Win@BR \advance\dimen0\Win@BT % big radius + \put(\strip@pt\@tempdima,\strip@pt\@tempdimb){% + \color{#1BorderColor}% + \Left@Corner{\@height}{\@depth}% + \vrule width\@tempdimc height0pt depth\dimen0% + \Right@Corner{\@height}{\@depth}% + }% + \dimen0\Win@BR \advance\dimen0 by -0.3pt% + \put(\strip@pt\Win@LLX,\strip@pt\@tempdimb){% + \color{#1BackgroundColor}% + \Left@Corner{\@height}{\@depth}% + \vrule width\@tempdimc height0pt depth\dimen0% + \Right@Corner{\@height}{\@depth}% + }% + % top line: corners and top border + \@tempdimb=\Win@LLY \advance\@tempdimb by -\Win@BR% + \advance\@tempdimb by \Win@DimY% + \dimen0\Win@BR \advance\dimen0\Win@BT % big radius + \put(\strip@pt\@tempdima,\strip@pt\@tempdimb){% + \color{#1BorderColor}% + \Left@Corner{\@depth}{\@height}% + \vrule width\@tempdimc height\dimen0 depth0pt% + \Right@Corner{\@depth}{\@height}% + }% + \dimen0\Win@BR% + \dimen0\Win@BR \advance\dimen0 by -0.3pt% + \put(\strip@pt\Win@LLX,\strip@pt\@tempdimb){% + \color{#1BackgroundColor}% + \Left@Corner{\@depth}{\@height}% + \vrule width\@tempdimc height\dimen0 depth0pt% + \Right@Corner{\@depth}{\@height}% + }% + % middle line: side borders and center + \@tempdimb=\Win@LLY \advance\@tempdimb by .93\Win@BR% + \@tempdimc=\Win@DimY \advance\@tempdimc by -1.86\Win@BR% + \put(\strip@pt\@tempdima,\strip@pt\@tempdimb){% + \color{#1BorderColor}% + \vrule width\Win@BT height\@tempdimc depth0pt% + \color{#1BackgroundColor}% + \vrule width\Win@DimX height\@tempdimc depth0pt% + \color{#1BorderColor}% + \vrule width\Win@BT height\@tempdimc depth0pt% + }% + \fi% +} +\def\ShowWindow@Graphics#1{% + \edef\tempFileName{\csname @#1@Overlay\endcsname}% + \put(\strip@pt\Win@LLX,\strip@pt\Win@LLY)% + {\includegraphics[width=\Win@DimX,height=\Win@DimY]{\tempFileName}}% +} +\def\ShowWindow@Contents#1{% + \put(\strip@pt\Win@LLX,\strip@pt\Win@LLY)% + {\makebox(\strip@pt\Win@DimX,\strip@pt\Win@DimY)% + {\csname @#1@\endcsname}}% +} +% +\def\Draw@TopTextWindow{% + \put(\strip@pt\@Text@LLX,\strip@pt\@Text@LLY)% + {\makebox(\strip@pt\@Text@DimX,\strip@pt\@Text@DimY)% + {\Top@Text@}}% +} + + +% -------------------------------------------------------------- +% CORNER DRAWING: drawing a few black rectangles, because +% (La)TeX's graphical features are very limited... +% +% NOTE: overlap of bars is necessary to avoid white +% lines due to alialising effects. +% The straight forward method, namely putting together simple +% adjacent bars, does not work properly. +% NOTE: \p@ means 0pt. \@width, \@height, \@depth are macros for +% the strings width, height, depth. 120 calls save enough memory +% space to justify that in this section. +\def\Right@Corner#1#2{ + \vrule \@width.070\dimen0 #1 \p@ #2 1.0\dimen0 \kern-.070\dimen0% + \vrule \@width.170\dimen0 #1 \p@ #2 .99\dimen0 \kern-.170\dimen0% + \vrule \@width.221\dimen0 #1 \p@ #2 .98\dimen0 \kern-.221\dimen0% + \vrule \@width.262\dimen0 #1 \p@ #2 .97\dimen0 \kern-.262\dimen0% + \vrule \@width.296\dimen0 #1 \p@ #2 .96\dimen0 \kern-.296\dimen0% + \vrule \@width.327\dimen0 #1 \p@ #2 .95\dimen0 \kern-.327\dimen0% + \vrule \@width.354\dimen0 #1 \p@ #2 .94\dimen0 \kern-.354\dimen0% + \vrule \@width.380\dimen0 #1 \p@ #2 .93\dimen0 \kern-.380\dimen0% + \vrule \@width.403\dimen0 #1 \p@ #2 .92\dimen0 \kern-.403\dimen0% + \vrule \@width.425\dimen0 #1 \p@ #2 .91\dimen0 \kern-.425\dimen0% + \vrule \@width.446\dimen0 #1 \p@ #2 .90\dimen0 \kern-.446\dimen0% + \vrule \@width.465\dimen0 #1 \p@ #2 .89\dimen0 \kern-.465\dimen0% + \vrule \@width.484\dimen0 #1 \p@ #2 .88\dimen0 \kern-.484\dimen0% + \vrule \@width.502\dimen0 #1 \p@ #2 .87\dimen0 \kern-.502\dimen0% + \vrule \@width.519\dimen0 #1 \p@ #2 .86\dimen0 \kern-.519\dimen0% + \vrule \@width.535\dimen0 #1 \p@ #2 .85\dimen0 \kern-.535\dimen0% + \vrule \@width.550\dimen0 #1 \p@ #2 .84\dimen0 \kern-.550\dimen0% + \vrule \@width.565\dimen0 #1 \p@ #2 .83\dimen0 \kern-.565\dimen0% + \vrule \@width.579\dimen0 #1 \p@ #2 .82\dimen0 \kern-.579\dimen0% + \vrule \@width.593\dimen0 #1 \p@ #2 .81\dimen0 \kern-.593\dimen0% + \vrule \@width.606\dimen0 #1 \p@ #2 .80\dimen0 \kern-.606\dimen0% + \vrule \@width.619\dimen0 #1 \p@ #2 .79\dimen0 \kern-.619\dimen0% + \vrule \@width.632\dimen0 #1 \p@ #2 .78\dimen0 \kern-.632\dimen0% + \vrule \@width.644\dimen0 #1 \p@ #2 .77\dimen0 \kern-.644\dimen0% + \vrule \@width.656\dimen0 #1 \p@ #2 .76\dimen0 \kern-.656\dimen0% + \vrule \@width.668\dimen0 #1 \p@ #2 .75\dimen0 \kern-.668\dimen0% + \vrule \@width.679\dimen0 #1 \p@ #2 .74\dimen0 \kern-.679\dimen0% + \vrule \@width.689\dimen0 #1 \p@ #2 .73\dimen0 \kern-.689\dimen0% + \vrule \@width.699\dimen0 #1 \p@ #2 .72\dimen0 \kern-.699\dimen0% + \vrule \@width.709\dimen0 #1 \p@ #2 .71\dimen0 \kern-.709\dimen0% + % + \vrule #2 .070\dimen0 #1 \p@ \@width1.0\dimen0 \kern-1.0\dimen0% + \vrule #2 .170\dimen0 #1 \p@ \@width.99\dimen0 \kern-.99\dimen0% + \vrule #2 .221\dimen0 #1 \p@ \@width.98\dimen0 \kern-.98\dimen0% + \vrule #2 .262\dimen0 #1 \p@ \@width.97\dimen0 \kern-.97\dimen0% + \vrule #2 .296\dimen0 #1 \p@ \@width.96\dimen0 \kern-.96\dimen0% + \vrule #2 .327\dimen0 #1 \p@ \@width.95\dimen0 \kern-.95\dimen0% + \vrule #2 .354\dimen0 #1 \p@ \@width.94\dimen0 \kern-.94\dimen0% + \vrule #2 .380\dimen0 #1 \p@ \@width.93\dimen0 \kern-.93\dimen0% + \vrule #2 .403\dimen0 #1 \p@ \@width.92\dimen0 \kern-.92\dimen0% + \vrule #2 .425\dimen0 #1 \p@ \@width.91\dimen0 \kern-.91\dimen0% + \vrule #2 .446\dimen0 #1 \p@ \@width.90\dimen0 \kern-.90\dimen0% + \vrule #2 .465\dimen0 #1 \p@ \@width.89\dimen0 \kern-.89\dimen0% + \vrule #2 .484\dimen0 #1 \p@ \@width.88\dimen0 \kern-.88\dimen0% + \vrule #2 .502\dimen0 #1 \p@ \@width.87\dimen0 \kern-.87\dimen0% + \vrule #2 .519\dimen0 #1 \p@ \@width.86\dimen0 \kern-.86\dimen0% + \vrule #2 .535\dimen0 #1 \p@ \@width.85\dimen0 \kern-.85\dimen0% + \vrule #2 .550\dimen0 #1 \p@ \@width.84\dimen0 \kern-.84\dimen0% + \vrule #2 .565\dimen0 #1 \p@ \@width.83\dimen0 \kern-.83\dimen0% + \vrule #2 .579\dimen0 #1 \p@ \@width.82\dimen0 \kern-.82\dimen0% + \vrule #2 .593\dimen0 #1 \p@ \@width.81\dimen0 \kern-.81\dimen0% + \vrule #2 .606\dimen0 #1 \p@ \@width.80\dimen0 \kern-.80\dimen0% + \vrule #2 .619\dimen0 #1 \p@ \@width.79\dimen0 \kern-.79\dimen0% + \vrule #2 .632\dimen0 #1 \p@ \@width.78\dimen0 \kern-.78\dimen0% + \vrule #2 .644\dimen0 #1 \p@ \@width.77\dimen0 \kern-.77\dimen0% + \vrule #2 .656\dimen0 #1 \p@ \@width.76\dimen0 \kern-.76\dimen0% + \vrule #2 .668\dimen0 #1 \p@ \@width.75\dimen0 \kern-.75\dimen0% + \vrule #2 .679\dimen0 #1 \p@ \@width.74\dimen0 \kern-.74\dimen0% + \vrule #2 .689\dimen0 #1 \p@ \@width.73\dimen0 \kern-.73\dimen0% + \vrule #2 .699\dimen0 #1 \p@ \@width.72\dimen0 \kern-.72\dimen0% + \vrule #2 .709\dimen0 #1 \p@ \@width.71\dimen0 \kern-.71\dimen0% +} +\def\Left@Corner#1#2{ + \vrule #2 .070\dimen0 #1 \p@ \@width1.0\dimen0 \kern-.99\dimen0% + \vrule #2 .170\dimen0 #1 \p@ \@width.99\dimen0 \kern-.98\dimen0% + \vrule #2 .221\dimen0 #1 \p@ \@width.98\dimen0 \kern-.97\dimen0% + \vrule #2 .262\dimen0 #1 \p@ \@width.97\dimen0 \kern-.96\dimen0% + \vrule #2 .296\dimen0 #1 \p@ \@width.96\dimen0 \kern-.95\dimen0% + \vrule #2 .327\dimen0 #1 \p@ \@width.95\dimen0 \kern-.94\dimen0% + \vrule #2 .354\dimen0 #1 \p@ \@width.94\dimen0 \kern-.93\dimen0% + \vrule #2 .380\dimen0 #1 \p@ \@width.93\dimen0 \kern-.92\dimen0% + \vrule #2 .403\dimen0 #1 \p@ \@width.92\dimen0 \kern-.91\dimen0% + \vrule #2 .425\dimen0 #1 \p@ \@width.91\dimen0 \kern-.90\dimen0% + \vrule #2 .446\dimen0 #1 \p@ \@width.90\dimen0 \kern-.89\dimen0% + \vrule #2 .465\dimen0 #1 \p@ \@width.89\dimen0 \kern-.88\dimen0% + \vrule #2 .484\dimen0 #1 \p@ \@width.88\dimen0 \kern-.87\dimen0% + \vrule #2 .502\dimen0 #1 \p@ \@width.87\dimen0 \kern-.86\dimen0% + \vrule #2 .519\dimen0 #1 \p@ \@width.86\dimen0 \kern-.85\dimen0% + \vrule #2 .535\dimen0 #1 \p@ \@width.85\dimen0 \kern-.84\dimen0% + \vrule #2 .550\dimen0 #1 \p@ \@width.84\dimen0 \kern-.83\dimen0% + \vrule #2 .565\dimen0 #1 \p@ \@width.83\dimen0 \kern-.82\dimen0% + \vrule #2 .579\dimen0 #1 \p@ \@width.82\dimen0 \kern-.81\dimen0% + \vrule #2 .593\dimen0 #1 \p@ \@width.81\dimen0 \kern-.80\dimen0% + \vrule #2 .606\dimen0 #1 \p@ \@width.80\dimen0 \kern-.79\dimen0% + \vrule #2 .619\dimen0 #1 \p@ \@width.79\dimen0 \kern-.78\dimen0% + \vrule #2 .632\dimen0 #1 \p@ \@width.78\dimen0 \kern-.77\dimen0% + \vrule #2 .644\dimen0 #1 \p@ \@width.77\dimen0 \kern-.76\dimen0% + \vrule #2 .656\dimen0 #1 \p@ \@width.76\dimen0 \kern-.75\dimen0% + \vrule #2 .668\dimen0 #1 \p@ \@width.75\dimen0 \kern-.74\dimen0% + \vrule #2 .679\dimen0 #1 \p@ \@width.74\dimen0 \kern-.73\dimen0% + \vrule #2 .689\dimen0 #1 \p@ \@width.73\dimen0 \kern-.72\dimen0% + \vrule #2 .699\dimen0 #1 \p@ \@width.72\dimen0 \kern-.71\dimen0% + \vrule #2 .709\dimen0 #1 \p@ \@width.71\dimen0 \kern-.709\dimen0% + % + \vrule \@width.709\dimen0 #1 \p@ #2 .71\dimen0 \kern-.699\dimen0% + \vrule \@width.699\dimen0 #1 \p@ #2 .72\dimen0 \kern-.689\dimen0% + \vrule \@width.689\dimen0 #1 \p@ #2 .73\dimen0 \kern-.679\dimen0% + \vrule \@width.679\dimen0 #1 \p@ #2 .74\dimen0 \kern-.668\dimen0% + \vrule \@width.668\dimen0 #1 \p@ #2 .75\dimen0 \kern-.656\dimen0% + \vrule \@width.656\dimen0 #1 \p@ #2 .76\dimen0 \kern-.644\dimen0% + \vrule \@width.644\dimen0 #1 \p@ #2 .77\dimen0 \kern-.632\dimen0% + \vrule \@width.632\dimen0 #1 \p@ #2 .78\dimen0 \kern-.619\dimen0% + \vrule \@width.619\dimen0 #1 \p@ #2 .79\dimen0 \kern-.606\dimen0% + \vrule \@width.606\dimen0 #1 \p@ #2 .80\dimen0 \kern-.593\dimen0% + \vrule \@width.593\dimen0 #1 \p@ #2 .81\dimen0 \kern-.579\dimen0% + \vrule \@width.579\dimen0 #1 \p@ #2 .82\dimen0 \kern-.565\dimen0% + \vrule \@width.565\dimen0 #1 \p@ #2 .83\dimen0 \kern-.550\dimen0% + \vrule \@width.550\dimen0 #1 \p@ #2 .84\dimen0 \kern-.535\dimen0% + \vrule \@width.535\dimen0 #1 \p@ #2 .85\dimen0 \kern-.519\dimen0% + \vrule \@width.519\dimen0 #1 \p@ #2 .86\dimen0 \kern-.502\dimen0% + \vrule \@width.502\dimen0 #1 \p@ #2 .87\dimen0 \kern-.484\dimen0% + \vrule \@width.484\dimen0 #1 \p@ #2 .88\dimen0 \kern-.465\dimen0% + \vrule \@width.465\dimen0 #1 \p@ #2 .89\dimen0 \kern-.446\dimen0% + \vrule \@width.446\dimen0 #1 \p@ #2 .90\dimen0 \kern-.425\dimen0% + \vrule \@width.425\dimen0 #1 \p@ #2 .91\dimen0 \kern-.403\dimen0% + \vrule \@width.403\dimen0 #1 \p@ #2 .92\dimen0 \kern-.380\dimen0% + \vrule \@width.380\dimen0 #1 \p@ #2 .93\dimen0 \kern-.354\dimen0% + \vrule \@width.354\dimen0 #1 \p@ #2 .94\dimen0 \kern-.327\dimen0% + \vrule \@width.327\dimen0 #1 \p@ #2 .95\dimen0 \kern-.296\dimen0% + \vrule \@width.296\dimen0 #1 \p@ #2 .96\dimen0 \kern-.262\dimen0% + \vrule \@width.262\dimen0 #1 \p@ #2 .97\dimen0 \kern-.221\dimen0% + \vrule \@width.221\dimen0 #1 \p@ #2 .98\dimen0 \kern-.170\dimen0% + \vrule \@width.170\dimen0 #1 \p@ #2 .99\dimen0 \kern-.070\dimen0% + \vrule \@width.070\dimen0 #1 \p@ #2 1.0\dimen0% +} + + +%-------------- Verbatim fix ------------- +% This code is provided by DP Story +\newdimen\@PDFspaceleft +\def\@PDFpagespace{% + \ifdim\pagetotal=0pt + \@PDFspaceleft=\vsize + \else + \@PDFspaceleft=\pagegoal + \advance\@PDFspaceleft by-\pagetotal + \fi} +\let\@PDFverbatim\verbatim +\let\@PDFendverbatim\endverbatim +\AtBeginDocument{% + \def\verbatim{\begingroup\setbox0=\vbox\bgroup + \hsize=\linewidth% + \@PDFverbatim\verbatim@font} + \def\endverbatim{\@PDFendverbatim\egroup + \@PDFpagespace\ifdim\@PDFspaceleft>\ht0 + \else + \setbox1=\vsplit0 to\@PDFspaceleft + \verbatim@font\unvbox1 \penalty\@M + \fi + \ifvoid0\relax\else\verbatim@font\unvbox0\fi + \endgroup} + \def\@verb{\@vobeyspaces \frenchspacing\@sverb} +} +% end of DPS' code +%-------------- end of Verbatim fix ------------- + + +% -------------------------------------------------------------- +% FINAL STUFF: \AtEndDocument settings and config file input +% +\AtEndDocument{% + \clearpage% + \addtocounter{page}{-1}% + \addtocounter{RealPage}{-1}% + \immediate\write\@auxout{\string\gdef\string\LastPageString{\thepage}}% + \immediate\write\@auxout{\string\expandafter\string\gdef% + \string\csname\space LastPageC\arabic{chapter}String\string\endcsname{\thepage}}% + \immediate\write\@auxout{\string\gdef\string\LastPage{\arabic{RealPage}}}% + \immediate\write\@auxout{\string\gdef\string\ChapterNumber{\arabic{chapter}}}% + \addtocounter{page}{1}% +} + +\if@nocfg% + \relax% +\else% + \IfFileExists{pdfwin.cfg}{\input pdfwin.cfg}% + {\PDFWIN@Warning{pdfwin.cfg does not exist!}}% +\fi + +\endinput + +%%%%%%%%%%%%%%%%%%% EOF diff --git a/Master/texmf-dist/tex/latex/pdfwin/truncate.sty b/Master/texmf-dist/tex/latex/pdfwin/truncate.sty new file mode 100644 index 00000000000..a4f0ed840cb --- /dev/null +++ b/Master/texmf-dist/tex/latex/pdfwin/truncate.sty @@ -0,0 +1,158 @@ +% truncate.sty ver 3.6 20-Aug-2001 Donald Arseneau +% This LaTeX program is released to the public domain. +% +% Truncate text to a specified width: \truncate [marker]{width}{text} +% +% If the text is too wide to fit in the specified width, then it is +% truncated, and a continuation marker is shown at the end. The default +% marker, used when the optional "[marker]" parameter is omitted, is +% "\,\dots". You can change this default by redefining "\TruncateMarker" +% ("\renewcommand{\TruncateMarker}{}"). +% +% Normally, the text (whether truncated or not) is printed flush-left +% in a box with exactly the width specified. The package option "[fit]" +% ("\usepackage[fit]{truncate}") causes the output text to have its +% natural width, up to a maximum of the specified width. +% +% The text will not normally be truncated in the middle of a word, +% nor at a space specified by the tie "~". For example: +% +% "\truncate{122pt}{This text has been~truncated}" +% gives +% "This text has... " +% +% You can give one of the package options "[hyphenate]", "[breakwords]", +% or "[breakall]" to allow breaking in the middle of words. The first +% two only truncate at hyphenation points; with the difference being that +% "breakwords" suppresses the hyphen character. On the other hand, +% "breakall" allows truncation at any character. For example: +% +% "\truncate{122pt}{This text has been~truncated}" +% gives +% "This text has been trun-..." (hyphenate) +% "This text has been trun... " (breakwords) +% "This text has been trunc..." (breakall) +% +% (All of these options work through TeX's hyphenation mechanism.) +% +\ProvidesPackage{truncate}[2001/08/20 \space ver 3.6] +% +% [breakwords] allows hyphenation but with invisible hyphen characters +\DeclareOption{breakwords}{% + \let\@Trunc@DoSelect\relax + \expandafter\chardef\csname \string\@TruncHyph T1\endcsname 23 + \expandafter\chardef\csname \string\@TruncHyph OT1\endcsname 223 + \expandafter\chardef\csname \string\@TruncHyph LY1\endcsname 0 + \def\@Trunc@Post{\hyphenpenalty\tw@ \exhyphenpenalty\tw@ + \doublehyphendemerits\z@ \finalhyphendemerits\z@ + \the\@Trunc@RestHyph % set invisible hyphenchars for all fonts used + }} +% +% [breakall] is like breakwords, but all characters are treated like +% the letter "c"; the default language 0 patterns allow hyphenation +% c-c-c-c-c-c-c-c-c. This means we don't need special patterns! +\DeclareOption{breakall}{\ExecuteOptions{breakwords}% + \expandafter\def\expandafter\@Trunc@Post\expandafter{\@Trunc@Post + \@tempcnta\z@ \chardef\c`\c % in knuth patterns, c allows hyphens + \loop \lccode\@tempcnta\c \advance\@tempcnta\@ne + \ifnum\@tempcnta<\@cclvi \repeat}% + \def\@Trunc@Pre{% force US english + \lefthyphenmin\@ne \righthyphenmin\@ne + \doublehyphendemerits\language + \language\z@ % default English language + \let\language\doublehyphendemerits + \uchyph\@ne + }} +% +% [hyphenate] ordinary hyphenation for breakpoints +\DeclareOption{hyphenate}{% takes precedence over breakwords + \def\@Trunc@Post{\hyphenpenalty\sixt@@n}\let\@Trunc@Pre\relax} +% +% [fit] use true size of truncated text, not requested size. +\DeclareOption{fit}{\def\@Trunc@Rebox{% + \setbox\z@\hbox{\unhbox\z@\unskip\unskip\@tempa}% + \ifdim\wd\z@>\hsize \hbox to\hsize{\unhbox\z@}\else \box\z@ \fi}} +% +% Defaults: +\let\@Trunc@Pre\@empty +\def\@Trunc@Post{\hyphenpenalty\@M} +\def\@Trunc@Rebox{\hbox to\hsize{\unhbox\z@\unskip\unskip\@tempa\hfil}} +\let\@Trunc@DoSelect\@empty + +\ProcessOptions\relax + +\providecommand{\TruncateMarker}{\,\dots} + +\newcommand{\truncate}[3][\TruncateMarker]{% #1=marker #2=width #3=text + \parbox[b]{#2}{\tolerance9999 \emergencystretch .216\hsize + \vbadness\maxdimen \vfuzz\vsize % no overfull warnings + \hbadness\maxdimen \hfuzz\vsize + % set up hyphenchar switching for all fonts used. + \edef\@tempb{\the\@Trunc@RestHyph}% save whole stack + \global\@Trunc@RestHyph{}% + \ifx\@Trunc@DoSelect\relax + \let\@Trunc@DoSelect\selectfont + \def\selectfont{\@Trunc@DoSelect\@Trunc@SaveHChar}% + \fi + \@Trunc@SaveHChar % do it for current font + \setbox\z@\vbox\bgroup + % First set text in a hbox to see if it fits. + \setbox\z@\@@line{\ignorespaces #3\unskip\hfil}% + \ifnum\badness>\@M % text does not fit + \settowidth\rightskip{#1}% + \advance\rightskip \z@\@plus\p@ + \parfillskip-\@ne\rightskip \@plus\@ne fil + \parshape \tw@ \z@\hsize \z@\maxdimen \linepenalty60 + \tracinglostchars\z@ + %% \let\par\relax -- don't do this because \vskip causes infinite loop + \@Trunc@Pre % must set language before paragraph + \noindent \vadjust{\penalty-\@MM}% for splitting off first line + \nobreak\hskip\z@skip % allow first word hyphenation + \ignorespaces #3% the text + \pretolerance\hyphenpenalty \@Trunc@Post % set up `hyphenation' + \@@par + \ifnum\prevgraf>\@ne + \egroup \def\@tempa{#1}% use truncation marker + \else + \egroup \let\@tempa\@empty% no linebreak, so all text fits; no marker + \fi + \else + \box\z@ \egroup \let\@tempa\@empty + \fi + \setbox\@tempboxa\vsplit\z@ to\z@ \unvbox\@tempboxa + \unskip\unpenalty\unpenalty + \setbox\z@\lastbox + \nointerlineskip + \hfuzz\p@ + \@Trunc@Rebox + \let\@Trunc@HC\@firstofone \the\@Trunc@RestHyph % restore hyphenchars + \global\@Trunc@RestHyph\expandafter{\@tempb}% restore the stack itself + }} +% (Note that the text may be proessed twice. I could avoid that +% if there are problems with global counters etc.) + +% we save (implicit global) hyphenchar settings for each font on a +% manual stack -- the token register \@Trunc@RestHyph -- before changing +% them. We execute \@Trunc@RestHyph to set them to the invisible +% characters and then again to restore them. (I can't imagine this +% will ever be required.) +\newtoks\@Trunc@RestHyph +\global\@Trunc@RestHyph{} +% +\def\@Trunc@SaveHChar{\begingroup + \edef\@tempa{% + \hyphenchar\the\font=\noexpand\@Trunc@HC{\the\hyphenchar\font}\relax + \the\@Trunc@RestHyph}% + \global\@Trunc@RestHyph\expandafter{\@tempa}% +% \hyphenchar\font\z@ + \endgroup} +% +% select an invisible character for hyphenation. Use \textcompwordmark, if +% any; use selected numbers for certain encodings (OT1 uses a *missing* +% character); use a space otherwise. +\def\@Trunc@HC#1{% + \@ifundefined{\f@encoding\string\textcompwordmark}{% + \@ifundefined{\string\@TruncHyph\f@encoding}% + {32}% If no appropriate character, guess space character may be blank + {\csname \string\@TruncHyph\f@encoding\endcsname}% + }{\csname\f@encoding\string\textcompwordmark\endcsname}}% |