Skip to main content

Questions tagged [varwidth]

A package that defines a {varwidth} environment (based on {minipage}) which is an analogue of {minipage}, but whose resulting width is the natural width of its contents.

Filter by
Sorted by
Tagged with
2 votes
2 answers
148 views

Side by side minipage and tcblisting environment

I would like to use a configuration similar to the following, so that the width of the minipage automatically adapts to that of the tcblisting, but I don't know how to get the width of varwidth (noted ...
MB4E's user avatar
  • 1,106
1 vote
2 answers
91 views

Side by side minipage and varwidth

I'm looking for a way to combine the minipage and varwidth environments side by side, so that the width of minipage automatically adapts to that of varwidth, to fill the entire line. \begin{minipage}{\...
MB4E's user avatar
  • 1,106
2 votes
2 answers
65 views

Formatting indices with long reference titles and lots of page numbers

I am trying to create a class file to format a particular kind of index required for certain legal documents in the United States. I have come up with two different approaches, but neither allows me ...
bbernicker's user avatar
4 votes
1 answer
302 views

What is the correct way to use the latex-firstaid package?

I have just noticed the latex-firstaid package for patching other packages. Should latex-firstaid be loaded before or after the packages that it patches? Or some other way? The package documentation ...
Doc Octal's user avatar
  • 369
2 votes
1 answer
162 views

How to avoid damaging of a paragraph with `lettrine` and `varwidth` while using `chickenize`?

Trying to put automatically one symbol-words (as shown by arrows on the screenshot 1) from the end of the line into the beginning of the new line in scrbook (according to the topical typography rules) ...
filokalos's user avatar
  • 1,037
0 votes
1 answer
82 views

Justification of header text

I want my long header text to be justified. In the picture below: I have inserted a red line such that I want all the text to be on the right side of that line (justification). How do I achieve that? ...
itc's user avatar
  • 655
2 votes
2 answers
138 views

Vertical alignment within tcolorbox using varwidth

I'm using tcolorbox to have a "warning" box. I'd like the "warning sign" to be at the very top of it, but it's not achieved even by using the [t] option of the varwidthenvironment. ...
UnderscorePoY's user avatar
3 votes
2 answers
151 views

How to increase space between text and the line-box when using NiceTabular environment in the nicematrix package?

When using the NiceTabular environment in the nicematrix package, how do I increase the space between the text and the tikz-drawn line-box on all sides of the text when using type V columns defined by ...
RosesBouquet's user avatar
1 vote
1 answer
76 views

breakable box with varwidth

PROBLEM Build an environment to put some text in some boxes that should be both breakable across a page and adapt to text width. Unfortunately, packages mdframed and tcolorboxes have the first option, ...
brodegon's user avatar
  • 217
1 vote
1 answer
192 views

Hyperref package affects enumerate inside varwidth

In the following example, why does hyperref package affect enumerate (but not itemize) inside varwidth environment? Is it a bug? \documentclass{article} \usepackage{varwidth} \usepackage{hyperref} % ...
L.J.R.'s user avatar
  • 11.3k
0 votes
0 answers
67 views

Tabto introduces vertical space inside varwidth

