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.

Filter by
Sorted by
Tagged with
1 vote
2 answers
45 views

Colored and inclined boxes

I would like to get the following colored boxes so that they are also slightly inclined. Here is a picture of what it should look like Can someone tell me how to do this with latex? Which packages do ...
user avatar
  • 387
1 vote
1 answer
36 views

Automatic line breaking of boxes

I want to automate some things in LaTeX using loops and saveboxes, but the boxes don't want to go automatically to the next line when there is no space for them (saveboxes are necessary). The code ...
user avatar
2 votes
1 answer
62 views

Drawing a color swatch/palette for CMYK

Background I wish to create a LaTeX version of a color palette similar to the one found here: https://codepen.io/devi8/pen/nJMGZR. It looks like this: I have managed to find code to build on, but I ...
user avatar
  • 2,603
0 votes
1 answer
28 views

top align lrbox [closed]

Is there a way to top align two lrbox? I try to mimic the captions of tufte-latex. On the left, what I want, on the right, what I got so far. \documentclass{book} \usepackage{kantlipsum} \usepackage{...
user avatar
-1 votes
1 answer
53 views

How to do this theorem environment (this exact style)?

I'm writing a course support on latex and I was looking to my own old notes and came across this template for theorems and would like to implement it in my own course support.
user avatar
1 vote
2 answers
48 views

Splitting a tcolorbox into two columns

I'd like to split a tcolorbox environment into two columns like this: +---------------------------------------------------------------------------+ | Definition. Lorem ipsum dolor sit amet, ...
user avatar
  • 13
3 votes
1 answer
79 views

Box repeat shape of word

Hi, is there any way how to make "box" follow shape of words?
user avatar
1 vote
0 answers
42 views

How to draw boundary boxes?

I read this wonderful paper by Alexander Perlis entitled "A complement to \smash, \llap, and \rlap". The author draws the boundary boxes that LaTeX uses for typesetting like so: Question: ...
user avatar
  • 297
1 vote
2 answers
71 views

Default text in tcolorbox body

I'd like to define a tcolorbox environment, e.g., \newtcolorbox{mybox}{ enhanced, boxrule=0pt,frame hidden, borderline west={3pt}{0pt}{Peach}, colback=Peach!5, sharp corners } But I would like for ...
user avatar
1 vote
0 answers
41 views

unwanted gap between paper border and hbox

I am creating the title page for my thesis, and I need this red rectangle right next to the top margin, but the following code generates a (very) small gap between the top of the box and the paper ...
user avatar
2 votes
4 answers
139 views

How to vertically align text and equations

How could I vertically move the third line on the left upward so that it doesn't appear broken with the two lines above? I'd like to obtain this. I have used this code. \documentclass{article} \...
user avatar
  • 23
0 votes
1 answer
64 views

Boxing only some of the equations in an align environment

I am looking to box some of the equations in an aligned environment, but not all. For example, I want to box the equations that are within the "max" and "s.t." sections, but not ...
user avatar
  • 69
0 votes
2 answers
46 views

Align equals signs between unboxed and boxed amsmath split lines

I'm trying to figure out how to align the equals sign with the rest of the equals on the last line. Unfortunately, I get the offset alignment you can see in the image below. Any recommendations on how ...
user avatar
  • 103
0 votes
3 answers
60 views

Beamer fancy boxes

[I am trying to add ovalbox to my text but not getting it properly. The remaining text that should be in the oval box but it is not seen on the screen. Please help. .com/WgMw6.png
user avatar
3 votes
2 answers
165 views

Which length still creates the distance between the 2 boxes

I try to place 2 boxes on top of each other. I would like to define the height of the lower box and a potential gap between the boxes and the top box should use the remaining space. As you can see in ...
user avatar
  • 269
1 vote
1 answer
34 views

TeXbook - Chapter 12: Glue - Exercise 12.13

Exercise 12.13 (p. 81) makes the following assumptions: \box1 is 1pt high 1pt deep and 1pt wide \box2 is 2pt high 2pt deep and 2pt wide \baselineskip=9pt minus3fil \boxmaxdepth=-4pt The exercise is ...
user avatar
  • 47
5 votes
3 answers
246 views

How to align minipages on the top

Problem I am trying to align minipages on the top but to no avail, I thought that the [t] option is exactly meant for that, but apparently not. The [c] option seems to work better, except for the ...
user avatar
  • 269
4 votes
3 answers
239 views

How to create numbered-named saveboxes in a foreach-loop?

Is there a principally way to create numbered saveboxes? For a usage like: \usebox{box-1}, \usebox{box-2}, \usebox{box-3} The follwing MWE gives no error, but no output. PS: It seems to be clear why ...
user avatar
  • 6,217
2 votes
1 answer
61 views

The dimensions of a character's box vs what is in the .afm and .tfm files

For definiteness, let's suppose we use pdfLaTeX to compile this: \documentclass[10pt]{article} \usepackage{lmodern} \begin{document} \thispagestyle{empty} \setlength{\fboxsep}{0pt} \setlength{\...
user avatar
0 votes
0 answers
62 views

Hide part of a document but process the side effects

This is a follow-up on the answers here. I found two cases where the proposed solutions fail, and I am looking for ways to address it. Consider the MWE: \documentclass{article} \usepackage{etoolbox} \...
user avatar
  • 1,486
0 votes
1 answer
65 views

Debuging boxes in LaTeX

I'm trying to read the TeXbook to understand more on the internal of boxes. They say that: \setbox0=\hbox{T\kern-.1667em\lower.5ex\hbox{E}\kern-.125em X} \showbox0 should display how the box is ...
user avatar
  • 5,043
0 votes
1 answer
66 views

Two horizontal rules made by \hrule in the same line

I make a table by the following code in which a cell of the talbe is consctructed by a \makebox. Cells at the same line are seperated by \vrule. lines are seperated by \hrule. In this example, I want ...
user avatar
  • 2,169
0 votes
0 answers
24 views

xpatch + listing + realboxes + mathmode gives wrong spacing

I stumbled upon a problem that was quite hard to reproduce as it seems it required a very specific combination of several packages to make the code compile and yet produce the problem. The problem is ...
user avatar
  • 73
0 votes
2 answers
46 views

Trouble drawing boxes with centered letter inside

Basically I wanted to execute the following in latex: (Colors don't matter) But I am having trouble doing so, because I have 0 experience with boxes. I know about arrays, but I really dont know how ...
user avatar
  • 265
0 votes
0 answers
61 views

Chapter and section numbering style

I am writing a document in LaTeX and I would like to use exactly the numbering style as shown in the image attached to my message. Can anyone help me? Thank you.
user avatar
3 votes
1 answer
67 views

Unexpected line break before makebox with expl3 syntax

I want to type some texts as the following. some text:____underline_text_______ I hope the total length of the above texts could be some given length. The length of the underline part depends on the ...
user avatar
  • 395
10 votes
2 answers
210 views

Different position of indices after parentheses of the same height

Let us look at the following code: \documentclass{article} \usepackage{amsmath} \begin{document} \[ \frac{\partial^2u}{\partial x^2} = \frac{\left(y-y_0\right)^2-(x-x_0)^2}{\left((x-x_0)^2+\left(y-...
user avatar
-1 votes
1 answer
127 views

Overfull \vbox has occurred while \output is active

I have the following MWE: \documentclass[]{scrbook} \usepackage{longtable} \usepackage{tabularx, booktabs} \usepackage{multirow} \begin{document} \chapter{Discussion} In this chapter the ...
user avatar
  • 107
0 votes
1 answer
66 views

How do you balance two frame boxes in the same page? [duplicate]

I have a problem with fitting two flowcharts encased in frame boxes to fit nicely within a single page and how do you add a little more bottom space to the box frame? \documentclass[11pt,twoside, ...
user avatar
  • 83
3 votes
2 answers
68 views

How to control horizontal spacing between tcolorboxes?

Similar question but for vertical spacing here: Unwanted vertical separation between tcolorboxes I would like to know how to control the horizontal spacing between tcolorboxes. MWE: \documentclass{...
user avatar
  • 458
0 votes
1 answer
49 views

Help for specific template

Im going to make a math and physics report in school, but before I need to fill a specific template in my report. It needs to look like the picture I added. I don't need to have the images above the ...
user avatar
0 votes
0 answers
54 views

modify a template for report

I'm trying to use this template for report. the problem that in this template the two red box and the plue one are added by inserting a figure(i want to delete the image of the university). can you ...
user avatar
1 vote
0 answers
30 views

dashed border for beamercolorbox

Is it possible to draw a beamercolorbox with a dashed border? I cannot find in the Beamer documentation the possibility of such kind of decoration.
user avatar
  • 281
1 vote
1 answer
133 views

Nested breakable boxes with line on the left (any package)

I'm trying to create an environment like quotation, but with a line on the left. I would also like it to support multiple paragraphs, footnotes, math environments and floats (basically you should be ...
user avatar
  • 180
3 votes
0 answers
46 views

Nested breakable boxes with line on the left [duplicate]

I'm trying to create an environment like quotation, but with a line on the left. I would also like it to support multiple paragraphs, footnotes, and floats (basically you should be able to wrap it ...
user avatar
  • 180
1 vote
0 answers
80 views

How to create an \mbox with more than one lines?

I am using LaTeX to compose homework for my students. I use \CheckBox for multichoice test and \mbox for text typing. In the outcome PDF file the \mbox environment allows typing in 1 line even though ...
user avatar
  • 337
2 votes
1 answer
75 views

Positioning two boxes inside a LC circuit in Circuitikz

I am trying to introduce two boxes inside an LC circuit, but I encounter two problems: the first concerns the positioning of these two boxes, I cannot align them perfectly with the node, I cannot find ...
user avatar
1 vote
1 answer
48 views

customizing chapter heading by adding box and text

I have a custom chapter heading working fine but I want to add a box and a text to it. It looks like this right now Here is the code I used \definecolor{myblue}{RGB}{0,82,155} \titleformat{\chapter}[...
user avatar
2 votes
1 answer
48 views

How do I increase the spacing before and after the empheq environment (with tcolorbox)?

I want to ask a question on how to properly increase the spacing before and after the boxes set inside an empheq environment. Here's my MWE that I compiled using LuaLaTeX. \documentclass{scrbook}[DIV=...
user avatar
6 votes
2 answers
159 views

Unexpected newline (catcode magic)

I am playing with Tex catcodes and hboxes. The following code should produce three lines of output: A...1... B...2... C...3... However, for some reason it makes a line break between A and ...1..., ...
user avatar
  • 87
1 vote
1 answer
54 views

How can I fake a hyperref-style colorful box around text?

By default, the hyperref package will add a cyan box around a URL: \documentclass{amsart} \usepackage{hyperref} \begin{document} \url{https://www.baidu.com} \end{document} How can I add such a ...
user avatar
1 vote
1 answer
144 views

How to wrap text around a box without using any packages?

This question has been edited since the original problems due to errors in my code were fixed. I tried to use wrapfig to wrap text around a box at the right margin, but the package behaves ...
user avatar
  • 1,709
2 votes
2 answers
52 views

Measure the length of an \hskip with one compilation

I am trying to measure the width of an \hskip. I have tried something like \ExplSyntaxOn a \skip_horizontal:N 10pt plus 1fill \box_set_to_last:N \l_tmpa_box b\par \the\box_wd:N \l_tmpa_box \...
user avatar
2 votes
1 answer
47 views

How TeX places text horizontally and vertically?

Am I right that TeX processes text in a manner like this? Since the very first character it is forming an hbox of textwidth width. When the first hbox is filled in its width, TeX makes a hyphenation, ...
user avatar
  • 515
3 votes
1 answer
55 views

Why do I receive underful hbox warning with this MWE?

\documentclass[]{scrbook} \usepackage{tabularx} \begin{document} \begin{table}[t] \caption{Scores of the individual metrics} \begin{tabularx}{\columnwidth}{p{0.118\textwidth} p{0.1312\...
user avatar
  • 107
4 votes
1 answer
74 views

Why does TeX stretch more than the plus component and it's OK?

The code is as follows: \newlength{\stretchable} \newlength{\fixed} \setlength{\stretchable}{2cm plus 6cm} \setlength{\fixed}{8cm} \hbox to 10cm{|\hfil|} % the sample of a 10cm hspace \...
user avatar
  • 515
0 votes
2 answers
142 views

Is there a way have breakable framed boxes?

Here is a command I have: \newcommand{\numbox}[2]{$^{\circled{#1}}${\fbox{#2}}} What it does is boxing and numbering a text. However I for the box to break nicely across lines. In command \fbox{text} ...
user avatar
1 vote
0 answers
26 views

Box variable does not display its content

I'd like to use box variables and cannot deal with this example: \newsavebox{\abox} % declared a variable of a box type \sbox{\abox}{The block content} % abox := \hbox{The block content}; ...
user avatar
  • 515
7 votes
1 answer
191 views

The concept of boxes in TeX

Am I right that TeX considers a text in terms of boxes (rectangles) where each character (char) is in a rectangle with three dimensions (height, width and depth (hwd)) and the origin point? And that ...
user avatar
  • 515
0 votes
2 answers
94 views

Box around every page body

I am defining page margins with geometry, adding a footer and header. I want the body of the text (not the footer or header) to be enclosed in a box (every page). This is a similar question to What is ...
user avatar
  • 474

1
2 3 4 5
30