{adjustbox} package allows to adjust general (La)TeX material in several ways using a key=value interface. It got inspired by the interface of \includegraphics from the graphicx package. This package also loads the trimclip package whose code was once included in this package.

learn more… | top users | synonyms

17
votes
1answer
8k views

Cropping/Trimming an image with includegraphics by specifying percentages

Say I have an image my_image.png that I am loading in my LaTeX document using: \begin{figure} \includegraphics[width=0.5cm]{my_image.png}} \end{figure} Is there a way of telling LaTeX to only ...
14
votes
2answers
1k views

How to scale and then trim an image?

I am trying to create a document that requires the inclusion of images at a precise size (h x w inches). I would like to reuse the document template, so I would like to create a command that would ...
10
votes
2answers
339 views

How to create command for a box where text inside the box can automatically adjust?

I have a problem on how I can make my command right. I created a box where the text will be inside it when used but something went wrong when I prolong the text it turn out like this: Code: ...
9
votes
4answers
2k views

Set size of \colorbox for a single character

my question is simple (or not) I want to set the size of the \colorbox command or \fcolorbox command for a single character. The problem is the next: As seen in the image, the height and width are ...
7
votes
1answer
988 views

Why does adjust box not resize to the dimensions given

Hi looking to understand this a little better. Why does adjustbox not resize the text in the following example so that it fits the dimensions I think I'm specifying. e.g a 4in x 4in box. Am I doing ...
7
votes
1answer
658 views

defining a centered shadowboxed listings environment

I'm trying to define a environment for code listings wrapped in a shadowbox and centered in the line. Using this code, I can generate the kind of output that I want: ...
6
votes
2answers
5k views

Frame option in includegraphics makes an overfull \hbox

I'm using the adjust package to add the frame option in \includegraphics command. The package is loaded in this way: \usepackage[export]{adjustbox} Now I can write the following command: ...
6
votes
2answers
1k views

How do I export adjustbox-parameters?

I have got two adjustboxes (from the adjustbox package). Now I need to give the second box the same totalheight as the one which the first box got. \documentclass{article} \usepackage{etex} ...
6
votes
1answer
664 views

Grid missing horizontal lines

The following code: \begin{figure}[!t] \centering% \begin{tikzpicture}[xscale=1,yscale=1,auto, inner sep=0pt,remember picture] \node[anchor=north west,inner sep=0] (image) at (0,0) ...
6
votes
1answer
1k views

Robust colored background for parts of the document

I would like to set off certain parts of my document by giving them a colored background. With the help of adjustbox I was able to write an environment that does more or less what I want: It puts its ...
6
votes
1answer
291 views

Horizontal array of enumerated equations

This is for use in work assignments for math students. I'd like to post multiple parts for a given question, without sacrificing too much space for this. So I want a bunch of equations arrayed ...
6
votes
1answer
788 views

How to scale a verbatim block in a user-defined environment?

In order to produce an ereader-friendly PDF with small page dimensions, I'd like to scale down some oversize verbatim blocks such as program output with lines too long for the small page. Then readers ...
6
votes
0answers
139 views

Draft option with adjustbox package [closed]

I've been using the great labour-saving adjustbox package to excellent results. Nonetheless, when using the draft option with the \adjustimage command I do not get the expected result, namely, the ...
5
votes
2answers
174 views

How to switch off “figure” in algorithm2e only in certain cases?

