How to set the picture title locally small in latex? - latex

I have been stuck trying to change the local size of a picture title.
The picture is like this. The "EnlightenGAN" is just too long. I would want to make "EnlightenGAN" smaller only.
This is the picture
the code is here:
\begin{figure}[!htb]
\label{fig:example}
\begin{subfigure}{.194\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/exdark/原图/2015_00001.png}
\caption{输入图片}
\end{subfigure}
\begin{subfigure}{.194\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/exdark/dupe/2015_00001.png}
\caption{Deep-UPE\upcite{DUPE}}
\end{subfigure}
\begin{subfigure}{.194\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/exdark/lime/2015_00001.jpg}
\caption{LIME\upcite{LIME}}
\end{subfigure}
\begin{subfigure}{.194\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/exdark/mir/2015_00001.jpg}
\caption{MIRNet\upcite{MIRNet}}
\end{subfigure}
\begin{subfigure}{.194\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/exdark/retinex/2015_00001.jpg}
\caption{RetinexNet\upcite{retinexnet}}
\end{subfigure}
\begin{subfigure}{.194\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/exdark/ssien/2015_00001.jpg}
\caption{SSIEN\upcite{ssien}}
\end{subfigure}
\begin{subfigure}{.194\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/exdark/zeroDCE/2015_00001.jpg}
\caption{Zero-DCE\upcite{zero}}
\end{subfigure}
\begin{subfigure}{.194\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/exdark/enlightenGAN/2015_00001.png}
\small
\caption{EnlightenGAN\upcite{enlightengan}}
\end{subfigure}
\begin{subfigure}{.194\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/exdark/kind/2015_00001.jpg}
\caption{KinD\upcite{KinD}}
\end{subfigure}
\begin{subfigure}{.194\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/exdark/mine/2015_00001.png}
\caption{本文}
\end{subfigure}
\caption{增强结果}
\end{figure}
I would be grateful if anyone could help me with this problem!

Related

change subfigure configuration in latex

