我正在使用环境排版练习的子部分array
。但是,练习编号的垂直中心与显示样式分数条不对齐(见下图)。array
欢迎不使用其他方法,但请注意,不同行之间的垂直空间可以更改(例如\renewcommand{\arraystretch}{0.5}
在我的代码中)。如果能帮助解决这种情况,我将不胜感激。
\documentclass[a5paper,12pt]{book}
\usepackage[top=1.5cm,bottom=2cm,includehead=true,inner=2cm,outer=1.8cm]{geometry}
\usepackage{amsmath,amsthm,amssymb}
\usepackage{array}
\begin{document}
\chapter{Chap}
\section{Sec}
text text text text text text text text text text text text text text text text text text text text text text text text text
\subsection{Exercise}
\begin{equation*}
\renewcommand{\arraystretch}{0.5}
\begin{array}{r@{\enspace } >{$\displaystyle}m{4.4cm}<{$} r@{\enspace } >{$\displaystyle}m{4.4cm}<{$}}
1. & {\frac{1}{2}}+{\frac{1}{5}}= & 2. & {\frac{3}{4}}+{\frac{5}{8}}= \\
& & & \\
3. & {\frac{7}{9}}+{\frac{16}{21}}= & 4. & {\frac{5}{6}}+{\frac{11}{14}}= \\
& & & \\
5. & {\frac{15}{22}}+{\frac{11}{26}}= & 6. & {\frac{103}{10}}+8{\frac{5}{16}}= \\
\end{array}
\end{equation*}
\end{document}
答案1
为什么不追求简单呢?
\documentclass[a4paper,12pt]{book}
\usepackage{amsmath}
\usepackage{array}
\begin{document}
\chapter{Chap}
\section{Sec}
Some text for the section.
Some text for the section.
Some text for the section.
Some text for the section.
Some text for the section.
\subsection{Exercises}
\begingroup
\renewcommand{\arraystretch}{2.5}
\setlength{\arraycolsep}{0.5em}
\begin{tabular}{
@{}
l
>{$\displaystyle}l<{$}
@{\hspace{4em}}
r
>{$\displaystyle}l<{$}
@{}
}
1. & {\frac{1}{2}}+{\frac{1}{5}}= & 2. & {\frac{3}{4}}+{\frac{5}{8}}= \\
3. & {\frac{7}{9}}+{\frac{16}{21}}= & 4. & {\frac{5}{6}}+{\frac{11}{14}}= \\
5. & {\frac{15}{22}}+{\frac{11}{26}}= & 6. & {\frac{103}{10}}+8{\frac{5}{16}}= \\
\end{tabular}
\endgroup
\end{document}
答案2
无论如何,练习数字都是在基线上输入的,而分数条则在数学轴上。
如果您确实想对齐它们,这里有一种方法,使用基于tasks
包的更简单的代码:
\documentclass[a5paper,12pt]{book}
\usepackage[top=1.5cm,bottom=2cm,includehead=true,inner=2cm,outer=1.8cm]{geometry}
\usepackage{amsmath,amsthm,amssymb}
\usepackage{tasks}
\begin{document}
\chapter{Chap}
\section{Sec}
text text text text text text text text text text text text text text text text text text text text text text text text text
\subsection{Exercise}
\begin{tasks}[label=\raisebox{0.5ex}{\arabic*.} ](2)
\task $\dfrac{1}{2}+\dfrac{1}{5}= $
\task $ \dfrac{3}{4}+\dfrac{5}{8}= $
\task $ \dfrac{7}{9} + \dfrac{16}{21} = $
\task $ \dfrac{5}{6} + \dfrac{11}{14} = $
\task $ \dfrac{15}{22} + \dfrac{11}{26}= $
\task $ \dfrac{103}{10}+8\,\dfrac{5}{16} = $
\end{tasks}
\end{document}