Suppose the following situation. Algorithm2e should have the global option "figure", i.e. an algorithm is included in Figures. However we need to switch off this property only in certain cases (to ...
5
votes
1answer
349 views

LaTeX align/distribute objects à la InDesign?

I'm trying to replicate, in LaTeX, InDesign's align and distribute tools. This is a snapshot of ID's toolbar: Say I want first to align vertically two objects (texts, graphics, boxes,...), and ...
5
votes
1answer
300 views

Adjustbox ate my newlines

Apologies for the long MWE. Wanted to understand what I was doing wrong here. Trying to shrink this as part of a longer exercise in producing some slides. (This is the legend for a graphic referenced ...
5
votes
3answers
166 views

How could a verbatimtab environment in a figure environment be resized (perhaps using the package adjustbox)?

How could a verbatimtab environment in a figure environment be resized (perhaps using the package adjustbox)? I have some code something like the following: \begin{figure}[htb] \centering ...
5
votes
2answers
1k views

Reference to figure label in adjustbox

\begin{figure} \begin{adjustbox}{addcode={\begin{minipage}{\width}}{\caption[bla] {% bla ..., fig. \protect\ref{fig:fig1}, ...bla. } \end{minipage}}} \includegraphics[scale=1]{figure.png} ...
5
votes
1answer
113 views

customized caption and label for adjustbox

The question is a follow up of the question posted here how to make adjustbox work correctly . \documentclass{scrartcl} \usepackage{adjustbox} \usepackage{wrapfig} \usepackage{lipsum} ...
5
votes
2answers
176 views

How to have two adjustwidth environments starting at the same height?

When using minipage environments, as below, the left corner of the two environments are automatically placed at the same height in the document. \begin{minipage}{8em} Lorem ipsum dolor sit amet, ...
5
votes
0answers
1k views

Fitting TikZ picture in beamer: Difference between using \resizebox and \adjustbox? [closed]

\documentclass[10pt]{beamer} \usepackage{amsmath} \usepackage{amssymb} \usepackage[english]{babel} \usepackage{color} \usepackage{float} \usepackage[T1]{fontenc} ...
4
votes
1answer
225 views

How to make adjustbox work correctly with wrapfigure?

I have an adjustbox environment which gives colored background to content. It doesn't play nicely with wrapfigure. It overlaps with the content. Below is the mew. \documentclass{scrartcl} ...
4
votes
2answers
6k views

! LaTeX Error: File `adjustbox.sty' not found on Ubuntu 10.04.2

I have install $ sudo apt-get install texlive-full on Ubuntu 10.04.2 but when I run I got this error about adjustbox. ! LaTeX Error: File `adjustbox.sty' not found Is there anyone know how to ...
4
votes
2answers
53 views

Fit table to textwidth AND textheight

The table below was too long to fit the textheight and not wide enough to fit the textwidth. I would prefer the height of the table to conform to the height specified by the commented-out line ...
4
votes
1answer
1k views

vertical aligning images in table with \adjustbox only works when not every image is in an \adjustbox

I'm trying to center all images vertically and horizontally within a table cell. Therefore I'm using the adjustbox packet. This is the code I use for my table: \begin{table}[b] \begin{center} ...
4
votes
1answer
561 views

Adjustbox on a landscape page makes a table too small

I am trying to use adjustbox to scale down a table that is too large for a landscape page, but when I use it, the scaled table is much smaller than it needs to be relative to the size of the page. Any ...
4
votes
2answers
106 views

Control the size of an equation (in display mode)

There are several ways to show an equation. I'm trying to put a big equation in display mode (i.e.: \[ {\equation} \]) and to keep it's dimensions within the size that is reasonable, using adjustbox. ...
4
votes
1answer
113 views

“adjustbox” with Export option seems to break page selection (in “pdfpages”)

I'd like to include some pages from a separate PDF with the right half trimmed off, but I don't know in advance the exact size of the pages. I tried a solution, using pdfpages to include from the PDF ...
4
votes
1answer
179 views

Modify the \textwidth of all subsubsections compatible with adjustbox

I have a very simple document which is a succession of tables within subsubsections of the document. \usepackage{geometry} \geometry{verbose,landscape,a4paper,lmargin=1cm,rmargin=1cm} This is my ...
3
votes
1answer
280 views

error '\clipbox already defined' when use package adjustbox

I am trying draw table. I use adjustbox package. I loaded this package in separate file. That separate file contains the packages I use. \usepackage{inputenc} \usepackage{graphicx,color} ...
3
votes
2answers
117 views

Wrap a few lines of Algorithmic in a box

I have some pseudocode where I want to reveal an algorithm little-by-little. Currently I highlight the code that is revealed by coloring it red and this looks good onscreen. However, on print, this ...
3
votes
2answers
90 views

Add rotated comment on margin

this is my MWE: \documentclass[a5paper]{book} \usepackage[ngerman]{babel} \usepackage{ucs} \usepackage[utf8x,utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[garamond]{mathdesign} ...
3
votes
1answer
80 views

How can I use adjustbox in \sectionmark?

I want to use adjustbox in \sectionmark but it doesn't work. Is there a work-around for this? \documentclass{book} \usepackage{blindtext} \usepackage{adjustbox} \usepackage{fancyhdr} ...
3
votes
1answer
261 views

Adjustbox does not reduce table and tikzpicture widths

I'm redesigning lecture notes for a university class since the students wanted to read the notes on their tablets, e-book readers, etc. So I've written a Makefile with different targets for different ...
3
votes
1answer
546 views

How to fit a wide table landscape orientation

I have this simple code: I can build the table on landscape orientation, but when I insert the command adjustbox, there are some erros: Not in outer par mode undefined conttrol sequence ... Error ...
3
votes
1answer
2k views

Adjustbox inside figure environment [closed]

I am trying to use the adjustbox package. When I use the adjustbox command inside a \ffigbox (floatrow package) it works fine. Now I wanted to use it inside a figure environment. Therfore I used the ...
3
votes
1answer
835 views

Adjustbox not showing caption with key option chosen

I can't get a caption to show up in the following MWE. I've put caption at the end of the key list, and in the actual example the BLAH BLAH BLAH is replaced with an \input{table.tex} variant, but the ...
3
votes
1answer
106 views

minipage layout not correct

I want to generate a document with graph at left and tikz code at the right. I try to use two minipage but it seems it always layout it as up and down. The minipage is 0.45\textwidth, why latex still ...
3
votes
1answer
391 views

Resizing table when using package {threeparttable}

I'm using the {threeparttable} package because I want to use table notes, but I'm having a problem resizing my tables. If I use {adjustbox} to enclose {tabular} (or {tabularx}), I get an error ...
3
votes
1answer
249 views

adjustbox and includegraphics page selection

I want to use adjustbox package to include graphics in beamer presentations. I prefer it over graphicx because it has max size option which only scale when figure size is larger than certain size. ...
3
votes
3answers
226 views

rotate table (90 degrees) and stretch to fill whole page

i'd like to rotate a table (90 degrees) and stretch it to fill whole page. That's what i've got so far: \documentclass{book} \usepackage{tabularx} \usepackage{adjustbox} \begin{document} ...
3
votes
1answer
4k views

Expand table to use page width

I normally use the table and tabu environment to create my tables. I am new to LaTeX and after I while I realized tables look nicer when they use the whole page width rather than being just centered. ...
2
votes
1answer
59 views

tcolorbox: How to create layout of single box on one side, multiple boxes on other?

I have three tcolorboxes where I would like the layout to be similar to this: I can make the titles of the first and second box align using the adjustbox package (as seen here), but I'm unsure how ...
2
votes
1answer
66 views

Referencing figure in adjustbox

I have rotated my figure to 90 degrees using adjustbox as follows: \begin{figure}[ht] \begin{adjustbox}{addcode={\begin{minipage}{\width}}{\caption{% My caption ...
2
votes
1answer
60 views

Background color around paperwidth figure

The question could have been subtitled: "how to force a caption to appear always on top of object float". I have a complex set of configurations and commands which I could resume to that MWE. % !TeX ...
2
votes
1answer
66 views

Align downscaled graphics to the left

I include a PDF as a figure in my document, and the PDF is a great deal wider than the \linewidth. I use the adjustbox package to set the width to slightly more than \linewidth, but I can't figure out ...
2
votes
1answer
290 views

adjustbox and lstnewenvironment

I'm trying to use adjustbox to make a frame around listings (I know that listings itself can do this, but its implementation produces sub-optimal results when the line heights are not equal throughout ...
2
votes
2answers
49 views

Align itemize text with graphic and use caption

I would like to align the top of the text with a figure and add a caption with a label to it. But as soon as add caption=test,figure to the adjustbox the picture floats above the text. How do I ...
2
votes
1answer
20 views

Documentation for \newadjustboxkey

The documentation for package adjustbox has a brief section describing \newadjustboxkey, but it provides no examples. I tried searching the internet, but Google provided only three results for the ...
2
votes
1answer
364 views

Right-justifying vertical subfigures in a two-column document

I am trying to include a pair of subfigures in my two-column document, stacked one on top of the other. I want them to be right-justified; to achieve this with individual figures I have been using ...