How to align the note with the left side of the figure? - alignment

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:

Related

Tikz node won't apply left (nor right) alignment

I have been struggling with this issue for a while. I want to insert a title on a white box on top of a background image for a report cover, and everything is coming up great with the exception of the title alignment. It is centered and I want to make it left aligned, but so far none of the options I have tried have worked.
So far, this is what I got:
\usepackage{tikz}
\usepackage{makecell}
\begin{titlepage}
\setlength{\parindent}{0pt}
\begin{figure}
\begin{tikzpicture}[remember picture,overlay]
\node at (current page.center) {\includegraphics[scale=0.2]{example-image-10x16}};
\node[fill=white, scale=2, text=red, text width=94mm, align=left] at ([xshift=7mm,yshift=30mm]current page.center) {\makecell{\textbf{The title goes here and it is very}\\\textbf{long so it covers two lines}\\\Xhline{2\arrayrulewidth}\\[-18pt]\scalebox{.35}{\textbf{\fontfamily{phv}\selectfont DEPARTMENT OF SOME ENGINEERING DISCIPLINE $\vert$ MY UNIVERSITY}}\\[-7pt]\scalebox{.35}{\textbf{\fontfamily{phv}\selectfont MY NAME HERE $\vert$ NAME OF PROGRAM}}}};
\end{tikzpicture}
\end{figure}
\end{titlepage}
I have tried raggedright options with the \usepackage{ragged2e} and the \begin{flushleft}\end{flushleft} approach with different variations but I don't seem to make it align to the left or even to the right.
Cheers!
I would avoid all this messing with \makecell and whatnot. Instead use a simple minipage:
\documentclass{article}
\usepackage{tikz}
\usepackage{makecell}
\begin{document}
\begin{titlepage}
\setlength{\parindent}{0pt}
\begin{figure}
\begin{tikzpicture}[remember picture,overlay]
\node at (current page.center) {\includegraphics[scale=0.2]{example-image-10x16}};
\node[
fill=white,
text=red,
text width=92mm,
font=\bfseries
] at ([yshift=30mm]current page.center) {
\begin{minipage}{\linewidth}
\LARGE The title goes here and it is very
long so it covers two lines
\vskip-0.5cm
\rule{\textwidth}{1pt}
\vskip0.1cm
\scriptsize\fontfamily{phv}\selectfont DEPARTMENT OF SOME ENGINEERING DISCIPLINE $\vert$ MY UNIVERSITY
NAME HERE $\vert$ NAME OF PROGRAM
\end{minipage}};
\end{tikzpicture}
\end{figure}
\end{titlepage}
\end{document}

latex subfigure not centered

My code is as following but my figures are not centre aligned with captions. How can I fix it?
code result
\begin{figure}[H]
\centering
\begin{subfigure}{0.7\textwidth}
\includegraphics[width=4cm,height=6cm]{outwithsel.PNG}
\caption{Outliner}
\label{fig:h1}
\end{subfigure}
\begin{subfigure}{\textwidth}
\includegraphics[width=0.8\linewidth]{moveBtns.PNG}
\caption{Buttons that move selected object in 4 different directions}
\label{fig:h2}
\end{subfigure}
\caption{Kitchen is selected and can be moved to where desired}
Here somaia, that's what happens when I tried what you said. fix from comment 1
Your images have the widths 4cm and .8\textwidth, respectively. This means they are smaller than the subfigure around them. To get them centred inside the bigger subfigure, you need to repeat \centering inside the subfigure.
In addition there are missing % at the end of some of your lines. These unprotected line breaks will act like a space, and thus decentre your subfigure by a small amount (probably not noticeable, but when we are already at it...).
Unrelated to your problem: don't specify both the width and the height of the image, this will distort it. At least add keepaspectratio if you really must give both dimensions.
\documentclass{article}
\usepackage{subcaption}
\usepackage{graphicx}
\usepackage{float}
\begin{document}
\begin{figure}[H]
\centering
\begin{subfigure}{\textwidth}
\centering
\includegraphics[width=4cm,height=6cm]{example-image-duck}
\caption{Outliner}
\label{fig:h1}
\end{subfigure}%
\begin{subfigure}{\textwidth}
\centering
\includegraphics[width=.8\textwidth]{example-image-duck}
\caption{Buttons that move selected object in 4 different directions}
\label{fig:h2}
\end{subfigure}%
\caption{Kitchen is selected and can be moved to where desired}
\end{figure}
\end{document}
I think you have a problem in \texwidth, you have to choose the 0.5 textwidth for each subfigure
This will solve your problem:
\begin{figure}[H]
\centering
\includegraphics[width=.7\textwidth]{Bloch sphere.PNG}
\caption{Outliner}
\label{fig:h1}
\includegraphics[width=0.7\textwidth]{Bloch sphere.PNG}
\caption{Buttons that move selected object in 4 different directions}
\label{fig:h2}
\caption{Kitchen is selected and can be moved to where desired}
\end{figure}

