我想排版以下段落:
我目前能够实现的是:
\documentclass{article}
\usepackage{amssymb,csquotes,tabularx}
\begin{document}
\noindent
\begin{tabularx}{\textwidth}{lX}
\( \mathbb{N} \): & set of natural numbers \( (0, 1, 2, \cdots, n, \cdots) \) (N for \textquote{numbers}).\\
\( \mathbb{Z} \): & ring of rational integers (natural numbers and their negatives) (Z for \textquote{Zahlen}).\\
\( \mathbb{Q} \): & field of rational numbers (quotients of elements of \( \mathbb{Z} \)) (Q for \textquote{quotients}).\\
\( \mathbb{R} \): & field of real numbers (R for \textquote{reals}).\\
\( \mathbb{C} \): & field of complex numbers (C for \textquote{complexes}).\\
\( \mathbb{F}_q \): & finite field with \( q \) elements (F for \textquote{finite} or \textquote{field}).
\end{tabularx}
\end{document}
但我不知道如何将括号放在新行中并使其垂直对齐。
另外,它不必是表格,因为通过使其成为表格,内容将变得牢不可破(除非使用longtable
,但宽度不能像 那样简单地设置tabularx
)。我也尝试过,description
但结果不太好(对齐方式不同)。
如何正确排版内容才能获得原始结果?
答案1
另一种解决方案是不使用表格,如果文本很长,表格会增加缩进。请参阅\makebox[][]{}
如果您喜欢不同的水平对齐方式;makebox
可以接受[l]
或[c]
作为[r]
第二个可选参数。
\documentclass{article}
\usepackage{amssymb,csquotes}
\newcommand\setdescr[2]{%
\hangindent=4.5em%
\hangafter=1%
\noindent\makebox[2.5em][r]{\ensuremath{#1}:}\hspace{1em}#2\par}
\usepackage{showframe}
\begin{document}
\setdescr{\mathbb{N}}{set of natural numbers \( (0, 1, 2, \cdots, n, \cdots) \)\newline%
(N for \textquote{numbers}).}
\setdescr{\mathbb{Z}}{ring of rational integers (natural numbers and their negatives)\newline%
(Z for \textquote{Zahlen}).}
\setdescr{\mathbb{Q}}{field of rational numbers (quotients of elements of \( \mathbb{Z} \))\newline%
(Q for \textquote{quotients}).}
\setdescr{\mathbb{R}}{field of real numbers\newline%
(R for \textquote{reals}).}
\setdescr{\mathbb{C}}{field of complex numbers\newline%
(C for \textquote{complexes}).}
\setdescr{\mathbb{F}_q}{finite field with \( q \) elements\newline%
(F for \textquote{finite} or \textquote{field}).}
\end{document}
答案2
像这样?
\documentclass{article}
\usepackage{amssymb,csquotes,tabularx}
\begin{document}
\noindent
\begin{tabularx}{\textwidth}{lX}
\( \mathbb{N} \): & set of natural numbers \( (0, 1, 2, \cdots, n, \cdots) \)\par\quad (N for \textquote{numbers}).\\
\( \mathbb{Z} \): & ring of rational integers\par\quad (natural numbers and their negatives) (Z for \textquote{Zahlen}).\\
\( \mathbb{Q} \): & field of rational numbers\par\quad (quotients of elements of \( \mathbb{Z} \)) (Q for \textquote{quotients}).\\
\( \mathbb{R} \): & field of real numbers\par\quad (R for \textquote{reals}).\\
\( \mathbb{C} \): & field of complex numbers\par\quad (C for \textquote{complexes}).\\
\( \mathbb{F}_q \): & finite field with \( q \) elements\par\quad (F for \textquote{finite} or \textquote{field}).
\end{tabularx}
\end{document}