Questions tagged [bounding-box]

{bounding-box} is for questions about the bounding box of elements in a document, usually {graphics}, {tikz-pgf} or {pstricks} pictures, or glyphs in {fonts}. Use this tag in addition to other tags specifying what bounding-box is the question about.

Filter by
Sorted by
Tagged with
0 votes
2 answers
37 views

Is there a way to prevent \mathchoice from resetting the bounds of its contents (with respect to superscript/subscript placement)?

I have a series of norm macros that I want to expand to \left\| ...\right\| in display math but remain as \| ... \| in inline math. Each norm has a subscript unique to the macro: \newcommand {\...
user avatar
  • 349
26 votes
2 answers
2k views

Why is the 7 (Computer Modern italic) jumping out of the baseline in this code?

I have an issue I cannot explain to myself. Here is the code: \documentclass{scrartcl} \usepackage{tikz} \begin{document} \newcommand{\tikzmark}[4][]{\begin{tikzpicture}\node[inner sep=1pt,outer sep=...
user avatar
  • 4,514
1 vote
1 answer
64 views

Node anchor too far away from node text

I'm using a loop to write several labels for line intersections, but perhaps for reasons of scale or something the labels are a bit too far away from the intersections. I can't fix each manually since ...
user avatar
  • 1,163
1 vote
0 answers
52 views

Approximate bounding box for chemfig figure

If I wanted LaTeX to automatically make an approximate bounding box for, say, the following figure, could I use some built-in feature of the chemfig package? Or would I need to code this up in plain ...
user avatar
  • 139
1 vote
2 answers
94 views

Clipped scope's bounding box

In the following example, I \clip out a 3x3 rectangle of an image. I'd expect the resulting scope to have a bounding box of 3x3, so the two text nodes should line up with the extent of the clipped ...
user avatar
  • 945
1 vote
0 answers
391 views

Overleaf No Bounding Box Error

I am using Overleaf V2 and just received the following error message: This topic has been dealt with here: No BoundingBox error message But I am new to this and don't understand how to check the eps ...
user avatar
0 votes
1 answer
68 views

'Dimension too large' when `useasboundingbox` with `fill between`

\documentclass[tikz]{standalone} \usepackage{pgfplots} \usepgfplotslibrary{fillbetween} \pgfplotsset{compat=newest} \begin{filecontents*}{data.txt} X Y CI95 1 1.50 0.39 2 1....
user avatar
1 vote
1 answer
101 views

How do bounding boxes work?

I want to include a histogram into the first and second node with a bounding box and only text for the rest node. Here's my work: \documentclass{article} \usepackage[dvipsnames]{xcolor} \usepackage{...
user avatar
1 vote
0 answers
43 views

How to measure the width of a character including overshoot

I'm trying to measure the width of arbitrary letters. For example, I'm using this to get the width of a letter A: \settowidth{\letterwidth}{A} This seems to work fine for all my letters, except for ...
user avatar
  • 295
4 votes
1 answer
106 views

Bounding a picture inside a shape on a node

I have a tikzpicture tiled inside of a tikzpicture with the shape of a starburst as a central, repeating node. I want to fill the starburst with a picture. Normally, for a question here, I'd take ...
user avatar
3 votes
1 answer
86 views

Can I change the bounding box of the digit 1?

This is a follow-up to Is this horizontal alignment correct?. In short, I would to print the text 100 µm visually centered on a scale bar. The problem with this is the digit 1 has the same wide ...
user avatar
  • 5,132
3 votes
2 answers
229 views

How can I get the bounding box of a specific group of objects in TikZ?

Considering TikZ code: \begin{tikzpicture} \draw <a square>; \draw <an elephant>; \draw <a toaster>; \end{tikzpicture} I'd like to access the ...
user avatar
  • 349
3 votes
1 answer
196 views

Moving tikz node scales coordinates in scope

I was looking for a way to overlay an image with an grid. I found this answer, which allows me to get an evenly sized grid over an arbitrary sized image (see first figure attached). Very nice! However,...
user avatar
  • 63
1 vote
1 answer
623 views

How do I put a rectangular box around a figure?

i need to put a bounding box around a cropped image of which I don't know the dimension in cm how can I do it ? This is the code I'm using and the image. \documentclass{article} \usepackage{tikz} \...
user avatar
5 votes
2 answers
159 views

How to position legend at corner of tikxpicture bounding box?

I've created a block diagram and want to add a legend to it which should be positioned in the very top left corner. I've setup a custom environment for the legend according to the answer to this ...
user avatar
  • 171
2 votes
2 answers
654 views

Tikz cuts off top of text in tikzpicture

I am drawing an arrow with text above it \documentclass[tikz]{standalone} \usetikzlibrary{decorations.text} \begin{document} \begin{tikzpicture} \draw[<-, thick, postaction={decorate, decoration={...
user avatar
0 votes
1 answer
78 views

Make box in alignment mode

I have written this equation in alignment mode. But now I want to box this whole expression. What command should I use? Any Idea? \begin{align*} I=&\frac{1}{|\mathrm{det \, \textbf{A}}|} \sum_{m_{...
user avatar
  • 456
4 votes
4 answers
216 views

How do I use two colours in a bounding box?

I had what I thought was a simple task, which is to create two different coloured background rectangles. The purpose is to distinguish one set of concepts from another. I haven't found an answer that ...
user avatar
  • 473
4 votes
1 answer
1k views

tikzpicture padding

I don't get where the mysterious white space around this mwe-tikzpicture comes from: \documentclass{article} \usepackage{amsmath} \usepackage{tikz} \usepackage{pgfplots} \usetikzlibrary{arrows.meta} ...
user avatar
  • 304
0 votes
0 answers
158 views

Inserting figures into Anki (LaTeX cards) causes no BoundingBox error

I'm using latex to format my Anki cards and ran into an error: "! LaTeX Error: Cannot determine size of graphic in" \begin{center} \includegraphics{supplementary.PNG}\\\relax {{c1::Supplementary ...
user avatar
3 votes
1 answer
124 views

Why is the bounding box not updated when using arrows.meta arrowheads in inline tikz?

I am using inline tikz calls to create annotations in my documents. I am using the (below defined) \Curve macro to annotate graph plots (e.g. created with pgfplots) and \Curvee macro for more ...
user avatar
  • 8,479
0 votes
1 answer
212 views

Make bounding box of 3D figure tighter

I am trying to plot 3 figures using pgfplots next to one-another. To do so, I have created 3 minipages with a with of 0.3\textwidth, so that there is a bit of room between them. In each minipage I ...
user avatar
1 vote
1 answer
98 views

How to properly use savebox with tikz externalize?

I am unable to properly capture dimensions with savebox while tikzexternalize is on. Here is the MWE: \documentclass {article} \RequirePackage {tikz} \RequirePackage {expl3} \usetikzlibrary {...
user avatar
  • 289
1 vote
1 answer
262 views

TikZ: Create bounding box in tikz picture of control system diagram

I have completed writing a control system in TikZ. I now want to create two coloured "boxes" with dashed lines which should entail my controller and plant components of the entire control loop. Please ...
user avatar
0 votes
3 answers
364 views

Irregular bounding box for text in LaTeX

Bounding box example Can you tell me the package to use to make the irregular shape for bounding the text, as in the example just above ?
user avatar
  • 137
3 votes
1 answer
418 views

How do I find the bounding box that surrounds various Tex elements

Given a tex file like this : \documentclass{article} \usepackage{lipsum} \begin{document} \lipsum[1] \end{document} I'm unable to figure out a way to log the bounding box co-ordinates (x, y, width,...
user avatar
2 votes
3 answers
709 views

How to position `local bounding box` (scope containing a series of paths) below a node's `south` anchor?

It's easy to position a node below a local bounding box (behavior is standard) but not the other way. I assume it's because the scope doesn't "know" about nodes outside of it. I tried to use ...
user avatar
  • 3,636
5 votes
3 answers
628 views

How can I draw a rectangle around venn Diagrams?

I have tried some of the solutions to similar questions, but none of them included minipages, which seems to be the problem (I`m fairly new to LaTeX) So, here's the coding: % Definition of circles \...
user avatar
2 votes
1 answer
105 views

Pgfplots Interrupt Bounding Box by applying a style to a node

I would like to be able to use \addplot ... node {<node text>}; and have the node not affect the bounding box. That is, the bounding box should be what it would be with just: \addplot ... ; ...
user avatar
12 votes
1 answer
446 views

Change bounding box of math glyphs in LuaTeX

I'm trying to use the Garamond-Math font in LuaTeX (despite the documentation saying I should use it with XeTeX only :-). It's working more or less OK with LuaTeX, except for some unfortunate glyph ...
user avatar
0 votes
0 answers
160 views

Force includegraphics to obey bounding box of eps

I have an test.eps that consists of %%BoundingBox: 0 0 343 491 %%EOF and a tex document \documentclass{minimal} \usepackage{graphicx} \newbox\figbox \begin{document} \setbox\figbox\hbox{\...
user avatar
  • 2,335
1 vote
1 answer
650 views

Creating a Tikz-Picture with respect to paper width

Till now I just create a desired picture for example with QTikz or Tikz-EDT and pass the code afterwards to my document. To fit the picture to the width of the paper I use \resizebox. However, if the ...
user avatar
  • 1,213
4 votes
2 answers
343 views

Tikz Figure with Adjusted Bounding Box Does Not have Correct Spacing

The \DrawBoundingBox macro draws bounding box around a figure with a 1pt border. In the first figure, produced with \MyNode\MyNode, no tweaks are done to tikz's bounding box. Due to the control points ...
user avatar
2 votes
1 answer
216 views

Bounding boxes for each column of a 2-column algorithm & align them flush with page margins

I have two sub-algorithms for side-by-side placement using the algpseudocode layout from the algorithmicx package. Since each sub-algorithm needs to be individually referred in text, I chose the ...
user avatar
34 votes
2 answers
2k views

Why does rotating a circle alter its bounding box?

Why does rotating a tikzpicture with a circle alter the height and width of the bounding box, and is there a way to not have this effect? The MWE below yields: Code: \documentclass{article} \...
user avatar
3 votes
1 answer
268 views

mdframed with raised extra content runs into the header of an scrbook document

I'm using a variant of Example 5 – complex example with TikZ from the mdframed manual in a scrbook document. The goal is to include easily distinguishable boxes that contain exercises, definitions, ...
user avatar
6 votes
1 answer
782 views

Align tikzpictures at internal bounding box with text below it

I want to align the bottom of the red bounding boxes, but can't seem to find the right combination of baseline and anchor options to get this to work. The failing test case of the MWE below is the ...
user avatar
3 votes
3 answers
175 views

How to avoid or compensate horizontal and vertical shifts in a tikz' struck out node?

The following MCE below points out that, for a tikz' struck out node, the line width causes both horizontal and vertical shifts. Is it possible to avoid them? Or, at least, to know exactly the ...
user avatar
2 votes
1 answer
106 views

Proof tree as argument to function, with tight-fitting box

I would like to define a function over proof trees, using mathpartir to layout the proofs. For example: However, I would like the function parentheses to fit snugly around the inference rule. I'm ...
user avatar
  • 3,846
1 vote
2 answers
587 views

\includegraphics pagebox without clipping

I have some PDF icons with a TrimBox different from the MediaBox. For example: Page size: 23.2441 x 20.6929 pts (rotated 0 degrees) MediaBox: 0.00 0.00 23.24 20.69 CropBox: ...
user avatar
  • 33
5 votes
2 answers
629 views

Tikz "overlay" option does not draw nodes referencing local bounding box

I'm wanting to populate the cover page of my package with a border of examples of my package command's outputs, which are drawn in TikZ. To this end I'm using a tikzpicture environment with the ...
user avatar
16 votes
2 answers
528 views

How to have a background which exactly fits the text height/depth?

I tried with a background starting from text anchor or from base anchor, and with a colorbox without sep, but the top of the "S" and the bottom of the "p" are a little bit above of the background ...
user avatar
  • 54.2k
2 votes
1 answer
313 views

Boxed text, multiline

How can I something like this (an \fbox that can span multiple lines): |--------------------------------------------- The quick brown fox |jumps over the| lazy dog. The quick ...
user avatar
1 vote
1 answer
629 views

Adjust overpic size to accommodate annotations

How to make a bounding box around overpic that includes the added contents (such as \put, etc.)? For instance below \fbox does not take into account the \put commands nor the grid labels. \...
user avatar
  • 2,142
1 vote
0 answers
223 views

tikz bounding box of a cubic Bézier curve [duplicate]

This document \documentclass[DIV=16]{scrartcl} \usepackage{tikz} \pagestyle{empty} \begin{document} \hrule \begin{center} \begin{tikzpicture}[scale=.3] \draw[domain=-1:5] plot (\x,{0.5*\x*\x*(\x-...
user avatar
4 votes
2 answers
433 views

Overfull box on table that don't exceed textwidth

I have the following code. As you can see, in the column definition I have put @{} as suggested here \documentclass[draft]{scrbook} \usepackage{dcolumn,booktabs} \begin{document} \newcolumntype{P}[...
user avatar
5 votes
3 answers
9k views

Includegraphics doesnt show graphic if using bounding box

as the title says... I dont really know what's the problem, tried with different formats of figures (eps, pdf, jpg) \documentclass{article} \usepackage{graphicx} \usepackage{float} \begin{document} ...
user avatar
  • 129
2 votes
1 answer
312 views

How to calculate and use the bounding box of a figure/tikzpicture/table/array

I am writing some text where I usually have some text and then some figure/tikz picture/table (with tabular or array environment) side by side, in this orden. The command that I use is \newcommand{\...
user avatar
  • 1,329
3 votes
1 answer
495 views

Bounding box and umlaut issue in text decoration

In the above TikZ picture, how can I extend the bounding box to include the text decoration without manual tinkering (the only solution I was able to find is fiddle with the border or margin class ...
user avatar
  • 3,782
4 votes
2 answers
411 views

Decoration markings don't extend bounding box

How come decoration markings don't extend a TikZ picture's bounding box and how can I change this? Consider this example where the arrow markings are partially cropped. \documentclass[tikz]{...
user avatar
  • 3,782