{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

80
votes
3answers
32k 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 ...
211
votes
4answers
78k 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 ...
58
votes
5answers
6k 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 ...
17
votes
1answer
31k 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, ...
25
votes
3answers
5k 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}.
42
votes
4answers
14k 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 ...
19
votes
4answers
6k 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: ...
27
votes
2answers
6k 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 ...
167
votes
4answers
39k 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 ...
69
votes
3answers
134k 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 ...
15
votes
3answers
1k 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 ...
10
votes
1answer
6k views

How to fit landscape multi-page table to textwidth

\usepackage{longtable} \begin{landscape} \begin{table}[!htb] \centering \resizebox{\linewidth}{!}{% \begin{longtable}{|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|} % Table here \end{longtable}% }% \end{table} ...
23
votes
2answers
22k 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 ...
13
votes
4answers
10k views

Scale (resize) large images (graphics) that exceed page margins

Background A large number of screen captures have been scaled 300% at 288dpi. They appear correctly when embedded in OpenOffice, but not LyX. Problem Images that do not extend beyond the margins ...
9
votes
1answer
502 views

Automate Fixed Width Page, length > some minimum length, but only as long as needed

I am trying to automate the solution proposed by egreg to How define a fixed width page, but length > some minimum length, but only as long as needed by hooking into \begin{document} and ...
25
votes
4answers
2k 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 ...
25
votes
4answers
40k views

Setting exact margins

I am writing a document for which I need the margin to be exactly as follows: left, right, top and bottom text margin all equal to 1in, distance from bottom of the paper to page number equal to 0.75in ...
6
votes
1answer
2k views

How can I align section titles and list environments in the left margin?

I was wondering if you could help me with some alignment issues. I've search both here and Google but haven't really found a decent solution. This is what I have (LaTeX default): 1 First section ...
13
votes
3answers
3k views

Minimize automatically the page size of the PDF outputs

I would like to produce the PDF version of the following TEX code without margins. How can I achieve this automaticcaly, even if it needs tricky code (I'm a regular user of Python) ? I would like to ...
6
votes
2answers
5k views

Multiple border around page

I was thinking about giving a finishing touch to my resume by adding a border to the document in black color. I tried using \fancybox but not impressed with the output. ...
71
votes
4answers
12k 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 ...
67
votes
10answers
8k 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, ...
35
votes
3answers
3k 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 ...
24
votes
1answer
4k 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 ...
42
votes
1answer
832 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 ...
18
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
3answers
12k views

What is the easiest way to get borders around a page in LaTeX?

I want my document to have borders in all pages. I imagine I can do that using TikZ, but is there an easier way to do it? I also asked this question here, but as the main question was something ...
15
votes
1answer
3k views

How can I number paragraphs (and sections) in the margin?

I am (still) trying replicate the layout of this document. Sections and paragraphs are all numbered, in the margin (the chapter titles do not treat this as a margin, but I can ignore that). They are ...
12
votes
1answer
1k views

Create a “yearbook-style” multi-page layout of photos

I would like to create a "yearbook-style" layout of photos in LaTeX. Each photo would have a caption and the objective would be to automatically layout the differently sized rectangular photos to ...
11
votes
3answers
4k views

How do I change my margins and spacing to fit the PhD thesis requirements of University XYZ?

Even-odd pages, inner edge 2.5cm, outer edge 1.5cm top and bottom 2cm. 1.5 spacing between the lines, double between paragraphs, no indent. A general solution for other requirements would be best.
17
votes
4answers
5k 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 ...
14
votes
4answers
4k views

Remove margins for title page

The scrbook class calculates margins automatically. For the title page of a book, I would like no margins at all, so that the text would be centered properly. How can I disable all margins for the ...
8
votes
2answers
5k views

How to determine head height automatically

I'm creating three documents with three different headers, containing images or large banners. Is there a way to determine the head height automatically or even better a way to change the head height ...
9
votes
1answer
1k views

Theorem Name/Numbering in Margin

I have seen the previous discussion on this same issue before (see Theorem name and number in margin, note in text), however this did not resolve anything as clearly as I had hoped. Basically, I ...
9
votes
1answer
5k views

geometry, fancyhdr: \fancyfoot[C]{\thepage} is not really centered

After switching from the report class to the book class and starting to use the fancyhdr package to control headers/footers, the page numbers in my footers are no longer centered. This is my fancyhdr ...
3
votes
1answer
1k views

Average number of characters in one line

How can I calculate the average number of the characters per line of my document?
20
votes
3answers
4k 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 ...
21
votes
2answers
3k 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 ...
23
votes
5answers
10k 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 ...
20
votes
2answers
11k views

Scale tikz figure to a percentage of \textwidth

A user asked a question about scaling a figure to a factor of \textwidth and got an answer like this: \documentclass{article} \usepackage{graphicx} \begin{document} ...
20
votes
2answers
1k 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 ...
19
votes
2answers
11k 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?
11
votes
4answers
6k views

Creating Page Border for Single Page only

I am digitizing a book and there is only a single page which has page border as shown in the attached image. How can I create border to a single page? Is there a library where I can choose a border ...
16
votes
2answers
2k 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 ...
8
votes
3answers
462 views

Displaying page construction guides

Is there any way to overlay some lines and dimensions on the document so that one can see where the margins end and more easily examine the overall layout and ratios of elements on the page? See for ...
8
votes
1answer
317 views

How define a fixed width page, but length > some minimum length, but only as long as needed

This recent question on how to increase the width of the output, and this earlier question on how to increase the length of the output reminded me of something I have been wondering: I would like to ...
5
votes
1answer
1k views

Page border coloured

How to create a coloured page border for a document using KOMA-Script scrbook class? Something like this: (image taken from the memoir tutorial)
11
votes
4answers
456 views

\newgeometry doesn't work with Turkish babel package

\newgeometry is a nice feature of geometry package. I found out that it doesn't work (together with many other problems) when \usepackage[turkish]{babel} is also used with many errors stating: ...
9
votes
1answer
4k views

margins in beamer columns

I have some trouble with margins in multi-column layout beamer slides. If put the following snippet in a non-rounded theme like "Rochester", you will see that the boxes of the first row have ...
7
votes
3answers
3k views

Why isn't \textwidth the width of the text?

I'm trying to display two things (a bordered box and a shaded box), both of which stretch across the entire text area - that is, since I have 1cm margins, the box should start 1cm from the left edge ...