Page Layoutvmargin | Margin Size Adjustment for odd and even Pages

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
sdelandtsheer
Posts: 14
Joined: Tue Aug 07, 2012 2:50 pm

vmargin | Margin Size Adjustment for odd and even Pages

Post by sdelandtsheer »

Hello,

I was a total LaTeX newbie recently and found my way to write my thesis, solving all the problems by myself. Just one is left.

I use a special document class that I found online. It is called "Thesis". In the class file the margins are defined with the vmargin package. In the output on each page the left margin is bigger than the right margin. I would like that for the even-numbered pages, the situation is reversed (otherwise it looks funny). How do I do that? Which package should I use?

Thank you in advance

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

vmargin | Margin Size Adjustment for odd and even Pages

Post by localghost »

sdelandtsheer wrote:[…] In the class file the margins are defined with the vmargin package. […]
A class file that relies on an obsolete package should also be considered obsolete. I would recommend against this class, not least because there are much more sophisticated classes for writing a thesis [1]. Nevertheless the vmargin manual shows in Section 3.2 how to set margins subsequently.

[1] The TeX Catalogue Online, Topic Index – Typesetting Theses and Papers for Journals


Best regards and welcome to the board
Thorsten
sdelandtsheer
Posts: 14
Joined: Tue Aug 07, 2012 2:50 pm

Re: vmargin | Margin Size Adjustment for odd and even Pages

Post by sdelandtsheer »

Thanks for the reply. As I said I was introduced to LaTeX recently, I liked it and used it while nevertheless doing some awesome mathematics research on HIV propagation that I need to submit by the end of the month. I realize I haven't chosen the right template but that's what google gave me, it looked fine at first look, now the layout is approved by the supervisor I am reluctant to change it and possibly have lots of problems with special formulas or special tables.

The vmargin package, as the manual says in section 3.2, sets the oddmargin and evenmargin to the same values (or else I did not get it). I need to change that. Either I get a helping answer here or I go trial and error by myself, possibly loosing a lot of time.

Thanks anyway
sdelandtsheer
Posts: 14
Joined: Tue Aug 07, 2012 2:50 pm

Re: vmargin | Margin Size Adjustment for odd and even Pages

Post by sdelandtsheer »

Got the cheap solution: I decided to print recto only... More paper, but one problem solved...
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

vmargin | Margin Size Adjustment for odd and even Pages

Post by localghost »

sdelandtsheer wrote:[…] The vmargin package, as the manual says in section 3.2, sets the oddmargin and evenmargin to the same values (or else I did not get it). I need to change that. Either I get a helping answer here or I go trial and error by myself, possibly loosing a lot of time. […]
Au contraire, you got a helping answer. Section 3.2 clearly describes the commands that allow to change the margins. The given values are only examples and of course can be set arbitrarily. So, before criticizing answers kindly take a closer look at the manual you have been referred to. For that you don't need to be a LaTeX expert.

If you expected a more specific answer, you should have given an adequate problem description along with a proper minimal example and with the used class attached (in case this class is not listed on CTAN). This would allow others to comprehend the problem and test possible solutions.
sdelandtsheer
Posts: 14
Joined: Tue Aug 07, 2012 2:50 pm

vmargin | Margin Size Adjustment for odd and even Pages

Post by sdelandtsheer »

Thanks for your patience. I still do not get it. Specifically :

In the manual:

Code: Select all

\setmargins{leftmargin}{topmargin}{textwidth}{textheight}{headheight}{headsep}{footheight}{footskip}
\setmarginsrb{leftmargin}{topmargin}{rightmargin}{bottommargin}{headheight}{headsep}{footheight}{footskip}
The first four parameters of the above two commands are used to set \oddsidemargin, \evensidemargin, \textwidth, \topmargin, and \textheight.
In my class file :

Code: Select all

\def\baseclass{book}

\usepackage{vmargin}
\setmarginsrb           { 1.5in}  % left margin
                        { 0.6in}  % top margin
                        { 1.0in}  % right margin
                        { 0.8in}  % bottom margin
                        {  20pt}  % head height
                        {0.25in}  % head sep
                        {   9pt}  % foot height
                        { 0.3in}  % foot sep
And this is exactly what it is doing, the margins on the left are bigger than on the right. I do not see any other reference to odd or even pages in the class file.
Of note, the function \cleardoublepage works ok.

I know it is probably a stupid question. I am sorry for that. Thanks for your help.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

vmargin | Margin Size Adjustment for odd and even Pages

Post by localghost »

Since you again did not provide a proper minimal example, I will do so to show you that your "problem" does not exist.

In the »book« class the option twoside is set by default. The vmargin manual says that the package respects two-sided printing. So the value for leftmargin determines the inner margin and the value for rightmargin determines the outer margin. And this is exactly shown by the below example.

Code: Select all

\documentclass[12pt,english]{book}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{vmargin}
\usepackage{blindtext}    % Automatic generation of a dummy document

%\setpapersize{USletter}
\setmarginsrb
{1.5in}   % left margin
{0.6in}   % top margin
{1.0in}   % right margin
{0.8in}   % bottom margin
{20pt}    % head height
{0.25in}  % head sep
{9pt}     % foot height
{0.3in}   % foot sep

\begin{document}
  \frontmatter
  \tableofcontents
  \listoffigures
  \listoftables

  \mainmatter
  \blinddocument

  \backmatter
\end{document}
And if you want to modify the margins, simply try the \setmarginsrb command in the preamble of your document. If that does not work, consider a modification of your custom class file. Feel free to ask for assistance.

If this behaviour is not shown in your document, build a proper minimal example. Otherwise this discussion remains academic thus is a waste of my time.
sdelandtsheer
Posts: 14
Joined: Tue Aug 07, 2012 2:50 pm

vmargin | Margin Size Adjustment for odd and even Pages

Post by sdelandtsheer »

Hi.

Thanks for your example. My document does not show this behavior, apparently my custom class, somewhere, overrides the two-side default.

I found a quick fix :

\setboolean{@twoside}{true}

at the beginning of the document (just before title page) solves the problem.


How beautiful it is now!

Thanks
Post Reply