我有一个表格环境的代码,但显示不正确。我的小写罗马数字 、 和 后面的右括号是i
对齐iii
的v
,我想让小写罗马数字 、 和 后面的右括号对齐ii
。iv
我vi
以为我已将列间距设为 1.5 英寸……但事实并非如此。为什么\hspace*{2em}
表格环境前面的命令没有将包含表格环境内容的框的左边缘缩进2em
?(我知道还有其他包可用于显示此表。我想使用表格环境并修改我的代码。)
\documentclass{amsart}
\usepackage{amsmath}
\begin{document}
\noindent The following sets have either a least upper bound or a greatest lower bound of 1. \\
\noindent \hspace*{2em}
\setlength{\tabcolsep}{1.5in}
\begin{tabular}{r@{}lr@{}l}
\textbf{i.) } & $\displaystyle{\left\{1 - \frac{1}{n} \mid n \in \mathbb{N}\right\}}$
\textbf{ii.) } & $\displaystyle{\left\{1 + \frac{1}{n} \mid n \in \mathbb{N}\right\}}$ \\[1.2\normalbaselineskip]
\textbf{iii.) } & $\displaystyle{\left\{9\sum_{n=1}^{N} \frac{1}{10^{n}} \mid N \in \mathbb{N}\right\}}$
\textbf{iv.) } & $\displaystyle{\left\{1 - \left(\frac{1}{2}\right)^{n} \mid n \in \mathbb{N}\right\}}$ \\[1.2\normalbaselineskip]
\textbf{v.) } & $\displaystyle{\left\{\sqrt[\uproot{1} \leftroot{-1} n]{2} \mid n \in \mathbb{N}\right\}}$
\textbf{vi.) } & $\displaystyle{\left\{\sqrt[\uproot{1} \leftroot{-1} n]{n} \mid n \in \mathbb{N}\right\}}$
\end{tabular}
\end{document}
答案1
像这样吗?
\documentclass{amsart}
\usepackage{array}
\newcolumntype{L}{>{$\displaystyle}l<$}
\newcommand\mmid{\;\middle\vert\;}
\begin{document}
\noindent
The following sets have either a least upper bound or a greatest lower bound of 1.
\noindent\hspace{2em}% <-- added "\hspace{2em}"
\setlength{\tabcolsep}{0.25in}
\setlength{\extrarowheight}{3ex}
\begin{tabular}{@{} *{2}{r@{\hspace{1em}}L} @{}}
\textbf{i.)} &
\left\{1 - \frac{1}{n} \mmid n \in \mathbb{N}\right\} &
\textbf{ii.)} &
\left\{1 + \frac{1}{n} \mmid n \in \mathbb{N}\right\} \\
\textbf{iii.)} &
\biggl\{9\sum_{n=1}^{N} \frac{1}{10^{n}} \biggm|N \in \mathbb{N\biggr\} &
\left\{1 - \left(\frac{1}{2}\right)^{n} \mmid n \in \mathbb{N}\right\} \\
\textbf{v.)} &
\left\{\sqrt[\uproot{1} \leftroot{-1} n]{2} \mmid n \in \mathbb{N}\right\} &
\textbf{vi.)} &
\left\{\sqrt[\uproot{1} \leftroot{-1} n]{n} \mmid n \in \mathbb{N}\right\}
\end{tabular}
\end{document}
答案2
我认为使用专用工具(即tasks
包)更容易获得您想要的东西。每个工具\task
都值得参考。我添加了一个\set
符号命令set-builder
,灵感来自mathtools
文档中的代码:
\documentclass{amsart}
\usepackage{showframe} \renewcommand{\ShowFrameLinethickness}{0.3pt}
\usepackage{mathtools}
\usepackage{tasks}%
\usepackage{xparse} %
\DeclarePairedDelimiterX{\set}[1]\{\}{\setargs{#1}}
\NewDocumentCommand{\setargs}{>{\SplitArgument{1}{;}}m}
{\setargsaux#1}
\NewDocumentCommand{\setargsaux}{mm}
{\IfNoValueTF{#2}{#1}{\nonscript\,#1\nonscript\;\delimsize\vert\nonscript\:\allowbreak #2\nonscript\,}}
\begin{document}
\noindent The following sets have either a least upper bound or a greatest lower bound of 1.
\settasks{label-width=2em, label-align=right, item-indent=4em, counter-format =\bfseries tsk[r].), column-sep=1in, before-skip=1.5ex, after-skip=1.5ex }
\begin{tasks}(2)
\task $ \set*{1 - \frac{1}{n} ; n ∈ \mathbb{N}} $; \task $ \set*{1 + \frac{1}{n}; d n ∈ \mathbb{N}} $;
\task $ \set*{9∑_{n=1}^{N} \frac{1}{10ⁿ} ; N ∈ \mathbb{N}} $;
\task $ \set*{1 - \left(\frac{1}{2}\right)ⁿ ; n ∈ \mathbb{N}} $;
\task $ \set*{√[\uproot{1} \leftroot{-1} n]{2} ; n ∈ \mathbb{N}} $;
\task $ \set*{√[\uproot{1} \leftroot{-1} n]{n} ; n ∈ \mathbb{N}} $.
\end{tasks}
Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text
\end{document}