Hot answers tagged

67

If you're willing to just scale the entire table down, then this is fairly straight-forward, put it in a box and scale the box to \textwidth. \documentclass{article} \usepackage{graphicx} \begin{document} test \begin{table}[ht] \centering \resizebox{\textwidth}{!}{\begin{tabular}{rlrrrrrrr} \hline & X & MASHvstRap & MASHvsBEEML & ...


66

You are looking for the macros \resizebox{<h-length>}{<v-length>}{<content>} and \scalebox{<h-scale>}[<v-scale>]{<content>} from the graphics/graphicx packages (→ graphics manual, 3.3 “Scaling”, p. 3). The \scalebox macro expects ratios like those you’d use in \includegraphics, you you would be using \begin{figure}...


58

Use the adjustbox package's valign=t key to align the graphics contents at the top: \documentclass{article} \usepackage[export]{adjustbox}% http://ctan.org/pkg/adjustbox \begin{document} \begin{figure} \centering \includegraphics[scale=0.5,valign=t]{example-image-a} \includegraphics[scale=0.3,valign=t]{example-image-b} \caption{A caption\label{fig:...


45

The question wasn't "should it be done?" But, for the same reason men climb mountains, "could it be done?" The answer, with the scalerel package, is yes. Thus, we introduce \reallywidehat [EDITED to add phantom rule below argument, so that baseline of result matches baseline of original argument. RE-EDITED to \ensuremath on the \widthof calculation (...


41

This worked for me \begin{figure}[ht] \centering \includegraphics[width=1.0\textwidth]{Normal_Case_1_req_1_response} \caption{Normal Case: 1 Request \& 1 Response.} \label{normal_case} \end{figure}


40

The solutions from Stefan and Jake scale the fonts, write into the margin or require some manual tweaking. I was heading for an automatic solution, so that nothing has to be tweaked again, if the document is changed. The fonts in all plots should have the same size, so resizebox was not an option for me. As I didn't want to plot into the margins either, I ...


39

With the adjustbox package you can say \adjustbox{max width=\columnwidth}{...} that will scale the contents only if it exceeds the \columnwidth, according to the documentation: A good example is max width=\textwidth which will limit large content to the text width but will not affect smaller content. Of course \textwidth is just by way of example and ...


39

With explicitly adding width=7cm,height=3cm options to the Pgfplots axis environment you can control the size of the plot. Giving one of them will keep the aspect ratio constant hence would behave as a scaling only.


37

TeX has an internal integer register called \mag whose value is initialized to 1000 and can be changed before a page is shipped out. If one sets \mag=1200 all dimensions will be increased by 20%. More precisely they are multiplied by \mag and divided by 1000, unless they are specified with the keyword true before the unit. Thus setting \dimen0=5 true cm ...


36

If vertical size do not matter, then you could use \includegraphics[width=<X>\textwidth]{<first image>}% \includegraphics[width=<1-X>\textwidth]{<second image>} Here <X> denotes a number in (0,1), while <1-X> denotes its complement in the interval (0,1). Note the % to remove any space between the images. For equally-...


35

As already mentioned in https://tex.stackexchange.com/a/97506/2975 you can use \resizebox or better adjustbox to scale the table to a specific width, e.g. \textwidth which is the width of the text on the page. This however might make your table text very small and hard to read. \documentclass{article} \usepackage{adjustbox} \usepackage{lipsum}% example ...


35

There is no centering environment. And issuing \centering inside \resizebox doesn't make sense anyway: it should be outside, because you want to center the resized box. \documentclass[11pt,english,titlepage]{article} \usepackage{graphicx} \begin{document} \begin{table} \centering \caption{mytable} \resizebox{.5\textwidth}{!}{% <------ Don't forget this ...


31

\usepackage{graphicx} ... \scalebox{1}[3]{hello}


31

For more exotic requirements adjustbox or resizebox are useful but you don't really need any additional commands for this (other than a local command just to access @ commands more easily) \documentclass{article} \usepackage{graphicx} \makeatletter \def\maxwidth#1{\ifdim\Gin@nat@width>#1 #1\else\Gin@nat@width\fi} \makeatother \begin{document} \...


30

