3

While setting lecture notes I use a quite wide margin (two side) with a relatively narrow text width. Tables and figures are allowed to use the complete width, if necessary. Now I would like to set an equation using the whole width, which is nearly successful (see MWE below). Only the equation tag sticks still to the textwidth. How can I change this?

\documentclass{scrbook} \usepackage{blindtext} \usepackage[textwidth=12cm, textheight=22cm, includehead=true, includefoot=true, headsep=1.2\baselineskip, marginparsep=0.8cm, marginparwidth=4.2cm, inner=2cm, top=1.5cm ]{geometry} \begin{document} \blindtext % \begin{equation} E = m c^2 \end{equation} % \blindtext % \begin{addmargin*}{0pt}{\marginparsep+\marginparwidth} \begin{equation} EEEEEEEEEEEEEEE = mmmmmmmmmmmmmmmmmmmmmmm c^2 \end{equation} \end{addmargin*} % \blindtext \end{document} 

2 Answers 2

2

it works with the changepage package:

enter image description here

\documentclass{scrbook} \usepackage{blindtext} \usepackage[textwidth=12cm, textheight=22cm, includehead=true, includefoot=true, headsep=1.2\baselineskip, marginparsep=0.8cm, marginparwidth=4.2cm, inner=2cm, top=1.5cm ]{geometry} \usepackage[strict]{changepage} \begin{document} \blindtext % \begin{equation} E = m c^2 \end{equation} % \blindtext \vskip-0.5\baselineskip \begin{adjustwidth*}{}{-\dimexpr\marginparsep+\marginparwidth} \begin{equation} EEEEEEEEEEEEEEE = mmmmmmmmmmmmmmmmmmmmmmm c^2 \end{equation} \end{adjustwidth*} % \blindtext \end{document} 
1
  • Works (nearly) perfectly. Many thanks! --- The only drawback is, that I get a page break in my original document between the equation and the preceding text. And the \vskip-macro seems to be essential, as without it the odd/even page discrimination does not work correctly (even with the strict-option). Commented Oct 18, 2018 at 7:26
2

There are three mistakes with your code:

  • The addmargin environment provides an optional and a mandatory argument, but you are trying to use two mandatory arguments.
  • As the name already says, the addmargin environment adds the values of the arguments to the left and right margin. So to make the margins smaller, you need to use a negative value.
  • The arguments of addmargin should be length or dimensional values not dimensional expressions. For dimensional expressions, you can use \dimeval{…}, \dimexpr …\relax or the calc package.

So a solutions using addmargin would be:

\documentclass{scrbook} \usepackage{blindtext} \usepackage[textwidth=12cm, textheight=22cm, includehead=true, includefoot=true, headsep=1.2\baselineskip, marginparsep=0.8cm, marginparwidth=4.2cm, inner=2cm, top=1.5cm ]{geometry} \begin{document} \blindtext % \begin{equation} E = m c^2 \end{equation} % \blindtext % \begin{addmargin*}[0pt]{-\dimeval{\marginparsep+\marginparwidth}} \setlength{\belowdisplayshortskip}{0pt}% This IMHO improves vertical alignment \begin{equation} EEEEEEEEEEEEEEE = mmmmmmmmmmmmmmmmmmmmmmm c^2 \end{equation} \end{addmargin*} % \blindtext \end{document} 

equation inside the text area and equation spanning text area plus marginpar area

This also works when using another class. In this case you just have to add package scrextend to be able to use the addmargin environment.

BTW: If you want all equation environments to use the extended width, you could use environment hooks, e.g.:

\documentclass{scrbook} \usepackage{blindtext} \usepackage[textwidth=12cm, textheight=22cm, includehead=true, includefoot=true, headsep=1.2\baselineskip, marginparsep=0.8cm, marginparwidth=4.2cm, inner=2cm, top=1.5cm ]{geometry} \AddToHook{env/equation/before}{% \begin{addmargin*}[0pt]{-\dimeval{\marginparsep+\marginparwidth}} \setlength{\belowdisplayshortskip}{0pt}% } \AddToHook{env/equation/after}{% \end{addmargin*} } \begin{document} \blindtext % \begin{equation} E = m c^2 \end{equation} % \blindtext % \begin{equation} EEEEEEEEEEEEEEE = mmmmmmmmmmmmmmmmmmmmmmm c^2 \end{equation} % \blindtext \end{document} 

See “LaTeX's hook management” for more information.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.