平均能量损失
\documentclass[a4paper,twoside,openright,12pt]{book}
\usepackage{geometry}
\usepackage[svgnames]{xcolor}
\usepackage[listings,skins,breakable,hooks]{tcolorbox}
\usepackage{empheq}
\usepackage{enumitem}
\usepackage[color]{changebar}
\newcommand\A{True choice is \textbf{A}.}
\newcommand{\dort}[4]{
\begin{enumerate}[label=\textbf{\Alph*}),itemsep=-3pt,topsep=1pt]
\item #1
\item #2
\item #3
\item #4
\end{enumerate}}
\definecolor{formulzemin}{RGB}{255,255,170}
\newcommand*\mybox[1]{%
\colorbox{formulzemin}{\hspace{1em}#1\hspace{1em}}}
\newcommand{\denk}[1]{\begin{empheq}[box=\mybox]{align}{\textnormal{#1}\nonumber}\end{empheq}}
\newcommand{\kutu}[2]{\begin{tcolorbox}[enhanced jigsaw,breakable, left=0mm,right=0mm,bottom=0mm,top=0mm,colback=red!5!white,colframe=red!75!black,pad at break=1mm,]#1 \begin{flushright}\textit{#2}\end{flushright}\end{tcolorbox}}
\newcommand{\soru}[1]{\begin{tcolorbox}[enhanced,breakable=false,left=0mm,right=0mm,bottom=0mm,top=0mm,colback=white!5!white,colframe=white!75!white,frame hidden,borderline={.3mm}{0mm}{blue,dotted}]{#1}\end{tcolorbox}}
\begin{document}
\newgeometry{left=1cm,right=1cm,top=2.5cm,bottom=2.5cm,marginparwidth=0cm,marginparsep=0cm,outer=1cm}
\twocolumn
\begin{enumerate}
\soru{\item Question one?
\dort{ITU}{ECC}{HAM}{ARRL}}
\kutu{\denk{International Telecommunication Union}}{\A}
\kutu{\denk{International Union}}{\A}
\end{enumerate}
\end{document}
并输出
如果答案选项很长,则上面有空格。如果答案选项很短,则上面没有空格。长答案选项的开头是短答案的开头。如何解决这个问题?
答案1
只需在命令的tcolorbox中添加选项键即可\kutu
:
oversize
:防止 tcb 的大小与文本长度成比例,halign=center
:使 tcb 的文本水平居中。
\newcommand{\kutu}[2]{%
\begin{tcolorbox}[%
oversize,
halign=center,
enhanced jigsaw,
breakable, left=0mm,
right=0mm,bottom=0mm,top=0mm,
colback=red!5!white,
colframe=red!75!black,
pad at break=1mm]
#1%
\begin{flushright}
\textit{#2}
\end{flushright}
\end{tcolorbox}
}
更新
如果希望文本和 tcolorbox 顶部边框之间留出尽可能小的空白,可以在环境\abovedisplayskip=0pt
开始后立即添加声明\kutu
。文本和边框之间的空格也已更改为:left = -1mm, right = -1mm
。
\soru{%
\item Question one?
\dort{ITU}{ECC}{HAM}{ARRL}
}
\kutu{%
\abovedisplayskip=0pt
\denk{International Telecommunication Union}}{\A}
\kutu{%
\abovedisplayskip=0pt
\denk{International Union}}{\A}