6 votes
Accepted

How to make procedure name with underscore using `algorithm2e`?

For unclear reasons, algorithm2e stores the argument of \caption as a \csname and obviously this fails when \_ is used. The code is found in \SetKwFunction and \SetKwArray. What this is for is really ...
egreg's user avatar
  • 1.1m
6 votes

Automatically add a final period to a caption where there is none

The following code shows how we can remove optional dot from the end of the argument of a macro and then we can add single period to the output. All is done only by TeX primitive commands. \def\...
wipet's user avatar
  • 73.3k
6 votes
Accepted

How can I represent a math formula as a figure?

Despite the name, the figure environment can contain anything. For instance an equation, a picture, some text, whatever. \documentclass{article} \usepackage{mathtools}% Loads amsmath \usepackage{...
egreg's user avatar
  • 1.1m
5 votes

Two large figures side by side

This uses a combination of saveboxes and \parboxes. The captions are placed in \parboxes to control the width (minipages will do just as well). The \nulls prevent \abovecaptionskip from geing ...
John Kormylo's user avatar
  • 79.2k
5 votes
Accepted

Package caption incompatibility: biblatex citecounter double-counts references inside table captions

The content of the caption is processed twice because of the singleline check. You can either disable the check: \captionsetup{singlelinecheck=false} or disable the citetracker during the check. ...
Ulrike Fischer's user avatar
4 votes

Alignment issue with captions six figures next to each other

I suggest to use an outer tabular*, so you don't have to guess widths. Each picture is in its own tabular environment, so they'll be vertically aligned. I used \footnotesize so not to go beyond the ...
egreg's user avatar
  • 1.1m
4 votes

Table too long for one page and column content not vertically aligned

Here's a code based on longtable with working headers and footers. I also added two packages: listings improves code formatting; and cellspace inserts extra vertical spacing between rows. \...
Celdor's user avatar
  • 8,838
4 votes
Accepted

Automatically add a final period to a caption where there is none

If you add \tl_show:n{#1} in the code for \userninefourtwoninethree_maybeaddperiod:n, you will see that the first call shows > \ignorespaces \caption@makeanchor {This is an image}. For its ...
egreg's user avatar
  • 1.1m
4 votes

Variable for Figure Number

You don't need to hardcode the figure numbers by hand. Instead, you can put a label in your figure with, \label{myLabel} command in your figure environment. Then, you can cite your figure with \ref{...
aralto's user avatar
  • 71
4 votes

The caption is not spanning the entire width of the table

The main problem with your table isn't that the caption isn't centered relative to the tabular material. Rather, the main problem is that the tabular material is simply much wider than \textwidth. I ...
Mico's user avatar
  • 503k
4 votes

Problem with captions in apa-style

The apa class has not caught up with fact that \contentsline has four arguments with hyperref (and for a few years also with LaTeX). Try \makeatletter \long\def\@@contentsline#1#2#3#4{ #2 }\...
Ulrike Fischer's user avatar
4 votes
Accepted

How to rotate figure with caption

You can use hvfloat package. You can see that is rotated both the figure and its caption into a text. \documentclass{article} \usepackage{graphicx} \usepackage{lipsum} \usepackage{hvfloat} % for ...
Sebastiano's user avatar
  • 53.6k
3 votes

Table too long for one page and column content not vertically aligned

Here's a longtable based solution that strives to give the table a more open "look" by using the line-drawing macros of the booktabs package -- specifically, \midrule, \addlinespace, and \...
Mico's user avatar
  • 503k
3 votes

Package caption warning: The option `hypcap=true' will be ignored for this particular \caption

If you just want to disable the warning, you can configure caption to not use the hypcap package for tables which will change the default behavior of the hyperlink anchor placement from the beginning ...
Collin's user avatar
  • 31
3 votes
Accepted

`caption` bug (?) where `\captionsetup[figure]` within a figure has no effect

Per @Peter Wilson's comment, I contacted the caption maintainer on their issue tracker on GitLab here and I appreciate the maintainer responding so quickly with: Options given via \captionsetup[x]{......
JamesT's user avatar
  • 3,123
3 votes

How to overwrite ref to remove rogue paranthesis?

You show see figure \ref{fig:examplefigure}) it becomes see figure 1) which imples \ref is just making 1 and the ) is simply text in your source which you can delete if you don't need it.
David Carlisle's user avatar
3 votes
Accepted

\endlastheader in longtable?

You can easily do it with longtblr of the wonderful package tabularray: \documentclass{article} \usepackage{tabularray} \DefTblrTemplate{conthead-text}{default}{- Continued from previous page} \...
CarLaTeX's user avatar
  • 62.1k
3 votes
Accepted

htlatex: problem with caption in longtable

Try this version of longtable.4ht: % longtable.4ht (2022-04-28-13:47), generated from tex4ht-4ht.tex % Copyright 1997-2009 Eitan M. Gurari % Copyright 2009-2022 TeX Users Group % % This work may be ...
michal.h21's user avatar
  • 50.5k
3 votes

How to create captioned TikZ pictures inside a tblr?

Assuming that images can be arbitrary, so beside of tikzpicture I also use ˙example-image-duck`, which is available to anyone: \documentclass{article} \usepackage[export]{adjustbox} % for "...
Zarko's user avatar
  • 296k
3 votes
Accepted

Preventing the List of Figures from Adopting the Display Style of Captions

This isn't the greatest answer but will post it either way in case it is useful to others in the future: It essentially just revolves around wrapping the \caption command in another command. I am not ...
JamesT's user avatar
  • 3,123
3 votes
Accepted

Custom figure counter: links jump to the wrong figure

You need to redefine \theHfigure to make the link target unique. I would also number the labels by section, that makes it easier to keep track of the correct numbers: \documentclass{article} \...
Ulrike Fischer's user avatar
3 votes
Accepted

Font size problem with \sfrac in figure caption

The problem is with the obsolete package anyfontsize: % anyfontsize.sty -- allow font size substitutions % by Péter Szabó <[email protected]> at Sat Feb 3 13:56:49 CET 2007 The right package to ...
egreg's user avatar
  • 1.1m
3 votes
Accepted

Line numbers in \captionof

Instead of using \internallinenumbers before \caption you have to use it inside the mandatory \caption argument: \documentclass[12pt,a4paper]{article} \usepackage[a4paper,left=2.6cm, right=2.9cm, top=...
cabohah's user avatar
  • 10.7k
3 votes

How to overlap subfigure with caption

In those kind of scenarios, I think tikz provides good solutions, at least to start with. The only thing is in this case you have to split actions of a regular \caption because the latter cannot be ...
Celdor's user avatar
  • 8,838
3 votes

The caption is not spanning the entire width of the table

You not provide any information about your document page layout In the case, when you use a4paper and have 25mm margins, than the following MWE can solve your problem: \documentclass{article} \...
Zarko's user avatar
  • 296k
3 votes
Accepted

Removing Continued from captions of tabularray longtable

For global setting of this features put in preamble the following instructions: \DefTblrTemplate{contfoot-text}{default}{} \DefTblrTemplate{conthead-text}{default}{} MWE: \documentclass{article} \...
Zarko's user avatar
  • 296k
3 votes
Accepted

Why are figure numbers not showing in captions on minipage?

Your example does not define \captionof at all but if the example is fixed to be \documentclass{article} \usepackage{capt-of} \begin{document} \section{Disability}\label{sect:Disability} \begin{...
David Carlisle's user avatar
3 votes
Accepted

Different caption setups for different figures/tables

To long for the comment ... What you after is standard features of caption. You not need to declare separate caption setup: \documentclass{article} \usepackage{graphicx} \usepackage[format=hang,...
Zarko's user avatar
  • 296k
3 votes
Accepted

Add the word "Supplementary" in the caption title of longtblr

I would like to add the word "Supplementary" just before the word "Table". How can I do it? tabularray, specifically with longtblr as well as talltblr works along templates. Each ...
Celdor's user avatar
  • 8,838
3 votes

Cite references ( \cite{} ) in Tables/Figures

\caption only has one mandatory argument, I assume you meant \caption[Gram Negative Bacteria.]{\cite{Bacterial_Classification}} not \caption{Gram Negative Bacteria.}{\cite{Bacterial_Classification}}
David Carlisle's user avatar

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