答案1
使用常规方法enumerate
并将每个方程设置在相同大小的框内(使用eqparbox
的\eqmakebox[<tag>][<align>]{<stuff>}
:
\documentclass{article}
\usepackage{eqparbox}
\begin{document}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ut lorem ac orci ullamcorper mattis.
Nunc at convallis turpis, aliquam vehicula leo. Etiam mollis, urna nec interdum suscipit, lacus
ante mollis risus, placerat efficitur lacus quam at mauris. Vestibulum pretium dolor a eleifend
vestibulum. Duis sed ornare sapien.
\begin{enumerate}
\item First item
\item Second item
\item Third item
\end{enumerate}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ut lorem ac orci ullamcorper mattis.
Nunc at convallis turpis, aliquam vehicula leo. Etiam mollis, urna nec interdum suscipit, lacus
ante mollis risus, placerat efficitur lacus quam at mauris. Vestibulum pretium dolor a eleifend
vestibulum. Duis sed ornare sapien.
\begin{enumerate}
\item
\eqmakebox[leq][l]{$f(x) = \Theta$} \qquad (belonging to~$\Theta$)
\item
\eqmakebox[leq][l]{$f(x+y) = x \leftrightarrow x > y$} \qquad (identity of confusion)
\item
\eqmakebox[leq][l]{$\lambda f(x) = f(x^\lambda)$} \qquad (non-sensible relation)
\end{enumerate}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ut lorem ac orci ullamcorper mattis.
Nunc at convallis turpis, aliquam vehicula leo. Etiam mollis, urna nec interdum suscipit, lacus
ante mollis risus, placerat efficitur lacus quam at mauris. Vestibulum pretium dolor a eleifend
vestibulum. Duis sed ornare sapien.
\end{document}
使用列表而不是tabular
将确保内容按照您的其他列表相同的方式排列,并且将内容设置在类似大小的框中将确保与您的“评论”水平对齐。
答案2
您可以根据tabular
与将提供编号和对齐方式的命令项的组合来定义一个新环境:
\documentclass{article}
\usepackage{array,environ}
\newcolumntype{L}{>{$}l<{$}}
\newcounter{aenum}
\renewcommand{\theaenum}{\arabic{aenum}.}
\newcommand{\aitem}[2]{\refstepcounter{aenum}\theaenum&(#2)\\}
\NewEnviron{annotedeqnlist}{\noindent
\begin{tabular}{rL@{\quad}l}
\setcounter{aenum}{0}%
\BODY
\end{tabular}}
\begin{document}
\begin{annotedeqnlist}
\aitem{f(x) \in \Theta}{belonginess to \( \Theta \)}
\aitem{f(x+y)=x \iff x>y}{identity of confusion}
\end{annotedeqnlist}
\end{document}
我已使用该array
包来提供方便的数学类型列。您可以考虑\displaystyle
按如下方式添加到列定义中:
\newcolumntype{L}{>{$\displaystyle}l<{$}}
答案3
\documentclass[a4paper]{article}
%% Language and font encodings
\usepackage[english]{babel}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
%% Useful packages
\usepackage{amsmath}
\newcommand\lreqn[2]{\noindent\makebox[\textwidth]{$\displaystyle#1$\hfill(#2)}\vspace{2ex}}
\begin{document}
\lreqn{f(x)= \Theta}{first function}
\lreqn{f(x+y)=f(x)+f(y)}{second function}
\end{document}
答案4
代码可能看起来很复杂,但语法相当友好。annotedeqn
环境是由 引入的行列表\item
,以&
为分隔符。前面的部分&
是在数学模式下排版的(如果需要,可以更改),第二部分是在文本模式下排版的。
将测量第一部分,以便我们可以从相同的水平位置开始第二部分,距最宽的第一部分的末端两个 em。
显而易见的假设是每一件物品都适合一行。
\documentclass{article}
\usepackage{environ,xparse}
\usepackage{lipsum}
\ExplSyntaxOn
\NewEnviron{annotedeqnlist}
{
\giusti_annotedeqn_list:V \BODY
}
\seq_new:N \l__giusti_annotedeqn_list_seq
\seq_new:N \l__giusti_annotedeqn_listarg_seq
\seq_new:N \l__giusti_annotedeqn_temp_seq
\box_new:N \l__giusti_annotedeqn_first_box
\cs_new_protected:Nn \giusti_annotedeqn_list:n
{
% get the items
\seq_set_split:Nnn \l__giusti_annotedeqn_list_seq { \item } { #1 }
% discard the first empty item
\seq_pop_left:NN \l__giusti_annotedeqn_list_seq \l_tmpa_tl
% massage the items
\seq_clear:N \l__giusti_annotedeqn_listarg_seq
\seq_map_inline:Nn \l__giusti_annotedeqn_list_seq
{
\seq_set_split:Nnn \l__giusti_annotedeqn_temp_seq { & } { ##1 }
\seq_put_right:Nx \l__giusti_annotedeqn_listarg_seq
{
{\seq_item:Nn \l__giusti_annotedeqn_temp_seq { 1 } }
{\seq_item:Nn \l__giusti_annotedeqn_temp_seq { 2 } }
}
}
% measure the equations
\hbox_set:Nn \l__giusti_annotedeqn_first_box
{
$\begin{array}{@{}l@{}}
\seq_map_function:NN \l__giusti_annotedeqn_listarg_seq \__giusti_annotedeqn_first:n
\end{array}$
}
% produce the enumerate environment
\begin{enumerate}
\seq_map_function:NN \l__giusti_annotedeqn_listarg_seq \__giusti_annotedeqn_item:n
\end{enumerate}
}
\cs_generate_variant:Nn \giusti_annotedeqn_list:n { V }
\cs_new_protected:Nn \__giusti_annotedeqn_first:n
{
\use_i:nn #1 \\
}
\cs_new_protected:Nn \__giusti_annotedeqn_item:n
{
\__giusti_annotedeqn_item:nn #1
}
\cs_new_protected:Nn \__giusti_annotedeqn_item:nn
{
\item
\makebox[\box_wd:N \l__giusti_annotedeqn_first_box][l]{$#1$}
\qquad
#2
}
\ExplSyntaxOff
\begin{document}
\lipsum*[2]
\begin{annotedeqnlist}
\item f(x) \in \Theta & (belonginess to \( \Theta \))
\item\label{confusion} f(x+y)=x \iff x>y & (identity of confusion)
\item \lambda f(x)=f(x^\lambda) & (non-sensible relation)
\end{annotedeqnlist}
with a reference to item~\ref{confusion}.
\lipsum*[3]
\begin{annotedeqnlist}
\item f(x) \in \Theta & (belonginess to \( \Theta \))
\item \lambda f(x)=f(x^\lambda) & (non-sensible relation)
\end{annotedeqnlist}
\end{document}