55 lines
1.5 KiB
TeX
55 lines
1.5 KiB
TeX
|
\usepackage[margin=1in]{geometry}
|
|||
|
\usepackage{environ} % 加了这个再\def\myitem就不报错了
|
|||
|
\usepackage{extarrows}
|
|||
|
\usepackage{amssymb, amsfonts, amstext, amsmath, amsopn, amsthm}
|
|||
|
% \usepackage{mathrsfs} % \mathscr
|
|||
|
\usepackage{enumitem}
|
|||
|
\usepackage{setspace}
|
|||
|
\usepackage{color}
|
|||
|
\usepackage{mylatex}
|
|||
|
\usepackage{diagbox}
|
|||
|
\usepackage{makecell}
|
|||
|
\usepackage{mathtools} % \coloneqq 在好几个包里都出现了,不知道引入哪个最好
|
|||
|
% \usepackage{floatflt}
|
|||
|
% \usepackage{wrapfig}
|
|||
|
\usepackage{picinpar}
|
|||
|
% \usepackage{cutwin}
|
|||
|
% https://www.zhihu.com/question/26837705 试了好几个,发现能在列表和证明环境中完美使用的只有picinpar
|
|||
|
\usepackage{amsrefs}
|
|||
|
\usepackage{hyperref}
|
|||
|
\usepackage{subfiles}
|
|||
|
|
|||
|
|
|||
|
\setlist[1]{label=\arabic{enumi}., listparindent=\parindent}
|
|||
|
\setlist[2]{label=(\arabic{enumii}), listparindent=\parindent}
|
|||
|
\definecolor{shadecolor}{RGB}{204,232,207}
|
|||
|
|
|||
|
\def\myitem#1#2{
|
|||
|
\item \textbf{#1}
|
|||
|
\begin{enumerate}
|
|||
|
#2
|
|||
|
\end{enumerate}
|
|||
|
}
|
|||
|
|
|||
|
\ExplSyntaxOn
|
|||
|
\cs_set:Nn \rawquestionandanswer:Nnnn {%
|
|||
|
\begin{shaded}%
|
|||
|
\ifstrequal{#2}{-}{}{\format_item:Nn #1{#2}} #3%
|
|||
|
\end{shaded}%
|
|||
|
\begin{zhongwen}%
|
|||
|
#4%
|
|||
|
\end{zhongwen}%
|
|||
|
}
|
|||
|
\cs_set:Nn \format_item:Nn {
|
|||
|
\IfBlankTF{#2}{
|
|||
|
\item
|
|||
|
}{
|
|||
|
\item[#1{#2}]
|
|||
|
}
|
|||
|
}
|
|||
|
\cs_set:Nn \simple_format:n {R#1.}
|
|||
|
\newcommand{\questionandanswer}[3][]{%
|
|||
|
\rawquestionandanswer:Nnnn \simple_format:n {#1}{#2}{#3}
|
|||
|
}
|
|||
|
\ExplSyntaxOff
|
|||
|
% 成功实现了,而且下划线也没问题!!!似乎是函数式程序设计,或者装饰器模式?
|