{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

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 ...
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 ...
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 ...
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, ...
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 ...
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: ...
12
votes
3answers
687 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 ...
8
votes
1answer
3k 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} ...
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 ...
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 ...
124
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 ...
11
votes
4answers
7k 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 ...
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}.
7
votes
1answer
338 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 ...
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, ...
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 ...
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 ...
10
votes
3answers
2k 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
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} ...
11
votes
3answers
1k 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 ...
12
votes
3answers
15k 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 ...
5
votes
1answer
1k 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 ...
10
votes
3answers
3k 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 ...
9
votes
1answer
879 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 ...
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 ...
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 ...
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 ...
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 ...
16
votes
1answer
2k 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 ...
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?
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 ...
8
votes
1answer
265 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 ...
7
votes
1answer
3k 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 ...
5
votes
2answers
426 views

Line break in citation with organization as author

I have the following reference: @MISC{EX2012, author = {{S}ingle {A}uthor {O}rganization}, year = {2012}, title = {Example} } A citation for this is breaking after "Author", but extending ...
3
votes
1answer
648 views

Average number of characters in one line

How can I calculate the average number of the characters per line of my document?
3
votes
3answers
5k views

How to force LaTeX to put even pages on the right hand side in documentclass article

In documentclass article I try to put even pages on the right hand side of a twoside document (unfortunatelly it is no option for me to change the document class). My point is to start with ...
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 ...
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 ...
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 ...
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 ...
11
votes
3answers
6k 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 ...
9
votes
1answer
738 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 ...
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 ...
11
votes
4answers
4k 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 ...
6
votes
1answer
2k 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 ...
15
votes
1answer
655 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. ...
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 ...
9
votes
3answers
8k views

beamer: frame without decorations, with custom margin

I use \begin{frame}[plain] to have a frame without decorations. The content (inside columns environment) seems to horizontally still respecting the old margins (with Warsaw, gap on the left), although ...
8
votes
1answer
2k views

Change page layout after first page

currently I'm trying to prepare a letter head with XeLaTeX. The first page of the letter should have a sidebar on the right. For this sidebar, the text width should be shrinked to approx. 80% of its ...
4
votes
1answer
966 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)