TeX has a magnification feature (which is used in plain Tex mostly as the format only loads 10pt fonts by default) it is not really supported or used in LaTeX. If you apply magnification then most lengths are scaled by the appropriate amount, however for referring to physical lengths such as the page size you need to refer to unmagnified lengths, so you can ...


30

It appears as if you want to rescale the x coordinates without extracting some common factor. The scaled x ticks feature has the main use case of generating a common tick factor which is placed into some node... and, in fact, pgfplots has no builtin support for scaled ticks and log axes as it is typically no use-case. However, rescaling the x coordinates is ...


29

You need rather less that \textheight to allow room for the title. Also, it's probably easier to use adjustbox than \resizebox: \documentclass{beamer} \usepackage{adjustbox} \begin{document} \begin{frame}{Well formulated title} \centering \adjustbox{max height=\dimexpr\textheight-5.5cm\relax, max width=\textwidth}{ \begin{tabular}{rrrrrrrr} ...


25

You could load the relsize package and issue the command \relscale{0.95} % or whatever scaling is desired at the start of the document.


24

Just use width=0.5\textwidth instead of scale=3. The width option will scale an image to match the given width while keeping the aspect ratio. To get a little white space between them you may use something like this. \begin{figure} \includegraphics[width=0.475\textwidth]{peer} \hfill \includegraphics[width=0.475\textwidth]{peer-inconsistent} \end{...


24

The problem is that the scalebox command needs to operate on a box, and the itemize environment is not in one. Perhaps the easiest way to fix this is to put it in a vbox \scalebox{0.8}{% \vbox{% \begin{itemize} \item 1... \item 2... \end{itemize} }} Or you might prefer a minipage \scalebox{0.8}{% \begin{minipage}{\textwidth} \...


23

Use the TikZ library arrows.meta and then you can scale the arrow heads as you wish. Here are a few examples. \documentclass{amsart} \usepackage{tikz} \usetikzlibrary{arrows.meta} \begin{document} \begin{tikzpicture} \draw[->,line width=4pt] (0,0) to (1,0); \end{tikzpicture} \begin{tikzpicture} \draw[-{>[scale=2.5, length=2, ...


22

Here is working example of resizing table together with caption. \documentclass{article} \usepackage{graphicx} \begin{document} \begin{table}[htbp] \centering \resizebox{0.5\textwidth}{!}{\begin{minipage}{\textwidth} \caption{Table caption} \begin{tabular}{|c|c|c|c|} \hline $t_0~(MeV\cdot fm^3 ) $ & $t_3~(MeV\...


22

I think you have two good choices and a (likely) dreadful choice: Use a tabular* environment, Use a tabularx environment (or its close cousin, tabulary) Use the basic tabular environment and scale it up (or down) using \resizebox. The results are as follows (the first horizontal line is there just to illustrate the width of the text block): Can you tell ...


21

The matplotlib PGF backend saves as raw PGF. What you probably want instead is pgfplots, which you can get using tikzplotlib, assuming your plots aren't too complex and all the features are supported. Sample Python script for creating figure: from pylab import * from tikzplotlib import save as tikz_save x = linspace(0, 10, 101) plot(x, sin(x)) xlabel('$x$-...


20

align adjusts its contents based on the available width (in order to place it horizontally in the centre, and to place the appropriate tags/numbering). Inserting it inside a \scalebox causes the problem that there's no defined box to contain it. However, if you provide such a containment, it scales without problem: \documentclass{beamer}% http://ctan.org/...


19

If you want to add captions to it, I suggest: \begin{frame}{Pixelweise Segmentierung} \begin{figure}[ht] \begin{minipage}[b]{0.45\linewidth} \centering \includegraphics[width=\textwidth]{a.png} \caption{Label for a} \label{fig:a} \end{minipage} \hspace{0.5cm} \begin{minipage}...


19

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@decorate@@brace@brace@code{ \ifdim\pgfdecoratedremainingdistance<4\pgfdecorationsegmentamplitude \pgftransformxscale{\...


17

if the text that you want to be "narrow" is just short phrases, and they don't need to be broken into lines, you can cheat, and use \scalebox from the graphicx package. for example: the narrowed portion was produced with \scalebox{.7}[1.0]{This text is narrowed.} you do need the optional [1.0] height, since you want to change the aspect ratio. it's not ...


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