Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm‎ using ‎the ‎geometry package in the ‎book‎ class‎ ‎and now I ‎want‎ the margins of the first page of each chapter ‎to‎ be, for example, top=50mm, ‎bottom=50mm‎, ‎left=50mm‎, ‎‎right=50mm‎ and the margins of other pages to be, say, ‎top=3‎0mm, ‎‎bottom=3‎0mm‎, ‎‎left=3‎0mm‎, ‎‎‎‎right=30‎mm.‎ BTW,‎ I ‎want‎ to do it in the preamle, and not in the document ‎body ‎itself. For ‎convenience,‎ I put ‎the‎ following MWE:‎‎

‎\documentclass{book}‎
\usepackage[top=50mm, ‎bottom=50mm‎, ‎left=50mm‎, ‎‎‎right=50mm]{geometry}‎‎‎
‎‎\usepackage{lipsum‎} ‎‎
‎\begin{document}‎‎‎‎‎
‎‎\chapter{One‎}‎‎‎
‎\lipsum[1-‎‎‎12‎‎‎]‎
‎\chapter{Two‎}‎‎‎‎
‎\lipsum[4-‎8‎]         
‎‎‎‎\end{document}‎‎‎

I'm‎ familiar with ‎command‎s like \newgeometry, \savegeometry, ‎and‎ \loadgeometry ‎etc‎, but I couldn't ‎accomplish‎ that. ‎Can‎ anybody please help me do that?

share|improve this question
5  
It's not easy in TeX to change line width mid-paragraph unless you know in advance how many lines are required for the first width. thus you can not change the lien width at an automatic page break the whole paragraph has already been set with the settings from the first page. If you have a fixed break such as \clearpage then you can reset the geometry at that point (as done in lscape package for example) it would perhaps be possible in some cases with a multiple-pass procedure that determined the page break on one pass and re-set on later passes, or using luatex which has extra features here –  David Carlisle Sep 20 '12 at 22:17
    
I would try afterpage package. But this isn't working for me: \newgeometry{top=50mm,bottom=50mm,left=50mm,right=50mm} \afterpage{\clearpage\restoregeometry} (just thought mentioning the package could help) –  someonr Sep 20 '12 at 22:37
    
Cannot it be done using another package? –  Vahid Damanafshan Sep 22 '12 at 20:57
    
@VahidDamanafshan -- I'm afraid there is no existing, automatic solution in 'package' form. Perhaps someone could get clever with LuaTeX, but I don't think anyone has done so yet. –  jon Sep 25 '12 at 1:18
    
Does this help: tex.stackexchange.com/a/13451/10898 –  azetina Oct 7 '12 at 13:05

1 Answer 1

It's not easy in TeX to change line width mid-paragraph unless you know in advance how many lines are required for the first width. thus you can not change the line width at an automatic page break the whole paragraph has already been set with the settings from the first page.

If you have a fixed break such as \clearpage then you can reset the geometry at that point (as done in lscape package for example) it would perhaps be possible in some cases with a multiple-pass procedure that determined the page break on one pass and re-set on later passes, or using luatex which has extra features here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.