Using the newest packages in TeX Live, the \tabto command introduces a slight vertical space when used inside a varwidth environment. Consider the following MWE: \documentclass{article} \usepackage{...
Christian Matt's user avatar
4 votes
1 answer
193 views

Newest Tex Live Updates introduce vertical space above varwidth

After updating all packages in Tex Live to the newest version, I have issues with the spacing produced by varwidth. Consider the following example: \documentclass[a4paper]{article} \usepackage{...
Christian Matt's user avatar
2 votes
1 answer
327 views

Change margins for tcolorbox with varwidth environment

In the code posted below, I am using varwidth to shrink my tcolorbox to the text width for short text lines. However, I also have some wraparound text lines and the tcolorbox is too big in that case. ...
hodop smith's user avatar
0 votes
1 answer
38 views

If statement based on varwidth

I am producing a document with different widths using the varwidth package. While writing the content, I only work with one width at the time. For final production, the content is copied and pasted ...
user44413's user avatar
  • 611
1 vote
1 answer
2k views

How to enumerate with two columns inside a box?

I'm trying to figure out how to insert a enumerated list with two columns inside a box with minimal waste of space. The code outputs the first items of each column unaligned among themselves and ...
redgrapejuice's user avatar
1 vote
0 answers
119 views

Autowidth Box for Itemize Environment

A newenvironment is defined using varwidth and tikz to get a block of width equal to that of the content within it. It works fine, unless itemization is involved. A MWE is given here. \documentclass[]...
Ashok's user avatar
  • 1,104
0 votes
1 answer
289 views

Extra white border with varwidth (standalone)

When I use the following code to generate two colored boxes: \documentclass[border={0pt 0pt 0pt 0pt}]{standalone} % left bottom right top \usepackage{varwidth} \usepackage{xcolor} \usepackage[xparse]{...
pelegs's user avatar
  • 267
2 votes
2 answers
231 views

Use varwidth with algorithm2e

I’m trying to draw a box around an algortihm2e construct, like this: I tried to use the varwidth package to get a box with the natural width of the content: \documentclass{article} \usepackage{...
Roman Langrehr's user avatar
2 votes
1 answer
75 views

Possible incompatibility between varwidth and ocgcolorlinks (hyperref/ocgx2)

In the simple example below, a reference inside varwidth environment fails due to hyperref package loaded with option ocgcolorlinks. Ading ocgx2 (with the same option) makes this even worse. \...
Peter's user avatar
  • 998
2 votes
1 answer
127 views

Using varwidth within an environment definition with minted

I'm trying to create a new environment which holds a centered code snippet using minted. Firstly I came across to a minipage package, however it needs the width specification. I just want it to be ...
kubisma1's user avatar
  • 123
1 vote
1 answer
1k views

problem with varwidth package

I had a book that contains the varwidth package. Until now everything was OK, but finally this error appeared: Sorry, but "C:\Program Files\MiKTeX 2.9\miktex\bin\x64\pdflatex.exe" did not ...
Kώστας Κούδας's user avatar
5 votes
2 answers
942 views

Using \color in varwidth environment produces warning and does not work as intended

Trying to use color in a varwidth environment, I stumbled upon a warning from the varwidth package. Inspecting the issue and trying the same with \parbox and the minipage environment lead to the ...
nox's user avatar
  • 4,200
4 votes
2 answers
264 views

Restrict background color to varwidth's narrower width with adjustbox?

I want to wrap a frame, with background color, around each table, with its caption included within the frame. For the frame, I've adapted Martin Scharrer's answer to "Adding border around figure and ...
Jim Ratliff's user avatar
  • 1,049
0 votes
0 answers
38 views

Make it so that output is single "sheet" with unbounded width

The first line of my TeX document is \documentclass[varwidth=true, border=10pt]{standalone} The output generated is cropped to the width of the content, but it has a maximum width after which it ...
Melab's user avatar
  • 181
1 vote
1 answer
635 views

Redefine \intertext and \shortintertext to measure their width

I am trying to measure the natural width of an align* (with the fleqn documentclass option) and have been told in the comments at Determine natural width of align*: varwidth uses \linewidth even ...
Peter Grill's user avatar
1 vote
0 answers
75 views

Determine value of overfull amount

If I set content into a box that is not wide enough (0pt in the MWE below), I get an overfull mesage displayed in the console. Can I obtain the maximum value reported in the messages Overfull \hbox (...
Peter Grill's user avatar
3 votes
1 answer
416 views

Determine natural width of align*: varwidth uses \linewidth even though display is correct

In an earlier question, align* in varwidth seems to ignore fleqn option, it appeared as if align* was not being properly handled by the varwidth environment. A "fix" was provided which results in the ...
Peter Grill's user avatar
3 votes
1 answer
202 views

align* in varwidth seems to ignore fleqn option

I am using the \documentclass option [fleqn] (which I think is identical to \usepackage[fleqn]{amsmath}). This seems to work fine, except when using an align* within the varwidth environment: Notes: ...
Peter Grill's user avatar
2 votes
1 answer
573 views

Pseudo-code with algorithmic. Escape and indent a function using varwidth and parbox

I'm using the algorithmic package to create pseudo-code for my document. One of the algorithms has a few lines that are too long and they go too far to the edge of the page so I wanted to add a ...
Atirag's user avatar
  • 393
3 votes
3 answers
386 views

Vertical padding for multiline cells using varwidth

To set a maximum column width, I use varwidth as suggested by this answer. However, the vertical padding is only correct for single line cells, and is too little for multiline ones. Minimal example: \...
Gabor Szarnyas's user avatar
3 votes
1 answer
646 views

standalone varwidth option breaks subcaption

I'm trying to generate a figure that is 19.05cm wide (according to submission specifications). I'm defining the width of the standalone document using the varwidth. I'm also using the subcaption ...
kmundnic's user avatar
  • 227
1 vote
1 answer
78 views

Scaling a PDF page to fit a logic puzzle

I am trying to create a big logic puzzle using the logicpuzzle package. I want the resulting PDF page to fit the whole logic puzzle. I have tried using the standalone document class, but the puzzle is ...
m13r's user avatar
  • 291
0 votes
2 answers
213 views

Page-unbreakable centered itemized list

I am trying to write new environment that would centre an itemised list, and here is the code for it: \usepackage{varwidth} \usepackage{enumitem} \newenvironment{mitemize}{ \begin{minipage}{1\...
Robur's user avatar
  • 1
13 votes
3 answers
1k views

TeX \newcommand and D.R.Y. (don't repeat yourself)

My goal is to create a list within a varwidth, and alternate the colors of each item. At the time, the best I could do is this: \documentclass{article} \usepackage[T1]{fontenc} \usepackage[utf8]{...
Salvo Matteini's user avatar
1 vote
0 answers
157 views

System equation and varwidth [closed]

I have two question: How can I left-align the equation system? How can I middle-align (vertical) the item bullet? \documentclass{article} \usepackage[T1]{fontenc} \usepackage[utf8]{...
Salvo Matteini's user avatar
1 vote
1 answer
242 views

`gather` Environment Does Not Work with `minipage`

I have been using minipage environment with displayed equation environments align* and gather*. The align* environment works fine with minipage but does not work well with varwidth. Code1: \...
ένας's user avatar
  • 321
0 votes
1 answer
4k views

Set varwidth to column width with multicol package

I'm using two columns with the multicol package. I have some text that I put inside a \colorbox as below, and I use varwidth to make it include line breaks. If the lines are short, the box width ...
devil0150's user avatar
  • 103
1 vote
1 answer
478 views

Align-top varwidth

There's a way to align-top an array of warwidth placed side by side? \documentclass{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[italian]{babel} \usepackage[ a4paper, ...
user3204810's user avatar
  • 1,539
4 votes
2 answers
564 views

standalone class would not crop AMS equations properly (left and top margin space remains)

I have the following simple code that I thought would output the AMS "gather" equation properly cropped at all sides up to the point where an imaginary straight line drawn at each side would touch the ...
Ben's user avatar
  • 501
1 vote
0 answers
202 views

Detect width of minipage environment

I am using the following setup to add comments to the right of aligned equations. \documentclass{amsart} \usepackage{lipsum} \newcommand{\comment}[1]{\text{\footnotesize{#1}}} \newcommand{\blurb}[2]{...
Jon Warneke's user avatar
2 votes
3 answers
816 views

Tabular individual vertical alignment in header row with varwidth columns

How can i bottom align the header row only? Is there a way to do it with \rowstyle or something similar as i did to make the whole row \bf? I would prefer not to use multiple tabulars. (\...
Nowak's user avatar
  • 77
4 votes
0 answers
199 views

Centering list issue with Enumerate+Hyperref+Varwidth

I want to center an enumerated list so i've tried to use the answer of this question given by the Great David Carlisle. But using hyperref, varwidth and enumerate (in any order in the preamble) cause ...
sbm's user avatar
  • 73
2 votes
1 answer
267 views

Microtype, raggedright and varwidth doesn't work well with each other

I am using microtype inside varwidth environment in the way described here. It works well with justified text, but now I have very short-lined text like a verse. And sometimes microtype is working, ...
web-stranger's user avatar
7 votes
1 answer
374 views

Microtype does not work inside varwidth

I make a template for different texts and I need to use varwidth. But it seems microtype doesn't work inside this environment. Is there any way to make it work? \documentclass{book} \usepackage[...
web-stranger's user avatar
6 votes
1 answer
506 views

Combining varwidth with \hangindent

Looks like inside {varwidth} hangindent is applied to the right side of the paragraph, instead of the left side: \documentclass{article} \usepackage{varwidth} \usepackage{lipsum} \begin{document} \...
Desik's user avatar
  • 2,179
6 votes
2 answers
226 views

Combining centering with \narrowragged

Package varwidth defines the command \narrowragged that allows us to have narrow paragraphs. It makes all the lines, including the last one, to have approximately the same length: \documentclass{...
Desik's user avatar
  • 2,179
1 vote
2 answers
1k views

2D and 3D Tikz pictures side-by-side

Previously I've had problems with 3D Tikz pictures having a lot of whitespace added to one side which was solved by using \documentclass[varwidth,border=5pt]{standalone}. Now, however, I'm trying to ...
thosphor's user avatar
  • 1,203
3 votes
1 answer
835 views

Follow-on to tabulary + longtable + captioning

I was able to use the coding provided by Justibus: Several caption problems in longtable and tabulary. What my question is - now that i've been able to make my table wrap columns and break over ...
Mitchell 's user avatar
7 votes
1 answer
180 views

Adding color package destroys listing centering

I am using @egreg's answer to make listings centered: \documentclass[a4paper]{book} \usepackage[T1]{fontenc} \usepackage[ hang, small, it, hypcap=true ]{caption} \usepackage{fancyvrb} \...
Emit Taste's user avatar
  • 4,424
6 votes
1 answer
450 views

Why is a varwidth incorrectly vertically centered by \raisebox{-0.5\height}?

I was creating a pseudocode/JavaScript comparison table, and wanted to typeset algorithms written with the algorithm2e package vertically centered in table cells. Out-of-the box, algorithm2e can't do ...
forritari's user avatar
  • 163