3

I used the cancel package today for the first time but the arrow isn't straight. Is this normal?

\documentclass{article}
\usepackage[makeroom]{cancel}
\usepackage{mathtools}
\begin{document}
\begin{align*}
  L\{2\cos(3t)\}(s)
   & = 2\int_0^{\infty}\cos(3t)e^{-st}dt\\
   & = \cancelto{0}{\frac{2e^{-st}\sin(3t)}{3}\biggl|_0^{\infty}} +
   \frac{s}{3}\int_0^{\infty}\sin(3t)e^{-st}dt
\end{align*}
\end{document}

enter image description here

I would like to use this package, but at the same time, it is sloppy unless there is a fix for this problem.

dustin
  • 18,617
  • 23
  • 99
  • 204

1 Answers1

5

cancel uses picture environment commands, so sloping lines are made by positioning many font glyphs with small line segments, this inevitably gives a notch sometimes as rounding error moves the line from one pixel to the next.

Normally in such cases, you can use

\usepackage{pict2e}

to re-implement the picture mode commands using pdf drawing primitives to get a smoother appearance and less restrictions on available slopes.

That didn't work here, but it turns out that's a documented feature, the end of cancel.sty says

% pict2e removes bounding box from line and vector, so use original
% versions by declaring \OriginalPictureCmds; make it a no-op if undefined

\@ifundefined{OriginalPictureCmds}{\let\OriginalPictureCmds\relax}{}

% Sometime maybe find a better solution that uses all slopes with pict2e

So currently that's just how it is.

David Carlisle
  • 757,742