我有一个自定义布局,其中有一个宽边距,有点像 1.5 列文档。我希望在边距中放置方程式和方程式标签,类似于其他人cuted
对两列文档所做的操作。我想使用两个边距,如下图所示:
以下是 MWE:
\documentclass{scrbook}
\usepackage[utf8]{inputenc}
\usepackage[includemp, showframe,
paperwidth=18.90cm,
paperheight=24.58cm,
top=2.170cm,
bottom=3.510cm,
inner=1.5835cm,
outer=1.5835cm,
marginparwidth=4.28cm,
marginparsep=0.4cm]{geometry}
\usepackage{lipsum}
\begin{document}
\section{Introduction}
\lipsum[1]
A short equation:
\begin{equation}
A + B = C
\end{equation}
A long equation:
\begin{equation}
\sin x + \cos x + \tan x + \sinh x + \cosh x + \tanh x + \int \sin x dx + \int \cos x dx + \int \tan x dx + \sec x
\end{equation}
\lipsum[2]
\lipsum[3]
\lipsum[4]
Another short equation
\begin{equation}
D + E = F
\end{equation}
Long equation again:
\begin{equation}
\sin x + \cos x + \tan x + \sinh x + \cosh x + \tanh x + \int \sin x dx + \int \cos x dx + \int \tan x dx + \sec x
\end{equation}
\end{document}
答案1
从你的草图来看,我假设你只希望长方程式进入边距。你可以使用changepage
's轻松地在适当的方程式处加宽线条adjustwidth
。请注意,如果方程式是环境中的第一个方程式,则必须将其向上移动一行,因为它在内部是一个列表环境。
\documentclass{scrbook}
\usepackage[utf8]{inputenc}
\usepackage[includemp, showframe,
paperwidth=18.90cm,
paperheight=24.58cm,
top=2.170cm,
bottom=3.510cm,
inner=1.5835cm,
outer=1.5835cm,
marginparwidth=4.28cm,
marginparsep=0.4cm]{geometry}
\usepackage{lipsum}
\usepackage[strict]{changepage}
\newenvironment{fullwidth}
{\begin{adjustwidth*}{}{\dimexpr-\marginparwidth-\marginparsep\relax}}
{\end{adjustwidth*}}
\begin{document}
\lipsum[1]
A short equation:
\begin{equation}
A + B = C
\end{equation}
A long equation:
\begin{fullwidth}
\vspace{-\baselineskip}
\begin{equation}
\sin x + \cos x + \tan x + \sinh x + \cosh x + \tanh x + \int \sin x dx + \int \cos x dx + \int \tan x dx + \sec x
\end{equation}
\end{fullwidth}
\lipsum[2]
\lipsum[3]
\lipsum[4]
Another short equation
\begin{equation}
D + E = F
\end{equation}
Long equation again:
\begin{fullwidth}
\vspace{-\baselineskip}
\begin{equation}
\sin x + \cos x + \tan x + \sinh x + \cosh x + \tanh x + \int \sin x dx + \int \cos x dx + \int \tan x dx + \sec x
\end{equation}
\end{fullwidth}
\end{document}
如果您希望所有方程式都使用全宽,您也可以equation
通过将其添加到 MWE 的序言中来修补环境:
\usepackage[strict]{changepage}
\newenvironment{fullwidth}
{\begin{adjustwidth*}{}{\dimexpr-\marginparwidth-\marginparsep\relax}}
{\end{adjustwidth*}}
\AddToHook{env/equation/before}{\begin{fullwidth}\vspace{-\baselineskip}}
\AddToHook{env/equation/after}{\end{fullwidth}}