{minipage} is an environment providing a paragraph box which is a complete mini version of a page.

learn more… | top users | synonyms

38
votes
3answers
17k views

\parbox vs. minipage: Differences in applicability

Lamport, LaTeX: A document preparation system, states on p. 104: There are two ways to make a parbox at a given point in the text: with the \parbox command and the minipage environment. They can ...
34
votes
2answers
3k views

How to keep a constant baselineskip when using minipages (or \parboxes)?

When a minipage is used to box a text paragraph, the first line of the minipaged text and the last line of the previous text paragraph are closer than two consecutive lines in a standard text ...
29
votes
3answers
9k views

Understanding minipages - aligning at top

I would like to be able to align two minipage at the top, without worrying about what is in the minipage. I am aware of the optional [t] parameter, but still have some confusion as to how this all ...
28
votes
4answers
2k views

Fit text into given box by adjusting the fontsize

I would like to fit text (potentially several paragraphs) into a box of given size. This should be done by adjusting the fontsize of the contained text. Clarification edit: The given dimensions are ...
25
votes
1answer
349 views

Using elastic lengths — when do they work?

I was wondering why elastic lengths like \fill seem to work only under certain conditions. For instance if I write A \hspace{\fill} B I get A left aligned, B right aligned as wanted. If however ...
24
votes
2answers
54k views

How to use figure inside a minipage?

I'm trying to include an image, and keep it centered, and prevent from wrapping from the next page. The following code works for that: \begin{minipage}{\textwidth} \begin{center} Caption ...
19
votes
2answers
1k views

Print programs with its proper syntax

I have defined my own language whose syntax is very close to the one of Pascal. I would like to type the following program for instance. Many people use the packages algorithmicx or algorithm2e to ...
19
votes
2answers
14k views

Aligning image and text on top, with minipages

I have an image (on the left) and a block of text (on the right), and I would like both to be aligned on their top. I am trying to use minipages for that: \documentclass{article} \begin{document} ...
18
votes
1answer
1k views

Why is \parskip zero inside a minipage?

This question was originally entitled "inconsistent paragraph spacing with \parskip inside minipage" as the MWE below shows. But I found the answer at How to preserve the same parskip in minipage, ...
18
votes
1answer
4k views

Can I get a normal footnote in a minipage environment in LaTeX? How?

I need to use a minipage environment and I need a footnote in that minipage. I want the footnote to be numbered in the normal footnote sequence and to occur together with the rest of the footnotes in ...
17
votes
2answers
2k views

How to preserve the same parskip in minipage

I have following structure: \begin{document} Paragraph1. Paragraph2. \begin{minipage} Some paragraph1. Some paragraph2. \end{minipage} \end{document} How can I make the same spacing between ...
16
votes
3answers
2k views

multicols not wrapping to 2nd column properly?

This question led to a new feature in a package: multicol I am having problem with multicol package, I created a sample demo to show it. When I put 3 minipages of certain height in the ...
15
votes
2answers
1k views

Placing TikZ drawings in a minipage side by side

I've some problems with aligning some drawings I made with TikZ: I want these two TikZ pictured below to be displayed side by side with the two captions being on the same horizontal level. ...
14
votes
2answers
27k views

How to split a frame (of beamer) into 2 parts (minipage) side by side?

I would like to split a frame into 2 parts side by side by minipage. But it seems that the following code puts one on top of the other: \begin{minipage}[t]{0.48\linewidth} left part ...
14
votes
3answers
17k views

side by side minipage figures

I have this code where the part marked A is the same as the part marked B except that .4 in A is .45 in B. Even though they are so similar the first one puts the images side by side with the ...
13
votes
3answers
5k views

Minipage spanning across pages

I'm looking for a way to span minipages across pages in LaTeX. I have a collection of recipes (presented through the recipe environment provided by the cuisine package) that varies in length, from ...
12
votes
4answers
708 views

Two column problem

I'm trying to replicate a certain part of a scanned book. However, I'm unable to get two columns, which have enumeratation on the left, line of the right column which is in the parallel with first ...
12
votes
2answers
7k views

