summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/litesolution/doc/litesolution.tex
blob: 678e4cd4aa79551023c5a1aaadedafa3b87d6929 (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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
\documentclass[mtpro2,twoside,openany]{litesolution}

\usepackage[listings]{tcolorbox}
\lstset{language=[LaTeX]TeX,basicstyle=\small\ttfamily,breaklines=true,columns=flexible}

\title{\sffamily The \pkg{LiteSolution} Class}
\subtitle{\sffamily\scshape Hangzhou Dianzi University}
\bioinfo{Mingyu Hsia (\mailto{xiamyphys@hdu.edu.cn})\quad|\quad\today\quad|\quad Version 2.2b}
\cover[checkerboard]{schrodinger}\coverhead[3]{universe}

\begin{document}

\maketitle[DarkSlateGray]
\frontmatter\tableofcontents\mainmatter
\chapterimage{\UPFadingImage*[trim={0 {.9\paperheight} 0 0},clip]{Beautiful-realities}}

\chapter{Introduction to the \pkg{LiteSolution} Class}

\section{Preface}

This is the document for the \pkg{LiteSolution} class, which is designed for typesetting solutions of problems in exams, textbooks, etc.

Welcome to feedback bugs or ideas via email \href{mailto:xiamyphys@hdu.edu.cn}{\ttfamily xiamyphys@hdu.edu.cn} or \href{https://github.com/xiamyphys/litesolution}{GitHub}.

\subsection{Installing \pkg{LiteSolution} and loading it}

Simply download \verb|litesolution.cls| file from \href{https://github.com/xiamyphys/litesolution}{GitHub} or \href{https://ctan.org/pkg/litesolution}{CTAN} and save it under your working directory. However, I strongly suggest to use terminal to install and update all packages to the latest version

\begin{verbatim}
    sudo tlmgr update --self --all
\end{verbatim}

To learn more, please refer to \href{https://tex.stackexchange.com/questions/55437/how-do-i-update-my-tex-distribution}{How do I update my \hologo{TeX} distribution?}

\subsection{Compatibility}

The test environments are macOS + Mac\hologo{TeX} 2024 / Overleaf / Ubuntu 22.04.2 + \hologo{TeX} Live 2024 and they all work fine for \hologo{pdfLaTeX} and \hologo{XeLaTeX} compilers. Windows and Unix platforms compatibility unknown.

\section{Global Options of this Class}

\begin{verbatim}
    \documentclass[<options>]{litesolution}
\end{verbatim}

\subsection{The \mode{answer} option}

The \mode{hideanswer} mode can hide contents in \cmd{solution} environment and \cmd{ans} command.

\subsection{The \mode{math} option}

The \mode{mtpro2}, \mode{newtx} and \mode{newtxsf} modes can format the font of formulas in the document. Please check if mtpro2 font has been installed on your computer correctly before using \mode{mtpro2} mode.

\section{Related Packages}
\begin{description}
    \item[Package \pkg{notebeamer}] provides macros for inputting slides on note papers quickly.
    \item[Package \pkg{fadingimage}] provides macros for inputting full width picture at the edges of pages quickly.
\end{description}

\chapter{Settings \& Usages of this Class}

\section{Cover Configurations}

\subsection{The cover page configurations}

\begin{verbatim}
    \title{<content>}                 \subtitle{<content>}
    \bioinfo{<content>}               \cover[<pattern>]{<image>}
    \coverhead[<angle>]{<image>}      \coverhead*[<angle>]{<content>}

    \begin{document}                  \maketitle[<color>]
\end{verbatim}

\begin{verbatim}
    \title{\sffamily The \pkg{LiteSolution} Class}
    \subtitle{\sffamily\scshape Hangzhou Dianzi University}
    \bioinfo{Mingyu Hsia (\mailto{xiamyphys@hdu.edu.cn})
            \quad|\quad\today\quad|\quad Version 2.2b}
    \cover[checkerboard]{schrodinger} \coverhead[5]{universe}

    \begin{document}                  \maketitle[Midnightblue]
\end{verbatim}

\subsection{The chapter head configurations}

\begin{verbatim}
    \chapterimage {<insert image macro>}
\end{verbatim}

This command can assign the format of the image at every chapters begin and you can adjust the format of the image with the \pkg{fadingimage} package.

\section{Preset Packages}

This template has preset many packages. The following packages are the common ones

\begin{table}[htbp]
    \centering\small
    \begin{tabular}{l l l l l l l l}
        \toprule
        \pkg{amsthm}      & \pkg{amssymb}    & \pkg{bm}         & \pkg{booktabs} &
        \pkg{cancel}      & \pkg{caption}    & \pkg{circuitikz} & \pkg{datetime} \\
        \midrule
        \pkg{derivative}  & \pkg{diagbox}    & \pkg{esvect}     & \pkg{extarrows} &
        \pkg{fadingimage} & \pkg{fancyhdr}   & \pkg{fixdif}     & \pkg{fontawesome5} \\
        \midrule
        \pkg{geometry}    & \pkg{graphics}   & \pkg{graphicx}   & \pkg{hyperref} &
        \pkg{indentfirst} & \pkg{lipsum}     & \pkg{mathtools}  & \pkg{multicol} \\
        \midrule
        \pkg{multirow}    & \pkg{nicematrix} & \pkg{notebeamer} & \pkg{paracol} &
        \pkg{pgfplots}    & \pkg{physics2}   & \pkg{qrcode}     & \pkg{refstyle} \\
        \midrule
        \pkg{setspace}    & \pkg{siunitx}    & \pkg{tabularx}   & \pkg{tasks} &
        \pkg{wallpaper}   & \pkg{xcolor}     & \pkg{xeCJK}      & \pkg{xfrac} \\
        \bottomrule
    \end{tabular}
\end{table}

\section{Preset Commands}

\subsection{The \cmd{ans} command}

\begin{verbatim}
    \ans {<contents>}
\end{verbatim}
 
This command can underline the answer, and if mode \mode{noans} is enabled the answer will be hidden.

\subsection{The \cmd{solute} command}

\begin{verbatim}
    \solute {<number>}              \solute* {<contents>}
\end{verbatim}

This command can create a fixable answer box when the mode \mode{noans} is enabled.

\subsection{Other preset commands}

\begin{verbatim}
    \def\i{\mathrm i}       \def\e{\mathrm e}       \def\T{\mathsf T}
    \let\leq\leqslant       \let\geq\geqslant       \let\vec\vv
\end{verbatim}

\section{Preset \pkg{amsthm} Environments}

\subsection{The \cmd{problem} environment}

\begin{tcblisting}{sidebyside,colback=DarkGreen!5,colframe=DarkGreen!80}
\begin{problem}[<Keywords>]\leavevmode
\begin{tasks}(2)
  \task Choice A  \task[\true] Choice B
  \task Choice C  \task Choice D
\end{tasks}
\end{problem}
\end{tcblisting}

\subsection{The \cmd{solution} and \cmd{note} environment}

\begin{minipage}{.48\textwidth}
\begin{tcblisting}{sidebyside,colback=MidnightBlue!5,colframe=MidnightBlue!80}
\begin{solution}
  B is correct.
\end{solution}
\end{tcblisting}
\end{minipage}
\hfill
\begin{minipage}{.48\textwidth}
\begin{tcblisting}{sidebyside,colback=DarkRed!5,colframe=DarkRed!80}
\begin{note}
  We note that.
\end{note}
\end{tcblisting}    
\end{minipage}

\section{Equation test}

\[\begin{cases}
    \i\hbar\partial_t\psi(\mathbf x,t)=\ab(-\frac{\hbar^2}{2m}\bm\nabla^2+V)\\
    \i\hbar\partial_t\psi(\mathbf x,t)=-(\i\hbar c\bm\alpha\cdot\bm\nabla+\beta mc^2)\psi(\mathbf x,t)
\end{cases}\]

\section*{Original Code for the Cover Head}

\setstretch{1.15}
\lstinputlisting{figure/universe.tex}

\end{document}