-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathxourse.cls
More file actions
154 lines (141 loc) · 4.43 KB
/
xourse.cls
File metadata and controls
154 lines (141 loc) · 4.43 KB
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
%%
%% This is file `xourse.cls',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% ximera.dtx (with options: `classXourse')
%% src/optionsxourse.dtx (with options: `classXourse')
%% src/activity.dtx (with options: `classXourse')
%% src/sectioning.dtx (with options: `classXourse')
%% src/logo.dtx (with options: `classXourse')
%% src/graded.dtx (with options: `classXourse')
%% ------------:| ------------------------------------------------------------
%% ximera:| Simultaneously writing print and online interactive materials
%% Author:| Jim Fowler and Oscar Levin and Jason Nowell and Wim Obbels and Hans Parshall and Bart Snapp
%% E-mail:| bart.snapp@gmail.com
%% License:| Released under the LaTeX Project Public License v1.3c or later
%% See:| http://www.latex-project.org/lppl.txt
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesClass{xourse}
[2024/05/12 v1.5.1
Combining Ximera activities into Xourses]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newif\ifnotoc
\notocfalse
\DeclareOption{notoc}{\notoctrue}
\newif\ifnonewpage
\nonewpagefalse
\DeclareOption{nonewpage}{\nonewpagetrue}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{ximera}}
\ProcessOptions\relax
\LoadClass{ximera}
\newcommand{\skip@preamble}{%
\let\document\relax\let\enddocument\relax%
\newenvironment{document}{\let\input\otherinput}{}%
\renewcommand{\documentclass}[2][subfiles]{}}
\let\otherinput\input
\let\othermaketitle\maketitle
\renewcommand{\maketitle}{ %
\pagestyle{empty}
\begin{center}
~\\ %puts space at top of page to move title down.
\vskip .25\textheight
\hrulefill\\
\vskip 1em
\bfseries{\Huge \@title} \\
\hrulefill\\
\vskip 3em
{\Large \@author}
\vskip 2em
{\large \@date}
\end{center}
\clearpage
\ifnotoc
\else
\tableofcontents\clearpage
\clearpage
\fi
\pagestyle{main}
\let\maketitle\othermaketitle
}
\relax
\ifnonewpage
\newcommand{\activity}[2][]{%
\setkeys{activity}{#1}
\renewcommand{\input}[1]{}
\begingroup\skip@preamble\otherinput{#2}\endgroup\par\vspace{\topsep}
\let\input\otherinput}
\else
\newcommand{\activity}[2][]{%
\setkeys{activity}{#1}
\renewcommand{\input}[1]{}
\begingroup\skip@preamble\otherinput{#2}\endgroup\clearpage
\let\input\otherinput}
\fi
\relax
\ifxake
\renewcommand\activity[2][]{}
\fi
\ifhandout
\newcommand{\practice}[2][]{
\setkeys{practice}{#1}%!!!!!
\renewcommand{\input}[1]{}
\begingroup\skip@preamble\otherinput{#2}\endgroup
\let\input\otherinput}
\else
\newcommand{\practice}[2][]{\texttt{\detokenize{#2}}%% gives file name for practice
\setkeys{practice}{#1}%!!!!!
\renewcommand{\input}[1]{}
\begingroup\skip@preamble\otherinput{#2}\endgroup
\let\input\otherinput}
\fi
\relax
\ifxake
\renewcommand\practice[2][]{}
\fi
\renewcommand*\l@section{\@dottedtocline{1}{1.5em}{4.2em}}
\renewcommand*\l@subsection{\@dottedtocline{2}{3.8em}{4.2em}}
\newcommand*{\logo}[1]{%
\ifx\@onlypreamble\@notprerr
\ClassError{xourse}{logo can only be used in the preamble}
{Move your logo command to the preamble}
\else %
\IfFileExists{#1}%
{\gdef\xourse@logo{#1}}%
{\ClassError{xourse}{logo file does not exist}
{To use logo, make sure that the referenced image file exists}}%
\fi%
}
\newenvironment{graded}[1]{}{}
%%
%% Copyright (C) 2024 by Bart Snapp <bart.snapp@gmail.com> and Jim Fowler <kisonecat@gmail.com>
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License (LPPL), either
%% version 1.3c of this license or (at your option) any later
%% version. The latest version of this license is in the file:
%%
%% http://www.latex-project.org/lppl.txt
%%
%% This work is "maintained" (as per LPPL maintenance status) by
%% Bart Snapp. The source code can be found at:
%%
%% https://github.com/XimeraProject/ximeraLatex
%%
%% This work consists of the file ximera.dtx, the associated files
%% under src/, and a Makefile.
%%
%% Running "make" generates the derived files README, ximera.pdf, ximera.cls, xourse.cls.
%%
%% Running "make inst" installs the files in the user's TeX tree.
%%
%% Running "make install" installs the files in the local TeX tree.
%%
%%
%% End of file `xourse.cls'.