Two minipages with 0.5\textwidth each get placed one below another

This happens in the beamer class only. Does anyone know the reason behind this? I fix it by just setting both widths to 0.49\textwidth and this works but I'm still curious why this happens and if I ...
12
votes
2answers
194 views

\if@minipage purpose in floats

In floating environments such as the captions of figures, LaTeX has a \global\@minipagefalse, why is this necessary and what does this switch do? \long\def\@makecaption#1#2{% ...
12
votes
2answers
2k views

How to change symbol for footnote in minipage

\renewcommand method does not work \documentclass{article} \renewcommand{\thefootnote}{\arabic{footnote}} \begin{document} \begin{minipage}{1.3\textwidth} test this\footnote{abc} \end{minipage} ...
12
votes
4answers
2k views

In beamer class, how do I remove the additional vertical space before an itemize environment?

On a beamer slide, I want to produce something like I use the following LaTeX code, which works well in LaTeX with the article class. \begin{minipage}[t]{1.4cm} Questions: \end{minipage}\nobreak ...
12
votes
1answer
1k views

Wrapfigure-Minipage Woes: How do I correctly typeset wrapped text boxes within a \parcolumns environment modified for a two-sided document?

This is a follow-up question concerning an experimental chapter layout I'm trying to implement for a novel I'm writing. So. My initial problem of finding a way to modify the innards of the parcolumns ...
11
votes
2answers
920 views

highlight lines in listings

