更改長方程式的左邊距

更改長方程式的左邊距

假設我有一個帶有overfull \hboxa 的長對齊方程20pt,並且我想將10ptso 的左邊距減少為overfull \hbox只有 和10pt。如何在不給每行添加負空格的情況下得到這個?

\documentclass[11pt]{article}
\pdfoutput=1
\pagestyle{empty}

\usepackage{amsmath}

\begin{document}
My ``overfull {\textbackslash}hbox'' long equation example
\begin{align}
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\notag\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\notag\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\notag\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\notag\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\notag\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\notag\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\notag\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\notag\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\notag\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\notag\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\notag\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\notag\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x
\end{align}
\end{document}

在此輸入影像描述

我嘗試了包adjustwidth的環境changepage,但有時它不起作用(我不明白為什麼)。

註1。我需要一個可以長期使用的解決方案,多頁“對齊”方程式。我無法將它們分開。

筆記2。我不需要調整方程式的大小。我知道我可以做到,但有時我只需要更改左邊距。

答案1

假設您的方程式包含大量+和/或-符號,您可以考慮減小 length 參數的值\medmuskip。例如,發出指令\medmuskip=2mu可以讓align環境舒適地適應。

完整的 MWE:

\documentclass[11pt]{article}
\usepackage{amsmath,showframe}
\begin{document}
\begingroup % localize scope of next instruction
\medmuskip=2mu % <-- new
\begin{align}
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\notag\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\notag\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\notag\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\notag\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\notag\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\notag\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\notag\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\notag\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\notag\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\notag\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\notag\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\notag\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x
\end{align}
\endgroup
\end{document}

答案2

軟體包的changepage工作原理如廣告所示:)。但是,它不能從一頁開始並停在下一頁!

嘗試以下 MWE(按changepage使用情況,它有效...)更改 oitside margin :

\documentclass[11pt,twoside]{article}
\usepackage{amsmath}
\usepackage[strict]{changepage}

%-------------------------------------- only for show page layout
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%

\begin{document}
My ``overfull \verb+\hbox+ long equation example
    \begin{adjustwidth*}{}{-\marginparwidth}
\begin{equation}
    \begin{aligned}
& x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x   \\
& x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x   \\
& x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x   \\
& x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x   \\
& x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x   \\
& x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x   \\
& x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x   \\
& x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x   \\
& x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x   \\
& x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x   \\
& x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x   \\
& x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x   \\
& x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x
    \end{aligned}
\end{equation}
    \end{adjustwidth*}
\end{document}

在此輸入影像描述

編輯: 如果您想要變更左側(即內部)邊距,例如延伸 22 毫米,可以透過以下方式完成:

\documentclass[11pt,twoside]{article}
\usepackage{amsmath}
\usepackage[strict]{changepage}

%-------------------------------------- only for show page layout
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%

\begin{document}
My ``overfull \verb+\hbox+ long equation example
    \begin{adjustwidth*}{-22mm}{}
\begin{equation}
    \begin{aligned}
& x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x   \\
& x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x   \\
& x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x   \\
& x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x   \\
& x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x   \\
& x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x   \\
& x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x   \\
& x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x   \\
& x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x   \\
& x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x   \\
& x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x   \\
& x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x   \\
& x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x
    \end{aligned}
\end{equation}
    \end{adjustwidth*}
\end{document}

在此輸入影像描述

如果機器人範例在您的文件中不起作用,那麼您的 MWE 中可能存在一些不匹配的情況。

答案3

即使不進行計算也很容易。

\documentclass[11pt]{article}

\usepackage{amsmath}

\begin{document}
My \verb|Overfull \hbox| long equation example
and some text some text some text some text
some text some text some text some text
\begin{equation}
\makebox[\textwidth]{%
$\begin{aligned}
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x
\end{aligned}$}
\end{equation}
\end{document}

在此輸入影像描述

我看到你正在使用\pdfoutput=1.不。編譯用pdflatex.

如果你想破壞顯示,你也可以這樣做,用changepage(但它需要計算);當然,方程式編號也會改變。

\documentclass[11pt]{article}

\usepackage{amsmath,changepage}
\usepackage{showframe} % just for the example

\allowdisplaybreaks

\begin{document}
My \verb|Overfull \hbox| long equation example
and some text some text some text some text
some text some text some text some text
\begin{adjustwidth}{-10pt}{-10pt}
\begin{align}
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+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x+x+x+x+x+x+x+x+x+x+x+x+x+x\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x\\
&x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x+x
\end{align}
\end{adjustwidth}
My \verb|Overfull \hbox| long equation example
and some text some text some text some text
some text some text some text some text

\end{document}

相關內容