{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

59
votes
3answers
20k 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 ...
176
votes
4answers
53k 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 ...
53
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 ...
16
votes
1answer
24k 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, ...
38
votes
3answers
10k 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 ...
138
votes
4answers
29k 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 ...
18
votes
4answers
4k 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: ...
23
votes
2answers
4k 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 ...
51
votes
3answers
84k 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 ...
14
votes
3answers
944 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
4k 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} ...
20
votes
3answers
4k 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}.
21
votes
2answers
17k 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 ...
12
votes
4answers
8k 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 ...
16
votes
4answers
25k 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 ...
5
votes
2answers
3k 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. ...
8
votes
1answer
414 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 ...
63
votes
10answers
7k 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, ...
23
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 ...
31
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 ...
21
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 ...
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
3k 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
4k 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 ...
11
votes
3answers
2k 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 ...
11
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
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 ...
18
votes
3answers
3k 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 ...
19
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 ...
39
votes
1answer
744 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 ...
20
votes
5answers
8k 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 ...
16
votes
2answers
9k 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?
15
votes
3answers
8k 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 ...
10
votes
1answer
903 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 ...
14
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
1answer
291 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)
8
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 ...
6
votes
3answers
373 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 ...
5
votes
2answers
622 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 ...
8
votes
1answer
339 views

Center over-long equations between both margins

I understand the reasoning behind the fairly narrow textwidth in a default LaTeX article. 60-80 characters per line and all that. However, I am preparing a document that features many lengthy ...
5
votes
3answers
2k 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 ...
3
votes
1answer
840 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
7k 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 ...
65
votes
4answers
9k 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 ...
57
votes
7answers
39k 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
998 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 ...
12
votes
2answers
12k views

Remove vertical space at start of latex document

I have this test file which is supposed to put Hello there. near the top of the page but it does not work in so far as there is still tons of vertical space at top. How can I fix this? ...
24
votes
3answers
4k 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 ...