I have code that i have included into my document using the texcode below \begin{minipage}{.48\textwidth} \centering \lstinputlisting[numbers=left,xleftmargin=2em,frame=single,framexleftmargin=2em, ...
11
votes
3answers
255 views

How to draw a polygon with height exactly equals to the text's height

I am using MiKTeX 2.9 and XeLaTeX. I have a minipage with some formatted text: \centering \begin{minipage}{\quotewidth}% \centering\small\textit{Lorem ipsum dolor sit amet, consectetur adipiscing ...
11
votes
2answers
362 views

How do I put card backs on my cards?

I have a a document that is making me sheets of cards. A stripped down, almost minimal example looks something like \documentclass{article} \usepackage[utf8]{inputenc} %Needed for input ...
11
votes
1answer
11k views

Align minipage to baseline of first or last line inside minipage?

The minipage environment has options for making the top, bottom, or center of the minipage box line up with the baseline of the surrounding text. Is there a way to make it line up to the baseline of ...
11
votes
4answers
388 views

How do I force multicols environment to use first column when called from within a minipage

I understand how to get multicol package to use the entirety of the first column before moving to the next: \begin{multicols*}{3} .... \end{multicols*} which is mentioned in section 2.2 of the ...
10
votes
1answer
5k views

lstlisting in two columns

I would like to have two listings, side by side. They have approximately the same length, therefore I don't care about how it's layed out if one part is longer. I tried \begin{minipage}{\textwidth} ...
10
votes
1answer
4k views

How to move a whole tikzpicture?

I have a tikzpicture, rounded by a fbox, and embedded in a minipage. Is it possible to change the position of the whole picture inside the minipage? for instance, move the picture 1 unit higher and 1 ...
10
votes
1answer
5k views

Relative padding of a minipage's paragraph

Background Created a custom command for rendering quotations (epigraphs). Problem The text in the following image has no space at the border: The word "and" is flush with the right margin. Code ...
10
votes
3answers
4k views

How can I create a two-column layout with different widths (and texts) for the two columns?

I want to create a document in which there are two separate columns of content. The column on the left is normal text, with sections, environments, etc. The column on the right is figures, all roughly ...
9
votes
2answers
265 views

Three tables side by side, want only one caption

I have three tables and I want to use one caption under them. I tried the following but then nothing prints except the caption - \begin{figure}[!h] \begin{table}[h] \centering ...
9
votes
4answers
6k views

Colored box in new environment

I have a problem, I'm fairly new to LaTeX but I think I got the basics. My problem is that wants to create a environment that can create a minipage with a background color and some text in it. I can ...
9
votes
1answer
10k views

tables side-by-side using minipage

I'm trying to get three tables side by side using minipage. In spite of my horrific efforts my tables keep stacking on top of each other instead of standing beside what drives me mad. Can anybody spot ...
8
votes
3answers
2k views

How to split a page in six equally sized sectors?

I'd like to split an A4 page into six equally sized sectors. I want that page to be in landscape. Each sector has a body of text and a caption. I don't really have an idea where to start. I know I ...
8
votes
4answers
3k views

Background image for minipage

I'd like to put a background image into a minipage, stretching exactly to the surrounding fbox. What's the best option to do that? (Searching the web, I only found solutions for backgrounding the ...
8
votes
3answers
265 views

Vertical align a tabular and tikz figure in a minipage

How can I vertically align a tabular left to a tikz figure? With minipage without a vertical align option it looks good: The problem is that I need it aligned at top (for this I replaced ...
8
votes
2answers
4k views

Minipage that allows page breaks?

Is there a minipage-like environment that allows pagebreaks? Everything I can find is about avoiding page breaks (which minipage does well) but I want to indent a whole section, which is convenient to ...
8
votes
3answers
395 views

Minipage footnote is inside tikZ node

I have a minipage, and inside of it I have a footnote and a tikZ picture. Now my problem is, that the footnote text goes inside the last node of my tikZ picture. That is not what I want – and it's ...
8
votes
2answers
3k views

Fitting and centering text (both!) in a constrained area

Is there a way to make text size and alignment automatically "best fit" on a page? So that a large amount of text will be constrained on the page in a small font, but a small amount of text can be of ...
8
votes
1answer
497 views

Why does \vfill not work inside minipage?

Perhaps the answer is trivial, and I am facing the scenario as part of a larger macro. I faced a situation where I found that \vfill does not work inside minipage environment. The extracted code from ...
8
votes
2answers
355 views

minipage is wider than I wanted

Occasionally, the width of a minipage environment seems to be ignored. I've not kept accurate records of when this has happened. But below is purely illustrative code that shows the issue. ...
8
votes
2answers
2k views

How do I make one minipage the same size as another?

I'm writing a LaTeX document into which I want to put two boxes, in a row next to each other, which will contain varying length content. I want each box to be the same height, and that height needs ...
8
votes
1answer
124 views

Problem with tikzpagenodes and minipage

Using the anchors defined by tikzpagenodes inside a minipage produces unexpected results; this is not the case for the current page family of anchors defined by standard TikZ as the following example ...
8
votes
1answer
78 views

Minipage width not acurate

I have the following document, with several minipages of 12cm width. Each minipage contains a different number of minipages (with a sum of 12cm for all of them). So every *sub*minipages should fit ...
8
votes
1answer
625 views

Multiple columns with minipage, can't use 100% of \textwidth

In a document I'm making, I have several cases where I need to organize things into several "columns." For example, here is some code I might use: \documentclass[letterpaper,12pt]{report} ...
8
votes
1answer
205 views

How to create a group of minipages that can be spanned across columns but can't be broken in two pages?

I'm trying to diagram an exam for an educational purpose. I'm using the package multicols to display questions in two columns. Each question of this exam is divided in three blocks: base text ...
8
votes
2answers
2k views

Changing minipage vertical alignment in mid-line?

Please consider the following MWE: \documentclass{article} \usepackage{lipsum} \usepackage[showframe,showcrop]{geometry} \begin{document} \section{Section 1} aa \fbox{\begin{minipage}{100pt} Box 1 ...
8
votes
2answers
123 views

Hyperref inserting undesired space at start of enumerate environments

This question arises from my attempt to answer vertical spacing on enumitem. Originally, I was able to answer the OP's question, but then the OP mentioned that the problem re-emerged if the hyperref ...
8
votes
1answer
976 views

How to produce 5-up 3by5 index cards

I want to produce instructional 3by5 index cards. It's easy enough to produce the cards one per page, but I want to print five copies of the same car on a single sheet of 8.5by11 card stock, where it ...