5

It's easy with the caption package: \documentclass{article} \usepackage[T1]{fontenc} \usepackage{listings} \usepackage{caption} \DeclareCaptionLabelFormat{reversed}{#2.\bothIfSecond{~}{#1}} \captionsetup[lstlisting]{ labelformat = reversed , labelsep = period } \begin{document} \begin{lstlisting}[caption=Test] a b c \end{lstlisting} \end{document} ...


4

Enclose the table and the \caption-of command in a minipage- or a table-environment. I have reduced your code to an (M)WE. You may also use a table-environment, as demonstrated in example 2 below: In addition, I suggest that you use cleveref for references. You then just write \cref{<label>} instead of figure~ref{<label>} etc. to make a ...


3

subcaption package provides \subcaptionbox command, \subfloat command and subfigure environment, so you cannot use \subfigure (which is roughly equivalent to \begin{subfigure}) alone. A \subfloat example (supported since subcaption v1.3): \documentclass[11pt,a4paper]{article} \usepackage{graphicx} \usepackage{subcaption} \begin{document} \begin{figure} \...


3

Here's a couple of options that will hopefully help to display your tables as you'd like. Option 1: small tweaks to your code This option has just a few small tweaks to your code, the output is: \documentclass{article} \usepackage{array} \usepackage[margin=1cm]{geometry} \begin{document} \begin{table} \begin{minipage}[t]{.55\textwidth} \...


3

Small comment to the question & answer from Elad Den (not enough reputation to comment myself) \SetAlgorithmName{Pseudocode}{}{} The command \SetAlgorithmName requires three arguments. Missing the last one leads to not printing the caption name at all, in case you use multiple algorithm blocks. see http://ctan.mirror.norbert-ruehl.de/macros/latex/...


3

The algorithm2e does not naturally come with a definition allowing the counter to come before the caption. You can, however edit the internal commands it uses to suit your needs: \fnum@algocf is the macro that sets the caption name. You can renew it to output the counter first then the name thus: \renewcommand{\fnum@algocf}{\AlCapSty{\AlCapFnt\thealgocf\...


2

Remove caption label and entry in \listofalgorithms If you want to remove the caption label entirely, you could use the caption package and then \caption* (note, though, that this will remove the algorithm from the \listofalgorithms): \documentclass{article} \usepackage{caption} \usepackage{algorithmicx, algpseudocode, algorithm} \begin{document} \...


2

You asked, How to get rid of the punctuation : in the reference but keep [it] in the caption label? I think you should change \usepackage[labelformat=simple]{subcaption} \renewcommand{\thesubfigure}{Figure \thefigure.(\alph{subfigure}):} to \usepackage[labelformat=simple,labelsep=colon]{subcaption} \renewcommand{\thesubfigure}{Figure \thefigure.(\alph{...


2

You have not provided an example that shows the issue but you can prevent the caption being evaluated twice with \usepackage[singlelinecheck=off]{caption} This will mean it is always set in a parbox rather than using a different layout for short captions that fit in one line.


2

You asked, Is there a way to change the alignment of the caption of a single table? There sure is, and it makes use of the machinery of the caption package as well. You mention in a follow-up comment that you will know only after the document is compiled whether or not a given table will be placed at the top of a page. I guess you will then have edit ...


2

In recent releases \includegraphics is robust so should not prematurely expand when writing the .toc file, but in any release you could define your command via \DeclareRobustCommand{\myicon}{\includegraphics[scale=0.2]{myicon.pdf}} then it will not expand in moving environments. Unrelated you may prefer to use something like height=1.1ex rather than scale=...


2

This redefines \caption locally (inside the \parbox). Every cell in a p column is a separate \parbox. \caption@caption is the original name used by the caption package. This uses \csname to implement the @ symbol, which in turn requires \expandafters. \documentclass[12pt]{article} \usepackage{graphicx} \usepackage{longtable} \usepackage{caption} \begin{...


2

Is this what you want? \documentclass{article} \usepackage{caption} \DeclareCaptionFormat{hangright}{\rightline{#1}\\\centerline{\bfseries#3}} \captionsetup[table]{format=hangright} \begin{document} \begin{table}[h!] \centering \caption{Optional components} \begin{tabular}{|c|ccc|} \hline Хост & cuda 8 & cuda 10 & ...


1

Update: Firstly, since \captionof is used before lstlisting environment, setting \captionsetup[lstlisting]{position=top, ...} is more appropriate. This way, the vertical space between \hrulefill and double-columned lstlisting environment comes from: the skip below caption, which is \abovecaptionskip (default value is 10pt), and the skip above multicols ...


1

The best solution is to not use footnotes in captions, but… Captions usually try to determine wether the contents fits in one line (and if it does the caption is centered). This measuring is the reason why the footnote gets typeset twice: once during the measuring and once when the caption is actually typeset. Since you already know that the caption does ...


1

Just to show another possibility to show source of image ... without use of \footnote: \documentclass[11pt]{beamer} \usepackage[gen]{eurosym} \usepackage{copyrightbox} \begin{document} \begin{frame} \frametitle{Slide Title} \begin{figure} \copyrightbox[b]{\includegraphics[width=0.7\linewidth]{example-image-duck}} {(source: source)} \...


1

From the TeX-FAQ (https://texfaq.org/FAQ-ftncapt): However, as well as all of the above, one also has to deal with the tendency of the \caption command to produce the footnote’s text twice. For this last problem, there is no tidy solution this author is aware of. If you’re suffering the problem, a well-constructed \caption command in a minipage ...


1

Solution suggested in my comment works nice when is using subfig package instead subcaption and not used \ffigbox[]{...}: \documentclass{article} \usepackage{floatrow} \usepackage{graphicx} \usepackage[label font=bf, labelformat=simple]{subfig} \usepackage{caption} \floatsetup[figure]{style=plain,subcapbesideposition=top} \captionsetup[subfloat]{labelfont=...


1

Use the `tocloft package, as shown below. % tocprob.tex SE 542631 \documentclass{article} \usepackage{tocloft} \usepackage{comment} % for my convenience % for table entries \setlength{\cfttabnumwidth}{2cm} % change length to suit \renewcommand{\cfttabpresnum}{TABLE } \renewcommand{\cfttabaftersnum}{.} % for figure entries \setlength{\cftfignumwidth}{2cm} %...


1

Here are a bunch of different options. Red lines indicate the margins. \documentclass{article} \usepackage[demo]{graphicx} \usepackage[justification=centering, labelfont=bf, font=bf]{caption} \usepackage{framed} \usepackage{showframe} % remove in actual document \renewcommand*\ShowFrameColor{\color{red}} % remove in actual document \begin{document} \...


1

\documentclass{article} \usepackage[demo]{graphicx} \usepackage[justification=centering, font=bf]{caption} \begin{document} \begin{figure}[!ht] \centering \framebox{\parbox{0.7\linewidth}{\includegraphics[width=\linewidth]{Picture.jpg}}} \parbox{0.7\linewidth}{ \caption{Title if you will but centred and bold} Fairly concise but ...


1

The MWE you provide does not compile for me. When I create my own fig1.jpg (Should this really be a JPEG?) and change linewidth to \linewidth, I cannot reproduce the bug with TeX Live 2019. The version of cas-dc.cls I have (2.1) loads stix as the math font and charis as the text font, which should both be scalable and work properly. If it can’t find ...


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