TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am including an image in a beamer presentation, centred, and want to give an unintrusive attribution link, just under the picture, right-aligned to the right-hand edge of the image.

In other words, I’d like something almost like what’s produced by

\documentclass[10pt]{beamer}

\begin{document}

\begin{frame}
  \begin{center}
     \includegraphics[width=0.6\textwidth]{file_extensions.png} \\
     \url{http://xkcd.com/1301}
  \end{center}
\end{frame}

\end{document}

except with the url shifted horizontally, so that its right-hand edge is flush to the right-hand edge of the image. How can I achieve this?

(Image file for MWE.)

share|improve this question
up vote 10 down vote accepted

Or use a minipage

\documentclass{beamer}

\begin{document}

\begin{frame}

\begin{center}
\begin{minipage}{0.6\textwidth}
\includegraphics[width=\linewidth]{example-image} \\
\raggedleft\url{http://xkcd.com/1301}
\end{minipage}
\end{center}

\end{frame}

\end{document}

enter image description here

share|improve this answer

Use a tabular

\documentclass{beamer}

\begin{document}

\begin{frame}

\begin{center}
\begin{tabular}{@{}r@{}}
\includegraphics[width=0.6\textwidth]{example-image} \\
\url{http://xkcd.com/1301}
\end{tabular}
\end{center}

\end{frame}

\end{document}

enter image description here

share|improve this answer

Or use a makebox:

\documentclass[10pt]{beamer}
\begin{document}
\begin{frame}
\centering
\includegraphics[width=0.6\textwidth]{example-image}\\ 
\makebox[0.6\textwidth][r]{\url{http://xkcd.com/1301}}
\end{frame}
\end{document}

Or \llap and \raisebox

\documentclass[10pt]{beamer}
\begin{document}
\begin{frame}
\centering
\includegraphics[width=0.6\textwidth]{example-image-a}% no space here !
\llap{\raisebox{-10pt}{\url{http://xkcd.com/1301}}}
\end{frame}
\end{document}

Or even a \vbox:

\documentclass[10pt]{beamer}
\begin{document}
\begin{frame}
\hspace{-.2\textwidth}
\vbox{
\raggedleft
\includegraphics[width=.6\textwidth]{example-image}\\
\url{http://xkcd.com/1301}}%
\end{frame}
\end{document}
share|improve this answer

...or use a right-aligned stack

\documentclass[10pt]{beamer}
\usepackage{graphicx}
\usepackage{url,stackengine}
\begin{document}
\begin{frame}
  \begin{center}
     \def\stackalignment{r}\stackunder[6pt]{%
      \includegraphics[width=0.6\textwidth]{example-image}%
     }{%
      \url{http://xkcd.com/1301}%
     }
  \end{center}
\end{frame}
\end{document}

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.