9

I am using \sout from the ulem package together with beamer to strike through some text:

\documentclass[mathserif]{beamer}
\usepackage{ulem}
\begin{document}
\begin{frame}
  Next meetings: 
  \begin{itemize}
    \item \sout{22.01.2016} (cancelled) 
    \item 28.01.2016
  \end{itemize}
\end{frame}
\end{document}

However, I would like to have the line a bit thicker because it's so thin that people might miss it. How is that possible?

12

The ulem source states that:

To draw a line through text instead of under it (strike out) do under-line with negative depth.

So, the thickness of the strike is the same as that of the underline. From the ulem package documentation:

The thickness of the underline rule is given by the command macro \ULthickness; use \renewcommand (not the usual \setlength) to change it.

So, writing:

\documentclass[mathserif]{beamer}
\usepackage{ulem}
\newcommand{\soutthick}[1]{%
    \renewcommand{\ULthickness}{2.4pt}%
       \sout{#1}%
    \renewcommand{\ULthickness}{.4pt}% Resetting to ulem default
}
\begin{document}
\begin{frame}
  Next meetings: 
  \begin{itemize}
    \item \soutthick{22.01.2016} (cancelled)
    \item \sout{22.01.2016}
    \item 28.01.2016
  \end{itemize}
\end{frame}
\end{document}

you will get:

enter image description here

  • Hm, so there's no easy way to adjust the width for \sout without changing the thickness for underlines? – fuenfundachtzig Jan 14 '16 at 15:15
  • @fuenfundachtzig Sorry for the late response. Apparently no! I updated my answer to make a new command with different line thickness. – jak123 Jan 17 '16 at 9:29
5

You can exploit the fact that \sout opens a group, so any assignment to \ULthickness will be local.

\documentclass[mathserif]{beamer}
\usepackage{ulem,xpatch}

\xpatchcmd{\sout}
  {\bgroup}
  {\bgroup\def\ULthickness{2pt}}
  {}{}

\begin{document}
\begin{frame}
  Next meetings:
  \begin{itemize}
    \item \sout{22.01.2016} (cancelled)
    \item \uline{28.01.2016}
  \end{itemize}
\end{frame}
\end{document}

enter image description here

  • i don't know why, but this doesn't work for me. the other answer does work. – dbliss Mar 7 '18 at 22:27
  • @dbliss I tried it again on a fresh file and it works. – egreg Mar 7 '18 at 22:29
  • @dbliss It's silly to downvote a working solution; are you using exactly the same example? If you're integrating it in another document there are several other factors that can influence the result. No information, no clue for helping you. – egreg Mar 7 '18 at 22:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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