1

I have a figure at the centre of the page.

I would like to keep it centered, but write text to its right, to the bottom.

\documentclass{article}
\usepackage[a4paper]{geometry}
\usepackage{graphicx}

\begin{document}
    \centering
    \begin{tabular}{ ccc }
        & \includegraphics[width=0.25\textwidth]{../icons/fig.png} & text to the bottom right
    \end{tabular}

\end{document}

The result I want to get is:

enter image description here

But instead I get: (the red line is the centre of the page:

enter image description here

3
  • Is the text supposed to be a caption? Commented Jun 7 at 13:15
  • Not a caption, as in the image above..
    – ellat
    Commented Jun 7 at 13:18
  • Too bad. If it were supposed to be a caption, you could have used the hvfloat package which has tons of option to place captions besides images. Commented Jun 7 at 13:20

3 Answers 3

1

Your example is not working, because of the usage of a not available image. So I've replaced it by a free available example from mwe.

If I understand correctly, what you want, you can indeed use a table, but a tabularx instead of a tabular:

\documentclass[a4paper]{article}
\usepackage{graphicx}
\usepackage{tabularx}
\usepackage{showframe}
\begin{document}
\noindent
\begin{tabularx}{\linewidth}{@{}Xc>{\raggedleft\arraybackslash}X@{}}
  \hfill & \includegraphics[width=0.25\textwidth]{example-image} & text to the bottom right
\end{tabularx}

\end{document}

I've also added package showframe to visualize the text area.

enter image description here

But if you already know the width of the image as in your example given by the width option to \includegraphics you can even use this information:

\documentclass[a4paper]{article}
\usepackage{graphicx}
\usepackage{tabularx}
\usepackage{showframe}
\begin{document}
\noindent
\hspace*{\dimeval{(\textwidth-0.25\textwidth)/2}}% 0.25\textwidth is the width of the image
\includegraphics[width=0.25\textwidth]{example-image}%
\hfill
text to the bottom right
\end{document}

Same result as above.

You can also place several lines of text bottom aligned:

\documentclass[a4paper]{article}
\usepackage{graphicx}
\usepackage{tabularx}
\renewcommand{\tabularxcolumn}[1]{b{#1}}
\usepackage{showframe}
\begin{document}
\noindent
\begin{tabularx}{\linewidth}{@{}Xc>{\raggedleft\arraybackslash}X@{}}
  \hfill & \includegraphics[width=0.25\textwidth]{example-image} & text to\par the
  bottom right
\end{tabularx}

\end{document}

or

\documentclass[a4paper]{article}
\usepackage{graphicx}
\usepackage{tabularx}
\usepackage{showframe}
\begin{document}
\noindent
\hspace*{\dimeval{(\textwidth-0.25\textwidth)/2}}% 0.25\textwidth is the width of the image
\includegraphics[width=0.25\textwidth]{example-image}%
\parbox[b]{\dimeval{(\textwidth-0.25\textwidth)/2}}{%
  \raggedleft
  text to the\\
  bottom right
}  
\end{document}

Both with the result:

multiple lines bottom aligned beside the image

or

\documentclass[a4paper]{article}
\usepackage{graphicx}
\usepackage{tabularx}
\usepackage{showframe}
\begin{document}
\noindent
\hspace*{\dimeval{(\textwidth-0.25\textwidth)/2}}% 0.25\textwidth is the width of the image
\includegraphics[width=0.25\textwidth]{example-image}%
\hfill
\begin{tabular}[b]{@{}l@{}}
  text to the\\
  bottom right
\end{tabular} 
\end{document}

with different alignment of the text:

text raggedright instead of raggedleft but still moved to the right margin

2
  • Thank you! This is exactly what I want. Would it be possible to add another line of text above this one?
    – ellat
    Commented Jun 7 at 13:24
  • Excellent! Thanks very much!
    – ellat
    Commented Jun 7 at 13:31
0

For a fixed distance, you can do like this

\documentclass[a4paper]{article}
\usepackage{graphicx}

% just for the example
\usepackage{showframe}

\newcommand{\imagerights}[1]{%
  \unskip
  \makebox[0pt][l]{\scriptsize\quad\begin{tabular}[b]{@{}l@{}}#1\end{tabular}}%
}

\begin{document}

\begin{figure}[htp]
\centering

\includegraphics[width=0.3\columnwidth]{example-image-9x16}
\imagerights{This image is \\ not copyrighted}

\caption{A centered picture with a note on its side}

\end{figure}

\end{document}

Just remember not to leave a blank line before \imagerights.

enter image description here

If you want the text flush with the right margin:

\documentclass[a4paper]{article}
\usepackage{graphicx}

% just for the example
\usepackage{showframe}

\newcommand{\imagerights}[1]{%
  \unskip\hfil
  \makebox[0pt][r]{\scriptsize\begin{tabular}[b]{@{}r@{}}#1\end{tabular}}%
  \hfilneg
}

\begin{document}

\begin{figure}[htp]
\centering

\includegraphics[width=0.3\columnwidth]{example-image-9x16}
\imagerights{This image is \\ not copyrighted}

\caption{A centered picture with a note on its side}

\end{figure}

\end{document}

enter image description here

0

Just use \rlap{...}. No tabular needed. Horizontal gap is adjustable (currently one space wide). Note baseline at bottom of image.

\documentclass{article}
\usepackage[a4paper]{geometry}
\usepackage{graphicx}

\begin{document}
    \centering
    \includegraphics[width=0.25\textwidth]{example-image}%
    \rlap{ text to the bottom right}

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .