\documentclass[svgnames]{l3doc} \usepackage{litetable, twemojis} \usepackage[mono = false]{libertine} \usepackage[fontset = fandol, linespread = 1.2, autoindent = 0pt]{ctex} \AddToHook{env/function/before}{\vspace*{-.7\baselineskip}} \AddToHook{env/syntax/after} {\par\vspace*{.2\baselineskip}} \makeatletter \def \@key #1{\textcolor{red}{\textbf{\texttt{#1}}}~\texttt{=}~} \def \s@key #1{\textcolor{red}{\textbf{\texttt{#1}}}} \DeclareRobustCommand \key {\@ifstar\s@key\@key} \def \val #1{\meta{\textup{#1}}} \def \TFF {true\textbar \textbf{false}} \def \TTF {\textbf{true}\textbar false} \def \HoLogo@ApLaTeX #1{% \HOLOGO@mbox {A\kern -.05em p\kern -.05em \hologo{LaTeX}}} \makeatother \newlist{keyval}{itemize}{10} \setlist[keyval]{leftmargin = 0pt, labelsep = 0pt} \makeindex \title{% \bfseries \cls{litetable} 宏包 --- 多彩的課程表\thanks{% \url{https://github.com/myhsia/litetable}, \url{https://ctan.org/pkg/litetable} } } \author{% 夏明宇 \texttt{<\href{mailto:myhsia@outlook.com}{myhsia@outlook.com}>}\thanks{% \href{https://github.com/ljguo1020}{郭李軍}% 開發了讀取 \meta{left} \texttt{->} \meta{right} 型數據結構的接口, 并为低版本 \hologo{TeX} Live 做兼容. } } \date{Released 2025-05-24\quad \texttt{v3.3J}} \begin{document} \maketitle \begin{documentation} \section{介紹} \pkg{litetable} 宏包提供了一個多彩的課程表設計, 基於 \pkg{tikz} 由 \pkg{expl3} 開發. 支援 \hologo{pdfLaTeX},\hologo{XeLaTeX},\hologo{ApLaTeX} 同 \hologo{LuaLaTeX} 等多種編譯方式. 點擊跳轉 \href{http://mirrors.ctan.org/macros/latex/contrib/litetable/litetable.pdf}{[\textsf{English}]} \href{http://mirrors.ctan.org/macros/latex/contrib/litetable/litetable-zh-cn.pdf}{[\textsf{简体中文}]} 手册. \section{用户接口} 要加載此宏包,只需寫下 \begin{quote} |\usepackage{litetable}| \end{quote} \DescribeEnv{litetable} 環境 \env{litetable} 可生成空白課程表, 需在命令 \cs{timelist} 同 \cs{weeklist} 後執行 \begin{quote} |\begin{litetable}| \oarg{keys} \marg{title} \oarg{keys}| ... |% |\end{litetable}| \end{quote} 强制參數用於設定課程表標題, 可選參數接受以下鍵 \begin{keyval} \item [\key{color}] \val{color} 可設定課程表框架的背景色 (默認值:|gray|),鍵名可省略. \item [\key{sem}] \val{string} 可設定頁面右上角的學期信息. \item [\key{hline}] \val{string} 可設定水平线的樣式 (默認值:|solid|). \end{keyval} \begin{function}{\weeklist} \begin{syntax} \cs{weeklist} \oarg{keys} \marg{list} \oarg{keys} \end{syntax} 强制參數接收數組, 用於設定課程表頂部的工作日列表同列寬. 可選參數接受以下鍵 \begin{keyval} \item [\key{format}] \val{format commands} 可設置工作日列表格式(默認值:|\bfseries|). \item [\key{sep}] \val{string} 可設定工作日列表的分隔符. \end{keyval} \begin{verbatim} \weeklist [ format = \bfseries \scshape, sep = \textbar ] { Mon -> 1, Tue -> 1, Wed -> 1, Thu -> 1, Fri -> 1 } \end{verbatim} \end{function} \begin{function}{\timelist} \begin{syntax} \cs{timelist} \oarg{keys} \marg{list} \oarg{keys} \end{syntax} 强制參數均接收數組,用於設置課程表的左側的時間列表. 可選參數接受以下鍵 \begin{keyval} \item [\key{numformat}] \val{format} 可設定時間列表的序號字體 (默認值:|\ttfamily \bfseries|). \item [\key{timefont}] \val{format} 可設定時間列表的時間字體 (默認值:|\ttfamily|). \item [\key{hidetime}] \val\TFF 用於隱藏時間列表中的時間,只保留序號 (初始值:|false|). \end{keyval} \begin{verbatim} \timelist [ numformat = \bfseries, timeformat = \ttfamily ] { 08:30 -> 10:00, 10:30 -> 12:00, 13:00 -> 14:30, 15:00 -> 16:30 } \end{verbatim} \end{function} \begin{function}{\course} \begin{syntax} \cs{course} \oarg{keys} \marg{start} \oarg{keys} \marg{end} \oarg{keys} \end{syntax} 用於在當前工作日添加課程盒子, 需在 \env{litetable} 環境中執行. 兩個强制參數分别用於設置課程的開始同結束序號. 可選參數接收下列鍵 \begin{keyval} \item [\key{color}] \val{color} 用於設置課程盒子的颜色 (默認值:|teal|). 鍵名可省略. \item [\key{subject}] \val{string} 用於設置課程名稱. \item [\key{location}] \val{string} 用於設置課程地點. \item [\key{lecture}] \val{string} 用於設置授課教師. \item [\key{comment}] \val{string} 用於給課程添加脚注. \end{keyval} \begin{texnote} \begin{itemize}[leftmargin = 2em] \item 若 \meta{start} |=| \meta{end}(課程盒子的高度为 $1$), 若 \key*{location} 和 \key*{lecture} 會輸出在同一行, 而且 \key*{comment} 將隱藏. \item 即使誤將 \meta{start} 同 \meta{end} 寫反, 模板也會自動糾正. \item 若 \key*{location} 同 \key*{lecture} 均未使用, 則 \key*{subject} 將輸出在課程盒子的 竖直方向中心. \item 超出課程表範圍的課程盒子將唔顯示, 并會返回警告. 輸入用例見 Appendix \ref{mwe}. \end{itemize} \end{texnote} \end{function} \begin{function}{\newday} \begin{syntax} \cs{newday} \oarg{integral value} \end{syntax} 使其後面添加的課程盒子後移 \meta{intergal value} 個工作日. 可選參數的默認值为 |1|. \end{function} \begin{function}{\more} \begin{syntax} \cs{more} \marg{comment} \end{syntax} 在課程表的右下角添加備注. \end{function} \appendix \linespread{1.25} \section{工作範例} \label{mwe} \begin{verbatim} \documentclass[svgnames]{article} \usepackage{litetable, twemojis} \usepackage[mono = false]{libertine} \usepackage[T1]{fontenc} \begin{document} \weeklist [ format = \bfseries \scshape, sep = \textbar ] { \texttwemoji{1f312} Mon -> 1, \texttwemoji{1f525} Tue -> 1, \texttwemoji{1f30a} Wed -> 1, \texttwemoji{1f332} Thu -> 1, \texttwemoji{1fa99} Fri -> 1 } \timelist [ numformat = \ttfamily \bfseries, timeformat = \ttfamily ] { 08:05 -> 08:50, 08:55 -> 09:40, 10:00 -> 10:45, 10:50 -> 11:35, 11:40 -> 12:25, 13:30 -> 14:15, 14:20 -> 15:05, 15:15 -> 16:00, 16:05 -> 16:50, 18:30 -> 19:15, 19:20 -> 20:05, 20:10 -> 20:55 } \begin{litetable} [ DarkBlue, sem = SEM 7, hline = dashed ] { Course Schedule } \course [ subject = interface3, comment = \TeX\ Live 2025, lecture = The \LaTeX\ Project, DarkBlue ] {4} {5} \newday \course [ subject = expl3, lecture = The \LaTeX\ Project ] {8} {8} \newday \course [ subject = Keep on \TeX ing, lecture = Donald E. Knuth, location = Stanford University, Purple ] {10} {11} \newday \course [ subject = Ti\textit k\/Z, lecture = \textsc{pgf}, Crimson, comment = Version 3.1.10 ] {3} {5} \more { Programme Duration: 09 / 2021 -- 07 / 2025 } \end{litetable} \end{document} \end{verbatim} \weeklist [ format = \bfseries \scshape, sep = \textbar ] { \texttwemoji{1f312} Mon -> 1, \texttwemoji{1f525} Tue -> 1, \texttwemoji{1f30a} Wed -> 1, \texttwemoji{1f332} Thu -> 1, \texttwemoji{1fa99} Fri -> 1 } \timelist [ numformat = \ttfamily \bfseries, timeformat = \ttfamily ] { 08:05 -> 08:50, 08:55 -> 09:40, 10:00 -> 10:45, 10:50 -> 11:35, 11:40 -> 12:25, 13:30 -> 14:15, 14:20 -> 15:05, 15:15 -> 16:00, 16:05 -> 16:50, 18:30 -> 19:15, 19:20 -> 20:05, 20:10 -> 20:55 } \begin{litetable} [ DarkBlue, sem = SEM 7, hline = dashed ] {Course Schedule} \course [ subject = interface3, comment = \TeX\ Live 2025, lecture = The \LaTeX\ Project, DarkBlue ] {4} {5} \newday \course [ subject = expl3, lecture = The \LaTeX\ Project ] {8} {8} \newday \course [ subject = Keep on \TeX ing, lecture = Donald E. Knuth, location = Stanford University, Purple ] {10} {11} \newday \course [ subject = Ti\textit k\/Z, lecture = \textsc{pgf}, Crimson, comment = Version 3.1.10 ] {3} {5} \more { Programme Duration: 09 / 2021 -- 07 / 2025 } \end{litetable} \end{documentation} \PrintIndex \end{document}