New answers tagged

3

The following MWE allows to reproduce the output shown in the original question. \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{graphicx} \usepackage{caption} % for source \usepackage{float} \usepackage[export]{adjustbox} % valign \newcommand{\imagesource}[1]{{\scriptsize Source: #1}} \usepackage[export]{adjustbox} \...


4

Like this? With use of tabular instead of the minipages: \documentclass{article} \usepackage{graphicx} \usepackage{caption} % for source \usepackage[export]{adjustbox} % valign \newcommand{\imagesource}[1]{{\smallskip\hfill\scriptsize Source: #1}} \begin{document} \begin{figure}[ht] \centering \setkeys{Gin}{width=\linewidth} \begin{tabular}{...


2

I would do that withe floatrow and copyrightbox: \documentclass{article} \usepackage{geometry} \usepackage{graphicx} \usepackage{caption} \usepackage{floatrow} \usepackage{copyrightbox} \newcommand{\imagesource}[1]{{\scriptsize Source: #1}}% doesn’t work with floatrow \begin{document} \begin{figure}[H] \centering \floatsetup{heightadjust=object, valign=t}\...


1

The following should result in the expected output: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{graphicx} \usepackage{caption} \usepackage{float} \usepackage[export]{adjustbox} \newcommand{\imagesource}[1]{{\scriptsize Source: #1}} \begin{document} \begin{figure}[H] \centering \begin{minipage}[t]{.475\textwidth} % [t][...


1

As I mentioned in comment, problem is your caption set up. If you like to have, that the caption width id 0.8 width of environment, where it is, than the width you need to setup in this environment. In your case you not need to use \captionof since captions are inside figure float. Remove command \centering inside of tikzpicture (it's no harm, nor it has any ...


1

Just introduce \hspace{2pc} tag will add more horizontal space between the images, and the MWE is: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[a4paper,top=2.5cm,bottom=2.50cm,left=3.00cm,right=3.00cm]{geometry} \usepackage{float} \usepackage{wrapfig} \usepackage{amsmath,amssymb,commath} \...


1

With use of the subcaption (which you already loaded): \documentclass{article} \usepackage{fullpage} \usepackage{amssymb, mathtools} \usepackage{caption, subcaption} \usepackage{tikz} \usepackage{hyperref} \begin{document} \section{Test} \begin{figure}[ht] \centering \begin{subfigure}{0.45\linewidth} \centering \begin{tikzpicture} \shade[...


5

The listings package already has a built in mechanism for captions and labels using the eponymous keys as shown in the following example. By default, such a listing will not float, as oppsoed to figure or table, so this approach might be useful, if you are just interested in adding caption and label. If you also want your listing to float, you can add the ...


3

Are you looking for something like this? \documentclass{article} \usepackage{capt-of} \usepackage{listings} \usepackage{float} \newfloat{Grammar example}{tbph}{loe} \begin{document} \begin{Grammar example} \begin{lstlisting} S -> A | B A -> aA | empty B -> b \end{lstlisting} \caption{A formal ...


0

If you no need to get List of Tables, then try with the below MWE: \documentclass{article} \usepackage{amsmath,caption} \begin{document} \begin{table} \center \captionsetup{singlelinecheck=off} \caption[.]{This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. \begin{equation*} THISEQUATION=...


0

The marginfigure and its caption are set in a minipage with its default center positioning, which will not break across pages. You can either put the marginfigure higher on the page or ask Lars Madsen (daleif@math.au.dk), the maintainer of memoir to do something like enabling the minipage bandt` options. In any case you, on occasions, will have to manually ...


0

You could use the option labelformat=empty for this particular floating environment and use the regular \caption command (instead of \caption*). For example: \documentclass{report} \usepackage{float} \newfloat{Example}{htb}{qcl} \usepackage{caption} \captionsetup[Example]{labelformat=empty} \begin{document} \begin{Example} \centering Here ...


1

A good workaround for what is happening is to define a command which resets the label of a figure. Afterwards, employ \AfterEndEnvironment (from etoolbox) to execute such command after every figure and figure* environment. This way, you might be able to redefine how caption should look like but also still get the original definition of figures caption after ...


2

I found a solution using the newfloat environment: \usepackage{newfloat} \DeclareFloatingEnvironment[fileext=frm,placement={tph},name=Frame]{myfloat} … \begin{myfloat}[t] \centering \begin{minipage}{0.45\linewidth} \captionof{lstlisting}{Appears} Inside custom 1 \end{minipage}\hfill% \begin{minipage}{0.45\linewidth} \captionof{...


3

It's a hidden feature in float that, when you do \restylefloat, the \caption command changes in a peculiar way: it stores its argument in a box which is assigned globally; only at \end{table} the box is used, which means that the first caption has been forgotten. The package does so because it wants to enforce top or bottom position of the caption ...


4

As you've found out in the meantime, running \restylefloat is the cause of the odd-ball formatting issue you've encountered. Incidentally, it is not true that it's necessary to run \restylefloat in order to use the [H] positioning specifier with table or figure floats. That said, you should really ask yourself if you're doing the right thing -- ...


0

I don't think that you need the subfigure package for the figure you show. The following is an extension to John Kormylo's answer. % subcaptionprob.tex SE 564314 % This is mainly from John Kormylo's answer \documentclass{article} \usepackage{graphicx} \usepackage{subcaption} %\usepackage{showframe}% MWE only \begin{document} \begin{figure}[htp] \...


0

This solution places the \subcaption in a separate \parbox. Note that the widths should add up to \linewidth. \documentclass{article} \usepackage{graphicx} \usepackage{subcaption} \usepackage{showframe}% MWE only \begin{document} \begin{figure}[htp] \raisebox{\dimexpr 0.5\baselineskip-0.5\height}% center baseline {\includegraphics[width=0.9\...


2

I suggest you re-organize the header material to that one sees only one instance of "Class" per table. I'd also get rid of all vertical lines and most horizontal lines in order to give the tables a more open and inviting "look". \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[english]{babel} \usepackage{amsmath} %%\...


3

Here is my suggestion using siunitx for the alignment of the numbers, booktabs for the horizontal lines and tabular* to make sure the tables fit into the available space. Additionally, I have replaced the \parbox commands with two minipage environments: \documentclass{article} \usepackage{booktabs} \usepackage{siunitx} \usepackage{caption} \usepackage[left=...


3

Try this code: \documentclass{article} \usepackage{array} \usepackage{geometry} \begin{document} \begin{table} \setlength{\tabcolsep}{4pt} \setlength{\extrarowheight}{2pt} \noindent\parbox{.45\linewidth}{ \centering \begin{tabular}{|*{9}{c|}} \hline \textbf{Class}& \bfseries 1 & \bfseries 2 & \bfseries 3 & \bfseries4 & \bfseries 5 & ...


0

% figure vertical allignment \begin{figure} \centering \begin{subfigure}[t]{0.4\textwidth} \centering \includegraphics[width=0.9\textwidth]{images/figure01.png} %\caption{Choose any caption if you want to add }} \end{subfigure}% \begin{subfigure}[t]{0.4\textwidth} \centering \includegraphics[width=...


2

Here's how to do it, although I don't recommend having captions below tables. I simplified a bit you preamble, and used the S column type, from siunitx, to align number on the decimal dot and the rules from booktabs which have some vertical padding. Last point; I replaced \scalebox with a smaller font size (for the table): \documentclass[a4 paper, 12pt]{...


Top 50 recent answers are included