| 1 |
% Patch cnltx-doc class |
| 2 |
\AddToHook{class/scrartcl/after}{ |
| 3 |
\NewCommandCopy{\originalAfterPackage}{\AfterPackage} |
| 4 |
\RenewDocumentCommand{\AfterPackage}{t! m m}{ |
| 5 |
\IfBooleanTF{#1}{#3}{% |
| 6 |
\originalAfterPackage{#2}{#3} |
| 7 |
} |
| 8 |
} |
| 9 |
} |
| 10 |
\makeatother |
| 11 |
\typeout{*** Patch cnltx-doc} |
| 12 |
\documentclass[ |
| 13 |
babel-options={english}, |
| 14 |
load-preamble-, |
| 15 |
title=compact |
| 16 |
]{cnltx-doc} |
| 17 |
|
| 18 |
\usepackage[oldstyle]{libertine} |
| 19 |
\usepackage[scaled=.81]{DejaVuSansMono} |
| 20 |
\usepackage{enumitem} |
| 21 |
% Since the cnltx class doesn't do examples with lualatex, |
| 22 |
% we can't include our package. |
| 23 |
% Thus, we use readprov to get file information. |
| 24 |
\usepackage{readprov} |
| 25 |
\ReadFileInfos{seatingchart.sty} |
| 26 |
|
| 27 |
\providecommand{\packagename}{seatingchart} |
| 28 |
\def\thepkg{\pkg*{\packagename}} |
| 29 |
\setcnltx{ |
| 30 |
name = seatingchart, |
| 31 |
package = \packagename, |
| 32 |
version = \UseVersionOf{\packagename.sty}, |
| 33 |
date = \UseDateOf{\packagename.sty}, |
| 34 |
title = The \pkg*{seatingchart} Package, |
| 35 |
info = Generation and visualization of seating plans, |
| 36 |
authors = {Matthias Werner[[email protected]]}, |
| 37 |
abstract={ |
| 38 |
This package allows for easy creation of seating charts, such as those |
| 39 |
required for examinations. |
| 40 |
Several automatic placement schemes are predefined, but custom, fine-grained |
| 41 |
seat assignments can also be specified. |
| 42 |
While the package was initially intended for internal use at Chemnitz |
| 43 |
University of Technology and contains predefined seating layouts for (some) |
| 44 |
of the rooms of TUC, on the one hand the room data can be easily |
| 45 |
expanded or replaced, and on the other hand rooms can also be created ad |
| 46 |
hoc. |
| 47 |
}, |
| 48 |
url =https://github.com/tuc-osg/seatingchart, |
| 49 |
build-title |
| 50 |
} |
| 51 |
\def\thepkg{\pkg*{\packagename}} |
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
\begin{document} |
| 56 |
\section{Introduction} |
| 57 |
To conduct exams, we occasionally require seating plans. |
| 58 |
Over time, we have accumulated several such plans in the form of TikZ-supported |
| 59 |
\LaTeX\ files. |
| 60 |
Depending on the number of students in an exam—and how high we assess the |
| 61 |
risk of attempted cheating—we apply different placement schemes, which |
| 62 |
requires adapting the files accordingly. |
| 63 |
Moreover, we are sometimes assigned new rooms for which no seating plans exist yet. |
| 64 |
|
| 65 |
This was the motivation for developing the \thepkg\ package. It \ldots |
| 66 |
\begin{itemize}%[itemsep=0pt] |
| 67 |
\item enables quick and easy creation of seating plans; |
| 68 |
\item separates seat layout from the placement scheme; |
| 69 |
\item offers a set of standard placement schemes; |
| 70 |
\item includes a number of predefined rooms with seat layouts; |
| 71 |
\item allows for \emph{ad hoc} creation of new rooms and placement schemes. |
| 72 |
\end{itemize} |
| 73 |
|
| 74 |
\section{Dependencies} |
| 75 |
The \thepkg\ package works only with Lua\LaTeX\ and requires a sufficiently |
| 76 |
modern \LaTeX\ version, at least from July 2022. |
| 77 |
It loads the following packages: |
| 78 |
\begin{itemize}%[nosep] |
| 79 |
\item \pkg{etoolbox} |
| 80 |
\item \pkg{luacode} |
| 81 |
\item \pkg{tikz} |
| 82 |
\end{itemize} |
| 83 |
These packages are available in all major \TeX\ distributions and themselves |
| 84 |
depend on other packages. |
| 85 |
In particular, \pkg*{tikz} loads the \pkg{xcolor} package, whose color definitions |
| 86 |
are also used by \thepkg. |
| 87 |
|
| 88 |
\section{Seat Layout} |
| 89 |
\label{sec:layout} |
| 90 |
The package is loaded as usual with |
| 91 |
\cs{usepackage}\oarg{options}\{\thepkg\} |
| 92 |
|
| 93 |
This allows the layout of the seats—i.e., their arrangement in the room— |
| 94 |
to be defined right away. Seat assignment is done later; |
| 95 |
see Section~\ref{sec:seat-assignment}. |
| 96 |
|
| 97 |
\subsection{Class Options} |
| 98 |
\label{sec:class-options} |
| 99 |
The use of the option \option{room} distinguishes between two fundamental use cases: |
| 100 |
\begin{options} |
| 101 |
\keyval{room}{Room} This option key should be used if the desired room |
| 102 |
is already predefined. |
| 103 |
\keyval{layout}{institution}\Default{tu-chemnitz} |
| 104 |
The data for the predefined rooms is read |
| 105 |
from \code{seatingchart-}\meta{institution}\code{.sc}. |
| 106 |
This key can be used if own predefined rooms have been declared, see |
| 107 |
Section~\ref{sec:new-rooms}. |
| 108 |
\end{options} |
| 109 |
If the room is not already known, it can also be created \emph{ad hoc}, whereas |
| 110 |
several key–value options are required to describe the layout: |
| 111 |
|
| 112 |
\begin{options} |
| 113 |
\keychoice{shape}{rectangle,arc}\Default{rectangle} |
| 114 |
Specifies whether the seating layout is rectangular (\choices{rectangle}) or curved (\choices{arc}).% |
| 115 |
\footnote{For example, room A10.316 at TU~Chemnitz uses an arc layout.} |
| 116 |
|
| 117 |
\keyval{rows}{number}\Default*!{}\vspace{-.3\baselineskip} |
| 118 |
\keyval{seats per row}{number}\Default!{} |
| 119 |
Defines the number of seat rows and seats per row. The maximum number must always be specified here. |
| 120 |
For incomplete rows, seats will be removed later, but no additional seats can be added that lie outside |
| 121 |
the originally defined layout area. |
| 122 |
\textbf{Note:} Aisles between blocks of seats must be counted here as seats as well. |
| 123 |
\end{options} |
| 124 |
|
| 125 |
If you specify \textbf{both} the \option*{room} key \textbf{and} one of the keys |
| 126 |
\option*{rows} or \option*{seats per row} in the class options, the result is undefined. |
| 127 |
A warning will be issued in that case.\medskip |
| 128 |
|
| 129 |
All further class options define the visual representation of the room layout. |
| 130 |
They can also be set later using \cs{scConfig}; see Section~\ref{sec:late-options}. |
| 131 |
|
| 132 |
\begin{options} |
| 133 |
\keybool{blackboard}\Default{false} |
| 134 |
Draws a blackboard. |
| 135 |
|
| 136 |
\keyval{seat distance}{distance}\Default{2pt} |
| 137 |
Distance between seats. This also determines the row spacing. |
| 138 |
If you want these two values to differ, you must use the following keys: |
| 139 |
|
| 140 |
\keyval{seat neighbor distance}{Distance}\Default*{2pt}\vspace{-.3\baselineskip} |
| 141 |
\keyval{row distance}{distance}\Default{2pt} |
| 142 |
|
| 143 |
\keychoice{rownumbers}{none,left,right,both}\Default{none} |
| 144 |
For rectangular layouts, defines whether to display row numbers on the left, right, or both sides. |
| 145 |
Counting starts at the front (blackboard side).\newline |
| 146 |
\emph{Note:} For arc-shaped layouts, this function is currently not implemented. |
| 147 |
|
| 148 |
\keyval{rownumber distance}{distance}\Default{2pt} |
| 149 |
Distance between the row number and the outermost seats, |
| 150 |
if \option*{rownumbers} is not \code{none}. |
| 151 |
|
| 152 |
\keyval{empty seat background color}{color}\Default*{lightgray!20}\vspace{-.3\baselineskip} |
| 153 |
\keyval{empty seat border color}{color}\Default*{lightgray}\vspace{-.3\baselineskip} |
| 154 |
\keyval{assigned seat background color}{color}\Default*{lightgray!30}\vspace{-.3\baselineskip} |
| 155 |
\keyval{assigned seat border color}{color}\Default{black} |
| 156 |
Defines background and border colors for empty or assigned seats. |
| 157 |
The syntax of color names follows the specification of the \pkg*{xcolor} |
| 158 |
package. |
| 159 |
If the seats should not be differentiated by color, the keys |
| 160 |
\keyval-{seat background color}{color}\Default*\vspace{-.3\baselineskip} |
| 161 |
\keyval-{seat border color}{color}\Default |
| 162 |
can also be used. |
| 163 |
\keyval{assigned seat label font}{font command}\Default*{\cs*{small}}\vspace{-.3\baselineskip} |
| 164 |
\keyval-{assigned seat label color}{color}\Default{black} |
| 165 |
Sets the size and color of the seat label. |
| 166 |
\end{options} |
| 167 |
|
| 168 |
\subsection{Late Option Selection} |
| 169 |
\label{sec:late-options} |
| 170 |
\begin{commands} |
| 171 |
\command{scConfig}This command can be used to set all keys mentioned in |
| 172 |
Section~\ref{sec:class-options}, except for |
| 173 |
\option{room}, \option{shape}, \option{rows}, and \option{seats per row}, |
| 174 |
outside of the \cs*{documentclass} options. |
| 175 |
\end{commands} |
| 176 |
|
| 177 |
\subsection{Modifying the Seat Layout} |
| 178 |
\label{sec:modify-layout} |
| 179 |
Often, not all seats are present in every row. |
| 180 |
This is already taken into account when specifying a predefined room, |
| 181 |
but it may still be necessary to remove individual seats — for instance, |
| 182 |
if a folding seat is broken. |
| 183 |
|
| 184 |
When creating a custom layout, such modifications are typically required. |
| 185 |
For this purpose, \pkg\ provides the following commands: |
| 186 |
\begin{commands} |
| 187 |
\command{scRemoveSeatAt}[\marg{row}\marg{seat number}] |
| 188 |
Removes seat \meta{seat number} in row \meta{row} from the layout. |
| 189 |
The values refer to the original layout and are unaffected by previously removed seats. |
| 190 |
If \meta{seat number} is negative, counting starts from the right. |
| 191 |
|
| 192 |
\command{scRemoveSeats}[\marg{list}] |
| 193 |
Removes all seats listed in the comma-separated \meta{list}, where each entry |
| 194 |
is of the form \code{\{\meta{row},\meta{seat number}\}}. |
| 195 |
As with \cs*{scRemoveSeatAt}, row and seat numbers refer to the original layout. |
| 196 |
In the following example, the first three seats on the left and the first seat |
| 197 |
on the right in the first row are removed: \vspace{-.3\baselineskip} |
| 198 |
|
| 199 |
\begin{example}[code-only] |
| 200 |
\scRemoveSeats{{1,1},{1,2},{1,3},{1,-1}} |
| 201 |
\end{example}\vspace{-1.3\baselineskip} |
| 202 |
|
| 203 |
\command{scSetAisle}[\Oarg{\meta{start row}-\meta{end row}}\marg{seat number}] |
| 204 |
Inserts an aisle at the position of \meta{seat number} through all rows. |
| 205 |
Use the optional argument if the aisle should not span all rows. |
| 206 |
|
| 207 |
For horizontal aisles (which split a seat block into front and back instead of |
| 208 |
left and right), |
| 209 |
please use \cs*{scRemoveSeats}. |
| 210 |
|
| 211 |
While this is also possible for vertical aisles, automatically generated |
| 212 |
seating schemes may treat aisles created via \cs*{scSetAisle} differently |
| 213 |
than those created with \cs*{scRemoveSeats}. |
| 214 |
\end{commands} |
| 215 |
|
| 216 |
\subsection{Output} |
| 217 |
\label{sec:drawing} |
| 218 |
|
| 219 |
\begin{commands} |
| 220 |
\command{scDrawSeating}[\Oarg{seat width=\meta{width}, seat |
| 221 |
height=\meta{height}}] |
| 222 |
Renders the seating plan. \thepkg\ attempts to calculate the seat dimensions |
| 223 |
so that the available space for the complete plan is fully utilized. |
| 224 |
Since this may not always meet all needs, the optional argument allows |
| 225 |
the width and height of the seats on the plan to be adjusted individually. |
| 226 |
|
| 227 |
\end{commands} |
| 228 |
|
| 229 |
The following example shows the code and the result for a simple seating layout |
| 230 |
with a central aisle and two missing seats in the first row. |
| 231 |
\begin{example}[compile,program=lualatex,pages=1,add-frame,code-sep=\bigskip,graphics={scale=.25}] |
| 232 |
\documentclass{article} |
| 233 |
\usepackage[shape=rectangle, rows = 9, seats per row=15]{seatingchart} |
| 234 |
\begin{document} |
| 235 |
\scSetAisle{8} |
| 236 |
\scRemoveSeats{{1,1},{1,2}} |
| 237 |
\scDrawSeating |
| 238 |
\end{document} |
| 239 |
\end{example} |
| 240 |
|
| 241 |
\section{Seat Assignment} |
| 242 |
\label{sec:seat-assignment} |
| 243 |
|
| 244 |
\subsection{Parameters for Constructing Assignment Schemes} |
| 245 |
\label{sec:constr-scheme} |
| 246 |
|
| 247 |
A seating plan is only partially useful without indicating which seats are occupied. |
| 248 |
In \thepkg, seat assignment is handled via assignment schemes. |
| 249 |
To define such a scheme, the command |
| 250 |
|
| 251 |
\begin{commands} |
| 252 |
\command{scSeatingScheme}[\oarg{key list}\marg{name}] \vspace{-1.7\baselineskip} |
| 253 |
\command{scSeatingScheme}[\sarg\oarg{key list}\marg{pattern}] |
| 254 |
The mandatory argument, in the standard version of the command, |
| 255 |
is a name for a predefined seating scheme (see Section~\ref{sec:defined-schemes}). |
| 256 |
In the starred version, a string of "`\code{X}"’ and "`\code{-}"’ is passed, |
| 257 |
describing (the beginning of) a row assignment pattern, where |
| 258 |
"`\code{X}"’ denotes an occupied seat and "`\code{-}"’ an empty one. |
| 259 |
If the string is shorter than the number of seats in a row, it will be repeated. |
| 260 |
|
| 261 |
For example, |
| 262 |
\begin{example}[code-only]\vspace{-1.3\baselineskip} |
| 263 |
\scSeatingScheme*{X--} |
| 264 |
\end{example}\vspace{-1.3\baselineskip} |
| 265 |
marks every third seat as occupied. |
| 266 |
|
| 267 |
The optional argument accepts a list of key–value pairs that control the remaining |
| 268 |
settings of the assignment scheme. |
| 269 |
These are especially important in the starred variant but may also be used |
| 270 |
in the standard one. |
| 271 |
|
| 272 |
\begin{options} |
| 273 |
\keyval-{row sep}{number}\Default{2} |
| 274 |
Specifies how many rows should lie between two occupied rows. |
| 275 |
|
| 276 |
\keyval-{start row}{row} |
| 277 |
First row to be included in the assignment. |
| 278 |
|
| 279 |
\keyval-{end row}{row} |
| 280 |
Last row to be included in the assignment. |
| 281 |
|
| 282 |
\keyval-{row restart after}{number}\Default |
| 283 |
Resets the seat pattern after \meta{number} rows. This allows for alternating |
| 284 |
row spacing; see the example in Section~\ref{sec:ex:own1}. |
| 285 |
|
| 286 |
\keyval-{aisle counts}{number}\Default{1} |
| 287 |
Specifies how many seats wide an aisle should be considered. This allows |
| 288 |
for wider aisles to be taken into account. |
| 289 |
|
| 290 |
\keybool{aisle restarts scheme}\Default{false} |
| 291 |
Restarts the scheme after an aisle. In that case, the \option*{aisle counts} |
| 292 |
key has no effect. |
| 293 |
|
| 294 |
\keybool{ignore aisle}\Default*{false}\vspace{-.3\baselineskip} |
| 295 |
\keybool{ignore removed seats}\Default{false} |
| 296 |
When determining seat numbers (used e.g. in labels; see |
| 297 |
Section~\ref{sec:seat-label}), aisles and removed seats are normally counted. |
| 298 |
This ensures that seat numbers are consistent across rows (in rectangular layouts). |
| 299 |
If one of these keys is set, aisles or removed seats are no longer counted. |
| 300 |
This is particularly useful in curved layouts. |
| 301 |
|
| 302 |
\keyval{assigned seat label}{format string}\Default{m{{\,}}D} |
| 303 |
Specifies how assigned seats should be labeled. |
| 304 |
By default, this consists of the row number, a thin space, |
| 305 |
and a letter for the current occupied seat |
| 306 |
(e.g., "`3\,c"'). A number of other formats can be configured; |
| 307 |
see Section~\ref{sec:seat-label} for details. |
| 308 |
\end{options} |
| 309 |
|
| 310 |
\command{scConfigScheme\marg{key list}} |
| 311 |
Sets keys just like the optional argument of \cs*{scSeatingScheme}, |
| 312 |
but does not assign seats. |
| 313 |
\end{commands} |
| 314 |
|
| 315 |
Key values set by \cs*{scSeatingScheme} or \cs*{scConfigScheme} |
| 316 |
remain in effect until they are explicitly redefined. |
| 317 |
|
| 318 |
\subsection{Predefined Seating Schemes} |
| 319 |
\label{sec:defined-schemes} |
| 320 |
The \thepkg\ package defines a set of predefined seating schemes. |
| 321 |
Some of them also have alternative names. |
| 322 |
\begin{options} |
| 323 |
\opt{1x1} |
| 324 |
Every seat is marked.\newline Alternative name: \option{all} |
| 325 |
|
| 326 |
\opt{2x2} |
| 327 |
One empty seat and one empty row between two occupied ones.\newline Alternative name: \option{simple} |
| 328 |
|
| 329 |
\opt{2x2-} |
| 330 |
One empty seat between two occupied ones. After a single empty row, |
| 331 |
\emph{two} rows with occupied seats follow. |
| 332 |
This scheme allows the largest number of students in a room during an exam |
| 333 |
while still maintaining minimal lateral distance and enabling supervision |
| 334 |
to reach every student (from the front or the back).\newline Alternative name: \option{dense} |
| 335 |
|
| 336 |
\opt{2x3} |
| 337 |
Occupied seats have two empty seats between them laterally, |
| 338 |
and one empty row between occupied rows. |
| 339 |
This is considered the preferred default scheme for exams in our group.\newline Alternative name: \option{sixpack} |
| 340 |
|
| 341 |
\opt{2x3-} |
| 342 |
Rows are occupied as in \option{2x2-}, but the lateral spacing |
| 343 |
within an occupied row is two seats. |
| 344 |
|
| 345 |
\opt{2x4} |
| 346 |
Occupied seats have three empty seats between them laterally, |
| 347 |
and one empty row between occupied rows. |
| 348 |
|
| 349 |
\opt{3x4} |
| 350 |
Occupied seats have three empty seats between them laterally, |
| 351 |
and two empty rows between occupied rows. |
| 352 |
\end{options} |
| 353 |
|
| 354 |
\subsection{Seat Labeling} |
| 355 |
\label{sec:seat-label} |
| 356 |
The labeling of assigned seats can be done in various ways, controlled by |
| 357 |
assigning a format string to the key \option{assigned seat label}. |
| 358 |
Four counters are available for this purpose: |
| 359 |
\begin{itemize} |
| 360 |
\item absolute row: the row number in the seat layout |
| 361 |
\item occupied row: the number of the \emph{assigned} row. |
| 362 |
Rows without any assigned seats are skipped. |
| 363 |
\item absolute seat number: the seat number in the seat layout. |
| 364 |
Whether removed seats are counted depends on the value of |
| 365 |
\option*{ignore removed seats}. |
| 366 |
\item occupied seat number: the number of the \emph{assigned} seats. |
| 367 |
Unassigned seats are skipped in this count. |
| 368 |
\end{itemize} |
| 369 |
Each of these counters can be formatted differently. |
| 370 |
For this, the format string uses format specifiers listed in the following table:\medskip |
| 371 |
|
| 372 |
\begin{tabular}{llccccc}\hline |
| 373 |
\textbf{\sffamily Counter}&\textbf{\sffamily Description}&\multicolumn{5}{c}{\textbf{\sffamily Rendered as\ldots}}\\ |
| 374 |
&&\rotatebox{90}{Arabic numeral}&\rotatebox{90}{lowercase letter}&\rotatebox{90}{uppercase letter}& |
| 375 |
\rotatebox{90}{lower Roman numeral}&\rotatebox{90}{upper Roman numeral}\\\hline |
| 376 |
absolute row&\emph{based on seat layout}&\code{m}&\code{a}&\code{A}&\code{y}&\code{Y}\\ |
| 377 |
occupied row&\emph{based on assigned rows}&\code{r}&\code{b}&\code{B}&\code{i}&\code{I}\\ |
| 378 |
absolute seat number&\emph{based on seat layout}&\code{n}&\code{c}&\code{C}&\code{x}&\code{X}\\ |
| 379 |
occupied seat number&\emph{based on assigned seats}&\code{s}&\code{d}&\code{D}&\code{j}&\code{J}\\\hline |
| 380 |
\end{tabular}\medskip |
| 381 |
|
| 382 |
\noindent |
| 383 |
Parts of the label that should not be interpreted as format specifiers must be |
| 384 |
wrapped in double braces: \code{\{\{\meta{protected string}\}\}}. |
| 385 |
|
| 386 |
For example,\vspace{-1.3\baselineskip} |
| 387 |
\begin{example}[code-only] |
| 388 |
\scSeatingScheme[assigned seat label=Y{{-}}D]{2x3} |
| 389 |
\end{example}\vspace{-1.3\baselineskip} |
| 390 |
produces the label "`III-B"' for the fourth seat (from the left) in the third |
| 391 |
row. |
| 392 |
|
| 393 |
\subsection{Seat List} |
| 394 |
\label{sec:seats-list} |
| 395 |
Especially in the context of examinations, it is useful to generate a seat list, |
| 396 |
i.e., a tabular mapping between student and assigned seat. |
| 397 |
In its current version, \thepkg\ does not create a \LaTeX\ table, |
| 398 |
but it can support table generation (e.g., using \LaTeX\ or a spreadsheet application). |
| 399 |
|
| 400 |
\begin{commands} |
| 401 |
\command{scSeatingList}[\oarg{input file}\marg{output file}]\vspace{-1.3\baselineskip} |
| 402 |
\command{scSeatingList}[\sarg\oarg{input file}\marg{output file}] |
| 403 |
Creates a CSV file \meta{output file} containing the labels of the assigned seats, |
| 404 |
one per line.\medskip |
| 405 |
|
| 406 |
\framebox{\parbox{\linewidth}{ |
| 407 |
\textbf{Note!} |
| 408 |
The label texts written to \meta{output file} are extracted from the |
| 409 |
corresponding \LaTeX\ boxes, and only printable characters are included. |
| 410 |
When using this function, it's therefore recommended to avoid excessive |
| 411 |
\TeX-level formatting in the \option*{assigned seat label} format string. |
| 412 |
}}\medskip |
| 413 |
|
| 414 |
In the starred variant, each line is prefixed with the absolute coordinates |
| 415 |
(row, seat number, relative to the layout), comma-separated, before the label. |
| 416 |
|
| 417 |
If an input file is specified, its content is prepended line-by-line |
| 418 |
to the generated lines. For example, the input file could contain names |
| 419 |
and/or student IDs, which will then be matched to the assigned seats in the output. |
| 420 |
If there are fewer entries in \meta{input file} than assigned seats, |
| 421 |
the corresponding fields in the output will be left empty. |
| 422 |
If, on the other hand, there are more entries than available seats, |
| 423 |
\thepkg\ will report which entries could not be assigned a seat. |
| 424 |
\end{commands} |
| 425 |
|
| 426 |
\section{Examples} |
| 427 |
\label{sec:examples} |
| 428 |
To demonstrate the behavior of \thepkg, a few usage examples are documented |
| 429 |
here. |
| 430 |
\subsection{Dense Occupancy for Example Room in Section~\ref{sec:drawing}} |
| 431 |
\label{sec:ex-simple} |
| 432 |
\begin{example}[compile,program=lualatex,pages=1,add-frame,code-sep=\bigskip,graphics={scale=.25}] |
| 433 |
\documentclass{article} |
| 434 |
\usepackage[shape=rectangle, rows = 9, seats per row=15]{seatingchart} |
| 435 |
\begin{document} |
| 436 |
\scSetAisle{8} |
| 437 |
\scRemoveSeats{{1,1},{1,2}} |
| 438 |
\scSeatingScheme{2x2-} |
| 439 |
\scDrawSeating |
| 440 |
\end{document} |
| 441 |
\end{example} |
| 442 |
\subsection{Predefined Room, Rectangular} |
| 443 |
\label{sec:ex:std-rect} |
| 444 |
\begin{example}[compile,program=lualatex,pages=1,add-frame,code-sep=\bigskip,graphics={scale=.5}] |
| 445 |
\documentclass{scrartcl} |
| 446 |
% To make better use of the paper, we use landscape format |
| 447 |
% and reduce the margins |
| 448 |
\usepackage[a4paper,landscape,inner=10pt,outer=10pt,top=1cm,bottom=1cm]{geometry} |
| 449 |
\usepackage[ |
| 450 |
room=C10.115, |
| 451 |
blackboard |
| 452 |
]{seatingchart} |
| 453 |
|
| 454 |
\begin{document} |
| 455 |
% Default title takes up too much space. |
| 456 |
\centering\textbf{\Huge\sffamily Seating Plan C10.115}\bigskip |
| 457 |
\scSeatingScheme{sixpack} |
| 458 |
\scDrawSeating |
| 459 |
\end{document} |
| 460 |
\end{example} |
| 461 |
\subsection{Predefined Room, Curved} |
| 462 |
\label{sec:ex:std-arc} |
| 463 |
\begin{example}[compile,program=lualatex,pages=1,add-frame,code-sep=\bigskip,graphics={scale=.5}] |
| 464 |
\documentclass{scrartcl} |
| 465 |
% To make better use of the paper, we use landscape format |
| 466 |
% and reduce the margins |
| 467 |
\usepackage[a4paper,landscape,inner=10pt,outer=10pt,top=1cm,bottom=1cm]{geometry} |
| 468 |
\usepackage[ |
| 469 |
room=A10.316, |
| 470 |
blackboard, |
| 471 |
assigned seat label color=blue |
| 472 |
]{seatingchart} |
| 473 |
|
| 474 |
\begin{document} |
| 475 |
% Default title takes up too much space. |
| 476 |
\centering\textbf{\Huge\sffamily Seating Plan A10.316}\bigskip |
| 477 |
\scSeatingScheme[ignore removed seats]{2x2} |
| 478 |
\scDrawSeating |
| 479 |
\end{document} |
| 480 |
\end{example} |
| 481 |
|
| 482 |
\subsection{Custom Layout and Seating Scheme} |
| 483 |
\label{sec:ex:own1} |
| 484 |
\begin{example}[compile,program=lualatex,pages=1,add-frame,code-sep=\bigskip,graphics={scale=.5}] |
| 485 |
\documentclass{scrartcl} |
| 486 |
% To make better use of the paper, we use landscape format |
| 487 |
% and reduce the margins |
| 488 |
\usepackage[a4paper,landscape,inner=10pt,outer=10pt,top=1cm,bottom=1cm]{geometry} |
| 489 |
\usepackage[ |
| 490 |
shape=rectangle, rows=9, seats per row=9, |
| 491 |
assigned seat background color=yellow |
| 492 |
]{seatingchart} |
| 493 |
|
| 494 |
\begin{document} |
| 495 |
\scRemoveSeats{{1,1},{1,-1},{2,1},{2,-1},{3,1},{3,-1}} |
| 496 |
|
| 497 |
\scSeatingScheme[ignore removed seats,end row=3]{2x3} |
| 498 |
\scSeatingScheme[start row=5, end row=10]{2x4} |
| 499 |
\scDrawSeating |
| 500 |
\end{document} |
| 501 |
\end{example} |
| 502 |
|
| 503 |
\subsection{Checkers} |
| 504 |
\label{sec:ex:dame} |
| 505 |
\begin{example}[compile,program=lualatex,pages=1,add-frame,code-sep=\bigskip,graphics={scale=.5}] |
| 506 |
\documentclass{scrartcl} |
| 507 |
\usepackage[a5paper,landscape,top=1cm,bottom=1cm]{geometry} |
| 508 |
\usepackage[shape=rectangle, rows=10,seats per row=10, |
| 509 |
assigned seat label color=blue, assigned seat background color=teal, |
| 510 |
empty seat background color=lime!50, |
| 511 |
seat distance=0pt]{seatingchart} |
| 512 |
\usepackage{stix} |
| 513 |
\begin{document} |
| 514 |
\centering\textbf{\Huge\sffamily Let's play Checkers}\bigskip |
| 515 |
|
| 516 |
\scConfigScheme{assigned seat label={}} |
| 517 |
\scSeatingScheme*[start row=5, end row=5]{X-} |
| 518 |
\scSeatingScheme*[start row=6, end row=6]{-X} |
| 519 |
\scConfigScheme{assigned seat label font=\Huge, assigned seat label={{{\textcolor{white}{$\circledbullet$}}}}} |
| 520 |
\scSeatingScheme*[start row=1, end row=3,row sep=2]{X-} |
| 521 |
\scSeatingScheme*[start row=2, end row=4]{-X} |
| 522 |
\scConfigScheme{assigned seat label={{{\textcolor{yellow}{$\circledbullet$}}}}} |
| 523 |
\scSeatingScheme*[start row=7, end row=9]{X-} |
| 524 |
\scSeatingScheme*[start row=8, end row=10]{-X} |
| 525 |
|
| 526 |
\scDrawSeating[seat width=1cm, seat height=1cm] |
| 527 |
\end{document} |
| 528 |
\end{example} |
| 529 |
\section{Declaration of New Rooms} |
| 530 |
\label{sec:new-rooms} |
| 531 |
In its current version, the \thepkg package only contains a relatively small |
| 532 |
number of rooms at TU Chemnitz with their seating layouts. |
| 533 |
Users will therefore often have to create their own layouts. |
| 534 |
|
| 535 |
In addition to the option for ad-hoc layout creation, as described in the se |
| 536 |
ction~\ref{sec:layout}, it is also possible to extend the package itself and |
| 537 |
create layouts for new rooms, which can then be easily accessed via the |
| 538 |
\option{room} key. |
| 539 |
|
| 540 |
For this purpose, custom \code{seatingchart-*.sc} files can be created and |
| 541 |
integrated via the \option{layout}. |
| 542 |
Two commands can be used in \code{seatingchart-*.sc} files: |
| 543 |
\begin{commands} |
| 544 |
\command{scDeclareRoom}[\marg{room name}\marg{key list}] |
| 545 |
A new room layout is created for the room \meta{room name}. |
| 546 |
The key list \emph{must} contain the three keys |
| 547 |
\begin{options} |
| 548 |
\keychoice{shape}{rectangle,arc}\Default*!{}%\vspace{-.3\baselineskip} |
| 549 |
\keyval-{rows}{number of rows}\Default*!{}%\vspace{-.3\baselineskip} and |
| 550 |
\keyval-{seats per row}{seats per row}\Default!{} |
| 551 |
These keys have the same meaning as the |
| 552 |
keys of the same name from Section~\ref{sec:layout}. |
| 553 |
This information about the base layout \emph{must} be followed by the key |
| 554 |
\opt{init}\Default! |
| 555 |
|
| 556 |
The layout can then be adjusted using |
| 557 |
\keyval-{aisle}{seat number}\vspace{-1.3\baselineskip} |
| 558 |
\keyval{remove}{list} |
| 559 |
These two keys function analogously to |
| 560 |
\cs*{scSetAisle} and \cs*{scRemoveSeats}, see Section~\ref{sec:modify-layout}. |
| 561 |
\end{options} |
| 562 |
\begin{example}[code-only] |
| 563 |
\scDeclareRoom{C10.115}{ |
| 564 |
shape=rectangle, |
| 565 |
rows=21, |
| 566 |
seats per row=35, |
| 567 |
init, |
| 568 |
aisle=18, |
| 569 |
remove={{1,1},{1,2},{1,3},{1,4},{1,-1},{1,-2},{1,-3},{1,-4}} |
| 570 |
} |
| 571 |
\end{example}\vspace{-1.3\baselineskip} |
| 572 |
\command{scAliasRoom}[\marg{alias}\marg{room}] |
| 573 |
Sets \meta{alias} as a replacement name for \meta{room}. |
| 574 |
\end{commands} |
| 575 |
If you would like your institution's layout file to be included in the package |
| 576 |
on CTAN, please send your file to the maintainer or initiate a pull request on |
| 577 |
\url{https://github.com/tuc-osg/seatingchart}. |
| 578 |
In this case, give the file a meaningful and distinguishable name. For example, |
| 579 |
\emph{University of Lummerland at Lummerland City} |
| 580 |
should use \code{seatingchart-lummerland-uni-lc.sc} rather than |
| 581 |
\code{seatingchart-lu.sc}. |
| 582 |
|
| 583 |
\section{Limitations and Bugs} |
| 584 |
\label{sec:bugs} |
| 585 |
Even though the \thepkg package is in practical use, at least in our group, it |
| 586 |
should be considered experimental. |
| 587 |
The \code{0} in the major version number indicates this fact. |
| 588 |
In particular, it means that the API is still subject to change. |
| 589 |
|
| 590 |
The package is subject to some limitations. |
| 591 |
Whether these will be fixed in future versions is not yet known. |
| 592 |
The package is designed for creating separate seating charts and therefore cannot be used to display multiple seating charts in one document. |
| 593 |
Likewise, seating layouts with staggered rows cannot be displayed. |
| 594 |
|
| 595 |
The number of predefined rooms is currently relatively small. |
| 596 |
There are plans to include additional rooms at TU Chemnitz in future patches. |
| 597 |
Layout files from other institutions are welcome. |
| 598 |
|
| 599 |
Curved room layouts are problematic for smaller row lengths. |
| 600 |
Please use GitHub for bug reports or pull requests: |
| 601 |
\url{https://github.com/tuc-osg/seatingchart}. |
| 602 |
|
| 603 |
\section{License} |
| 604 |
Permission is granted to copy, distribute and/or modify this software under the |
| 605 |
terms of the \LaTeX\ Project Public License (LPPL), version 1.3c or later |
| 606 |
(\url{http://www.latex-project.org/lppl.txt}). |
| 607 |
\end{document} |