adjusting side caption in latex - latex

I would like to adjust the side caption in latex by having the caption flushed left (or right) and be aligned with the top of the figure.
Attached is a MWE
\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage[ragged]{sidecap}
\begin{document}
\begin{SCfigure}
\includegraphics[width=5cm]{name}
\caption{I would like the caption to occupy say 0.2linewidth and be left (or right) adjusted and on top}\label{fig:testA}
\end{SCfigure}
\end{document}

To have the caption either flush left or right, the sidecap package offers the options raggedright and raggedleft.
To align the caption with the top of the figure, you can use \sidecaptionvpos{figure}{t}
\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage[
%ragged
%raggedright
raggedleft
]{sidecap}
\sidecaptionvpos{figure}{t}
\begin{document}
\begin{SCfigure}
\includegraphics[width=5cm]{name}
\caption{I would like the caption to occupy say 0.2linewidth and be left (or right) adjusted and on top}\label{fig:testA}
\end{SCfigure}
\end{document}

Related

Latex: how to align subcaptions on the top left and caption to the right of the figures

I am using LaTeX to write a report and I'm going crazy to get a result like
with subcaptions (a), (b), (c) align to the top left of the subfigures and caption on the right of the figure.
I've already tried with floatrow and subcaption, but I've never obtained the result I want.
MWE:
\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{floatrow}
\usepackage{subfig}
\floatsetup[figure]{style=plain,subcapbesideposition=top}
\begin{figure*}
\ffigbox[\FBwidth]
{\begin{subfloatrow}
\sidesubfloat[]{\includegraphics[width=.5\linewidth]{image1}\label{fig:a}}%
\sidesubfloat[]{\includegraphics[width=.5\linewidth]{image2}\label{fig:b}}%
\end{subfloatrow}}
{\caption{Two figures}\label{}}
\end{figure*}
\end{document}
Here some starting point with the subcaption package (the exact dimensions might need some tweaking to nicely align with the surrounding text)
\documentclass{article}
\usepackage{graphicx}
\usepackage{subcaption}
\captionsetup[subfigure]{font={bf,small}, skip=1pt, margin=-0.7cm, singlelinecheck=false}
\begin{document}
\begin{figure*}
\hfill
\begin{minipage}[b]{.63\textwidth}
\begin{subfigure}{\textwidth}
\subcaption{}
\includegraphics[width=\linewidth]{example-image-duck}
\end{subfigure}\par
\begin{subfigure}{\textwidth}
\subcaption{}
\includegraphics[width=\linewidth]{example-image-duck}
\end{subfigure}
\end{minipage}
\quad
\begin{minipage}[b]{.3\textwidth}
\caption{some caption with aligns at the bottom}\label{key}
\end{minipage}
\end{figure*}
\end{document}

Put two images with different height aligned to the top of the page LaTeX

I would like to create landscape document with two-column pages.
On the left side of each page is located a bigger image (covering more less the left part of page and aligned to the top of the page), on the right side is located smaller image covering about 1/3 on the right side of the page, aligned to the top and with some description below
\documentclass{book}
\usepackage[landscape]{geometry}
\usepackage{graphicx}
\usepackage{subcaption}
\begin{document}
\noindent
\begin{minipage}{0.49\linewidth}
\centering
\includegraphics[width=\linewidth]{image-3x4}
\captionof{figure}{Example picture proportion 3:4}
\end{minipage}
\hspace{0.01\textwidth}
\begin{minipage}{0.49\linewidth}
\centering
\includegraphics[width=\linewidth]{image-3x1}
\captionof{figure}{Example picture proportion 3:1}
Some extra description on the right side
\end{minipage}
\end{document}
Actual output:
Desired output:
How to create two images side-by-side aligned to the top of the page as desired?
You can use the valign key (needs the adjutsbox package):
\documentclass{book}
\usepackage[landscape]{geometry}
\usepackage{graphicx}
\usepackage{subcaption}
\usepackage[export]{adjustbox}
\begin{document}
\noindent
\begin{minipage}[t]{0.49\linewidth}
\centering
\includegraphics[width=\linewidth,valign=t]{example-image-duck}
\captionof{figure}{Example picture proportion 3:4}
\end{minipage}
\hspace{0.01\textwidth}
\begin{minipage}[t]{0.49\linewidth}
\centering
\includegraphics[width=\linewidth,height=1cm,valign=t]{example-image-duck}
\captionof{figure}{Example picture proportion 3:1}
Some extra description on the right side
\end{minipage}
\end{document}

Ignore margins and wrap text when adding pictures in Latex

I would like to add images in the top left/right or bottom left/right in a two-column page while ignoring the margins and having the text wrap around the picture. How can I also extend the solution to include half page images while ignoring the margins and with text wrapping.
I tried tikz package, but the text doesn't wrap around even when I use the wrapfig package.
For example, this is the code I used to insert image on the top left side of the page:
\documentclass[twocolumn, 12pt]{book}
\usepackage{lipsum}
\usepackage{tikz}
\begin{document}
\lipsum[1-3]
\begin{tikzpicture} [remember picture, overlay]
\node[anchor=north west,yshift=-1.5pt,xshift=1pt]%
at (current page.north west)
{\includegraphics[width=0.5\paperwidth,height=0.5\paperheight]{example.jpg}};
\end{tikzpicture}
\lipsum[1-3]
\end{document}
This results in the picture at the desired position, but the text is obscured behind the image. Thank you!
Not very pretty, but does the job I think (using geometry package only to get the correct values for top margin):
\documentclass[twocolumn, 12pt]{book}
\usepackage{lipsum}
\usepackage{tikz}
\usepackage{geometry}
\begin{document}
\begin{tikzpicture} [remember picture, overlay]
\node[anchor=north west]%
at (current page.north west)
{\includegraphics[width=0.46\paperwidth,height=0.5\paperheight]{example.png}};
\end{tikzpicture}
\vspace*{\dimexpr(0.5\paperheight-\voffset-1in-\headsep-\headheight)}
\lipsum[1-3]
\lipsum[1-3]
\end{document}

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

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:

How can I force a tikz image to go to the bottom of the page?

I'm using this code to implement a "background image" on my page:
\tikz[remember picture,overlay] \node[inner sep=0pt] at (current page.center){\includegraphics{Images/picture.pdf}};
However, I'd like it to show up at the bottom of the page. I've tried changing the current page.center and played around with \vfill but I can't quite figure it out.
Something along the lines of this answer may be what you are looking for (adapted for this question):
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{graphicx}
\begin{document}
\begin{titlepage}
\begin{tikzpicture}[overlay, remember picture]
\node[anchor=south west, %anchor is bottom left corner of the graphic
xshift=5cm, %shifting around
yshift=-5cm]
at (current page.south west) %left bottom corner of the page
{\includegraphics[width=5cm]{tiger}};
\end{tikzpicture}
\end{titlepage}
\end{document}

Resources