Caption Centered To Image Rather Than Page

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}

Multiple subfigures in a row in a LaTeX document

I am trying to insert four figures in a LaTeX document but if I use subfigure command, two of my figures stay in first row and the other two go to the second line. Like this :
The other solution I tried was using minipage command, but the problem with minipage is that the subfigures get normal figure caption (like Figure 1) while I would like subfigure captions like (a). See the following figure:
What I prefer is to have something like second picture but with the captions like first picture.
Your figures are too wide to fit side-by-side in one line. If multiple subfigures do not fit in one line, latex does an auto linebreak. You have to specify the width of each included graphic per subfigure such, that it will sum up to be smaller than the \textwidth parameter, i.e:
\begin{figure}
\centering
\subfigure[]{\includegraphics[width=0.24\textwidth]{monalisa.jpg}}
\subfigure[]{\includegraphics[width=0.24\textwidth]{monalisa.jpg}}
\subfigure[]{\includegraphics[width=0.24\textwidth]{monalisa.jpg}}
\subfigure[]{\includegraphics[width=0.24\textwidth]{monalisa.jpg}}
\caption{(a) blah (b) blah (c) blah (d) blah}
\label{fig:foobar}
\end{figure}
leads to
While if you set the width too high, e.g. width=0.5\textwidth leads to what I believe is your problem
Although it's been a long time since the question was asked but the solution #gehbiszumeis offered didn't work for me and I still got the normal figure caption for each subfigure. So in case anyone has still the same problem as mine here is what I did (according to this):
\begin{figure}
\centering
\begin{subfigure}{.24\textwidth}
\centering
\includegraphics[width=.95\linewidth]{FIRST IMAGE}
\caption{}
\label{SUBFIGURE LABEL 1}
\end{subfigure}
\begin{subfigure}{.24\textwidth}
\centering
\includegraphics[width=.95\linewidth]{SECOND IMAGE}
\caption{}
\label{SUBFIGURE LABEL 2}
\end{subfigure}
\begin{subfigure}{.24\textwidth}
\centering
\includegraphics[width=.95\linewidth]{THIRD IMAGE}
\caption{}
\label{SUBFIGURE LABEL 3}
\end{subfigure}
\begin{subfigure}{.24\textwidth}
\centering
\includegraphics[width=.95\linewidth]{FOURTH IMAGE}
\caption{}
\label{SUBFIGURE LABEL 4}
\end{subfigure}
\caption{FIGURE CAPTION}
\label{FIGURE LABEL}
\end{figure}
If some cannot get the subfigure's caption, like (a) (b) (c) and (d), me neither.
One solution is to replace the "[]" in "\subfigure[]" with "(a)",
just like:
\begin{figure}
\centering
\subfigure(a){\includegraphics[width=0.24\textwidth]{monalisa.jpg}}
\subfigure(b){\includegraphics[width=0.24\textwidth]{monalisa.jpg}}
\subfigure(c){\includegraphics[width=0.24\textwidth]{monalisa.jpg}}
\subfigure(d){\includegraphics[width=0.24\textwidth]{monalisa.jpg}}
\caption{(a) blah (b) blah (c) blah (d) blah}
\label{fig:foobar}
\end{figure}

Latex List of Figures

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.

Resources