{boxes} are the units used by (La)TeX to construct a page by pasting them together horizontally or vertically. A single character from a font is a box, as are the lines of type and the eventual page.

learn more… | top users | synonyms

12
votes
1answer
79 views

Tight connection of \vbox es

I don't understand why TeX put a thin whitespace between my two vertical boxes: \documentclass{article} \begin{document} \vbox to 1cm {\rule{1cm}{1cm}} \vbox to 1cm {\rule{1cm}{1cm}} ...
2
votes
1answer
154 views

Use a box to fill text to right margin

I often use an eqnarray (I know it's better to use align, but let's not worry about that for this question unless it changes the answer) as a way to list a bunch of definitions or descriptions of ...
4
votes
4answers
191 views

Is it possible to create a box with a fixed dimension, regardless of how large its content is?

Is that possible to create a box (without frame) so that, even though its content is pretty big, it only occupies a small space in the text follow. For example, a tikz picture, however large it is, ...
4
votes
2answers
144 views

How to create an alert box with a figure to the left? [duplicate]

I'm trying to create an alert box to show some info, with background color and an icon to the left. With the help of this question I've figured out to come up with this: ...
5
votes
3answers
135 views

How could a verbatimtab environment in a figure environment be resized (perhaps using the package adjustbox)?

How could a verbatimtab environment in a figure environment be resized (perhaps using the package adjustbox)? I have some code something like the following: \begin{figure}[htb] \centering ...
1
vote
0answers
172 views

How could I use scalebox to rescale a table such that it fits exactly in the usable page width (i.e., between the margins)?

How could I use scalebox to rescale a table such that it fits exactly in the usable page width (i.e., between the margins)? Is there some way in which something such as \hsize could be used as an ...
5
votes
2answers
133 views

Absolute vertical positioning of parbox