I use the following example code to create a subfigure in my latex document.
\usepackage{caption}
\usepackage{subcaption}
\begin{figure}
\centering
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{Figures/F1.png}
\caption{}
\label{fig:1}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{Figures/F2.png}
\caption{}
\label{fig:2}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{Figures/F3.png}
\caption{}
\label{fig:3}
\end{subfigure}
\caption{Values}
\label{fig:three graphs}
\end{figure}
And I get the following output configuration
But the sub-figures are too small on the page. So I want to change it to the following configuration and make the figure a bit larger and centered. How to modify this code to change the Figure configuration?
\documentclass{article}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{graphicx}
\begin{document}
\begin{figure}
\centering
\begin{subfigure}[b]{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{example-image-duck}
\caption{}
\label{fig:1}
\end{subfigure}
\quad
\begin{subfigure}[b]{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{example-image-duck}
\caption{}
\label{fig:2}
\end{subfigure}
\begin{subfigure}[b]{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{example-image-duck}
\caption{}
\label{fig:3}
\end{subfigure}
\caption{Values}
\label{fig:three graphs}
\end{figure}
\end{document}

Numbering of the subfigures are not centered with the figure in LATEX

The numbering (a,b,c) in the subfigures is a little off-center with the subfigures. I keep \caption inside the subfigure section empty because I do not want any captions but if I remove it, the numbering will go away. Is there any way to keep the numbering and make it centers with subfigures?
\documentclass[conference]{IEEEtran}
\IEEEoverridecommandlockouts
\usepackage{cite}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{algorithmic}
\usepackage{graphicx}
\usepackage{textcomp}
\usepackage{xcolor}
\usepackage{algorithm}
\usepackage{amsmath,amssymb}
\usepackage{subcaption}
\usepackage{url}
\usepackage{hyperref}
\begin{document}
\begin{figure*}[!h]
\centering
\begin{subfigure}[t]{0.3\textwidth}
\centering
\includegraphics[scale=0.3]{Paper/results.PNG}
\caption{} \label{fig1}
\end{subfigure}\hfill
\begin{subfigure}[t]{0.3\textwidth}
\centering
\includegraphics[scale=0.3]{Paper/results.PNG}
\caption{} \label{fig2}
\end{subfigure}\hfill
\begin{subfigure}[t]{0.3\textwidth}
\centering
\includegraphics[scale=0.3]{Paper/results.PNG}
\caption{} \label{fig3}
\end{subfigure}
\caption{Figures}
\label{fig:my_label}
\end{figure*}
\end{document}

Figures to flow/distribute automatically over pages in LateX

I have a long LaTeX script for making a document where most of the sections have three figures and they fit the page very good. In some random sections, we have six or nine figures. Therefore, the page will not fit these extra figures and they will overlay at the bottom of the page.
How can I automatically force the last three figures to appear on a separate page without the need to adjust each of these sections manually? (In other words, a way to make the clear page done automatically).
I am looking for something similar to longtable – Allow tables to flow over page boundaries environment to control the flow automatically.
Here is an example of the regular and random cases:
***Regular case***
\begin{figure}[b!]
\centering
\includegraphics[width =\textwidth]{Path/A.png}
\includegraphics[width =\textwidth]{Path/B.png}
\includegraphics[width =\textwidth]{Path/C.png}
\end{figure}
\clearpage
***Random case***
\begin{figure}[b!]
\centering
\includegraphics[width =\textwidth]{Path/E.png}
\includegraphics[width =\textwidth]{Path/F.png}
\includegraphics[width =\textwidth]{Path/G.png}
\includegraphics[width =\textwidth]{Path/H.png}
\includegraphics[width =\textwidth]{Path/I.png}
\includegraphics[width =\textwidth]{Path/J.png}
\includegraphics[width =\textwidth]{Path/K.png}
\includegraphics[width =\textwidth]{Path/L.png}
\end{figure}
\clearpage
Thanks everyone for the feedback. I checked couple of posts on the internet regarding the issue and there are couple of ways to solve the problem (fairly good but not 100%).
First Solution:
As mentioned by #samcarter_is_at_topanswers.xyz , the figure environment does not support page breaks. \captionof (from the caption package) and \label can be used for figure captioning and referencing.
\begingroup
\centering
\includegraphics[width =\textwidth]{Path/A.png}
\includegraphics[width =\textwidth]{Path/B.png}
\includegraphics[width =\textwidth]{Path/C.png}
\includegraphics[width =\textwidth]{Path/D.png}
\includegraphics[width =\textwidth]{Path/E.png}
\includegraphics[width =\textwidth]{Path/F.png}
\includegraphics[width =\textwidth]{Path/G.png}
\includegraphics[width =\textwidth]{Path/H.png}
\includegraphics[width =\textwidth]{Path/J.png}
\captionof{figure}{Whatever caption}
\label{WhateverLabel}
\endgroup
Second Solution (Not the best automated solution):
Divide the figure into subfigure and use \ContinuedFloat to break the pages but with the same caption and label.
\begin{figure}[b!]
\centering
\begin{subfigure}[b!]{\textwidth}
\centering
\includegraphics[width =\textwidth]{Path/A.png}
\end{subfigure}
\begin{subfigure}[b!]{\textwidth}
\centering
\includegraphics[width =\textwidth]{Path/B.png}
\end{subfigure}
\begin{subfigure}[b!]{\textwidth}
\centering
\includegraphics[width =\textwidth]{Path/C.png}
\end{subfigure}
\caption{whatever caption}
\label{WhateverLabel}
\end{figure}
\clearpage
\begin{figure}[b!]
\ContinuedFloat
\begin{subfigure}[b!]{\textwidth}
\centering
\includegraphics[width =\textwidth]{Path/D.png}
\end{subfigure}
\begin{subfigure}[b!]{\textwidth}
\centering
\includegraphics[width =\textwidth]{Path/E.png}
\end{subfigure}
\begin{subfigure}[b!]{\textwidth}
\centering
\includegraphics[width =\textwidth]{Path/F.png}
\end{subfigure}
\caption{whatever caption}
\label{WhateverLabel}
\end{figure}
\clearpage
Reference of Second Solution: Subfigure in LaTeX – Full Guide
Third Solution: Use figureSeries package created by #Prof. Thomas Weise. Unfortunately, it has not been updated since a while.
References of Third Solution: figureSeries Package on GitHub and figureSeries Package on Stack Exchange
The figure environment does not support page breaks. If you want something to break pages, don't use the figure environment.
In case you still need a caption and similar stuff, you can use the caption package like this:
\documentclass{article}
\usepackage{graphicx}
\usepackage{caption}
\begin{document}
\begingroup
\centering
\includegraphics[width =\textwidth]{example-image-duck}
\includegraphics[width =\textwidth]{example-image-duck}
\includegraphics[width =\textwidth]{example-image-duck}
\includegraphics[width =\textwidth]{example-image-duck}
\includegraphics[width =\textwidth]{example-image-duck}
\includegraphics[width =\textwidth]{example-image-duck}
\includegraphics[width =\textwidth]{example-image-duck}
\includegraphics[width =\textwidth]{example-image-duck}
\captionof{figure}{whatever caption}
\endgroup
\end{document}

Beamer : overlayarea inside a figure?

in my Beamer presentation, I would like to dynamically switch images in a figure environnement.
More precisely, my figure contains 9 subfloats presented 3x3 and each of them should switch between two images during the presentation.
In order to avoid some "tilting" between the different elements, I thought that it would be a good idea to use an overlayarea inside each subfloat.
Sadly, when used in an figure environment, the overlayarea seems to behave very odd : every thing I put in it appear outside the overlayarea ??
Here is a very short example :
\documentclass[9pt, aspectratio=43]{beamer}
\usepackage [francais]{babel}
\usepackage [T1]{fontenc}
\usepackage [utf8]{inputenc}
\usepackage[position=top]{subfig}
\usepackage{pdfpages}
\begin{document}
\begin{frame}
%% This works fine : 123 appears INSIDE the overlayarea
\fbox{\begin{overlayarea}{3cm}{2cm}
\fbox{123}
\end{overlayarea}}
%% This looks odd : 456 appears OUTSIDE the overlayarea
\begin{figure}
\fbox{\begin{overlayarea}{3cm}{2cm}
\fbox{456}
\end{overlayarea}}
\end{figure}
\end{frame}
\end{document}
Perhaps I mis-use this environnement ?
Thanks a lot :)
BR
Donut
Quick workaround: warp your subimages in minipages of fixed height:
\documentclass[9pt, aspectratio=43]{beamer}
\begin{document}
\begin{frame}
\begin{figure}
\begin{minipage}[c][.3\textheight][c]{.3\textwidth}
\centering
\includegraphics<1>[width=\textwidth,height=.3\textheight,keepaspectratio]{example-image-9x16}%
\includegraphics<2>[width=\textwidth,height=.3\textheight,keepaspectratio]{example-image-duck}%
\end{minipage}%
\hfill
\begin{minipage}[c][.3\textheight][c]{.3\textwidth}
\centering
\includegraphics<2>[width=\textwidth,height=.3\textheight,keepaspectratio]{example-image-9x16}%
\includegraphics<1>[width=\textwidth,height=.3\textheight,keepaspectratio]{example-image-duck}%
\end{minipage}%
\hfill
\begin{minipage}[c][.3\textheight][c]{.3\textwidth}
\centering
\includegraphics<1>[width=\textwidth,height=.3\textheight,keepaspectratio]{example-image-9x16}%
\includegraphics<2>[width=\textwidth,height=.3\textheight,keepaspectratio]{example-image-duck}%
\end{minipage}%
\begin{minipage}[c][.3\textheight][c]{.3\textwidth}
\centering
\includegraphics<2>[width=\textwidth,height=.3\textheight,keepaspectratio]{example-image-9x16}%
\includegraphics<1>[width=\textwidth,height=.3\textheight,keepaspectratio]{example-image-duck}%%
\end{minipage}%
\hfill
\begin{minipage}[c][.3\textheight][c]{.3\textwidth}
\centering
\includegraphics<2>[width=\textwidth,height=.3\textheight,keepaspectratio]{example-image-9x16}%
\includegraphics<1>[width=\textwidth,height=.3\textheight,keepaspectratio]{example-image-duck}%
\end{minipage}%
\hfill
\begin{minipage}[c][.3\textheight][c]{.3\textwidth}
\centering
\includegraphics<2>[width=\textwidth,height=.3\textheight,keepaspectratio]{example-image-9x16}%
\includegraphics<1>[width=\textwidth,height=.3\textheight,keepaspectratio]{example-image-duck}%
\end{minipage}%
\begin{minipage}[c][.3\textheight][c]{.3\textwidth}
\centering
\includegraphics<1>[width=\textwidth,height=.3\textheight,keepaspectratio]{example-image-9x16}%
\includegraphics<2>[width=\textwidth,height=.3\textheight,keepaspectratio]{example-image-duck}%
\end{minipage}%
\hfill
\begin{minipage}[c][.3\textheight][c]{.3\textwidth}
\centering
\includegraphics<2>[width=\textwidth,height=.3\textheight,keepaspectratio]{example-image-9x16}%
\includegraphics<1>[width=\textwidth,height=.3\textheight,keepaspectratio]{example-image-duck}%
\end{minipage}%
\hfill
\begin{minipage}[c][.3\textheight][c]{.3\textwidth}
\centering
\includegraphics<1>[width=\textwidth,height=.3\textheight,keepaspectratio]{example-image-9x16}%
\includegraphics<2>[width=\textwidth,height=.3\textheight,keepaspectratio]{example-image-duck}%
\end{minipage}%
\end{figure}
\end{frame}
\end{document}

latex subfigures not centered

This latex code:
\begin{figure}[H]
\setlength{\figW}{5cm} % determines the width of the images
\begin{subfigure}[b]{0.5\textwidth}
\input{images/eigw_kegel_0.5.tex}
\caption{}
\end{subfigure}
\begin{subfigure}[b]{0.5\textwidth}
\input{images/eigw_kegel_0.05.tex}
\caption{}
\end{subfigure} \\
\begin{subfigure}[b]{0.5\textwidth}
\input{images/eigv_norm_kegel_0.5.tex}
\caption{}
\end{subfigure}
\begin{subfigure}[b]{0.5\textwidth}
\input{images/eigv_norm_kegel_0.05.tex}
\caption{}
\end{subfigure}
\caption{(a) and (b): $\lambda_1(\VM{\omega})$ and
$\lambda_2(\VM{\omega})$ with $\omega_1 = 0.5$ (left) and $\omega_1 =
0.05$ (right), (c) and (d): norm of $\pderiv{\VM{x}_1(\VM{\omega})}
{\omega_2}$ with $\omega_1= 0.5$ (left) and $\omega_1= 0.05$ (right)}
\end{figure}
gives me the following output:
I would like to have the following output (made it using paint). How to adapt the latex-code so that I get this result?
I fixed this issue myself. You just need to add
\hspace{0.8cm} to move the figures to the right.
\begin{figure}[H]
\setlength{\figW}{5cm} % determines the width of the images
\begin{subfigure}[b]{0.5\textwidth}
\hspace{0.8cm}
\input{images/eigw_kegel_0.5.tex}
\caption{}
\end{subfigure}
\begin{subfigure}[b]{0.5\textwidth}
\hspace{0.7cm}
\input{images/eigw_kegel_0.05.tex}
\caption{}
\end{subfigure} \\
\begin{subfigure}[b]{0.5\textwidth}
\input{images/eigv_norm_kegel_0.5.tex}
\caption{}
\end{subfigure}
\begin{subfigure}[b]{0.5\textwidth}
\input{images/eigv_norm_kegel_0.05.tex}
\caption{}
\end{subfigure}
\caption{(a) and (b): $\lambda_1(\VM{\omega})$ and
$\lambda_2(\VM{\omega})$ with $\omega_1 = 0.5$ (left) and $\omega_1 =
0.05$ (right), (c) and (d): norm of $\pderiv{\VM{x}_1(\VM{\omega})}
{\omega_2}$ with $\omega_1= 0.5$ (left) and $\omega_1= 0.05$ (right)}
\end{figure}

Resources