GeneralDecrease margin on align environment

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
mro
Posts: 18
Joined: Thu Oct 16, 2008 10:49 pm

Decrease margin on align environment

Post by mro »

Hi there,
I have some large formulas within align* environments.
I would like to keep the page as usual but move the align environment a few centimeters to the left (and obviously decrease the right "margin" in these locations).
Note that these environments extend over multiple pages in my case.
How can this be done easily?
Regards,
Marki

PS. I could decrease font size too, I know, but the fonts would need to be a lot smaller and I only have 30% very long lines, so that would be a bad deal. And yes, I have already put linebreaks wherever I can and I don't really want to put any more, as it doesn't make reading stuff easier because of opening/closing parentheses...)

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10347
Joined: Mon Mar 10, 2008 9:44 pm

Decrease margin on align environment

Post by Stefan Kottwitz »

Hi,

have a look here: Centering wide tables or figures, instead of a table like in that example just use a wide minipage that contains the align* environment.

Stefan
LaTeX.org admin
mro
Posts: 18
Joined: Thu Oct 16, 2008 10:49 pm

Re: Decrease margin on align environment

Post by mro »

Note that this does not really seem to work for multi-page align blocks :-|
User avatar
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

Decrease margin on align environment

Post by Juanjo »

I don't know if I've misunderstood the problem. I suppose that you have quite wide expressions and you'd like to use part of the margins to write them. If this is not the case, a bit of your code will be necessary to clarify the issue. If my hypothesis is correct, the following code may be helpful (cf. this thread for the original definition of MyBox environment):

Code: Select all

\documentclass{article}

\usepackage{framed,amsmath}

\usepackage{lipsum,color}
\definecolor{shadecolor}{rgb}{1,0.8,0.3}

\newenvironment{MyBox}{%
  \def\FrameCommand{\fcolorbox{black}{shadecolor}}%
  %\def\FrameCommand{}
  \MakeFramed{\setlength{\hsize}{1.3\textwidth} \FrameRestore}}%
{\endMakeFramed}

\begin{document}
\lipsum[1-4]
\begin{MyBox}
\allowdisplaybreaks
\begin{align*}
   a&=b+c+e+f+g+h+i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+y+z \\
    &=b+c+e+f+g+h+i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+y+z \\
    &=b+c+e+f+g+h+i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+y+z \\
    &=b+c+e+f+g+h+i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+y+z \\
    &=b+c+e+f+g+h+i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+y+z \\
    &=b+c+e+f+g+h+i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+y+z \\
    &=b+c+e+f+g+h+i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+y+z \\
    &=b+c+e+f+g+h+i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+y+z \\
    &=b+c+e+f+g+h+i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+y+z \\
    &=b+c+e+f+g+h+i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+y+z \\
    &=b+c+e+f+g+h+i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+y+z \\
    &=b+c+e+f+g+h+i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+y+z \\
    &=b+c+e+f+g+h+i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+y+z \\
    &=b+c+e+f+g+h+i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+y+z \\
    &=b+c+e+f+g+h+i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+y+z 
 \end{align*}
\end{MyBox}
\end{document}
Instead of 1.3\textwidth, you may want to assign a suitable length to \hsize. Once fixed this length, you may turn color off. So, delete the actual definition of \FrameCommand and uncomment that lying right below. The lipsum and color packages can be also removed.
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
mro
Posts: 18
Joined: Thu Oct 16, 2008 10:49 pm

Re: Decrease margin on align environment

Post by mro »

Yes your hypothesis was correct.
My output looks kind of weird though using this environment. :-\

It always seems to look more or less like that no matter what I set for the \hsize.

I'm not sure what could be useful to diagnoze this. I am using a book document and also ps4pdf, but I don't suppose that matters much.
Attachments
calcs.jpg
calcs.jpg (23.34 KiB) Viewed 8873 times
User avatar
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

Re: Decrease margin on align environment

Post by Juanjo »

It seems that calcs.jpg shows part of the problematic align environment (a set of finite difference formulas?). Build a minimal working example with the corresponding code. Be sure you add the relevant part of the preamble to get the right font and textwidth. Then post everything here.
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
mro
Posts: 18
Joined: Thu Oct 16, 2008 10:49 pm

Re: Decrease margin on align environment

Post by mro »

So sorry for bothering you again.
I was missing a newline somewhere in the align block so things got messed up in there. :oops:
That error seems to have been less prominent without using the custom environment though.
Thanks again, your solution works just fine for now. :)

Marki
Post Reply