summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/talk/sidebars.sty
blob: 6bdd35ecb972a8fe4f251e57b19777e663ac72bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
%% sidebars -- (sidebars.sty) style file
%% A style package for the talk class
%% Author: Martin Wiebusch
%%
%% This file may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% 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.3 or later is part of all distributions of LaTeX
%% version 2003/12/01 or later.

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{sidebars}

\newif\if@compress\@compressfalse
\DeclareOption{compress}{\@compresstrue}

\ProcessOptions\relax

\@slidesize{6in}{4.5in}

\newcommand{\backgroundcolor}[1]{\definecolor{sb@bg}{rgb}{#1}}
\newcommand{\sidebarcolor}[1]{\definecolor{sb@sb}{rgb}{#1}}
\newcommand{\highlightcolor}[1]{\definecolor{sb@hl}{rgb}{#1}}
\newcommand{\titlecolor}[1]{\definecolor{sb@title}{rgb}{#1}}
\newcommand{\sidebartitlecolor}[1]{\definecolor{sb@sbt}{rgb}{#1}}

\backgroundcolor{1,1,1}
\sidebarcolor{0.85,0.85,0.85}
\highlightcolor{0,0,0.7}
\titlecolor{0,0,0.7}
\sidebartitlecolor{0,0,0.7}

\@newslidestyle{normal}{%
  \renewcommand{\@makeslidebackground}{%
    \color{sb@bg}
    \pgfrect[fill]{\pgfpoint\z@\z@}{\pgfpoint\slidewidth\slideheight}%
    \color{sb@sb}%
    \pgfrect[fill]{\pgfpoint{5in}\z@}{\pgfpoint{1in}\slideheight}%
    \@ifscreen{}{%
      \color{black}%
      \pgfrect[stroke]{\pgfpoint\z@\z@}{\pgfpoint\slidewidth\slideheight}%
    }%
  }%
  \renewcommand{\@makeslidecontent}{%
    \begin{pgfpicture}\z@\z@\z@\z@
      \pgfputat{\pgfpoint{5.1in}{-0.2in}}{%
        \pgfbox[left,top]{%
          \begin{minipage}[t][4.2in]{0.8in}%
            \sffamily\tiny%
            {\centering\tiny\sffamily\textcolor{sb@sbt}{\@shorttitle}\par%
             \vspace{1em}\@shortauthor\par\vspace{2em}}%
            {\parskip=0.8em\@tableofcontents}%
            {\vfill\hspace*{\fill}p. \theslidelabel\hspace*{\fill}}%
          \end{minipage}%
        }%
      }%
      \pgfputat{\pgfpoint{0.2in}{-0.2in}}{%
        \pgfbox[left,top]{%
          \begin{minipage}[t][4.1in]{4.6in}%
            \sffamily{\color{sb@title}\LARGE\@slidetitle\par}%
            \vspace*{1.5em plus 1fill}%
            \parskip=1.5ex plus0.5ex minus0.5ex\@slidebody\par%
            \vspace*{0pt plus 1fill}%
          \end{minipage}%
        }%
      }%
    \end{pgfpicture}
  }
  \renewcommand{\@maketocsection}[3]{%
    \raggedright\noindent%
    \@ifcurrentsection{##1}{%
      \@ifcurrentsubsection{0}{\textcolor{sb@hl}{##2}\par}%
                              {##2\par}%
    }{##2\par}%
  }%
  \renewcommand{\@maketocsubsection}[4]{%
    \raggedright\noindent%
    \@ifcurrentsection{##1}{%
      \@ifcurrentsubsection{##2}{%
        {\leftskip=1.5em\textcolor{sb@hl}{##3}\par}%
      }{%
        {\leftskip=1.5em ##3\par}%
      }%
    }{%
      \if@compress\else{\leftskip=1.5em ##3\par}\fi
    }%
  }%
}

\@newslidestyle{plain}{%
  \renewcommand{\@makeslidebackground}{%
    \color{sb@bg}
    \pgfrect[fill]{\pgfpoint\z@\z@}{\pgfpoint\slidewidth\slideheight}%
    \@ifscreen{}{%
      \color{black}%
      \pgfrect[stroke]{\pgfpoint\z@\z@}{\pgfpoint\slidewidth\slideheight}%
    }%
  }%
  \renewcommand{\@makeslidecontent}{\vspace*{\fill}\@slidebody\vspace*{\fill}}%
}

\@newslidestyle{outline}{%
  \renewcommand{\@makeslidebackground}{%
    \color{sb@bg}
    \pgfrect[fill]{\pgfpoint\z@\z@}{\pgfpoint\slidewidth\slideheight}%
    \color{sb@sb}
    \pgfrect[fill]{\pgfpoint\z@\z@}{\pgfpoint{0.5in}\slideheight}%
    \pgfrect[fill]{\pgfpoint{5.5in}\z@}{\pgfpoint{0.5in}\slideheight}%
    \@ifscreen{}{%
      \color{black}%
      \pgfrect[stroke]{\pgfpoint\z@\z@}{\pgfpoint\slidewidth\slideheight}%
    }%
  }%
  \renewcommand{\@makeslidecontent}{%
    \vspace{0.2in}%
    \hspace{0.7in}%
    \begin{minipage}[b][4.1in][t]{4.6in}%
      \sffamily%
      {\centering\LARGE\color{sb@title}\@slidetitle\par}%
      \vspace*{1.5em plus 1fill}\@slidebody\par%
      \vspace*{0pt plus 1fill}%
    \end{minipage}%
  }%
}

\renewcommand{\maketitle}{%
  \sffamily%
  {\centering%
    {\color{sb@sbt}\LARGE\@title\par}\vspace{3em}%
    {\large\@author\par}\vspace{1.5em}%
    {\large\@date\par}
  }%
}
\renewcommand{\tableofcontents}[1][0.0-99.99]{%
  \bgroup\parskip=0.4em\hangafter=1%
  \def\@maketocsection##1##2##3{%
    \@ifinrange{##1}{0}{#1}{{
      \hangindent=2.5em%
      \hspace{2em}\makebox[\z@][r]{##1.}\hspace{0.5em}##3\par%
    }}{}%
  }
  \def\@maketocsubsection##1##2##3##4{%
    \@ifinrange{##1}{##2}{#1}{{%
      \hangindent=3.5em
      \hspace{2.5em}\makebox[\z@][l]{$\bullet$}\hspace{1em}##3\par%
    }}{}%
  }
  \@tableofcontents
  \egroup
}

\@ifnotes{%
  \addtolength{\textwidth}{1in}
  \addtolength{\oddsidemargin}{-0.5in}
}{}

\setlength{\parindent}{\z@}
\slidestyle{normal}
\sloppy