{margins} is about dealing with (above all, changing) the margins of (whole) pages and, conversely, the width and height of the textblock and its positioning on the page. Popular packages are {geometry} and {typearea}. For changing the "margins" in the middle of a page, use {indentation} instead.

learn more… | top users | synonyms

142
votes
4answers
38k views

Difference between \textwidth, \linewidth and \hsize

The three lengths \textwidth, \linewidth and \hsize seem to all hold the width of the current line. At least I never saw some real difference between \textwidth and \linewidth in my code. Both seem to ...
126
votes
4answers
21k views

Why are default LaTeX margins so big?

I've read that—unless I know a lot about typesetting—I shouldn't change the margins of a LaTeX document. The default margin size of the article class is really big and it feels like a lot of space is ...
60
votes
10answers
6k views

Preparing PDF files for ebook readers, etc.

People are nowadays increasingly often reading papers on screen, using ebook readers, tablet PCs, laptops, etc. A typical PDF file generated with Latex is far from ideal for such use; in particular, ...
59
votes
4answers
7k views

Modern book design, margins and typed area

The golden fleece of book design has been the typesetting of the typed area in relation to the paper and the spread. Famous typographers such as Jan_Tschichold and Rosarivo devised canon's of page ...
53
votes
7answers
30k views

Custom margin settings for figure in LaTeX

I have a fairly large figure in a LaTeX document. This figure is too large for the left and right margin of the document. This results in the figure being placed flush with the left margin, and way ...
50
votes
4answers
3k views

How to scale a tikzpicture to \textwidth

I would like to scale my tikzpicture to exactly (or a proportion of) the \textwidth Of course I could play with the [scale=0.5] option until I found the right value, but I assume there must be an ...
48
votes
3answers
13k views

Center figure that is wider than \textwidth

