Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [boxes]

{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.

1
vote
1answer
39 views

\hbox \mbox difference … what they do? [duplicate]

What is the difference between \hbox and \mbox? What are these commands intended to do? I cannot see what they do from my code alone without a word explanation...
6
votes
2answers
364 views

Draw a palette box in LaTeX

Is there a way to build a structure like the following in Latex? They're probably just boxes, but I have very little experience with Latex and I'm not sure how to get this result.
1
vote
1answer
23 views

Indented paragraph next to a box

I am trying to indent a whole paragraph to the right of a numbered box. However, the paragraph does not appear vertically aligned with the box. I am using the below code: \documentclass[journal,...
3
votes
3answers
38 views

Vertically filling frameboxes on page

I am trying to write a problem assignment, with textboxes containing the written solutions. The textboxes should be distributed evenly on the page, consuming all the available space. The intended ...
1
vote
1answer
45 views

Headings with coloured boxes

I am needing to write a risk assessment report, the headings within the report are risks that have been discovered, next to each of the headings/risks I'm needing to use a key or coloured boxes to ...
1
vote
2answers
75 views

Text boxes in Latex

In an article is it possible to create boxes so that when the document has been printed users have some text boxes areas where they are able to make notes in? A very basic mock up using word with ...
12
votes
3answers
2k views

How to write mathematics with boxes?

I want to write the mathematics inside the box as written below. See my code given below: \documentclass{article} \begin{document} \\fbox{text} \framebox[width][pos]{text} \makebox[\textwidth]{...
0
votes
0answers
34 views

spacing problem after \makebox [duplicate]

The following two lines give me different results with respect to spacing: \noindent\makebox[\parindent]{?} Blabla \noindent\makebox[\parindent]{?}Blabla The second case is what I want: no space is ...
1
vote
3answers
62 views

Framed boxed text with “continued” text on page break

I need to write a boxed text as like as: Currently, I am using \documentclass{book} \usepackage{framed} \begin{document} \begin{framed} \section{Box 15...} ... \end{framed} \end{document} Please ...
0
votes
1answer
56 views

How can I execute a LaTeX command then hide the resulting text? [duplicate]

I would like to execute a command which produces text, but not have that text visible anywhere inside the document. Can we put the command inside a box, which clips other text, such as in the middle ...
1
vote
1answer
40 views

Two column CV - Increasing personal info and adding description under the name

I'm trying to use the tccv class to build my curriculum. Does someone know how to put my description under my name? I don't want it to be part of the half page format. Also do you know how to add ...
2
votes
2answers
170 views

Ideas to recreate this using latex

I'd like to create a Latex template similar to the one on the picture. Basically it's a set of boxes with different fields plus the big box on the bottom with a graphic. I've been analysing several ...
2
votes
1answer
44 views

Makebox spacing inside mdframed

I want to be able to have some text aligned in the left margin such as a theorem label, and then have the example in the mdframed box. Here is an example of my failed attempt. As you can see the text ...
2
votes
1answer
60 views

Why does additional brace group cause \settominwidth to complain about missing }

I'm using the pbox package's \settominwidth command to measure the typeset width of text that includes explicit line breaks (which is a case in which standard LaTeX's settowidth doesn't work). In the ...
2
votes
2answers
50 views

overfull hbox on chapters with line above/below chapter title using KOMA-script

I would like to add \linewidth-sized lines above and below my chapter titles (similar to borders above/below the 'paragraph' in MS Word) I tried the following, which somewhat approximates the desired ...
4
votes
1answer
105 views

Can you replace glue with a box, after it's been set?

The question is as asked. My intended use case for this would be to have something like minipage, but whose height can be set using glue, rather than only a dimen. When the page is pretty easy to ...
3
votes
2answers
36 views

Create an empty framebox with specific with and length

I am looking a package to create an empty framebox of 2.7 cm height and 15.97 cm lenght. I am using \framebox but I am able only to set the size. \framebox[15.97cm][l]{}
4
votes
1answer
48 views

Text in TikZ nodes: controlling the box variables of characters/string

I remember that there were different commands in TikZ that allow modifying how the characters in a node are placed but I'm not able to find all of them in TikZ manual. Probably I'm looking for the ...
1
vote
1answer
46 views

A visible box on the right hand side of the document

How can I get a small box at the right hand side of the document as in the figure below: My initial attempt failed: \begin{flushright} \begin{tcolorbox} \textbf{Date:11/12/2018}\\ \textbf{Time: 2:...
18
votes
1answer
342 views

Spacing difference when using boxes

On the left (obtained from the MWE below), I do not use boxes for the title nor the body text and the title and the text appears to be in the correct spot. However, when I attempt to use \...
0
votes
0answers
31 views

Prevent macro expansion within setbox

Following code is the quintessence of a problem i'm facing: \documentclass{minimal} \newbox\boxa \newbox\boxb \newbox\boxc \parindent=0pt \begin{document} \setbox\boxc\hbox{Hello World!} \def\...
11
votes
3answers
653 views

Squares for answer choice options and perfect alignment to mathematical answers

Since 2005, I have generally used this model to create multiple-choice tests for my students. I kindly ask you if there are packages or macros, or particular strategies to have squares with the ...
2
votes
1answer
35 views

\fbox around multiple \includegraphics

I am working on a figure like this, \begin{figure} \includegraphics[width=\textwidth]{a.png} \includegraphics[width=\textwidth]{b.png} \includegraphics[width=\textwidth]{c.png} \end{...
2
votes
1answer
71 views

Drawing grid lines to show vertical position of text [closed]

I have text where I want to adjust the space above the first line. I want to overlay grid lines to show where the vertical position of the text is. The MWE below with the following line commented is ...
2
votes
1answer
39 views

“Smart” page breaking for boxed content

I am trying to load content from a central .tex file, then display it. %%%%%%%%%%%%%%% % central.tex % %%%%%%%%%%%%%%% \saveContent{A}{this is content "A"} \saveContent{B}{this is content "B"} \...
12
votes
1answer
172 views

\savebox within tikzpicture results in an empty \savebox

Using \savebox within a tikzpicture environment seems wipe out the content of the \savebox. In the MWE below, the following macros define, measure and display the size of a \savebox: \newcommand*{\...
0
votes
0answers
26 views

Tex version and overfull boxes

I'm working on a paper with a collaborator and I've noticed that the number of overfull boxes is different whether I compile the document or he does. It's also not the same whether I compile it from ...
0
votes
1answer
21 views

Title and text paragraph indent

I'm trying to reproduce those design decision text boxes. How do I do this? They are indented and numbered. See Design decision 5 and Design decision 6 in the attached picture.
0
votes
1answer
56 views

Centralized/lateral boxes with squared/round edges

I'm trying to reproduce the boxes below exactly, i.e., a central box with round edges and a lateral box with squared edges. I've found articles teaching about coloured boxes, with shadows on the ...
0
votes
1answer
35 views

text justification/comments filling the space left from equation - flalign and paragraph mode

I have equations in a flalign environment and comments that may need to be multi-liner. \parbox seems fine except I can't tell it to automatically stretch in order to fill the space from the right-end ...
8
votes
2answers
316 views

How to add a small rounded rectangle around a word inline

I want to add a box with a very light pink background and red border around a word but inline and within a sentence. i.e. something like this (drawn with inkscape) I know the mdframed package can ...
3
votes
1answer
28 views

Overfull in vbox inside hbox with hsize of the same width

While learning with Plain TeX, I am trying to create a framed paragraph. I have started with the following code, which is supposed to limit the paragraph width but still enable the line breaking ...
1
vote
1answer
47 views

\leaders in redefining \headrule cause “A <box> was supposed to be here”

After stripping away hundreds of line of code to reach this MWE, I found that my "A «box» was supposed to be here" seemed to be caused by a \renewcommand{\headrule} in conjunction with fancyhdr. ...
4
votes
2answers
93 views

Aligned boxes without exceeding textwidth

I have this: \newcommand{\bpic}[2]{ \makebox[\textwidth][l]{ \fbox{\makebox[.1\textwidth][r]{\includegraphics[width=20pt]{#1}\hspace*{5pt}}}\fbox{\parbox{.9\textwidth}{#2}\newline}% } ...
1
vote
1answer
57 views

How does using \makebox allow arbitrary placement of things on a page?

What is it about using \makebox that makes it disregard text body borders / margins, where other boxes respect the margins / text width and friends? Allowing images outside of margin Letting graphics ...
1
vote
1answer
61 views

How to make this rectangle with an image on the left?

Here are two examples of the formatting I'm trying to recreate: I'm trying to recreate this style as closely as possible (including the slight shadow), but I don't know the font. I'd also like the ...
16
votes
3answers
1k views

How to make boxes like these?

I'd like to have custom commands for making boxes that look like the Wolfram|Alpha entities in Mathematica notebooks: \LinguisticAssistant{france} \Entity{France}{country} I've done the work of ...
1
vote
2answers
45 views

How do I get tikzpictures to overlap on the same page?

I have two complex TikZ drawings that need to overlap (appear on the same page). I can't put them into one tikzpicture, because different scale parameters need to be applied to them. Minimal example: ...
2
votes
1answer
55 views

How to create empty boxes at right page margin in exam class

I want to create exams. Therefore I will use the exam package. How can I create emtpy boxes at the right page margin? I need this for adding up the earned points of each question. My current ...
0
votes
1answer
42 views

Why are my boxes not the same height when specifying height as a function of width and content?

I save a box containing a \parbox. I set height of other \parboxes to the height of my saved box using TeX \the\ht\box Code For some reason, not all boxes are of the same size. \documentclass{...
1
vote
0answers
47 views

Using boxed with newline in it [duplicate]

I am new to LaTeX, cant figure out this issue. I want a box around the following equation. \begin{equation} A State S_{t} is Markov if and only if : \newline P [ S_{t+1} | S_{t} ] = P [ S_{...
7
votes
1answer
140 views

draw the container box of a glyph

I'm doing a practical job and I need to place the glyphs of some typographies inside the box that contains them. I do not mean a box in common, but the box that contains the glyph and allows you to ...
3
votes
2answers
119 views

Getting errors while trying to box a colored text + math with less than 6 lines of code

First time Latex user here I am trying to box a text plus math using the following code \documentclass[]{article} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{xcolor} \begin{document} \...
2
votes
1answer
58 views

Nested boxes around a few items in an itemize environment

this is kind of a follow up of this question, where someone asked how to create a box around a few items in an itemize environment. I'm facing a similar issue, but my case is a little bit more complex,...
2
votes
1answer
65 views

How to set different length for different borderline of a box using tcolorbox?

I would like to create box of example using tcolorbox as the picture below: and so far this what i got Here is my code : \documentclass[justified]{tufte-book} \usepackage[most]{tcolorbox} \...
3
votes
0answers
52 views

\savebox doesn't work inside tikz foreach loop [duplicate]

I need to process listed content passed to a \foreach loop inside a tikz environment. But \savebox seems not to behave the same as outside tikz. In particular, the following code: \documentclass{...
6
votes
1answer
85 views

Tikz node not showing saved box

I have a series of complicated content I'm trying to present using TikZ. The code is highly regular, so I wanted to write a simple command to handle everything. In the following code, \aelabelA and ...
5
votes
1answer
63 views

Removing characters from already built hboxes

Section 5.9.6 of TeX by Topic shows an algorithm for dissecting a vbox into the individual lines in form of hboxes by repeatedly removing the last line with \lastbox. Similar commands exist for ...
4
votes
2answers
152 views

Truncating multi-line text

We can use the truncate package to truncate a piece of text so that it fits e.g. in a 5cm wide box. However, the package can only handle one line of text. What if I have got a (possibly long) text ...
7
votes
3answers
949 views

Creating a nice-looking box without using minipage

I would like to create the following box and title without using minipage With : small box before Title Title with counter \documentclass{article} \usepackage[T1]{fontenc} \usepackage[utf8]{...