How to avoid a line break right after a bullet with LaTeX's beamer?

Viewed 152

I have a LaTeX beamer slide where I want to show an image on the right and some bullet item with a hyperlink on the left, but the link doesn't start right next to the bullet. Instead there is a line break. How can I get rid of that line break?

\documentclass[14pt, serif]{beamer}
\usepackage{hyperref}

\begin{document}

\begin{frame}{Links}
    \begin{columns}[T]
        \begin{column}{0.75\textwidth}
            \begin{itemize}
                \item \href{https://www.scrum.org/resources/blog/managing-risk-scrum}{scrum.org/resources/blog/managing-risk-scrum}
            \end{itemize}
        \end{column}

        \begin{column}{0.25\textwidth}
            image goes here
        \end{column}
    \end{columns}
\end{frame}

\end{document}

screenshot of the bullet and the text on the next line

(It's not a problem that the link overlaps the dummy text "image goes here" as in real life my image displays fine as there are more links with the given one at the bottom and the image is at the top of the column.)

1 Answers

The problem is that there are no possible breaking points in the very long string scrum.org/resources/blog/managing. I suggest to not give an alternative text, but show the original url. This way, hyperref can automatically determine good break points within the url.

If these break points aren't aggressive enough, you could also try the xurl package, which will allow breaks at every point of the url.


If you want to keep your alternative text, you can add \allowbreak to add break points.


Some other comments:

  • you don't need to load the hyperref package, beamer automatically does this for you

  • the serif class option is obsolete. A warning in the log file will inform you about this and recommand the serif font theme instead

  • I recommend using \frametitle{...}, this is much more flexible


\documentclass[14pt]{beamer}

\usefonttheme{serif}
%\usepackage{xurl}

\begin{document}


\begin{frame}
\frametitle{Links}
    \begin{columns}[T]
        \begin{column}{0.75\textwidth}
            \begin{itemize}
                \item \href{https://www.scrum.org/resources/blog/managing-risk-scrum}{scrum.org/\allowbreak resources/\allowbreak blog/\allowbreak managing-risk-scrum}
            \end{itemize}
        \end{column}

        \begin{column}{0.25\textwidth}
            image goes here
        \end{column}
    \end{columns}
\end{frame}

\begin{frame}
\frametitle{Links}
    \begin{columns}[T]
        \begin{column}{0.75\textwidth}
            \begin{itemize}
                \item \url{www.scrum.org/resources/blog/managing-risk-scrum}
            \end{itemize}
        \end{column}

        \begin{column}{0.25\textwidth}
            image goes here
        \end{column}
    \end{columns}
\end{frame}

\end{document}

enter image description here

Related