summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/litesolution
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2024-03-09 03:04:53 +0000
committerNorbert Preining <norbert@preining.info>2024-03-09 03:04:53 +0000
commitbb1788335b7c394ee980b7b6f12b81f5223bbd63 (patch)
tree1c53bbe5ff2a09f7864c9f758ed934b014aa58f5 /macros/latex/contrib/litesolution
parent0eba0875b1bcc4a022360ed72a29a81e041cd467 (diff)
CTAN sync 202403090304
Diffstat (limited to 'macros/latex/contrib/litesolution')
-rw-r--r--macros/latex/contrib/litesolution/doc/litesolution-demo.tex417
-rw-r--r--macros/latex/contrib/litesolution/doc/litesolution-doc.tex45
-rw-r--r--macros/latex/contrib/litesolution/doc/litesolution-gauge.tex65
-rw-r--r--macros/latex/contrib/litesolution/doc/litesolution.pdfbin910052 -> 612010 bytes
-rw-r--r--macros/latex/contrib/litesolution/doc/litesolution.tex10
-rw-r--r--macros/latex/contrib/litesolution/tex/litesolution.cls86
-rw-r--r--macros/latex/contrib/litesolution/tex/titleimage.sty20
7 files changed, 102 insertions, 541 deletions
diff --git a/macros/latex/contrib/litesolution/doc/litesolution-demo.tex b/macros/latex/contrib/litesolution/doc/litesolution-demo.tex
deleted file mode 100644
index ce9319cace..0000000000
--- a/macros/latex/contrib/litesolution/doc/litesolution-demo.tex
+++ /dev/null
@@ -1,417 +0,0 @@
-\chapter{A Sample for \pkg{LiteSolution} Template}
-\fancyhead[L]{\color{H6}\kaishu\faIcon{atom}\;2023年\titlelogo{https://sci.hdu.edu.cn}{HDU}「大学物理2」期中模拟}
-\fancyhead[R]{\color{H6}\kaishu\rightmark\,}
-
-\date{2023年12月3日}{大学物理教学团队}{A0715012}
-{\href{https://qm.qq.com/q/UPbGudx8cK}{\textbf{物理問題作}}}
-{https://ctan.org/pkg/litesolution}{CTAN}
-{https://github.com/xiamyphys/LiteSolution}{GitHub}
-
-\section{选择题(每题3分,共36分)}
-\begin{choice}{D}[弹簧振子]
- 一劲度系数为$k$的轻弹簧,下端挂一质量为$m$的物体,系统的振动周期为$T_1$. 若将此弹簧截去一半的长度,下端挂一质量为$m/2$的物体,则系统振动周期$T_2$等于
-\begin{tasks}(4)
- \task $2T_1$
- \task $T_1$
- \task $\frac{T_1}{\sqrt2}$
- \task $\frac{T_1}{2}$
-\end{tasks}
-\end{choice}
-\begin{solution}*
- 弹簧的劲度系数与长度成反比,所以剪断一半后劲度系数变为$2k$;根据弹簧振子的周期表达式$T=2\pi\sqrt{\frac mk}$可知此时的周期$T_2=2\pi\sqrt{\frac{m/2}{2k}}=\frac{T_1}{2}$.\sokka{D}
-\end{solution}
-
-\begin{choice}{B}[单摆]
- 把单摆摆球从平衡位置向位移正方向拉开,使摆线与竖直方向成一微小角度$\theta$,然后由静止放手任其振动,从放手时开始计时.若用余弦函数表示其运动方程,则该单摆振动的初相为
- \begin{tasks}(4)
- \task $\theta$
- \task $0$
- \task $\frac\pi2$
- \task $-\pi$
- \end{tasks}
-\end{choice}
-
-\vskip-2ex
-\begin{paracol}{2}
-\begin{choice}{A}[平面简谐波的波函数]
- 一平面简谐波,波速$u=5\mathrm{m/s}$,$t=3\mathrm{s}$时波形曲线如图,则$x=0$处质点的振动方程可能为
-\begin{tasks}(2)
- \task $y=2\ee{-2}\cos\ab(\frac12\pi t-\frac12\pi)$
- \task $y=2\ee{-2}\cos\ab(\frac12\pi t+\frac12\pi)$
- \task $y=2\ee{-2}\cos(\pi t+\pi)$
- \task $y=2\ee{-2}\cos\ab(\pi t-\frac32\pi)$
-\end{tasks}
-\end{choice}
-\switchcolumn\centering
-\vfill
-\begin{tikzpicture}
- \draw [->,thick] (-1.2,0) -- (4.8,0) node [anchor=south] {$x(\mathrm{m})$};
- \draw [->,thick] (0,-1.8) -- (0,1.8) node [anchor=west] {$y(\mathrm{m})$};
- \draw [very thick] (-.8,0) sin (0,-1) node [anchor=north west] {$-2\ee{-2}$} cos (.8,0) sin (1.6,1) cos (2.4,0) sin (3.2,-1) cos (4,0) sin (4.8,1);
- \draw [thick,->] (1.6,1.2) -- (2.4,1.2) node [midway,anchor=south] {$u$};
- \foreach \a in {5,10,...,25}
- \node [anchor=north,xshift=0.16*\a cm] at (0,0) {\a};
-\end{tikzpicture}
-\vfill
-\end{paracol}
-\vspace{-.75em}
-\begin{solution}*
- 由图可知$A=0.02\mathrm{m},\ \omega=\frac{2\pi u}{\lambda}=\frac12\pi$.由于原点处$v>0$,所以初相$\varphi=-\frac\pi2$.\sokka{A}
-\end{solution}
-
-\begin{choice}{A}[增透膜]
- 一艘油船行经我国台湾岛东部海域时发生石油泄漏,在海面上形成大片油膜,太阳光在头顶正射时,救授人员乘直升飞机从上往下看,发现油膜对$552\mathrm{nm}$波长的可见光反射形成干涉相长而最亮,则可以推测该区域油膜厚度可能为多少?(设石油折射率$n=1.2$,海水折射率$n=1.3$)
-\begin{tasks}(4)
- \task $460\mathrm{nm}$
- \task $552\mathrm{nm}$
- \task $345\mathrm{nm}$
- \task $425\mathrm{nm}$
-\end{tasks}
-\end{choice}
-\begin{solution}
- \begin{itemize}
- \item 由于$n_{\text{空}}>n_{\text{海}}>n_{\text{油}}$,所以石油两个表面反射光光程差为$\delta=2ne$.
- \item 使反射光干涉相长,即$2ne=k\lambda$. A选项刚好满足$k=2$时,$e_{\min}=2\cdot\frac{\lambda}{2n}=460\mathrm{nm}$.
- \end{itemize}
-\end{solution}
-
-\begin{choice}{C}[光程和光程差]
- 在相同的时间内,一束波长为$\lambda$的单色光在空气中和在玻璃中
- \begin{tasks}(2)
- \task 传播的路程相等,走过的光程相等
- \task 传播的路程相等,走过的光程不相等
- \task 传播的路程不相等,走过的光程相等
- \task 传播的路程不相等,走过的光程不相等
- \end{tasks}
-\end{choice}
-\begin{solution}*
- 光程的定义:在相同时间内光线在真空中传播的距离.题目中光传播时间相同,故光程相等;又因为光在两种介质中的传播速度不同,所以在相同的时间内传播的路程不相等.\sokka{C}
-\end{solution}
-
-\begin{choice}{C}[多普勒效应]
- 一观察者站在铁路旁,一火车以$30\mathrm{m/s}$的速度向他驶来并发出频率为$440\mathrm{Hz}$的汽笛声. 已知空气中声速为$330\mathrm{m/s}$,问观察者听到的火车频率为
-\begin{tasks}(4)
- \task $403\mathrm{Hz}$
- \task $480\mathrm{Hz}$
- \task $484\mathrm{Hz}$
- \task $528\mathrm{Hz}$
-\end{tasks}
-\end{choice}
-\begin{solution}
- 已知多普勒效应观察者(Observer)和发射源(Source)的的频率关系为
- \[\nu=\frac{u\pm v_o}{u\mp v_s}\nu_0\]
-
- $v_o$为观察者速度,接近为$+$,远离为$-$;$v_s$为发射源速度,接近为$-$,远离为$+$.观察者静止,其所听频率为
- \[\nu=\frac{330}{330-30}\times 440\mathrm{Hz}=484\mathrm{Hz}\]
-
- \sokka{C}
-\end{solution}
-
-\vskip-2ex
-\begin{paracol}{2}
-\begin{choice}{C}[弗琅禾费衍射]
- 在如图所示的单缝弗琅禾费衍射实验中,若将单缝沿透镜光轴方向向透镜平移,则屏幕上的衍射条纹
-\begin{tasks}(5)
- \task 间距变大\!
- \task 间距变小\!
- \task 不变化
- \task* 间距不变,明暗纹交替
-\end{tasks}
-\end{choice}
-\switchcolumn\centering
-\vfill
-\begin{tikzpicture}
- \filldraw [fill=gray] (0,1.5) rectangle (0.2,0.5);
- \filldraw [fill=gray] (0,-1.5) rectangle (0.2,-0.5);
- \draw [thick,densely dashed] (-1.2,0)--(3,0);
- \draw [thick] (3,1.5)--(3,-1.5);
- \filldraw [fill=white] (1.5,0) ellipse (0.1 and 1.2);
- \foreach \y in {0.5,-0.5}
- \draw [thick,->,yshift=\y cm] (-1,0)--(0,0);
- \length{(1.5,-1.4)}{(3,-1.4)}{$f$}{(0.25,0)}
- \node [anchor=south] at (-1.2,0.5) {$\lambda$};
- \node [anchor=south] at (1.5,1.2) {$L$};
- \node [anchor=west] at (3,1.5) {Screen};
-\end{tikzpicture}
-\vfill
-\end{paracol}
-\vspace{-.75em}
-\begin{solution}*
- 条纹间距只与波长、焦距、缝宽有关,入射光方向不变,所以条纹间距、位置不变. \sokka{C}
-\end{solution}
-
-\begin{choice}{A}[牛顿环]
- 牛顿环干涉装置上平凸透镜在垂直于平板玻璃的方向上,逐渐向下平移(靠近玻璃板)时,反射光形成的干涉条纹的变化情况是
- \begin{tasks}(2)
- \task 环纹向边缘扩散,环数不变
- \task 环纹向边缘扩散,环数增加
- \task 环纹向中心靠拢,环数不变
- \task 环纹向中心靠拢,环数增加
- \end{tasks}
-\end{choice}
-\begin{solution}*
- 对于某条环,其光程差是确定的,所以环数不变;向边缘扩散光程差增大,可抵消透镜下移时导致的光程差减小.\sokka{A}
-\end{solution}
-
-\begin{choice}{B}[最大分辨力]
- 假设用FAST装置探测波长为$20\mathrm{cm}$的宇宙射电信号,FAST望远镜的镜面直径为$500\mathrm{m}$,则装置的最小分辨角为
-\begin{tasks}(4)
- \task $9.76\ee{-4}$
- \task $4.88\ee{-4}$
- \task $2.44\ee{-4}$
- \task $4.00\ee{-4}$
-\end{tasks}
-\end{choice}
-\begin{solution}*
- $\theta=\frac{1.22\lambda}{D}=4.88\ee{-4}\mathrm{rad}$.\sokka{B}
-\end{solution}
-
-\vskip-2ex
-\begin{paracol}{2}
- \begin{choice}{B}[双缝干涉]
- 在双缝干涉实验中,屏幕$E$上的$P$点是明纹.若将缝$S_2$盖住,并在$S_1S_2$连线的垂直平分面处放一高折射率反射面$M$,如图所示.则此时$P$点
- \begin{tasks}(2)
- \task $P$点仍为明条纹
- \task $P$点为暗条纹
- \task 不能确定$P$点是明纹还是暗纹
- \task 无干涉条纹
- \end{tasks}
- \end{choice}
- \switchcolumn\centering
- \vfill
- \begin{tikzpicture}[decoration={markings,mark=between positions .2 and .8 step 18mm with {\arrow{stealth}}}]
- \draw [very thick] (0,1.5)--(0,-1.5);
- \draw [thick,postaction=decorate] (-1,0)--(0,0.5)--(2,0.8);
- \draw [thick] (0,0.5)--(0.8,0);
- \draw [thick,postaction=decorate] (-1,0)--(0,-0.5)--(2,0.8);
- \draw [very thick] (0,0)--(1.8,0);
- \draw [very thick] (2,1.8)--(2,-1.8);
- \fill [pattern=north west lines] (0,0) rectangle (1.8,-0.2);
- \fill [pattern=north east lines] (2,1.8) rectangle (2.2,-1.8);
- \node [anchor=east] at (-1,0) {$S$} node [anchor=south east] at (0,0.5) {$S_1$} node [anchor=north east] at (0,-0.5) {$S_2$};
- \node [anchor=north] at (0.8,-0.2) {$M$} node [anchor=west] at (2.2,0.8) {$P$} node [anchor=north] at (2.1,-1.8) {$E$};
- \node at (-1,0) {$\times$};
- \end{tikzpicture}
- \vfill
-\end{paracol}
-\vspace{-.75em}
-\begin{solution}*
- $S_1MP$、$S_2MP$长度相等,但平面镜使在反射中一条光路发生半波损失,两条光路的相位差变化$\pi$,所以$P$点由原来的明纹变为暗纹.\sokka{B}
-\end{solution}
-
-\begin{choice}{A}[迈克尔逊干涉仪]
- 如果使迈克尔逊干涉仪的动镜移动$0.233\mathrm{mm}$,观察到$792$个条纹的移动,则所用照明单色光源的波长是多少?
-\begin{tasks}(4)
- \task $588\mathrm{nm}$
- \task $294\mathrm{nm}$
- \task $442\mathrm{nm}$
- \task $552\mathrm{nm}$
-\end{tasks}
-\end{choice}
-\begin{solution}*
- 移动带来的光程差满足$\delta=2d=N\lambda$,由此得$\lambda=\frac{2d}{N}=588.38\mathrm{mm}$.\sokka{A}
-\end{solution}
-
-\begin{choice}{B}[光栅]
- 某元素的特征光谱中含有波长分别为$\lambda_1=450\mathrm{nm},\ \lambda_2=750\mathrm{nm}$的谱线,在光栅光谱中这两种波长的谱线有重合现象,重叠处$\lambda_2$的谱线级数将是
-\begin{tasks}(4)
- \task $2,\ 4,\ 6,\ 8,\cdots$
- \task $3,\ 6,\ 9,\ 12,\cdots$
- \task $4,\ 8,\ 12,\ 16,\cdots$
- \task $5,\ 10,\ 15,\ 20,\cdots$
-\end{tasks}
-\end{choice}
-\begin{solution}*
- 由光栅方程$d\sin\theta=k_1\lambda_1=k_2\lambda_2$得$k_2=\frac{k_1\lambda_1}{\lambda_2}$,取整值得$k_2=3,6,9,12,\cdots$.
-\end{solution}
-
-\section{填空题(共18分)}
-\begin{problem}[弹簧振子][3]
- 当弹簧振子以频率$f$做简谐振动时,它的动能的变化频率为\ans{$2f$}.
-\end{problem}
-\begin{solution}*
- 动能和势能变化趋势相反,所以二者变化频率相同. 势能$E_p\propto x^2$,由于$x$是周期为$T$的余弦函数,所以$x^2$的周期为$\frac T2$,即势能的变化频率等于动能的变化频率等于$2f$.
-\end{solution}
-
-\begin{problem}[驻波][3]
- 在均匀介质中,一列余弦波沿$Ox$轴传播,波动方程为$y_1=A\cos\ab(2\pi t+\frac{2\pi x}3)$ (SI),在$x=1\mathrm{m}$处反射,反射点为固定端,则反射波和入射波产生的驻波表达式为\ans{$2A\cos{\ab(2\pi t+\frac{7\pi}6)}\cos{\ab(\frac{2\pi x}{3}-\frac{7\pi}{6})}$}.
-\end{problem}
-\begin{solution}
-\begin{itemize}
- \item 考虑反射带来的半波损失,$x=1\mathrm{m}$处反射波的振动方程为$y_{10}=A\cos\ab(2\pi t+\frac{2\pi}{3}+\pi)$.
- \item 反射后传播方向改变,考虑以$x=1$处为参考点需坐标变换$x'=x-1$,所以反射波的表达式为
- \[y_2=A\cos\ab(2\pi t+\frac{2\pi}{3}-\frac{2\pi(x-1)}3+\pi)=A\cos\ab(2\pi t-\frac{2\pi x}{3}+\frac{7\pi}3)\]
- \item 驻波表达式$y=y_1+y_2=2A\cos{\ab(2\pi t+\frac{7\pi}6)}\cos{\ab(\frac{2\pi x}{3}-\frac{7\pi}{6})}$.
-\end{itemize}
-\end{solution}
-
-\begin{problem}[双缝干涉][6]
- 如图所示,在双缝干涉实验中,若把一厚度为$e$、折射率为$n$的薄云母片覆盖在$S_1$缝上,中央明条纹将向\ans{上}移动;覆盖云母片后,两束相干光至原中央明纹$O$处的光程差为\ans{$(n-1)e$}.
-\end{problem}
-\begin{solution}*
- 覆盖云母片后,通过$S_1$的光路光程差变大,为抵消这一变化中央明纹需上移使通过$S_2$的光路变长;原光程差为零,现光程差即云母片带来的光程差$\delta=ne-e=(n-1)e$.
-\end{solution}
-
-\begin{problem}[牛顿环][3]
- 若把牛顿环装置(都是用折射率为$1.52$的玻璃制成的)由空气搬入折射率为$1.33$的水中,则干涉条纹\ans{变密}(变疏/变密).
-\end{problem}
-\begin{solution}*
- 放入水中后每条条纹的光程差变大,为抵消这一变化条纹需向中心收缩,所以干涉条纹变密.
-\end{solution}
-
-\begin{problem}[弗琅禾费衍射][3]
- 在单缝夫琅禾费衍射实验中,波长为$\lambda$的单色光垂直入射在宽度为$a=6\lambda$的单缝上,对应于衍射角为$30^\circ$的方向,单缝处波阵面可分成的半波带数目为\ans{6}.
-\end{problem}
-\begin{solution}*
- 由衍射公式$a\sin{\theta}=k\lambda$得$k=3$,可分成的半波带数目为$2k=6$.
-\end{solution}
-
-\section{计算题(共46分)}
-\begin{paracol}{2}
-\begin{problem}[平面简谐波的波函数][10]
- 一列平面简谐波在媒质中以波速$u=5\mathrm{m/s}$沿$x$轴正向传播,原点$O$处质元的振动曲线如图所示.
-\begin{enumerate}
- \item 求解$x=25\mathrm{m}$处质元的振动方程并画出该点振动曲线.
- \item 求解波动方程,并画出$t=3\mathrm{s}$时的波形曲线.
-\end{enumerate}
-\end{problem}
-\switchcolumn\centering
- \vfill
- \begin{tikzpicture}
- \draw [->,thick] (-0.5,0)--(4,0) node [anchor=south] {$t(\mathrm{s})$} node [anchor=north] {\textcolor{H6}{$x(\mathrm{cm})$}};
- \draw [->,thick] (0,-1.5)--(0,1.5) node [anchor=west] {$y(\mathrm{cm})$};
- \draw[thick,H1] (0,0) sin (0.6,1) cos (1.2,0) sin (1.8,-1) cos (2.4,0) sin (3.0,1) cos (3.6,0);
- \draw [densely dashed] (0,1)--(.6,1) node [anchor=east,at start] {$2$};
- \node [anchor=north east] at (0,0) {$O$} node [anchor=south west] at (1.2,0) {$2$} node [anchor=south east] at (2.4,0) {$4$};
- \draw [very thick,H2,dotted,line cap=round] (0,-1) cos (0.6,0) sin (1.2,1) cos (1.8,0) sin (2.4,-1) cos (3,0) sin (3.6,1);
- \draw [very thick,H6,densely dashed,line cap=round] (-.8,0) sin (0,-1) cos (.8,0) sin (1.6,1) cos (2.4,0) sin (3.2,-1) cos (4,0);
- \node [anchor=north] at (.8,0) {\textcolor{H6}{5}} node [anchor=north] at (2.4,0) {\textcolor{H6}{15}};
- \end{tikzpicture}
- \vfill
-\end{paracol}
-\vspace{-.75em}
-\begin{solution}
- \begin{enumerate}
- \item 由图知振幅$A=0.02\mathrm{m}$,角频率$\omega=\frac{2\pi}{T}=0.5\pi\mathrm{s}$. $t=0$时,$y=0,\ v>0$,初相$\varphi=-\frac\pi2$. 波动方程为\point{2}
- \[y=0.02\cos{\ab[\frac\pi2\ab(t-\frac{x}{5})-\frac\pi2]}\eqno\point{2}\]
- $x=25\mathrm{m}$处质元的振动方程为$y(x_0,t)=0.02\cos\ab(\frac\pi2t-\pi)$.\point{2}
- \item 波动方程见上问. $t=3\mathrm{s}$时的波形方程为
- \[y(x,t_0)=0.02\cos\ab(-\frac{\pi}{10}x+\pi)\eqno\point{2}\]
- \end{enumerate}
-\end{solution}
-
-\vskip-2ex
-\begin{paracol}{2}
-\begin{problem}[光程和光程差][8]\footnote{\kaishu 选自37th CPhO预赛试题第10题,原题未并提供参考图片.}
- 一艘船(如图中$S$)在$25\mathrm{m}$高的桅杆($SS'$)上装有一天线(如图中$S''$),不断发射某种波长的无线电波,已知波长在$2-4\mathrm{m}$范围内,在高出海平面$150\mathrm{m}$的悬崖顶($OP$)上有一接收站$P$能收到这无线电波,但当那艘船驶至离悬崖底部$OS=2\mathrm{km}$时,接收站就收不到无线电波.设海平面完全反射这无线电波,求所用无线电波的波长.
-\end{problem}
-\switchcolumn\centering
-\vfill
-\begin{tikzpicture}[scale=0.8]
- \coordinate [label=below left:{$S$}] (S) at (0,0);
- \coordinate [label=above left:{$S'$}] (S') at (0,1);
- \coordinate [label=below left:{$S''$}] (S'') at (0,-1);
- \coordinate [label=below:{$M$}] (M) at (1.5,0);
- \coordinate [label=above:{$P$}] (P) at (6,3);
- \coordinate [label=below:{$O$}] (O) at (6,0);
- \draw [thick,line join=round,line cap=round] (P) -- (O) -- (S) -- (S');
- \draw [thick,dashed,line join=round] (P) -- (S) -- (S'') -- (M);
- \draw [very thick,line cap=round,densely dashed,H1] (S') -- (P);
- \draw [very thick,line cap=round,dotted,H1] (S') -- (M) -- (P);
- \length{(-.25,0)}{(-.25,1)}{$a$}{(0,0.25)}
- \pic ["$\theta$", draw, thick, angle radius=5mm, angle eccentricity=1.5] {angle=O--S--P};
- \pic ["$\theta'$", draw, thick, angle radius=5mm, angle eccentricity=1.5] {angle=O--M--P};
- \pic ["$\Delta\theta$", draw, thick, angle radius=10mm, angle eccentricity=1.5] {angle=S--P--M};
- \draw [thick] (S') -- (0.75,-0.5) coordinate [label=below:$K$] (foot);
- \pic ["$\theta$", draw, thick, angle radius=3mm, angle eccentricity=2] {angle=S''--S'--foot};
- \length{($(S'')+({0.5*sin(atan(2/3))},{-0.5*cos(atan(2/3))})$)}{($(foot)+({0.5*sin(atan(2/3))},{-0.5*cos(atan(2/3))})$)}{$\scriptstyle 2a\sin\theta$}{({0.5*cos(atan(2/3))},{0.5*sin(atan(2/3))})}
- \length{($(S)-(0,2)$)}{($(O)-(0,2)$)}{$2\mathrm{km}$}{(1.5,0)}
- \length{($(O)+(0.5,0)$)}{($(P)+(0.5,0)$)}{$150\mathrm{m}$}{(0,0.5)}
- \draw [dashed,H4] (S') --++ (6,0) -- (P);
- \draw [dashed,H6] (S'') --++ (6,0) -- (P);
-\end{tikzpicture}
-\vfill
-\end{paracol}
-\vspace{-.75em}
-\begin{solution}
- 考虑半波损失,经海平面反射的光波与直达$P$点的光波之间的光程差为
- \[\delta=2a\sin\theta+\frac\lambda2\eqno\point{3}\]
- 由几何关系$\sin\theta=\sin\arctan\ab(\frac{150}{2000})=0.075$. 利用干涉相消条件得无线电波长为\point{2}
- \[\delta=\frac{2k+1}{2}\lambda,\ \lambda=\frac{2a\sin\theta}{k}\xlongequal[2<\lambda<4]{k=1}3.74\mathrm{m}\eqno\point{3}\]
- \textbf{本题中$\Delta\theta$不可忽略,不得认为$\theta=\angle PMO$! 否则会得到$k=2.18$.}
- \vskip1ex\hrule\vskip1ex
- 另一种更精确的解法是直接计算两条光路的长度之差\footnote{值得一提的是,因上一种解法近似认为$S'K\bot S''K$,相对于这种解法有$7.73\ee{-3}\%$的误差(小数点第四位及以后不同).}
- \[\begin{aligned}
- \delta&=\overline{S''P}-\overline{S'P}+\frac\lambda2=\sqrt{\ab(\overline{SO})^2+\ab(\overline{OP}+\overline{SS''})^2}-\sqrt{\ab(\overline{SO})^2+\ab(\overline{OP}-\overline{SS''})^2}+\frac\lambda2\\
- &=\sqrt{2000^2+(150+25)^2}-\sqrt{2000^2+(150-25)^2}+\frac\lambda2=\frac{2k+1}{2}\lambda
- \end{aligned}\]
-
- 解得$\lambda\xlongequal{k=1}3.74\mathrm{m}$.
-\end{solution}
-
-\begin{problem}[薄膜干涉][10]
-波长为$\lambda=500\mathrm{nm}$的单色光垂直入射到\textbf{置于空气中}的上下表面平行的薄膜上,已知膜的折射率$n=1.25$,求反射光、透射光最强时膜的最小厚度.
-\end{problem}
-\begin{solution}*
- 两个表面反射光光程差为$\delta=2ne+\frac\lambda2$. 分别由反射光干涉相长$\delta=k\lambda$和相消$\delta=\frac{2k+1}{2}\lambda$得\point{4}
- \[e_{\min_1}=\frac{\lambda}{4n}=100\mathrm{nm},\ e_{\min_2}=\frac{\lambda}{2n}=200\mathrm{nm}\eqno\point{4}\]
-\begin{itemize}
- \item 反射光干涉相长时,反射光最强,膜的最小厚度为$e_{\min_1}=100\mathrm{nm}$.\point{1}
- \item 反射光干涉相消时,透射光最强,膜的最小厚度为$e_{\min_2}=200\mathrm{nm}$.\point{1}
-\end{itemize}
-\end{solution}
-
-\vskip-2ex
-\begin{paracol}{2}
-\begin{problem}[光栅][12]
- 如右图所示,$AB$之间的虚线为一透射式光栅,该光栅在$1\mathrm{mm}$内刻画有$500$条狭缝,单条狭缝的缝宽为$a=0.5\mu\mathrm{m}$,一波长为$\lambda=500\mathrm{nm}$的单色平行光斜入射在该光栅上,入射角$\theta=30^\circ$(从光栅光轴下方入射),在光栅后放置凸透镜和观察屏(屏位于透镜的焦平面处),问屏上能看到哪几级谱线?
-\end{problem}
-\switchcolumn\centering
-\vfill
-\begin{tikzpicture}[decoration={markings,mark=between positions .25 and .8 step 20mm with {\arrow{stealth}}}]
- \filldraw [thick,fill=gray] (0,1.6) rectangle (0.15,0.5);
- \draw [densely dashed,thick] (0,0.5)--(0,-0.5);
- \filldraw [thick,fill=gray] (0,-1.6) rectangle (0.15,-0.5);
- \draw [densely dashed,thick] (-1.5,0)--(2,0);
- \coordinate (b) at (-1.5,0);
- \coordinate (a) at (0,0);
- \coordinate (c) at (-1,-0.4);
- \coordinate (d) at (1.5,0.2);
- \coordinate (e) at (2,0);
- \foreach \a in {-0.5,-0.25,0,0.25,0.5}
- \draw [yshift=\a cm,thick,postaction=decorate,->] (-1,-0.4)--(0,0)--(1.5,0.2);
- \pic["$\theta$", draw=black, very thick, angle
- eccentricity=1.35, angle radius=24]{angle=b--a--c};
- \pic["$\varphi$", draw=black, very thick, angle
- eccentricity=1.35, angle radius=36]{angle=e--a--d};
- \node[anchor=east] at (0,0.6) {$A$} node[anchor=east] at (0,-0.6) {$B$};
-\end{tikzpicture}
-\vfill
-\end{paracol}
-\vspace{-.75em}
-\begin{solution}*
- 光栅常数$d=\frac{1\ee{-3}}{500}=2\mu\mathrm{m}$. 由于光栅方程\point{2}
- \[d(\sin\varphi-\sin\theta)=k\lambda\eqno\point{2}\]
-\begin{itemize}
- \item 令$\varphi=\pm 90^\circ$得$k_{\min}=-6,\ k_{\max}=2$. 由缺级条件得$k'=\frac{d}{a}=\pm 4$,第$-4$级缺级.\point{4}
- \item 由于$\varphi$无法取到$\pm 90^\circ$,所以屏上可见主极大级次为$k=0,\ \pm 1,\ -2,\ -3,\ -5$.\point{4}
-\end{itemize}
-\end{solution}
-
-\begin{problem}[驻波][6]
- 由振动频率为$400\mathrm{Hz}$的音叉在两端固定拉紧的弦线上建立驻波.这个驻波共有三个波腹,其振幅为$0.30\mathrm{cm}$,波在弦上的速度为$320\mathrm{m/s}$.
-\begin{enumerate}
- \item 求此弦线的长度.
- \item 若以弦的中点为坐标原点,试写出弦线上驻波的表达式.
-\end{enumerate}
-\end{problem}
-\begin{solution}
-\begin{enumerate}
- \item 由题意得弦长为$1.5$个波长,即$l=1.5\lambda=1.5\frac{u}{f}=1.2\mathrm{m}$.\point{2}
- \item 驻波的角频率$\omega=2\pi f=800\pi$,波矢$k=\frac{2\pi}{\lambda}=\frac{5}{2}\pi$. 设驻波的表达式为
- \[y=3\ee{-3}\cos\ab(800\pi t+\phi)\cos\ab(\frac52\pi x+\varphi)\eqno\point{2}\]
- 中点$x=0$处是波腹,所以$\cos\varphi=1,\ \varphi=0\ \text{or}\ \pi$. 所以驻波的表达式为
- \[y=\pm 3\ee{-3}\cos\ab(800\pi t+\phi)\cos\ab(\frac52\pi x)\eqno\point{2}\]
- 符号$\pm$对应$\varphi$的两个解,$\phi$由初始条件决定.
-\end{enumerate}
-\end{solution} \ No newline at end of file
diff --git a/macros/latex/contrib/litesolution/doc/litesolution-doc.tex b/macros/latex/contrib/litesolution/doc/litesolution-doc.tex
index c358895d8e..41e608614c 100644
--- a/macros/latex/contrib/litesolution/doc/litesolution-doc.tex
+++ b/macros/latex/contrib/litesolution/doc/litesolution-doc.tex
@@ -2,10 +2,13 @@
\fancyhead[L]{\,\color{H7}\href{https://github.com/xiamyphys/litesolution}{\faIcon{github}\;\leftmark}}
\fancyhead[R]{\color{H7}\rightmark\,}
-\centerline{Xia Mingyu, \href{https://www.hdu.edu.cn}{Hangzhou Dianzi University}}
+\centerline{Hsia Mingyu, \href{https://www.hdu.edu.cn}{Hangzhou Dianzi University}}
\yyyymmdddate
-\centerline{\mailto{xiamyphys@gmail.com}}
-\centerline{\today,\quad Version 1.2a}
+\begin{center}
+ \mailto{xiamyphys@gmail.com}
+
+ \today,\quad Version 1.3a
+\end{center}
This is the document for \pkg{LiteSolution} template, which provides a lite design of the solution of test paper.
@@ -81,7 +84,8 @@ This command can add watermark to the document.
\subsection{Other customer commands}
In order to facilitate input, the following commands are scheduled. You can add others in the \verb|*.cls| file as you like.
\vskip1em
-\begin{center}
+\begin{table}[!ht]
+ \centering
\begin{tabular}{l|l|l|l|l|l}
\toprule
Command & Output & Command & Output & Command & Output\\
@@ -90,12 +94,12 @@ In order to facilitate input, the following commands are scheduled. You can add
\hline
\verb|\sokka{#1}| & 故本题选择\#1项 & \verb|\d| & $\mathrm{d}$ & \verb|\e| & $\mathrm{e}$\\
\hline
- \verb|\xSim[#1]{#2}| & $\xSim[r_1\times2]{r_2+r_1}$ & \verb|\ee{#1}| & $\ee{-34}$ & \verb|\mat{#1}^\T| & $\mat{A}^\T$\\
+ \verb|\xSim[#1]{#2}| & $\xSim[r_1\times2]{r_2+r_1}$ & \verb|\num{e#1}| & $\num{e-34}$ & \verb|\mat{#1}^\T| & $\mat{A}^\T$\\
\hline
\verb|\rank{#1}| & $\rank{\mat{AB}}$ & \verb|\QED| & \QED & \verb|$5\unit{kg}$| & $5\unit{kg}$\\
\bottomrule
- \end{tabular}
-\end{center}
+ \end{tabular}
+\end{table}
\section{Environments of \pkg{LiteSolution}}
\subsection{The \cmd{choice} environment}
@@ -161,7 +165,7 @@ Sightly different from the cmd{choice} environment: the two variables are points
\begin{problem}[Keywords]
If you want to add keywords only.
\end{problem}
- \begin{problem}*[][5]
+ \begin{problem} [5]
If you want to add points only.
\end{problem}
\end{tcblisting}
@@ -224,7 +228,6 @@ If a star (*) is added after the \verb|\begin{solution}|, then the content will
This is the answer for the problem.
\end{solution}
\end{tcblisting}
-
If a star (*) is added after the \verb|\begin{solution}|, then the content will follow the
\begin{tcblisting}{sidebyside}
\begin{solution}*
@@ -235,20 +238,13 @@ If a star (*) is added after the \verb|\begin{solution}|, then the content will
If mode \mode{noans} is enabled, the solution will disappear, leaving only a blank box with the same height as the solution, and the name of the box will change to \emph{\textcolor{1号色}{\textbf{\faIcon{pen-square} 答题区域}}}.
\section{Known Issues}
-\TeX Live will return errors when you enable the mode \mode{noans} and use the \cmd{solution} environment in \cmd{paracol} environment.
-
-\section{Version History}
-This template is used to type the mid-term and final exam solutions of \emph{College Physics}. Initially, I used the \href{https://www.ctan.org/pkg/elegantbook}{ElegantBook} template for layout, however, it's no longer be maintained since January 1st, 2023, so I turn to use the \href{https://github.com/Azure1210/VividBooK}{\pkg*{VividBooK}} instead. But this template is too bloated and some functions \& designs need to be redesigned, so I started developing \pkg{LiteSolution}.
-
-\textsf{\bfseries Version 0.1a} was finished developing on 29 June, 2023 and released on \href{https://mp.weixin.qq.com/s/kd4StYk3XybhNQZkAfoY6A}{\faIcon{weixin} WeChat Public Account: 物理问题作} with the name \emph{FreshSolution}. This version redesigned the \cmd{exercise} environment and the \cmd{solution} environment in terms of designs and functions, and improvements have been made to the design of the chapterimage part.
+Sometimes \TeX Live will return errors when you enable the mode \mode{noans} and use the \cmd{solution} environment in \cmd{paracol} environment.
-\textsf{\bfseries Version 0.1b} was finished developing on 6 July, 2023 and released on \href{https://www.latexstudio.net/index/details/index/mid/3553.html}{LaTeX Studio} (Xiaoshan, Hangzhou) and \href{http://xhslink.com/YBuuuw}{Xiaohongshu}, where won the favor of many people. This version has added the global option to make the page number be remaked or continuous between chapters, and command \cmd{watermark} has been added in this version.
+\clearpage
-\textsf{\bfseries Version 1.0a} was finished developing on 15 November, 2023. This version has redesigned the \cmd{chapterimage} part, \cmd{choice} and replaced the \cmd{exercise} environment with the \cmd{problem} environment.
-
-\textsf{\bfseries Version 1.2a} was finished developing on \textcolor{H1}{13 November, 2023}. This version has integrated the chapter design of \href{https://www.ctan.org/pkg/elegantbook}{\pkg*{ElegantBook}} into the star (*) key value of this template \cmd{chapter}. And some commands friendly for matrices typesetting were added in. The command \cmd{chapterfont} was redesigned that it can call the font in the local path or call system font with(out) a star (*) after it. Also, the environment \cmd{proof} was redesigned, and the mode \mode{noans} in this version supports hide the solution box and replace it with a fixable solution box. Today (\textcolor{H1}{2023/12/13}) is \emph{The National public memorial day of Nanjing Massacre}. Hope for world peace.
+\section{Version History}
+This template is used to type the mid-term and final exam solutions of \emph{College Physics}. Initially, I used the \pkg*{ElegantBook} template for layout, however, it's no longer be maintained since January 1st, 2023, so I turn to use the \href{https://github.com/Azure1210/VividBooK}{\pkg*{VividBooK}} instead. But this template is too bloated and some functions \& designs need to be redesigned, so I started developing \pkg{LiteSolution}.
-\newpage
\subsection*{Update Announcements}
\datechange{2023/07/06}{Version 0.1b}
\begin{itemize}
@@ -264,17 +260,22 @@ This template is used to type the mid-term and final exam solutions of \emph{Col
\item Added the \cmd{note} environment and some customer commands.
\end{itemize}
-\datechange{\today}{Version 1.2a}
+\datechange{2023/12/13}{Version 1.2a}
\begin{itemize}
\item Fixed the bug that the gap around the chapter image.
\item Added some commands for matrices.
\item Redesigned the \cmd{chapterfont} command.
\item Redesigned the \cmd{proof} environment.
\item Supports to adjust the height of solution box when output the exam paper without answer.
- \item Add the \emph{排版规范} in \emph{中文(简体)} after the package document.
\item Fixed the bug that warnings of the packages \pkg{xeCJK} and \pkg{fontspec}.
\end{itemize}
+\datechange{\today}{Version 1.3a}
+\begin{itemize}
+ \item Added the mode \mode{tcolorbox}, which you can choose whether the tcolorbox breakable or not.
+ \item This version separate the chapterimage part to a single \verb|titleimage.sty| file, which will be posted on \nolinkurl{ctan.org} soon to make this template more maintainable.
+\end{itemize}
+
\subsection*{Future Plans}
\begin{itemize}
\item Plan to add the \mode{dark} mode to this template to make the text color light while make the page color dark to protect eyesight.
diff --git a/macros/latex/contrib/litesolution/doc/litesolution-gauge.tex b/macros/latex/contrib/litesolution/doc/litesolution-gauge.tex
deleted file mode 100644
index dc99ae2b17..0000000000
--- a/macros/latex/contrib/litesolution/doc/litesolution-gauge.tex
+++ /dev/null
@@ -1,65 +0,0 @@
-\chapter*{\pkg{LiteSolution}~试卷解析模板排版规范}% standard
-\fancyhead[L]{\,\color{1号色}\kaishu\href{http://weixin.qq.com/r/hR1SSofEIdpercMp90iX}{物理問題作}}
-\fancyhead[R]{\color{1号色}\ttfamily\mailto{xiamyphys@gmail.com}\,}
-
-
-\centerline{夏明宇, \href{https://www.hdu.edu.cn}{杭州电子科技大学}}
-\yyyymmdddate
-\centerline{\mailto{xiamyphys@gmail.com}}
-
-\section{模板介绍}
-本模板用于高校期中 \& 期末试卷排版,支持一键输出无答案试卷.
-
-\section{数学公式}
-\subsection{正体问题}
-\begin{enumerate}
- \item 微分算符要使用正体:\verb|\d|.
- \item 自然对数要使用正体:\verb|\e|.
- \item 三角函数、exp正体:\verb|\function|
- \item 撇\verb|'|和\verb|^\prime|的作用相同:\href{https://tex.stackexchange.com/a/538413/299948}{TeX Stackexchange}.
-\end{enumerate}
-
-\subsection{行内 \& 行间公式}
-\begin{enumerate}
- \item 行内公式:要\verb|$ ... $|不要\verb|\( ... \)|
- \item 行间公式:要\verb|\[ ... \]|不要\verb|$$ ... $$|
-\end{enumerate}
-至于为何,“不要”的命令在\LaTeX 中属于「脆弱」命令,这里不做详解.
-
-\href{https://www.zhihu.com/question/27589739}{\LaTeX 中的「要」和「不要」 - 知乎}
-
-\subsection{选填题}
-\begin{enumerate}
- \item 使用tasks环境判断高度
- \begin{verbatim}
- \begin{tasks}(一行选项个数,自己掂量)
- \task 选项1 \task 选项2
- \task 选项3 \task 选项4
- \end{tasks}
- \end{verbatim}
-
- 不要使用\verb|tabular|制作选择题选项,选项不是画表格!
- \item 答案不要擅自使用\verb|\underline{}|命令,而是使用\verb|\ans{}|命令,否则制作空白无答案版时答案将无法隐藏.
-\end{enumerate}
-
-\subsection{等高括号}
-\begin{enumerate}
- \item 凡是你觉得很高的都需做等高括号处理:\verb|\ab( ), \ab[ ], \ab\{ \}|
- \item 但也不要所有括号都做等高处理,比如\verb|f\ab(x)|和\verb|f(x)|的效果是一样的,多一个\verb|\ab|判断高度只会徒增编译时间.
-\end{enumerate}
-
-\section{偷懒技巧}
-以\verb|\frac{}{}|为例
-\begin{enumerate}
- \item \verb|\frac12 == \frac{1}{2}, \frac\pi2 == \frac{\pi}{2}, \frac yx == \frac{y}{x}|
- \item \verb|frac{}{}|后跟两个键值,如果未使用\verb|{}|界定作用域,则默认scan到第1个char或宏(如\verb|\alpha|)时将其放入第一个键值,scan到第2个char或宏(如\verb|\alpha|)时将其放入第2个键值.
- \item 不会用的话别乱用,老实儿使用\verb|{}|界定作用域,不要出现诸如\verb|\frac x'2|: $\frac x'2$(事实你要写的是$\frac{x'}{2}$).
-\end{enumerate}
-
-\section{排版美观}
-\begin{enumerate}
- \item 尽量不要(甚至杜绝)题目在上一页,答案在下一页的情况(\emph{\textbf{六级完形文章和题目不在一页的痛你应该经历过}}).
- \item 杜绝出现题目/解答盒子断开跨页的情况,这很不美观. 如果一个题目解析实在过长,请尝试缩句,或者使用分栏\verb|multicols|环境以节省空间.
- \item 如果因第$n+1$页开头的题目盒子高度小于第$n$页末尾剩余了空间而导致了空间浪费,请试着将后文中高度与第$n$页最后一道题目+剩余空间相当的题目位置与其交换.
- \item 最完美的排版:除非遇到下一个\verb|section|,每一页从头到尾都恰好填满了题目与解析.
-\end{enumerate} \ No newline at end of file
diff --git a/macros/latex/contrib/litesolution/doc/litesolution.pdf b/macros/latex/contrib/litesolution/doc/litesolution.pdf
index bf3764ef56..3391d993f5 100644
--- a/macros/latex/contrib/litesolution/doc/litesolution.pdf
+++ b/macros/latex/contrib/litesolution/doc/litesolution.pdf
Binary files differ
diff --git a/macros/latex/contrib/litesolution/doc/litesolution.tex b/macros/latex/contrib/litesolution/doc/litesolution.tex
index ba99681a2f..43f8d50f36 100644
--- a/macros/latex/contrib/litesolution/doc/litesolution.tex
+++ b/macros/latex/contrib/litesolution/doc/litesolution.tex
@@ -1,11 +1,13 @@
-\documentclass[ans,continuous]{litesolution}
+\documentclass[ans,continuous,nobreak]{litesolution}
+
+\usepackage{lipsum}
\begin{document}
\chapterimage{cover1.png}
\input{litesolution-doc.tex}
-\input{litesolution-demo.tex}
-\chapterfont{PingFang HK}
-\input{litesolution-gauge.tex}
+% \input{litesolution-demo.tex}
+% \chapterfont{PingFang HK}
+% \input{litesolution-gauge.tex}
\end{document} \ No newline at end of file
diff --git a/macros/latex/contrib/litesolution/tex/litesolution.cls b/macros/latex/contrib/litesolution/tex/litesolution.cls
index 232fc496a8..66a333f04e 100644
--- a/macros/latex/contrib/litesolution/tex/litesolution.cls
+++ b/macros/latex/contrib/litesolution/tex/litesolution.cls
@@ -7,7 +7,7 @@
%% * version. * * * ** * * * * *
%% ****************************************************** ***** ** * * *** * * *
%% start of file `litesolution.cls'. *
-%% Copyright 2023 LiteLaTeX (xiamyphys@gmail.com) *
+%% Copyright 2024 LiteLaTeX (xiamyphys@gmail.com) *
%% available at https://github.com/xiamyphys/LiteSolution *
%% Thanks https://github.com/ElegantLaTeX/ElegantBook, https://github.com/Azure1210/VividBooK *
%% !Mode:: "TeX:UTF-8" *
@@ -18,7 +18,7 @@
\PassOptionsToPackage{quiet}{fontspec}
\PassOptionsToPackage{no-math}{fontspec}
-\ProvidesClass{litesolution}[2023/12/13 v1.2a LiteSolution document class]
+\ProvidesClass{litesolution}[2024/03/08 v1.3a LiteSolution document class]
\RequirePackage{kvoptions}
\RequirePackage{etoolbox}
\SetupKeyvalOptions{family=LITE, prefix=LITE@, setkeys=\kvsetkeys}
@@ -28,7 +28,10 @@
\DeclareStringOption[ans]{answer}
\DeclareVoidOption{ans}{\ekv{answer=ans}}
\DeclareVoidOption{noans}{\ekv{answer=noans}}
-\DeclareVoidOption{preprint}{\ekv{answer=preprint}}
+
+\DeclareStringOption[breakable]{tcolorbox}
+\DeclareVoidOption{breakable}{\ekv{tcolorbox=breakable}}
+\DeclareVoidOption{nobreak}{\ekv{tcolorbox=nobreak}}
\DeclareStringOption[separate]{counter}
\DeclareVoidOption{separate}{\ekv{counter=separate}}
@@ -40,7 +43,7 @@
% ----- Default Options -----
\DeclareDefaultOption{\PassOptionsToClass{\CurrentOption}{book}}
\ProcessKeyvalOptions*\relax
-\LoadClass[a4paper,oneside]{book}
+\LoadClass[letterpaper,oneside]{book}
\RequirePackage[letterpaper,margin=0.75in,headheight=0.25in,headsep=0.2in,footskip=0.2in]{geometry}
\usepackage[level]{datetime}
@@ -49,6 +52,8 @@
\usephysicsmodule{ab,ab.legacy,braket,nabla.legacy}
\RequirePackage{amsmath,amssymb}
\usepackage{nicematrix}
+\usepackage{diagbox}
+\usepackage{nicefrac}
\RequirePackage{bm}
\RequirePackage{esint}
\RequirePackage[e]{esvect}% 矢量箭头
@@ -59,7 +64,7 @@
\RequirePackage{tasks}% 选择题
\settasks{label=\Alph*.}
\RequirePackage{setspace}
-\setstretch{1.5}
+\setstretch{1.25}
\AtBeginDocument{
\everymath{\displaystyle}
\setlength{\abovedisplayskip}{3pt}
@@ -99,8 +104,7 @@
}
\gdef\@chapterfont{#2}
}
-\setmainfont{Libertinus Serif}
-\setsansfont{Libertinus Sans}
+\usepackage[libertine,mono=false]{newtx}
\setcounter{tocdepth}{1}
\AfterEndPreamble{
@@ -116,9 +120,9 @@
\definecolor{headrulecolor}{HTML}{640125}
\definecolor{1号色}{HTML}{4D5AAF} %
\definecolor{2号色}{HTML}{006E54} %
+\definecolor{solutioncolor}{HTML}{0F2350} %
\ifdefstring{\LITE@answer}{ans}{
- \definecolor{solutioncolor}{HTML}{0F2350} %
\def\solutionname{\faIcon{check-square} 分析与解}
\def\ans#1{\underline{\color{solutioncolor}\ #1\ }}
\def\choiceans#1{{\color{solutioncolor}\ #1\ }}
@@ -128,7 +132,6 @@
}{\relax}
\ifdefstring{\LITE@answer}{noans}{
- \definecolor{solutioncolor}{HTML}{FEFEFB} %
\def\solutionname{\faIcon{pen-square} 答题区域}
\def\ans#1{\underline{\phantom{\color{solutioncolor}#1}}}
\def\choiceans#1{\phantom{\color{solutioncolor}}}
@@ -146,6 +149,7 @@
\def\problemname{\faIcon{pen-square} 题目} % 题目=习题
\RequirePackage[most]{tcolorbox}
+\ifdefstring{\LITE@tcolorbox}{breakable}{
\tcbuselibrary{breakable}
\tcbset{
common/.style={
@@ -157,6 +161,22 @@
fonttitle=\bfseries
}
}
+}
+{\relax}
+\ifdefstring{\LITE@tcolorbox}{nobreak}{
+\tcbset{
+ common/.style={
+ blanker,
+ left=3mm,
+ toprule=.3em,
+ bottomrule=.3em,
+ bottomtitle=.75\baselineskip,
+ fonttitle=\bfseries
+ }
+}
+}
+{\relax}
+
\newcounter{prob}[chapter]
\setcounter{prob}{1}
\renewcommand{\theprob}{\arabic{prob}}
@@ -181,42 +201,44 @@
}
\rmfamily}{\end{tcolorbox}}
-\NewDocumentEnvironment{problem}{s o o}{
- \refstepcounter{prob}
- \IfBooleanTF{#1}{
- \def\tagname{\relax}
- }{
- \def\tagname{\hfill\faIcon{tag}}
- }
+\NewDocumentEnvironment{problem}{s !o o}{
+\refstepcounter{prob}
+\IfBooleanTF{#1}{
+\tcbset{
+ wrapfig/.style={sidebyside,righthand width=\dimeval{2\textwidth/7}}}
+}{
+\tcbset{
+ wrapfig/.style={}}
+}
\IfNoValueTF{#3}{
\IfNoValueTF{#2}{
\begin{tcolorbox}[
- common,
+ common,wrapfig,
borderline west={1.5pt}{0mm}{2号色},
title=\color{2号色}{\problemname} \theprob,
coltitle=2号色,
]
}{
\begin{tcolorbox}[
- common,
+ common,wrapfig,
borderline west={1.5pt}{0mm}{2号色},
- title=\color{2号色}{\problemname} \theprob\tagname~#2,
+ title=\color{2号色}{\problemname} \theprob\hfill\faIcon{tag}~#2,
coltitle=2号色,
]
}
}{
\IfNoValueTF{#2}{
\begin{tcolorbox}[
- common,
+ common,wrapfig,
borderline west={1.5pt}{0mm}{2号色},
title=\color{2号色}{\problemname} \theprob(本题#3分),
coltitle=2号色,
]
}{
\begin{tcolorbox}[
- common,
+ common,wrapfig,
borderline west={1.5pt}{0mm}{2号色},
- title=\color{2号色}{\problemname} \theprob(本题#3分)\tagname~#2,
+ title=\color{2号色}{\problemname} \theprob(本题#3分)\hfill\faIcon{tag}~#2,
coltitle=2号色,
]
}
@@ -268,7 +290,6 @@
{\end{tcolorbox}}
\RequirePackage{enumerate}
-% list/itemize/enumerate setting
\RequirePackage[shortlabels,inline]{enumitem}
\setlist{nolistsep,leftmargin=1.5em}
@@ -279,12 +300,13 @@
\RequirePackage{booktabs}
\RequirePackage{paracol}
\columnratio{0.67}
+% sidebyside,righthand width=\dimeval{\linewidth/4}
\RequirePackage{multicol,multirow}
\RequirePackage{fancyvrb}
%绘图
\RequirePackage{tikz} %% load tikz without tikz
-\usetikzlibrary{intersections,decorations.markings,spy,arrows,shapes,fadings,mindmap,shapes.arrows,shapes.symbols,tikzmark,shapes.geometric,graphs,decorations.pathmorphing,through,arrows.meta,shapes.misc,decorations.shapes,angles,backgrounds,calc,math,decorations,decorations.pathreplacing,fit,quotes,shadows,positioning,patterns,shadings}
+\usetikzlibrary{intersections,decorations.markings,spy,arrows,shapes,fadings,mindmap,shapes.arrows,shapes.symbols,tikzmark,shapes.geometric,graphs,decorations.pathmorphing,through,arrows.meta,shapes.misc,decorations.shapes,angles,backgrounds,calc,math,decorations,decorations.pathreplacing,fit,quotes,shadows,positioning,patterns}
\tikzset{>=stealth,line cap=round,line join=round}
\RequirePackage{pgfplots}
\pgfplotsset{compat=1.9}
@@ -318,15 +340,13 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%chapter图片定制开始%%%%%%%%%%%%%%%
+\RequirePackage{titleimage}
+\makeatletter
\def\chapterimage{\gdef\@chapterimage}
\def\@makechapterhead#1{%
- \begin{tikzpicture}[remember picture,overlay]
- \node[scope fading=south,anchor=north,inner sep=0pt,outer sep=0pt] at (current page.north) {\includegraphics[width=\paperwidth]{\@chapterimage}}; % 图片
- \draw [line width=2pt,2号色!40] ($(current page.north west)-(0,3.5/13*\paperwidth)$) -- ($(current page.north east)-(0,3.5/13*\paperwidth)$); % 上线
- \draw [line width=2pt,2号色!40] ($(current page.north west)-(0,4.5/13*\paperwidth)$) -- ($(current page.north east)-(0,4.5/13*\paperwidth)$); % 下线
- \fill [backgroundcolor!40,opacity=0.5] ($(current page.north west)-(0,3.5/13*\paperwidth)$) rectangle +(\paperwidth,-\paperwidth/13); % 中间
- \node at ($(current page.north west)-(-0.5*\paperwidth,4/13*\paperwidth)$) {\ifcsname @chapterfont\endcsname\CJKfamily{chapterfont}\fi\huge\bfseries#1~\color{2号色}\faIcon{feather-alt}}; % 标题
- \end{tikzpicture}\par
+ \titleimage[
+ \ifcsname @chapterfont\endcsname\CJKfamily{chapterfont}\fi\huge\bfseries#1~\color{2号色}\faIcon{feather-alt}]
+ {\@chapterimage}
\vspace{3.5\paperwidth/13}
\thispagestyle{plain}
\fancypagestyle{plain}{
@@ -344,6 +364,7 @@
\centering \ifcsname @chapterfont\endcsname\CJKfamily{chapterfont}\fi \huge \bfseries \color{1号色!80!2号色!80!black} #1\par\nobreak
\vspace*{1em}
}
+ \makeatother
\thispagestyle{plain}
\fancypagestyle{plain}{
\fancyhead{} % 页眉清空
@@ -389,11 +410,10 @@
}
% document setup
+\RequirePackage{siunitx}
\def\e{\mathrm{e}}
\def\i{\mathrm{i}}
-\def\ee#1{\times 10^{#1}}
\def\T{\mathsf{T}}
-\def\unit#1{\,\mathrm{#1}}
\def\mat#1{\mathbf{#1}}
\def\rank#1{\text{R}({#1})}
\def\QED{\hfill\sffamily Q.E.D. }
diff --git a/macros/latex/contrib/litesolution/tex/titleimage.sty b/macros/latex/contrib/litesolution/tex/titleimage.sty
new file mode 100644
index 0000000000..0a4972aae1
--- /dev/null
+++ b/macros/latex/contrib/litesolution/tex/titleimage.sty
@@ -0,0 +1,20 @@
+\NeedsTeXFormat{LaTeX2e}[2020/10/01]
+\ProvidesPackage{titleimage}[2024/03/08/ v0.1 Package for adding south-shading full width picture on the top of page.]
+
+\RequirePackage{tikz,xcolor}
+\usetikzlibrary{shadings}
+\definecolor{titleline}{HTML}{006E54} %
+
+\newsavebox\imagebox % goes into the preamble
+\NewDocumentCommand{\titleimage}{ o m }{
+ \tikz[remember picture,overlay]
+ {
+ \node[scope fading=south,anchor=north,inner sep=0pt,outer sep=auto] at (current page.north) {\includegraphics[width=\paperwidth]{#2}};
+ \IfNoValueF{#1}{
+ \fill [backgroundcolor!40,opacity=0.5] ($(current page.north west)-(0,3.5/13*\paperwidth)$) rectangle +(\paperwidth,-\paperwidth/13); % 中间
+ \draw [line width=2pt,titleline!40] ($(current page.north west)-(0,3.5/13*\paperwidth)$) -- ($(current page.north east)-(0,3.5/13*\paperwidth)$); % 上线
+ \draw [line width=2pt,titleline!40] ($(current page.north west)-(0,4.5/13*\paperwidth)$) -- ($(current page.north east)-(0,4.5/13*\paperwidth)$); % 下线
+ \node at ($(current page.north west)-(-0.5*\paperwidth,4/13*\paperwidth)$) {#1};
+ }
+ }
+} \ No newline at end of file