Skip to main content
37 votes

How to scale a tikzpicture including texts?

If you want to scale everything in your tikz picture, you could also place it within a \scalebox or \resizebox (from package graphics/x) Examples: \scalebox{0.6}{ [Your tikz goes here] } \resizebox{....
Manuel Popp's user avatar
24 votes
Accepted

Really wide hat symbol

An alternative (and very simple) solution consists in using the package yhmath (which, as far as I was able to understand from its documentation, requires the amsmath package). With such a package (i....
user229745's user avatar
21 votes
Accepted

Scaling tikz brace

Add this after decorations.pathreplacing is used. It will scale the brace if it is necessary. \makeatletter \let\pgf@decorate@@brace@brace@code@old\pgf@decorate@@brace@brace@code \def\pgf@...
Symbol 1's user avatar
  • 37k
21 votes
Accepted

Why not scale elements that contain text

For good fonts, different font sizes don't only have a different size, but the actual shape of the letters is different. Consider the following example: \documentclass{article} \usepackage{...
samcarter_is_at_topanswers.xyz's user avatar
20 votes
Accepted

Inserting PNG file as is

This question cannot have general answer for ALL monitors. The size of the PNG image on the screen depends on the screen resolution (e.g. 110.27 PPI (pixels per inch) for my MacBook), and on Retina (...
pantlmn's user avatar
  • 1,376
18 votes

Scale image to page width?

width=\columnwidth worked for me in a two-column document: \begin{figure} \includegraphics[width=\columnwidth]{myfigure.pdf} \caption{My amazing figure} \end{figure}
hugomg's user avatar
  • 1,071
15 votes
Accepted

Little problem with xscale and tikzducks

The book is a node , and nodes are only transformed (rotated etc) if you use the transform shape key. But naturally this will also mirror the text, so you need reflectbox to get it back:: \...
Ulrike Fischer's user avatar
15 votes

Why not scale elements that contain text

Scaling an element which contains text will result in an inconsistent font size compared to the rest of the document. Especially automatic scaling to fit a table to the text width (\resizebox{\...
samcarter_is_at_topanswers.xyz's user avatar
14 votes
Accepted

How to make the summation sign wider?

I don't think you want something like this or Code for the first image \documentclass{article} \usepackage{amsmath} \usepackage{graphicx} \newcommand{\widesum}[2]{% \mathop{\vcenter{\hbox{\...
egreg's user avatar
  • 1.1m
12 votes

In beamer, What's the "right way" to scale a slide element down to better fit?

To achieve a very similar goal I generally use the following: \begin{frame} \frametitle{Size changed} \scalebox{0.8}{\begin{minipage}{1.20\textwidth} ... your content here ... \end{minipage}} \end{...
Lgen's user avatar
  • 231
12 votes
Accepted

Knowing how much \resizebox scales

\resizebox is just \scalebox with a scale factor being the number that you ask for. So you can just persuade it to expose that number rather than just use it in a local group and discard it. \...
David Carlisle's user avatar
11 votes

TikZ: the scale option changes font size

If your tikzpicture only contains a PGFPlots axis, you can move the scale=2 to the axis options: that way, the font sizes aren't affected. \documentclass[a4paper]{article} \usepackage{tikz} \...
Jake's user avatar
  • 233k
11 votes
Accepted

LaTeX - how to detect scale of \includegraphics

If you specify both height and width keys, and specify keepaspectratio then the values are taken as upper bounds and the image is scaled so that both height and width fit within the specified areas, ...
David Carlisle's user avatar
11 votes
Accepted

Recreate textlogo

The official logo is available as svg here https://uit.no/ressurs/uit/webmain/img/Navnetrekk_norsk.svg If you take the first three paths from that file they draw UiT <path fill="#231F20" d="M13,...
David Carlisle's user avatar
9 votes

Automatically fit the graphics in the remaining space of a Beamer slide

Following code shows an alternative solution using tcolorbox package and its space to option. space to = macro saves (after several compilations: two or more) into macro the difference between box ...
Ignasi's user avatar
  • 137k
9 votes
Accepted

Scale down verbatim environment even further

This way? See: How to get an even smaller font size than \tiny?. \documentclass{beamer} \usepackage{graphicx} \usetheme{default} \usepackage{float} \usepackage{tikz} \usepackage{amsfonts} \...
CarLaTeX's user avatar
  • 64.7k
9 votes
Accepted

Are \onehalfspacing and {spacing}{1.5} Supposed to Yield Different Results?

The environment name is onehalfspace, not onehalfspacing AND, it is (for a 10pt document) equivalent to \begin{spacing}{1.25}. \documentclass{book} \usepackage{setspace} \usepackage{lipsum} \begin{...
Steven B. Segletes's user avatar
8 votes

using underbrace without having left( and right) scale

I prefer \smash[b]: \documentclass{article} \usepackage{amsmath} \usepackage{mathtools} \begin{document} Here could be text. \[ \left(2,\smash[b]{\underbrace{\frac{5}{3}}_{\mathclap{\approx 1....
Jakob's user avatar
  • 1,003
8 votes

Part of the standalone tikzpicture gets scaled when pasting it in a document

The problem are different font sizes (12pt in the main file and default 10pt font size in the diagram file as you use \textwidth to size your polygon and this length depends on the document default ...
Martin Scharrer's user avatar
7 votes

Is there a way to slightly shrink a table, including font size, to fit within the column boundaries?

If the tabular only needs to scaled down very little, it might be worth trying out the widetable package which is like a tabular* but does not need \extracolsep and works by calculating the right ...
Frank Mittelbach's user avatar
7 votes

Compile a LaTeX document into a PNG image that's as short as possible

If you are on Linux, you can try pnglatex. It's pretty simple; to generate your formula you write $ pnglatex -f "E=mc^2" If the image was created using pnglatex you can also reverse the process. $ ...
mneri's user avatar
  • 261
7 votes
Accepted

How to use EB Garamont Font with KOMA Script Font Size 16pt

You will get these warnings if you are using option fontsize=16pt before setting a scalable font. To avoid the warnings you can load package fix-cm before the document class. Then the default font ...
esdd's user avatar
  • 86.1k
7 votes

How can I make scaling affect TikZ-pics within a tikzpicture?

transform shape is your friend. Usually, stuff like nodes (and obviously pics) are not scaled. With transform shape, you can enforce this. Note that this also scales text. \documentclass[tikz, border=...
pschulz's user avatar
  • 1,385
7 votes
Accepted

Scaling a tikzpicture in the figure environment with caption

For rescaling in general you can use a resizebox (from the graphicx package), which also works for tikzpicture. The first argument is the width, the second the height, or ! to scale proportionally. ...
Marijn's user avatar
  • 38.9k
7 votes
Accepted

How to prevent a node exceeding minimum size by making its contents scale-down if they are about to enlarge the node?

I would make a separate command that scales down oversized inputs. \documentclass[border=5mm]{standalone} \usepackage{tikz} \usetikzlibrary{shapes.geometric,positioning} \newcommand\MyTextScale[2][...
StefanH's user avatar
  • 13.9k
7 votes
Accepted

Can I resize a TikZ picture to have certain dimensions (width, height)?

If you want to create PNGs from your standalone file in a certain size, you can use the png class option to do this. It has a size and a density option to select the resulting image size. The density ...
Martin Scharrer's user avatar
7 votes

Scale all figures by the same value

The scale, or "natural width", of a graphics file may be of relevance at the time the file was created. E.g., the scale may have been chosen to make the image fit in a certain window on a ...
Mico's user avatar
  • 515k
7 votes
Accepted

Scale math font with newtxsf

My suggestion is to try with no scaling; in this case we get the height of a sans serif A is 8.87999pt and the height of a math A is 8.148pt. Therefore the scaling factor is 8.148/8.87999=0.91757 (...
egreg's user avatar
  • 1.1m
7 votes

Rescaling environment

The standard Puzzle environment produces a centered object, because it executes \PuzzlePre and \PuzzlePost, defined as \newcommand\PuzzlePre{% \par\noindent\mbox{}\hfill } \newcommand\PuzzlePost{% ...
egreg's user avatar
  • 1.1m

Only top scored, non community-wiki answers of a minimum length are eligible