如何使用 LaTeX 方法实现指示的格式选择?
\begin{tcolorbox}[colback=white!100!white]
\textbf{Elementary row operations (Def)} \\
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{flushleft}
Since the rows (horizontal lines) of an augmented matrix correspond to the equations in
the associated system, these three operations correspond to the following operations on
the rows of the augmented matrix:\\
\bigbreak
1. Multiply a row through by a nonzero \\ \qaud constant.\\
2. Interchange two rows.\\
3. Add a constant times one row to another.\\
\bigbreak
These are called elementary row operations on a matrix.
\end{flushleft}
\end{tcolorbox}
答案1
我建议您加载enumitem
包并使用enumerate
三个编号项目的环境,设置选项noitemsep
、itemindent=*
和leftmargin=*
以实现您在发布的屏幕截图中概述的格式目标。请注意,通过此调整,它不再是必要的——或者,就此而言,可取之处——插入所有这些\\
换行指令。
\documentclass{article}
\usepackage{tcolorbox,enumitem}
\newlength\mylen
\settowidth{\mylen}{\textbf{Elementary row operations (Def)}}
\addtolength{\mylen}{5\tabcolsep}
\begin{document}
\noindent
% Optional: Encase the "tcolorbox" environment in a "minipage" of a certain width
\begin{minipage}{\mylen}
\begin{tcolorbox}[colback=white!100!white]
\raggedright % easier than "flushleft" environment
\textbf{Elementary row operations (Def)}
\medskip % or, "\bigskip" if you want even more vertical separation
Since the rows (horizontal lines) of an augmented matrix correspond to the equations in
the associated system, these three operations correspond to the following operations on
the rows of the augmented matrix:
\begin{enumerate}[noitemsep,itemindent=*,leftmargin=*]
\item Multiply a row through by a nonzero constant.
\item Interchange two rows.
\item Add a constant times one row to another.
\end{enumerate}
These are called elementary row operations on a matrix.
\end{tcolorbox}
\end{minipage}
\end{document}
附录:如果您有大量此类枚举列表的实例,那么记住键入可能会变得很乏味
\begin{enumerate}[noitemsep,itemindent=*,leftmargin=*]
每次都这样。相反,你可以定义一个自定义的enumerate
列表,例如,myenum
如下所示:
\newlist{myenum}{enumerate}{1}
\setlist[myenum]{noitemsep,itemindent=*,leftmargin=*,
label=\arabic*.,ref=\arabic*}
然后在需要时在整个文档中使用\begin{myenum}
它。\end{myenum}