I create signature area like \documentclass{article} \usepackage[utf8]{inputenc} \begin{document} %some content here \begin{center}\parbox[t]{5cm}{\hrule height 1pt\medskip \textbf{John ...
4
votes
1answer
203 views

Making Inline Code Printing Pretty

I have to include small code snippets like method and class names within continuous text. I do not want to display those snippets as complete seperated listings, they should be displayed inline, ...
0
votes
2answers
343 views

Vertical bar in text mode [duplicate]

How do I create a vertical bar in text mode, which is a bit thicker and taller than the | character? I used to know how to do this with boxes, but googling no longer turns up any useful resources. ...
5
votes
1answer
497 views

Why the checklist box was put on the left

I just create a simple check list following the way described here: How do I generate a check-list?, My code is below: \documentclass[a4paper,notitlepage]{article} \usepackage[]{ctex} ...
2
votes
1answer
210 views

Grid of colorful boxes with shade

How can I reproduce this in Latex?
5
votes
3answers
621 views

parbox vertical alignment

The following code uses parboxes and hrules to vertically align two rectangles of different heights. The hrule seem a bit hackish to me. Is there a more elegant solution? \documentclass{article} ...
1
vote
0answers
60 views

Dropping boxes on top of the listings environment [closed]

I was wondering if anyone knew a decent way to drop boxes of text on top of the listings environment. This would be most useful for a beamer presentation that I am currently writing. Ideally the text ...
6
votes
1answer
482 views

Equation numbers for boxed multiline equations

I am attempting to set a box around multiline equations is LaTeX using the following code: \documentclass{article} \usepackage{empheq} \newcommand*\widefbox[1]{\fbox{\hspace{2em}#1\hspace{2em}}} ...
2
votes
0answers
134 views

overfull vbox if multirow is bigger than usual

I have the following table which gives an overfull vbox because the multirow takes more vertical space than each of the rows it spans. Also, I would like the multirow to center vertically if possible. ...
6
votes
1answer
97 views

Make an \fbox of the remaining line width in `exam` class

I'm writing a math test in the exam class, and I want to make framed boxes for the students to write their answer in. I've tried this solution, but the box exceeds the right page margin by 6.79999pts. ...
6
votes
1answer
86 views

Test for vertically overfull parbox

I'm currently updating an old class written in mostly plain TeX into LaTeX (mostly for readability) and I changed a combination of hbox and vbox into a single parbox with all the optional arguments. ...
7
votes
1answer
87 views

Is there a switch to turn off LaTeX counters from inside a box?

I know that amsmath typesets at least twice its material, the first one for measurement and that it takes measures (sic) to avoid some counters being updated twice. Is there a switch a macro writer ...
8
votes
1answer
491 views

Why does \smash screw up vertical spacing after tabulars?

Using \smash after a tabular seems too screw up vertical spacing. Wheras after a paragraph vertical spacing is fine. Witness for yourself: \noindent \begin{tabular}[t]{@{}ll}% One\cr Two\cr ...
8
votes
3answers
189 views

box the size of A containing B

A thing I'd often like to do is put in my document a box the size of some text A and containing some other text B. For instance, I have two tikz nodes, one containing $n$ and one containing $n+1$, and ...
1
vote
1answer
333 views

Resume: How to create a textbox ?

I am creating a resume template. The picture below looks bad, is there a way to fit the entire bullet point "subject" into a box, so it is properly aligned ? Or is there a better solutions that you ...
4
votes
2answers
178 views

Vertical alignment in tabular with fbox

I have problems with vertically aligning content in my single row header table for an invoice template. Currently it looks like this: What do I have to do to align the top fbox to the top of the ...
4
votes
1answer
97 views

Alignment of tabular objects inside a horizontal box

How to align two tabulars of different height side by side so that both top rows are aligned with each other? Example: \hbox{\vtop{\hbox{Foo}\hbox{Bar}}\enskip\hbox{Baz}} produces Foo Baz Bar ...
2
votes
1answer
163 views

Handle % character in verbatim inside a grey box

I found this snippet on the internet which is used to produce a text area inside a greybox. \newcommand\greybox[1]{% \vskip\baselineskip% \par\noindent\colorbox{lightgray}{% ...
1
vote
1answer
268 views

Text wrapping in a minibox?

For a class I'm given access to a LaTeX version of the homework so that it's easier to fill out. We're given boxes we're suppose to answer the questions in similar to: \begin{picture}(420,570)(0,0) ...
1
vote
1answer
55 views

Display some text next to an image regardless of its size

I want to create a command that displays an image and some text next to it. The image should be displayed in its original size and the command will be used with several images that differ in size and ...
3
votes
2answers
2k views

Frame option in includegraphics makes an overfull \hbox

I'm using the adjust package to add the frame option in \includegraphics command. The package is loaded in this way: \usepackage[export]{adjustbox} Now I can write the following command: ...
7
votes
2answers
86 views

\psdiabox is too big

How can I reduce the size of a \psdiabox, for instance: \documentclass[10pt,a4paper,twoside]{scrbook} \usepackage{pstricks} \usepackage{pst-all} \begin{document} \psset{unit=0.35} ...
7
votes
2answers
183 views

Box/Table surrounded by a pattern/symbols?

I have a box for tips, but I would like to have a pattern surrounding it like in the example picture. Thank you for your help! \documentclass[ngerman]{scrbook} \usepackage{fontspec} ...
7
votes
4answers
285 views

Drawing of matching boxes in LaTeX

I want to draw a split with diffrent blocks inside each one there is the block index. Since I am new to LaTeX, I tried to use \fbox{$b_{0}$}\fbox{$b_{1}$}\fbox{$b_{2}$}% ...
9
votes
3answers
152 views

Box with adaptive length

When I want to put formulas into boxes, I like the box to adapt to the length of my formula. For example, I don't want to put $1+1=2$ in a very large box. To address this, I use the command \encadrer ...
6
votes
1answer
3k views

Centering a \framebox

Before asking, I have checked Centered box, text inside it flushed right?, Questions about \fbox, and Any way to center text within a \parbox?. Here I have tested various centering methods (my ...
2
votes
2answers
862 views

How to preserve tabs and whitespaces in \parbox in latex

I am currently trying to insert a batch file programming code in my report. I am using the code listing. I am not able to preserve white spaces and tabs to format my code! I tried using \hspace but it ...
5
votes
1answer
556 views

Overfull hbox in tabular

In the following (M)WE, the tabular version of the Contact information from a CV gives an overfull hbox warning when compiled with pdfLatex, but the minipage version does not. Why? I have not found a ...
1
vote
2answers
107 views

How to put Text in two lines inside a box

\rightline{\fbox{LEMA 2: $(a^m-1,a^n-1)=a^d-1$\newline onde, $d=(m,n)$}} This command generates this I wanted to pass this onde d = (m, n) to the line below, but keeping within the box ... How ...
4
votes
1answer
127 views

Difficulty finding the vertical distances between two lines of content

I'm trying to determine the vertical distance between boxes and a line of text in the immediately following paragraph. Depending on the content of the top box I'm getting a discrepancy of \lineskip. ...
7
votes
2answers
395 views

Why \usebox (is it vestigial)?

Despite my inflammatory title, I understand that \usebox is employed to display a predefined box. But this question concerns when [the use of the box register, rather than the box content] becomes ...
5
votes
1answer
157 views

difficulties getting lrbox to cooperate with Verbatim environment

This is a follow up to an earlier question of mine: local commands are not recognized when trying to define a wrapper lrbox If I write \documentclass{article} \usepackage{fancyvrb} ...
4
votes
1answer
76 views

local commands are not recognized when trying to define a wrapper lrbox

I can't get the following code to work correctly: \documentclass{article} \usepackage{pgfkeys} \makeatletter \newif\if@ae@nfig@verb@ \pgfkeys {%%' /ae/nfigverb/.is family, /ae/nfigverb, ...
5
votes
3answers
2k views

I can't seem to get \fbox and \itemize to work together

I'm trying to place some text inside of a box, here's what I'm writing that is not working: \fbox{The \textit{two-step} model of XMCD: \begin{itemize} \item[In the \textit{first step}, circularly ...
3
votes
2answers
219 views

Bad box because of algebraic expression

I'm getting a bad box in the following (I can see in the PDF that the expression is shooting past the right edge of page contents): \item If $\dfrac{a}{b} = \dfrac{c}{d} = \dfrac{e}{f} = \ldots$, ...
11
votes
2answers
412 views

mdframed box of fixed minimum height

I would like my mdframed boxes from MyEnvironment to have a minimum total (title+body) height. The height can be greater (if the content warrants it), but not smaller than a certain size. I can ...
6
votes
0answers
127 views

Replace paragraphs with boxes [closed]

I would like to replace the paragraphs of a compiled document with framed boxes. Although I read the /tex/latex/base documentations I have no idea how to tackle this problem. In detail I want to ...
5
votes
3answers
439 views

Vertical spacing around a parbox

Given this: \documentclass{article} \usepackage{lipsum} \usepackage{setspace} \setstretch{1.5} \setlength{\parindent}{0pt} \newlength{\len} \newcommand{\arrowed}[1]{% % draw an arrow, then a ...
5
votes
2answers
138 views

How do I add a box as a prefix to sections or float a box left of sections?

I am working on converting some old documents at work into LaTeX. I realize that some of the things I need to do do not conform to the LaTeX typesetting standards but that is where I am. I have most ...
16
votes
3answers
750 views

Rounded box around placeholder text that supports line breaking

I want to draw a rounded box around a piece of text like that: The left and right borders should be half circles and line breaking should be supported. This my code so far: \setuppapersize[A7] ...
7
votes
1answer
460 views

defining a centered shadowboxed listings environment

I'm trying to define a environment for code listings wrapped in a shadowbox and centered in the line. Using this code, I can generate the kind of output that I want: ...
2
votes
0answers
198 views

\tcolorbox: footnote on page on which there are

I use in my document boxes created with tcolorbox package. Each box can cover few pages in document, and I would like to add some footnotes inside the box. But I want the footnotes to occur together ...
6
votes
1answer
142 views

Box with same vertical height, even when empty

I'm trying to draw a vertical box around one or more lines of text (for a field in a pre-filled form), but some of the fields may be empty and in these cases, the box should be the same vertical ...
8
votes
2answers
214 views

Better way to center text below overline with given length

I need to create lines for signatures. I need 3 of them with different texts below them, but i want all lines to have the same length and the texts centered below them. Tables with \hlines made the ...