summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/jslectureplanner
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-02-08 21:52:29 +0000
committerKarl Berry <karl@freefriends.org>2015-02-08 21:52:29 +0000
commita26b9ff90e587a4678f1c9d38a1d87f04d14c633 (patch)
treebbc2b403b13efd16413e888ee6cd6d6e28b0fd83 /Master/texmf-dist/tex/latex/jslectureplanner
parent0ab502f9af9ef6849cd94d45fe17d88bda544056 (diff)
jslectureplanner (8feb15)
git-svn-id: svn://tug.org/texlive/trunk@36235 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/jslectureplanner')
-rw-r--r--Master/texmf-dist/tex/latex/jslectureplanner/jslectureplanner.sty203
1 files changed, 144 insertions, 59 deletions
diff --git a/Master/texmf-dist/tex/latex/jslectureplanner/jslectureplanner.sty b/Master/texmf-dist/tex/latex/jslectureplanner/jslectureplanner.sty
index 89827f0074b..b47a48a00c4 100644
--- a/Master/texmf-dist/tex/latex/jslectureplanner/jslectureplanner.sty
+++ b/Master/texmf-dist/tex/latex/jslectureplanner/jslectureplanner.sty
@@ -21,8 +21,8 @@
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\def\filedate{2015/01/17}
-\def\fileversion{0.8}
+\def\filedate{2015/02/08}
+\def\fileversion{0.9}
\def\filename{jslectureplanner.sty}
\NeedsTeXFormat{LaTeX2e}
@@ -39,10 +39,6 @@
\RequirePackage{datetime}
\RequirePackage{calc}
-%
-% Store \today
-%
-\SaveDate
%
% VARIABLES
@@ -78,9 +74,13 @@
\def\programlistbeamer{}
\def\jsbiblist{}
+
%
% STRINGS
%
+
+% 1) Course types
+%
% vl
\def\lectypevl{Vorlesung}
\def\lectypevls{VL}
@@ -111,6 +111,8 @@
\def\lectypepvs{PV}
\def\lectypepvses{Sitzung}
+% 2.) Term types
+%
% fs
\def\lectermfs{Fr\"uhjahrssemester}
\def\lectermfss{FS}
@@ -124,11 +126,31 @@
\def\lectermws{Wintersemester}
\def\lectermwss{WS}
-% misc.
+% 3.) misc.
+%
+% Suffix to cancelled sessions
\newcommand*\leccancel{\ -- keine \lectypesession}
+% Beamer program heading
\newcommand*\lecprogram{Programm}
+% Program list indentation
\newcommand*\lecprogramlistindent{\textbf{88.\,88.}}
+
+%
+% COUNTERS
+%
+\newcounter{sesunit}
+\newcounter{dateratio}
+\setcounter{dateratio}{1}
+\newcounter{cancellations}
+\newcounter{snum}
+\newcounter{blocks}
+\newcounter{fbreaks}
+\newcounter{lecinterval}
+\setcounter{lecinterval}{7}
+\newcounter{sesoffset}
+
+
%
% PACKAGE OPTIONS
%
@@ -198,6 +220,17 @@
\define@key{lec}{room}{\def\lecroom{#1}}
\define@key{lec}{startdate}{\def\lecstartdate{#1}}
\define@key{lec}{style}{\AtEndOfPackage{\input{#1.lps}}}
+\define@key{lec}{interval}{%
+ % test if the input is a number
+ % courtesy of egreg at http://tex.stackexchange.com/a/50131
+ \if\relax\detokenize\expandafter{\romannumeral-0#1}\relax
+ \setcounter{lecinterval}{#1}%
+ \else
+ \PackageError{jslectureplanner}{%
+ Value of 'interval' option must be a number\MessageBreak
+ ('#1' was given instead)}{}%
+ \fi
+}
\DeclareOptionX{title}{\setkeys{lec}{title=#1}}
\DeclareOptionX{titlesep}{\setkeys{lec}{titlesep=#1}}
@@ -211,6 +244,7 @@
\DeclareOptionX{officehours}{\setkeys{lec}{officehours=#1}}
\DeclareOptionX{room}{\setkeys{lec}{room=#1}}
\DeclareOptionX{style}{\setkeys{lec}{style=#1}}
+\DeclareOptionX{interval}{\setkeys{lec}{interval=#1}}
\ProcessOptionsX
@@ -218,6 +252,7 @@
% End Options
%%
+
%
% ALTERNATIVE SETUP MACROS
%
@@ -231,6 +266,8 @@
\newcommand*{\LecInstitute}[1]{\setkeys{lec}{institute=#1}}
\newcommand*{\LecRoom}[1]{\setkeys{lec}{room=#1}}
\newcommand*{\LecStartDate}[1]{\setkeys{lec}{startdate=#1}}
+\newcommand*{\LecInterval}[1]{\setkeys{lec}{interval=#1}}
+
%
% CONCATENATED VARIABLES
@@ -249,22 +286,13 @@
\newdateformat{vldate}{\lecdateformat}
\newdateformat{vlshdate}{\lecdateshortformat}
-%
-% COUNTERS
-%
-\newcounter{week}
-\newcounter{dateratio}
-\setcounter{dateratio}{1}
-\newcounter{cancellations}
-\newcounter{snum}
-\newcounter{blocks}
-\newcounter{fbreaks}
%
-% MACROS (UI)
+% CUSTOMIZATION OF STRINGS
%
-% Change strings
+% 1) Course types
+%
% vl
\newcommand*\DefTypeVL[3]{%
\def\lectypevl{#2}
@@ -309,6 +337,8 @@
\def\lectypepvses{#3}
}
+% 2.) Term types
+%
% fs
\newcommand*\DefTypeFS[2]{%
\def\lectermfss{#1}
@@ -330,7 +360,13 @@
\def\lectermws{#2}
}
-% Program
+
+%
+% RETRIEVE COURSE INFORMATION
+%
+
+% 1) Course program
+%
% Define labeling list if not available
\@ifundefined{labeling}{%
\newenvironment{labeling}[2][]{%
@@ -348,6 +384,8 @@
\textbf{#1\hfil\sc@septext}%
}
}{}
+%
+% Program generation
\newcommand\makeprogram{%
\raggedright
\begin{labeling}{\lecprogramlistindent}
@@ -355,11 +393,7 @@
\end{labeling}
}
-% Bibliography
-\newcommand\makesessionbib{%
- \jsbiblist
-}
-
+%
% Beamer program generation
\define@key{beamerprogram}{title}{\csdef{@bptitle}{#1}}
\define@key{beamerprogram}{options}{\csdef{@bpopts}{#1}}
@@ -463,33 +497,31 @@
\end{frame}
}
-% Beamer frame breaks
-\newcommand*\SetBeamerFrameBreak{%
- \stepcounter{fbreaks}
- \@ifundefined{programlistbeamerii}{%
- \global\let\programlistbeamerii\programlistbeamer
- }{%
- \@ifundefined{programlistbeameriii}{%
- \global\let\programlistbeameriii\programlistbeamer
- }{%
- \global\let\programlistbeameriv\programlistbeamer
- }
- }
- \global\let\programlistbeamer\empty
+
+% 2) Bibliography
+%
+\newcommand\makesessionbib{%
+ \jsbiblist
}
-% Session definition
+
+%
+% COURSE SCHEDULE SETUP
+%
+
+% 1) Session definition
+%
\define@key{session}{titlesep}{\csdef{@sestitlesep}{#1}}
\define@key{session}{subtitle}{\csdef{@vasutitle}{#1}}
\define@key{session}{shorttitle}{\csdef{@vashorttitle}{#1}}
\define@key{session}{bibsec}{\csdef{@sesbibsec}{#1}}
\define@key{session}{room}{\csdef{@sesroom}{#1}}
\define@boolkey{session}{cancel}[true]{}
-
+%
\newcommand*\NewSession[2][]{%
- \stepcounter{week}
- \setcounter{dateratio}{(\theweek-1)*7}
- \setcounter{snum}{\theweek-\thecancellations}
+ \stepcounter{sesunit}
+ \setcounter{dateratio}{(\thesesunit-1)*\thelecinterval+\thesesoffset}
+ \setcounter{snum}{\thesesunit-\thecancellations}
\protected@csxdef{sesnr\thesnum}{\thesnum}
\csdef{@sestitlesep}{}
\csdef{@vasutitle}{}
@@ -532,8 +564,11 @@
\fi
}
+% 2) Semester breaks and schedule offsets
+%
+% Set break of one interval unit
\newcommand*\SetBreak[2][\empty]{%
- \stepcounter{week}
+ \stepcounter{sesunit}
\stepcounter{cancellations}
\ifx\empty#1
\protected@eappto\programlist{\noexpand\begin{center} (#2) \noexpand\end{center}}
@@ -544,19 +579,19 @@
\fi
}
-% Beamer program hook
-\newcommand*\SetBeamerHook[1]{%
- \protected@eappto\programlistbeamer{\noexpand#1}
-}
-
-\define@key{break}{weeks}{\csdef{@breakweeks}{#1}}
+% Set break of multiple interval units
+\define@key{break}{units}{\csdef{@breakunits}{#1}}
\define@key{break}{span}{\csdef{@breakspan}{#1}}
-\newcommand*\SetBreaks[2][weeks=1]{%
- \csdef{@breakweeks}{\empty}
+\define@key{break}{weeks}{%
+ \PackageWarning{jslectureplanner}{\protect\SetBreaks\space option 'weeks' is deprecated. Use 'units' instead.}%
+ \setkeys{break}{units=#1}%
+}
+\newcommand*\SetBreaks[2][units=1]{%
+ \csdef{@breakunits}{\empty}
\csdef{@breakspan}{\empty}
\setkeys{break}{#1}
- \setcounter{week}{\theweek+\csuse{@breakweeks}}
- \setcounter{cancellations}{\thecancellations+\csuse{@breakweeks}}
+ \setcounter{sesunit}{\thesesunit+\csuse{@breakunits}}
+ \setcounter{cancellations}{\thecancellations+\csuse{@breakunits}}
\ifx\empty\csuse{@breakspan}
\protected@eappto\programlist{\noexpand\begin{center} (#2) \noexpand\end{center}}
\protected@eappto\programlistbeamer{\noexpand\begin{center} (#2) \noexpand\end{center}}
@@ -566,6 +601,13 @@
\fi
}
+% Offset in days
+\newcommand*\SetLecOffset[1]{%
+ \addtocounter{sesoffset}{#1}
+}
+
+% 3) Definition of thematic blocks
+%
\newcommand*\StartBlock[1]{%
\stepcounter{blocks}
\protected@eappto\programlist{\noexpand\item[{\noexpand\bfseries\Roman{blocks}}.]%
@@ -588,15 +630,45 @@
\newenvironment{SessionBlock}[1]{\StartBlock{#1}}{\EndBlock}
-% Infrastructure
+% 4) Beamer-specific features
+%
+% Beamer frame breaks
+\newcommand*\SetBeamerFrameBreak{%
+ \stepcounter{fbreaks}
+ \@ifundefined{programlistbeamerii}{%
+ \global\let\programlistbeamerii\programlistbeamer
+ }{%
+ \@ifundefined{programlistbeameriii}{%
+ \global\let\programlistbeameriii\programlistbeamer
+ }{%
+ \global\let\programlistbeameriv\programlistbeamer
+ }
+ }
+ \global\let\programlistbeamer\empty
+}
+
+% Beamer program hook
+\newcommand*\SetBeamerHook[1]{%
+ \protected@eappto\programlistbeamer{\noexpand#1}
+}
+
+% 5) Infrastructure
+%
+% Office hours
\newcommand\SetOfficeHours[1]{%
\def\officehours{#1}%
}
+% (E-learning) platform
\newcommand\SetPlatform[1]{%
\def\lecplatform{#1}%
}
+
+%
+% RETRIEVE SESSION-SPECIFIC INFORMATION
+%
+
% Define current session
\newcommand\ThisSession[1]{%
\gdef\sesnr{\csuse{sesnr#1}}%
@@ -609,6 +681,8 @@
\gdef\sesroom{\csuse{sesroom#1}}%
}
+% Define a local session
+% (independent of current session)
\newcommand\LocalSession[1]{%
\gdef\lsesnr{\csuse{sesnr#1}}%
\gdef\lsesdate{\csuse{sesdate#1}}%
@@ -620,37 +694,46 @@
\gdef\lsesroom{\csuse{sesroom#1}}%
}
-% Session information
+% Get information for a specific (local) session
+%
+% Full title
\newcommand*\SessionFullTitle[1]{%
\LocalSession{#1}%
\lsestitle\lsestitlesep\lsessubtitle%
}
+% Date
\newcommand*\SessionDate[1]{%
\LocalSession{#1}%
\lsesdate%
}
+% Short title
\newcommand*\SessionShortTitle[1]{%
\LocalSession{#1}%
\lsesshorttitle%
}
+% Main title
\newcommand*\SessionTitle[1]{%
\LocalSession{#1}%
\lsestitle%
}
+% Short date
\newcommand*\SessionShortDate[1]{%
\LocalSession{#1}%
\lsesshortdate%
}
+% Room
\newcommand*\SessionRoom[1]{%
\LocalSession{#1}%
\lsesroom%
}
+% Program line suitable for
+% a description or labeling list
\newcommand*\MakeProgramline[1]{%
\LocalSession{#1}%
\item[{\bfseries\lsesshortdate}]%
@@ -658,8 +741,10 @@
}
% Reset to today
-% Not needed anymore as of v. 0.8,
-% but kept for backwards compatibility reasons
-\newcommand*\ResetDate{\SetDate}
+% DEPRECATED as of v.0.8,
+\newcommand*\ResetDate{%
+ \PackageWarning{jslectureplanner}{%
+ \protect\ResetDate\space is deprecated (not needed anymore).}%
+}
% Finis