如何使用 \hfill 命令编写符号列表并能够转到新行?

如何使用 \hfill 命令编写符号列表并能够转到新行?

我写了一个带有以下粗略代码的符号列表:

$B(x_0, r)$\hfill the open ball $\{x\in\R^d:|x-x_0|<r\}$
\par\smallskip\noindent
$\BUC(E)$\hfill the space of bounded and uniformly continuous functions on $E\subseteq\R^n$

tex 生成的结果是:

在此处输入图片描述

我希望$E\subseteq\mathbb R^n$有界且均匀的空间……。 我怎样才能做到这一点?

谢谢

答案1

也许您可以使用 xltabular(tabularx 与可变宽度列和 longtable 的组合,允许表格跨页分页,但分页符不会破坏表格单元格)和 p 列,其内容是 -environment,varwidth进而通过 \raggedleft向右移动:

% \errorcontextlines=10000
\documentclass{article}

\usepackage{amsmath, amssymb, xltabular, varwidth, blindtext}

\makeatletter
\newcolumntype{R}[1]{%
  >{%
     \raggedleft
     \begin{varwidth}[t]{#1}%
%     \narrowragged
% This allows more hyphenation:
%     \hyphenpenalty=50
%     \exhyphenpenalty=50
%     \doublehyphendemerits=50
% This forbids hyphenation:
%     \hyphenpenalty=10000
%     \exhyphenpenalty=10000
% This will shift lines inside the varwidth to the right:
%     \raggedleft
     \let\newline\\%
     \arraybackslash
   }%
  p{#1}%
  <{%
     \@finalstrut\@arstrutbox\end{varwidth}%
   }%
}
\makeatother


\DeclareMathOperator\BUC{BUC}
\newcommand\R{\mathbb{R}}

\begin{document}

\noindent text \hfill text

% Play with \arraystretch to adjust the vertical distance
% between table-rows:
% \renewcommand{\arraystretch}{1.5}

\noindent
% [l] = longtable-property
% {\textwidth} = total width of table is textwidth
% {@{}p{.2\textwidth}XR{.7\textwidth}@{}} = column-specifiers:
%    @{} - no horizontal gap at the left of the leftmost-column
%    p{.2\textwidth} - a column consisting of \parboxes of width .2\textwidth
%    X - a column whose width is calculated so that total width of table is achieved
%    R{.7\textwidth} - raggedright-varwidth-column of maximum-width .7\textwidth
%    @{} - no horizontal gap at the right of the rightmost-column
\begin{xltabular}[l]{\textwidth}{@{}p{.2\textwidth}XR{.7\textwidth}@{}}
$B(x_0, r)$&&the open ball $\{x\in\R^d:|x-x_0|<r\}$\\
$\BUC(E)$&&the space of bounded and uniformly continuous functions on $E\subseteq\R^n$
\end{xltabular}

\end{document}

在此处输入图片描述

如果你不喜欢“functions”这个词被连字符连接,那么激活“这禁止连字符:”下面的行,结果将如下所示:

在此处输入图片描述

相关内容