I have a figure that is wider than the \textwidth of my document. (I don't want to change the \textwidth.) As a result, the leftmost part of the figure is flush with the left margin, while the ...
39
votes
1answer
669 views

different type areas on even/odd pages

in some (very rare) cases, it might be desirable to have the type area, particularly the text width, be different on even and odd pages. Let's say we're typesetting a textbook that's supposed to have ...
37
votes
3answers
55k views

How to force a table into page width?

I have the following table: \begin{table}[htb] \begin{tikzpicture} \node (table) [inner sep=0pt] { \begin{tabular}{ l | l } {\bf Symptom} & {\bf Metric} \\ \hline Class that has many accessor ...
35
votes
3answers
8k views

pgfplots: how can I scale to text width?

This question led to a new package: tikzscale When I try to scale a plot with: width=\textwidth there is some horizontal space between the start/end of the plot and the start/end of the ...
29
votes
1answer
482 views

Non-rectangular body geometry

I'd love to typeset a document where the inner margin follows a sinuous path. For example, like the one below (done in Scribus). I tried wrapping the text around a curvy image set at the appropriate ...
27
votes
3answers
2k views

Nicely force 66 characters per line

I would like to have "something" (a package, a trick, a macro, ...?) that makes it possible for me to nicely play with the margins (or the layout) in order to set the average or typical number of ...
23
votes
1answer
778 views

Why doesn't a 17cm x 25cm picture fit on a 17cm x 25cm page?

Why doesn't this tikz picture fit on the first page of the document? \documentclass{report} \usepackage{tikz} \usepackage[showframe, centering, text={17cm, 25cm}]{geometry} \begin{document} ...
22
votes
4answers
1k views

How to set a letter to the margin of the page and position it vertically according to alphabetical order?

I would like to place a letter (that indicates which letter in the dictionary is shown) on the outer side of the book, set it for example in a darker box and position that letter vertically. Users of ...
21
votes
2answers
7k views

How to find the \textwidth in two-column mode?

Sometimes I find that floats don't fit nicely on a page, so I use \resizebox{\textwidth}{!}{ <blah blah blah> } so that the borders match the margins. However, I'm now working on a paper in ...
21
votes
3answers
3k views

Best ratios of number of letters per line and of number of lines per page

I am actually writing a master thesis in LaTeX but I didn't really like the default page style of the document style book. Therefore I tried to make my own page style and I resized manually the ...
20
votes
2answers
3k views

Squeeze some more lines on the current page

During the last phase of layout I frequently get a single line or two on a separate page. Rather then pulling the whole paragraph on that last page I would like to "squeeze" the lines on the previous ...
20
votes
1answer
946 views

Is there an overview of Beamer's slide (page) geometry anywhere?

I find this classic figure of LaTeX's page geometry very helpful: Source: http://commons.wikimedia.org/wiki/File:Latex_layout.svg Now, I am fiddling with some beamer slides and I could really use ...
19
votes
2answers
2k views

Default margins for geometry package

I want to explicitly specify sizes of my document. For this purposes I use geometry package. I do the following (I found the solution here): \documentclass{article} \usepackage[paperwidth=2394pt, ...
19
votes
2answers
2k views

Margin Figures/Captions

I have two figure/caption related questions. Firstly, in many textbooks, it is customary to put thin figures (along with their captions) entirely in the outer margin of the page. What is the most ...
19
votes
5answers
821 views

Different margin on first page

To meet the conditions of our corporate design I need other margins on the first page of each document. The normal page layout is given by \usepackage[left=3cm,right=2cm,bottom=3cm,top=2cm]{geometry} ...
18
votes
3answers
3k views

Illogical twoside margins

Shouldn't the twoside option produce a wider margin at the binding/spine edge, rather than the other way around? I'm using \documentclass[twoside]{report}.
18
votes
4answers
6k views

Draw true page border

Is there a way to draw a rectangle around every page? The problem is that my document (a Ph.D. thesis) is in a funny format (16x24cm). So to print it centered on A4 paper (for reviewing) I played ...
18
votes
2answers
841 views

A package to help with layout generation? Graph paper in the background?

Once in a while I have to create a layout given by several parameters, such as "left margin 3cm, logo 4 cm from the right margin, 2cm high" etc. Now I use geometry package an other helpers to create a ...
17
votes
4answers
2k views

A line of length \textwidth in TikZ

Why does the following latex document: \documentclass{minimal} \usepackage{tikz} \begin{document} \noindent \begin{tikzpicture} \draw (0,0) -- (\textwidth,0); \end{tikzpicture} ...
17
votes
4answers
3k views

Putting a bar in the margin

I sometimes want to give examples in a document I am writing. Because these examples are quite general it could be difficult for readers to see the difference between the examples and the theoretical ...
17
votes
3answers
15k views

making a table fit on a page by moving it left

I have a table where the last columns fall off the page. Instead of making the text smaller I would like the table to not adhere to the margin of where it begins. I would like to move it to the left. ...
17
votes
4answers
3k views

Place figures side by side, spill into outer margin

I would like to place two figures side by side (not subfigures) and what’s more, I’d like to let the figures spill into the outer margin (since they are too wide for the the text width. Like this: ...
17
votes
3answers
13k views

Determine text width

For sizing figures in LaTeX it's helpful to know how wide the text is so that figures can be sized to match without rescaling. LaTeX provides \textwidth for reference by other commands, e.g. ...
17
votes
1answer
25k views

Scale figure to a percentage of \textwidth

I would like to change my figure's width to a precentage of my \textwidth: \textwidth /2 would scale to 50% of the \textwidth. What is the proper syntax (if any) to do this ?
17
votes
2answers
614 views

Is there any package to automatically select font size and margins to optimize pages?

Suppose I am preparing multi-page handouts using LaTeX. I don't care much about the font and margins size (while they are reasonable), but I would like all the pages to be filled, ie. avoid the ...
16
votes
1answer
3k views

Overview of Margins in KOMA Script/TypeArea

I am looking for some dimensions associated to page layout using the KOMA Script classes. However, I find it very difficult to find the individual commands. Does there exist something like such an ...
16
votes
2answers
13k views

Different margins for title page

My document class is article with a4paper. The margins that I want for the body are: top: 1 inch bottom: 1 inch right: 0.5 inch left: 1.5 inch The title page should have a 1 inch margin on all four ...
16
votes
1answer
933 views

Wrong protrusion with csquotes and microtype

I’m experiencing problems using the csquotes package and microtype using protrusion (margin kerning). The problem is that using \enquote I only get margin kerning on the left margin. ...
15
votes
3answers
2k views

Making a LaTeX document appear as though it were typeset in MS Word

I am typesetting a document in LaTeX for which I have been given exact specifications that are intended for an MS Word-processed document (single-sided, single-spaced, 0.75 inch margins, no more than ...
15
votes
2answers
4k views

How can I get todonotes in the left margin

I want to use the package todonotes. Standard, the package prints the todo's in the right margin, while I want to have them in the left margin. Funny is, that in the manual itself they are placed in ...
15
votes
1answer
2k views

Geometry settings for default document layout?

How can I obtain the corresponding settings for the geometry package so that the document looks just like the standard article or report? Assume that I have a document in the default style, and I ...
15
votes
2answers
745 views

Problem with the geometry package reset option

Page 11 of the geometry package manual says that the reset option sets back the layout dimensions and switches to the settings before geometry is loaded. On page 30 there is a slightly different ...
15
votes
1answer
658 views

How could one setup a layout for a dictionary? (if possible)

A friend asked me if I knew any free software for creating dictionaries - which is good at saving space (reduce total number of pages). Example: I suppose this might be possible in LaTeX. ...
15
votes
1answer
822 views

Create a fancy page layout

In the following picture (desired layout) the grayed area is reserved for the header. It is supposed to be fancy looking with tikz pictures, chapter/section names with pretty fonts etc. The ...
15
votes
2answers
395 views

Periodic word count in margin

I need to have a continuous word count for an assignment. This is either in the form of a note in the margin or one parenthesised in-text every 100 words or so. For instance, ----- TEXT ------|- ...
14
votes
2answers
5k views

Caption of figure in marginpar and caption of wrapfigure in margin

I'm writing my master thesis and have run into trouble with the layout of captions in relation to the margins. I have two main questions: How can I make the caption text of an figure placed in a ...
14
votes
2answers
6k views

margins of book class

I would like to know what are the margins (top, right,bottom and left; in meters) that are by default assigned for thebook class. Is there a command or a way to know them?
14
votes
1answer
18k views

Change \textwidth and \textheight in mid-document

I set my \textwidth and \textheight in the preamble and would like to change both for some pages. How can this be done? E.g., the following example for \textwidth appears to work for the page number, ...
14
votes
2answers
1k views

Storing the original document class page layout with geometry

Is it possible, using the geometry package, to store (and restore) the original layout specified by the document class (in my case, the class is report)? Here is some context. I have been editing ...
14
votes
2answers
712 views

Customised section overlapping in margin

How can I fix the following overlap happening in the margin? I want the numbers to follow each other with a comma in between them. Edit: Clarification of the question. The text needs to be flowing ...
14
votes
1answer
1k views

Rules of thumb for size of binding correction (BCOR)

I was searching for this for a while now and I keep getting referred to an article about binding correction (probably in german) that seems to be offline. Another tip was to measure the horizontal ...
14
votes
1answer
354 views

How to typeset a complex layout like a page of the Talmud?

I need help for typesetting a complex typographic layout comparable to the Talmud, yet not necessarily in Hebrew. I found the parcolumns package, but it does not support footnotes and it also does ...
13
votes
3answers
693 views

How to set colored ruled margins for different pages?

I want to write a LaTeX document, and I want to have document rules (colored margins distinguishing sections and/or even/odd pages). Here is a model of what I have in mind: How can this be ...
13
votes
2answers
490 views

Inserting a line to separate the text and the margin note

How can I insert a vertical line through a whole page to separate the text and the margin notes?