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.

4
votes
1answer
94 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
26 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
41 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
34 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
317 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
26 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
633 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
25 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
59 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
36 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
156 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
25 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
15 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
38 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
30 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 ...
7
votes
2answers
268 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
24 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
33 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
44 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 ...
0
votes
0answers
47 views

How to define problem in a better way?

I want to define the problem more clearly. See my code given below: \documentclass[12pt,a4paper]{article} \documentclass[12pt,a4paper]{article} \usepackage{amsmath,amssymb,fancyhdr,url} \usepackage{...
1
vote
1answer
56 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 ...
0
votes
0answers
32 views

How to make a box fill the whole line?

I would like to add a title that takes up the whole width of the page before a paragraph, similar to the way the \section command works, but with the regular font size and without incrementing ...
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
38 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
45 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
29 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
43 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
136 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
115 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
54 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
53 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
46 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
76 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
61 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
124 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
929 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]{...
2
votes
0answers
64 views

How to see the box to debug or learn LaTeX?

For example, I want to see the boxes implicitly generated by alignedat. I want to see how \lineskiplimit and \lineskip work and also the particular spacing between the current row and the previous one....
3
votes
1answer
55 views

\comment (verbatim-package) inside \parbox throws errors - What is the problem?

I have defined my own environment - lets call it 'myenv' - which shows and hides its content based on some global settings. I'm using the \comment and \endcomment commands from the verbatim package, ...
4
votes
1answer
184 views

Vary transparency of colorbox in a sentence

I have a long sentence, where I want different parts of the sentence to have different transparency. The entire sentence should, however, be wrappen within a colorbox: \documentclass{article} \...
0
votes
1answer
59 views

LaTeX/plain TeX macro: style a box with custom borders and padding

I'd like to make a LaTeX environment for a styled box without using any additional packages, just defining some lines and spaces. I have already come far, but failing with the last line I imagined in ...
1
vote
1answer
70 views

Boxing The Entire Align Environment

Here's my code : \documentclass[12pt,a4paper]{report} \usepackage{multicol} \usepackage{enumitem} \usepackage{amsmath} \begin{document} \section{New Section} \begin{multicols}{2} \begin{enumerate}[...
10
votes
2answers
194 views

How to align consecutive \leaders properly?

I’m trying to build a construct with a box of a fixed filled with \leaders followed by \leaders with \hfill. However at the moment there is a little gap between these two making the pattern irregular, ...
0
votes
2answers
76 views

How to prevent reference to enumeration inside new environment?

I defined a guidancebox envirenment, which is similar to the longtable environment, only with a different counter/ caption tag and reference label. This works fine, except if I use enumerate inside ...
5
votes
1answer
118 views

How to create a (colored) box that hangs into the left margin?

I'm trying to highlight some parts (paragraphs) in a document. For this I want to use a box, with the paragraph number hanging out into the left margin. However, I don't really know how to pull this ...
1
vote
1answer
50 views

How can I get all box of a vertical list?

I know \lastbox is the last box in current list. Now my questuin is how can I access all boxes in current list. Thanks in advance.
1
vote
1answer
59 views

Insert paragraph that takes no vertical space aligning at normal text baseline

I want to insert a block of text (could contain anything) that takes up no vertical space, but also aligns with the normal text baseline. (I feel like this is probably a duplicate, but I can't it.) \...
2
votes
0answers
31 views

Remove ugly borders around clickable cross-references for Equations and Footnotes but keep them for figures, table and citation

I know that hyperref can make cross-references and hyperlinks clickable and I know how to get rid of all the border(the little green boxes around the clickable area) from this post, but I would like ...
7
votes
1answer
220 views

What is difference between \box and \unvbox or between \box and \unhbox

What is difference between \box and \unvbox or between \box and \unhbox.
0
votes
0answers
68 views

space between two vbox

I have two vboxes and I want space between two vbox be exactly same as space between two line of paragraph. \documentclass{report} \usepackage{lipsum} \setlength\parindent{0pt} \linespread{2} \begin{...