使用 \mbox 开始新行时遇到问题

使用 \mbox 开始新行时遇到问题

以下是我迄今为止尝试过的方法

\[\mbox{
\Large$
(1)(1)+2(1)+(-1)2+
\\
(-2)1+0(1)+(1)3+
\\
1(2)+(-1)(1)+0(4)
$}
\]

但是,\\在这里不起作用。有天才可以做到这一点吗?

我使用的原因\mbox是我想要一个相对较大的字体大小。

答案1

两个可能的工作示例:

1)有align环境

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{Large}
\begin{align*}
&(1)(1)+2(1)+(-1)2+{}\\
&(-2)1+0(1)+(1)3+{}\\
&1(2)+(-1)(1)+0(4)
\end{align*}
\end{Large}
\end{document}

2)与gather环境

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{Large}
\begin{gather*}
(1)(1)+2(1)+(-1)2+{}\\
(-2)1+0(1)+(1)3+{}\\
1(2)+(-1)(1)+0(4)
\end{gather*}
\end{Large}
\end{document}

答案2

为了在显示屏上使用更大(或更小)的字体大小,您需要更改大小里面显示,可以使用 来完成minipage。您可能会问为什么:答案如下图的第一个示例所示。 吹毛求疵的人和史蒂文的答案都存在这个问题,即显示之前的段落部分排版时使用了错误的基线跳过。

\documentclass{article}
\usepackage{amsmath}
\usepackage{lipsum} % for mock text

\newenvironment{faligned}[1][\Large]
 {\begin{minipage}{\displaywidth}#1\[\begin{aligned}}
 {\end{aligned}\]\end{minipage}}

\begin{document}

\section{This doesn't really work}

\lipsum[1][1-3]
\begin{Large}
\begin{align*}
&(1)(1)+2(1)+(-1)2+{}\\
&(-2)1+0(1)+(1)3+{}\\
&1(2)+(-1)(1)+0(4)
\end{align*}
\end{Large}
\lipsum[2][1-2]

\section{This does}

\lipsum[1][1-3]
\[
\begin{faligned}
&(1)(1)+2(1)+(-1)2+{}\\
&(-2)1+0(1)+(1)3+{}\\
&1(2)+(-1)(1)+0(4)
\end{faligned}
\]
\lipsum[2][1-2]

\end{document}

在此处输入图片描述

环境faligned有一个可选参数,因此您也可以说

\begin{faligned}[\Huge]
...
\end{faligned}

获得非常大的尺寸。

答案3

修订答案:在这里,我调整了一些宏,以便在数学模式中设置之前tabstackengine放置 TABstack 单元格的内容。我通过引入一个可选参数来实现这一点,其中执行可选参数\Large\TABstackMathstyle事先的进入数学模式来排版单元格内容。

这样,\baselineskip段落的排版就不会受到影响。

\documentclass{article}
\usepackage{tabstackengine}
\setstackgap{L}{1.2\normalbaselineskip}
\makeatletter
\def\TAB@mathPREstyle{}
\renewcommand\TABstackMathstyle[2][]{\renewcommand\TAB@mathstyle{#2}%
  \renewcommand\TAB@mathPREstyle{#1}}

\renewcommand\TABstackMath{\renewcommand\TAB@delim[1]{\TAB@mathPREstyle%
  \ensuremath{\TAB@mathstyle##1}}\let\recent@TAB@delim\TAB@delim}
\makeatother
\TABstackMath
\TABstackMathstyle[\Large]{}% <--NEW SYNTAX WITH OPTIONAL PRE-MATH SETTING
\setstackgap{L}{1.6\baselineskip}
\begin{document}
This is the line before This is the line before
This is the line before This is the line before
This is the line before This is the line before
This is the line before This is the line before
This is the line before
\[
\tabbedCenterstack[l]{
(1)(1)+2(1)+(-1)2+
\\
(-2)1+0(1)+(1)3+
\\
1(2)+(-1)(1)+0(4)
}
\]
This is the line afterward This is the line afterward
This is the line afterward This is the line afterward
This is the line afterward This is the line afterward
This is the line afterward This is the line afterward
This is the line afterward This is the line afterward
This is the line afterward
\end{document}

在此处输入图片描述


原始答案已编辑,以[尝试]纠正 egreg 提到的不正确的间距问题。

\documentclass{article}
\usepackage{tabstackengine}
\stackMath
\setstackgap{L}{1.2\normalbaselineskip}
\begin{document}
%\parskip 20pt
This is the line before This is the line before
This is the line before This is the line before
This is the line before This is the line before
This is the line before This is the line before
This is the line before
\begingroup\par\vspace{-\parskip}\Large
\[
\Vectorstack[l]{
(1)(1)+2(1)+(-1)2+
\\
(-2)1+0(1)+(1)3+
\\
1(2)+(-1)(1)+0(4)
}
\]\endgroup
This is the line afterward This is the line afterward
This is the line afterward This is the line afterward
This is the line afterward This is the line afterward
This is the line afterward This is the line afterward
This is the line afterward This is the line afterward
This is the line afterward
\end{document}

在此处输入图片描述

相关内容