How do you have a figure imported so that it appears on the bottom of a page with a caption? When I import it and put a caption on it normally, it always appears at the top of a page.
\begin{figure}[b]
your figure
\end{figure}
See this link, for more syntax:
http://en.wikibooks.org/wiki/LaTeX/Floats,_Figures_and_Captions#Figures
Just an example:
Caption below
\begin{figure}[h]
\centering
\includegraphics[width=0.3\textwidth]{thatcat.jpg}
\caption{That cat!} % caption line
\end{figure}
Caption above
\begin{figure}[h]
\centering
\caption{That cat!} % caption line
\includegraphics[width=0.3\textwidth]{thatcat.jpg}
\end{figure}
To add to freyrs:
If if you put \caption above the \includegraphics the caption will be above the figure, if you put \caption below the \includegraphics the caption will appear below the figure.
Related
There isn't exactly any code here, since I just want to centre \begin{figure} and \end{figure}'s captions to the entre of the image included rather than to the centre of the page, if i centre the image to the left, the caption still appears to the centre of the page (without using minipage as that is the only way i know to do it right now).
Here's an example:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\begin{document}
\begin{figure}[h]
\includegraphics[width=0.5\textwidth]{image.png}
\caption{Caption}
\end{figure}
\end{document}
What I get from compiling it:
I want this be centered to the image itself, and not the page, without using minipage.
Here is the source image btw, just some image I found on google
One possible approach using the varwidth package:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{varwidth}
\begin{document}
\begin{figure}[h]
\begin{varwidth}{\linewidth}
\includegraphics[width=0.5\textwidth]{example-image-duck}
\caption{Caption}
\end{varwidth}
\end{figure}
\end{document}
I am trying to put notes in the pictures of my work but the notes are getting aligned with the border of the text and not the figure. How to align the note (Fonte: Elaborated by the author (2021)) of the table with the left side of the figure?
\begin{figure}[h]
\begin{center}
\includegraphics[scale=.35]{image.jpg}
\caption{Text tex text.}
\label{fig_intbus}
\end{center}
\fonte{Elaborated by the author (2021)..}
\end{figure}
I would like something similar to the threeparttable environment for tables but that can be used in figures. I thought about the minipage environment but I don't want to specify the width for each figure manually.
Here is an example of how to do it, defining a new caption.
\documentclass{article}
\usepackage{graphicx}
\usepackage{caption}
\newcommand{\fonte}[1]{\captionsetup{skip=0.5ex,position=b}\caption*{\textit{Fonte:} {#1}}}
\begin{document}
\begin{figure}
\centering
\includegraphics[width=0.5\textwidth]{example-image-a}
\caption{Example image.}
\label{fig-img-a}
\fonte{Teste.}
\end{figure}
\end{document}
And the result is:
I found my caption disappear when I use the [H]
\begin{figure}[H]
\begin{center}
\includegraphics[width=13.5cm,height=9.5cm]{abc1.pdf}
\caption{abcd}
\end{center}
\label{fig:abcd}
\end{figure}
I found my caption appear when I use [ht]
How solve this when I still want use [H]?
Thanks
So i'm trying to hide the label in my cover image.
>\begin{figure}
>\center
>\includegraphics[scale=0.5]{universidade}
>\caption* {Mycaption}
>\end {figure}
This way it's not labeling the figure but its not showing on the list of figures
Help please ;D
You can give the caption package the option labelformat=empty to suppress the Figure 1 etc. labelling:
\usepackage[labelformat=empty]{caption}
You can use square brackets to specify the description for the figure list, and curly brackets for the actual figure caption. So I think you should be able to do the following to supress the caption but still have an entry in the figure list:
\begin{figure}
\center
\includegraphics[scale=0.5]{universidade}
\caption[Mycaption]{}
\end {figure}
There are a couple of options, depending on what yo're after exactly:
\documentclass{article}
\usepackage{graphicx}
\setcounter{topnumber}{3}% Just for this example
\begin{document}
\listoffigures
\begin{figure}
\addcontentsline{lof}{figure}{Example image A}%
\centering
\includegraphics[height=4\baselineskip]{example-image-a}
Example image A
\end{figure}
\begin{figure}
\addcontentsline{lof}{figure}{\protect\numberline{}Example image B}%
\centering
\includegraphics[height=4\baselineskip]{example-image-b}
Example image B
\end{figure}
\begin{figure}
\centering
\includegraphics[height=4\baselineskip]{example-image-c}
\caption{Example image C}
\end{figure}
\end{document}
The figure caption is added using \addcontentsline{lof}{figure}{<caption>}, where <caption> can either contain a blank \numberline{}, or just the regular caption. The above example shows the usage of either.
It would also be possible to have no label shows in the image, but have a numbered entry in the LoF using caption. But it would seem strange to have a numbered entry in the LoF and an unnumbered figure.
This is driving me crazy.
I want to center a lstlisting in LaTeX.
After 3 hours attempting here's some code:
\lstset{ %
caption=Descriptive Caption Text,
label=lst:descr_capti_text,
basicstyle=\ttfamily\footnotesize\bfseries,
frame=tb,
linewidth=0.6\textwidth
}
\centering\begin{tabular}{c}
\begin{lstlisting}
printf("this should be centered!");
\end{lstlisting}
\end{tabular}
This is putting the lstlisting on the center but not its caption, that goes to the right. If I take out the tabular, then caption gets centered but the code goes to the left! :(
Thank you.
Instead of using linewidth you should consider to use xleftmargin and xrightmargin (cf. texdoc listings, Chapter 4.10). The following code works without any center or minipage environment:
\lstset{
caption=Descriptive Caption Text,
basicstyle=\footnotesize, frame=tb,
xleftmargin=.2\textwidth, xrightmargin=.2\textwidth
}
\begin{lstlisting}
printf("this should be centered!");
\end{lstlisting}
Your caption is actually centered over the listing. You are just making the lines that run along the top and bottom of your listing only 0.6\textwidth long. This makes it appear as if the caption was off-center. Also, your \centering doesn't center the listing (visible if you don't shorten the lines below and above).
This should work:
\begin{center}
\lstset{%
caption=Descriptive Caption Text,
basicstyle=\ttfamily\footnotesize\bfseries,
frame=tb
}
\begin{lstlisting}
printf("this should be centered!");
\end{lstlisting}
\end{center}
You don't explain why you want the delimiting lines to be 0.6\textwidth long. If
you actually wanted to set the width of your listing to be that value, your
approach doesn't do what you want. Use something like a minipage to set a width
for the whole listing.
\begin{minipage}{0.6\textwidth}
\begin{center}
\lstset{%
caption=Descriptive Caption Text,
basicstyle=\ttfamily\footnotesize\bfseries,
frame=tb,
}
\begin{lstlisting}
printf("this should be centered!");
\end{lstlisting}
\end{center}
\end{minipage}
Actually, what did work for me is the converse: putting the minipage inside the center environment.