Page Layout ⇒ vmargin | Margin Size Adjustment for odd and even Pages
-
- Posts: 14
- Joined: Tue Aug 07, 2012 2:50 pm
vmargin | Margin Size Adjustment for odd and even Pages
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
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
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.sdelandtsheer wrote:[…] In the class file the margins are defined with the vmargin package. […]
[1] The TeX Catalogue Online, Topic Index – Typesetting Theses and Papers for Journals
Best regards and welcome to the board
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
-
- Posts: 14
- Joined: Tue Aug 07, 2012 2:50 pm
Re: vmargin | Margin Size Adjustment for odd and even Pages
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
-
- Posts: 14
- Joined: Tue Aug 07, 2012 2:50 pm
Re: vmargin | Margin Size Adjustment for odd and even Pages
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
vmargin | Margin Size Adjustment for odd and even Pages
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.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. […]
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.
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
-
- Posts: 14
- Joined: Tue Aug 07, 2012 2:50 pm
vmargin | Margin Size Adjustment for odd and even Pages
In the manual:
In my class file :The first four parameters of the above two commands are used to setCode: Select all
\setmargins{leftmargin}{topmargin}{textwidth}{textheight}{headheight}{headsep}{footheight}{footskip} \setmarginsrb{leftmargin}{topmargin}{rightmargin}{bottommargin}{headheight}{headsep}{footheight}{footskip}
\oddsidemargin
,\evensidemargin
,\textwidth
,\topmargin
, and\textheight
.
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
Of note, the function \cleardoublepage works ok.
I know it is probably a stupid question. I am sorry for that. Thanks for your help.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
vmargin | Margin Size Adjustment for odd and even Pages
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}
\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.
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
-
- Posts: 14
- Joined: Tue Aug 07, 2012 2:50 pm
vmargin | Margin Size Adjustment for odd and even Pages
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