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}
Related
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}
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}
Although i have tried many code of a footnote in a caption of a figure , it doesn't work , really , where is the problem here
\documentclass[a4paper,12pt]{report}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{fancyhdr}
\makenomenclature
\usepackage[nottoc]{tocbibind}
\pagenumbering{Roman}
\usepackage{lipsum}
\setcounter{tocdepth}{5}
\setcounter{secnumdepth}{4}
\begin{document}
\begin{figure}
\centering
\includegraphics[width=0.8\textwidth{images/frog.jpg}
\caption[frog]{frog \footnotemark }
\label{fig:pic1}
\end{figure}
\footnotetext{frog}
\end{document}
Two problems:
you can't have the \makenomenclature macro in your code with a package which defines it, e.g. nomencl
the ] after the optional argument of your graphic is missing
With the split between \footnotetext and \footnotemark there is always the risk that the floating figure and the footnote will end up on different pages. You can lessen the risk by using [htbp] as floating specifier for your figure, this way you at least allowed the figure to be placed where the footnote is.
\documentclass[a4paper,12pt]{report}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{fancyhdr}
%\makenomenclature
\usepackage[nottoc]{tocbibind}
\pagenumbering{Roman}
\usepackage{lipsum}
\setcounter{tocdepth}{5}
\setcounter{secnumdepth}{4}
\begin{document}
\begin{figure}[htpb]
\centering
\includegraphics[width=0.8\textwidth]{example-image-duck}
\caption[frog]{frog \footnotemark }
\label{fig:pic1}
\end{figure}
\footnotetext{frog}
\end{document}
I have used the InsertBoxL command in Latex to have 3 consecutive images, one below the other, with text beside each image. Is there a way to insert a caption with continuous numbering within Latex using the command above?
The Latex I have used so far is:
\documentclass[11pt]{article}
\input{insbox}
\begin{document}
\InsertBoxL{0}{\rule{1.6in}{0.9in}} %text inserted here
\bigskip
\InsertBoxL{0}{\rule{1.6in}{0.9in}} %text inserted here
\bigskip
\InsertBoxL{0}{\rule{1.6in}{0.9in}} %text inserted here
\end{document}
I have replaced my actual images with the \rule command.
Any help will be appreciated!
To add captions to your boxes, you could use the \captionof macro from the caption package:
\documentclass[11pt]{article}
\input{insbox}
\usepackage{caption}
\begin{document}
\InsertBoxL{0}{\rule{1.6in}{0.9in}} \captionof{figure}{some text}
\bigskip
\InsertBoxL{0}{\rule{1.6in}{0.9in}} \captionof{figure}{some text}
\bigskip
\InsertBoxL{0}{\rule{1.6in}{0.9in}} \captionof{figure}{some text}
\end{document}
However instead of these strange box thingies, minipages might be easier:
\documentclass[11pt]{article}
\usepackage{graphicx}
\usepackage{caption}
\captionsetup{singlelinecheck=false}
\begin{document}
\noindent\begin{minipage}[b]{1.6in}
\includegraphics[width=\textwidth]{example-image}
\end{minipage}%
\begin{minipage}[b]{\dimexpr\linewidth-1.6in}
\captionof{figure}{some text}
\end{minipage}%
\noindent\begin{minipage}[b]{1.6in}
\includegraphics[width=\textwidth]{example-image}
\end{minipage}%
\begin{minipage}[b]{\dimexpr\textwidth-1.6in}
\captionof{figure}{some tefffffxt}
\end{minipage}%
\noindent\begin{minipage}[b]{1.6in}
\includegraphics[width=\textwidth]{example-image}
\end{minipage}%
\begin{minipage}[b]{\dimexpr\textwidth-1.6in}
\captionof{figure}{some text}
\end{minipage}%
\end{document}
There are also ready-to-use packages for captions besides images:
\documentclass[11pt]{article}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{sidecap}
\begin{document}
\begin{SCfigure}
\includegraphics[width=.3\textwidth]{example-image-duck}
\caption{heading}
\end{SCfigure}
\begin{SCfigure}
\includegraphics[width=.3\textwidth]{example-image-duck}
\caption{heading}
\end{SCfigure}
\begin{SCfigure}
\includegraphics[width=.3\textwidth]{example-image-duck}
\caption{heading}
\end{SCfigure}
\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)?