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}
Related
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}
I want to align three figures in one row. I used the following latex code but got this output. What to change in this code to get these figures in one row? Thank you in advance.
\documentclass[conference]{IEEEtran}
\IEEEoverridecommandlockouts
\begin{document}
\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{figure*}[!h]
\centering
\begin{subfigure}[t]{0.5\textwidth}
\centering
\includegraphics[scale=0.5]{Paper/results.PNG}
\caption{Fig_1} \label{fig1}
\end{subfigure}\hfill
\begin{subfigure}[t]{0.5\textwidth}
\centering
\includegraphics[scale=0.5]{Paper/results.PNG}
\caption{Fig_2} \label{fig2}
\end{subfigure}\hfill
\begin{subfigure}[t]{0.5\textwidth}
\centering
\includegraphics[scale=0.5]{Paper/results.PNG}
\caption{Fig_3} \label{fig3}
\end{subfigure}
\caption{Figures}
\label{fig:my_label}
\end{figure*}
\end{document}
This is a two-column paper
Output I get from the above code
The sum of 3 times .5\textwidth is much bigger than the available space on one line. If you want to fit all three images in a single line, make them smaller:
\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[width=\textwidth]{example-image-duck}
\caption{Fig1} \label{fig1}
\end{subfigure}\hfill
\begin{subfigure}[t]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{example-image-duck}
\caption{Fig2} \label{fig2}
\end{subfigure}\hfill
\begin{subfigure}[t]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{example-image-duck}
\caption{Fig3} \label{fig3}
\end{subfigure}
\caption{Figures}
\label{fig:mylabel}
\end{figure*}
\end{document}
I am trying to create a custom title page in LaTeX according to my organization's template (in Word).
I managed to get close to it with the following code:
\documentclass{report}
\usepackage[a4paper,twoside,bindingoffset=0cm,nomarginpar,includeheadfoot,headheight=1.25cm,headsep=0cm,top=1cm,bottom=1.8cm,inner=1.75cm,outer=1.75cm,showframe]{geometry}
\usepackage{xcolor}
\usepackage{colortbl}
\usepackage{calc}
\usepackage{graphicx}
\usepackage{tabularx}
\definecolor{greenBE}{RGB}{141,182,60}
\definecolor{blueBE}{RGB}{0,111,144}
\title{La qualité de l'air en Région de Bruxelles-Capitale}
\newcommand{\subtitle}{Rapport annuel 2019}
\author{}
\usepackage{lipsum}
\begin{document}
\makeatletter
\begin{titlepage}
\thispagestyle{empty}
\newlength{\rulewidth}\setlength{\rulewidth}{3cm}%
\newlength{\logowidth}\setlength{\logowidth}{2.5cm}%
\newlength{\logoheight}\setlength{\logoheight}{\logowidth*\ratio{592pt}{1538pt}}% image size : 1538 x 592
\begingroup
\setlength{\tabcolsep}{0pt}
\renewcommand{\arraystretch}{0}
\noindent%
\begin{tabularx}{\textwidth}{p{\rulewidth}c>{\centering}X}
\cellcolor{blueBE}&\includegraphics[width=\logowidth]{ILLU_FR_LogoBE.jpg}&\cellcolor{greenBE}\color{white}{RAPPORT TECHNIQUE}
\end{tabularx}
\endgroup
\vspace*{3cm}
\color{blueBE}
\raggedleft\MakeUppercase{\Large\textbf{\#title}}\\
~\\
\raggedleft\large\textbf{\subtitle}
\vfill
\raggedleft\MakeUppercase{\Large\#date}\\
\vspace*{4cm}
\noindent%
\color{blueBE}{\rule{\textwidth}{\logoheight}}
\end{titlepage}
\makeatother
\restoregeometry
\tableofcontents
\chapter{Prerequisites}\label{prerequisites}
\lipsum
\end{document}
and the image logo ILLU_FR_LogoBE.jpg
However, as you can notice below, the text "RAPPORT TECHNIQUE" on top of the first page is enlarging the height of the row. Instead, I would like to center it vertically in the middle of the logo.
What am I doing wrong ?
Many thanks,
Alessandro
You could use \usepackage[export]{adjustbox} and then play around with different valign options for the graphic.
\documentclass{report}
\usepackage[a4paper,twoside,bindingoffset=0cm,nomarginpar,includeheadfoot,headheight=1.25cm,headsep=0cm,top=1cm,bottom=1.8cm,inner=1.75cm,outer=1.75cm,showframe]{geometry}
\usepackage{xcolor}
\usepackage{colortbl}
\usepackage{calc}
\usepackage{graphicx}
\usepackage{tabularx}
\definecolor{greenBE}{RGB}{141,182,60}
\definecolor{blueBE}{RGB}{0,111,144}
\title{La qualité de l'air en Région de Bruxelles-Capitale}
\newcommand{\subtitle}{Rapport annuel 2019}
\author{}
\usepackage{lipsum}
\usepackage[export]{adjustbox}
\begin{document}
\makeatletter
\begin{titlepage}
\thispagestyle{empty}
\newlength{\rulewidth}\setlength{\rulewidth}{3cm}%
\newlength{\logowidth}\setlength{\logowidth}{2.5cm}%
\newlength{\logoheight}\setlength{\logoheight}{\logowidth*\ratio{592pt}{1538pt}}% image size : 1538 x 592
\begingroup
\setlength{\tabcolsep}{0pt}
%\renewcommand{\arraystretch}{0}
\noindent%
\begin{tabularx}{\textwidth}{p{\rulewidth}c>{\centering}X}
\cellcolor{blueBE}&\includegraphics[width=\logowidth,valign=t]{ILLU_FR_LogoBE.jpg}&\cellcolor{greenBE}\color{white}RAPPORT TECHNIQUE
\end{tabularx}%
\endgroup
\vspace*{3cm}
\color{blueBE}
\raggedleft\MakeUppercase{\Large\textbf{\#title}}\\
~\\
\raggedleft\large\textbf{\subtitle}
\vfill
\raggedleft\MakeUppercase{\Large\#date}\\
\vspace*{4cm}
\noindent%
\color{blueBE}{\rule{\textwidth}{\logoheight}}
\end{titlepage}
\makeatother
\restoregeometry
\tableofcontents
\chapter{Prerequisites}\label{prerequisites}
\lipsum
\end{document}
I write an article, which is divided into two columns separated by a line. I use multicol package. I want to insert figures and align them to the top or to the down of the page in multicols environment. Figures can be inserted by the use of minipage environment by i don't know how to align them up or down. figure environment does not work in multicols environment.
\documentclass{article}
\usepackage{geometry}
\usepackage{multicol}
\usepackage{graphicx}
\usepackage{lipsum}
\usepackage{caption}
\geometry{margin=0.75in}
\begin{document}
\begin{multicols}{2}
\lipsum[1-3]
\vfill
\begin{minipage}{\linewidth}
\centering
\includegraphics[width=\linewidth]{beta_glucan.png}
\captionof{figure}{Figure caption}
\end{minipage}
\lipsum[1-3]
\end{multicols}
\end{document}
Any help will be appreciated cause I have been loosing time at it since friday.
Non-multicols solution:
\documentclass[twocolumn]{article}
\usepackage{geometry}
%\usepackage{multicol}
\usepackage{graphicx}
\usepackage{lipsum}
\usepackage{caption}
\usepackage{float}
\geometry{margin=0.75in}
\setlength{\columnseprule}{0.4pt}
\begin{document}
% \begin{multicols}{2}
\lipsum[1-3]
\begin{figure}[tb]
\centering
\includegraphics[width=\linewidth]{example-image}
\caption{Figure caption}
\end{figure}
\lipsum[1-3]
% \end{multicols}
\end{document}
See this MWE:
% !TeX spellcheck = en_US
\documentclass[12pt]{article}
\usepackage[onehalfspacing]{setspace}
\usepackage[a4paper, margin=2.5cm]{geometry}
\usepackage{mathptmx}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage[hang]{caption}
\usepackage{subcaption}
\usepackage[bottom]{footmisc}
\usepackage{dcolumn} %makes r output work
\usepackage{tabularx}
\newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{#1}}
\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}}
\newcolumntype{R}[1]{>{\raggedleft\arraybackslash}p{#1}}
\newcommand{\possessivecite}[1]{\citeauthor{#1}'s (\citeyear{#1})}
\usepackage{pdfpages}
\usepackage{hyperref}
\usepackage{pdflscape}
\usepackage{xcolor}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\begin{landscape}
\setcapmargin[2cm]
\begin{figure}[]
\captionsetup{justification=centering}
\caption{Main Caption. }
\label{fig:val_efcts}
\begin{subfigure}{0.55\textwidth}
\caption{X}
\includegraphics[width=\textwidth] {example-image-a}
\end{subfigure}
\begin{subfigure}{0.55\textwidth}
\caption{Y}
\includegraphics[width=\textwidth] {example-image-b}
\end{subfigure}
\begin{subfigure}{0.55\textwidth}
\caption{Z}
\includegraphics[width=\textwidth] {example-image-c}
\end{subfigure}
\captionsetup{justification=raggedright} \subcaption*{This subcaption is supposed to be ragged right and intented by 4 cm. \\ This is in a new line.}
\end{figure}
\end{landscape}
\end{document}
It should be self-explanatory, mostly. I'd like the last subcaption below the picture to be ragged right, but indented 2 cm. I tried to use \setcapmargin, but that does not work, creating the "undefined control sequence" error (so it's an unknown command).
Since you're writing a caption without numbering, set it in a \parbox where you have some more control over the placement and alignment:
\documentclass{article}
\usepackage{graphicx}
\usepackage[hang]{caption}
\usepackage{subcaption}
\begin{document}
\begin{figure}[]
\captionsetup{justification=centering}
\caption{Main Caption. }
\label{fig:val_efcts}
\begin{subfigure}{0.3\textwidth}
\caption{X}
\includegraphics[width=\linewidth] {example-image-a}
\end{subfigure}\hfill
\begin{subfigure}{0.3\textwidth}
\caption{Y}
\includegraphics[width=\linewidth] {example-image-b}
\end{subfigure}\hfill
\begin{subfigure}{0.3\textwidth}
\caption{Z}
\includegraphics[width=\linewidth] {example-image-c}
\end{subfigure}
\hspace*{4cm}%
\parbox{\dimexpr\linewidth-8cm}{\raggedright
\strut This subcaption is supposed to be ragged right and indented by 4cm. \\
This is in a new line.\strut%
}
\end{figure}
\end{document}
Note the use of \struts to support correct baseline alignment when dealing with text inside \parboxes. For more on this, see How to keep a constant baseline skip when using minipages (or \parboxes)?