13

I'm using the ulem for strikethrough, but need two formats of strikethrough. I'm currently using \dout{text} which looks good, but the second\xout{text} makes the base text a little too unreadable.

I'm looking for a clean double-strikethrough... the closest I've gotten is:

\newcommand\dout{\bgroup \markoverwith{\rule[0.2ex]{0.1pt}{0.4pt}\rule[0.8ex]{0.1pt}{0.4pt}}\ULon}

but this creates a slight hatching effect. (It's good enough, but I figured I'd see if any of ye clever folk had a cleaner solution.)

example

1
  • Just a note that when I use the above \dout command, it doesn't work in captions, and it looks a bit faded compared to \sout (rule weight doesn't quite help).
    – badroit
    Commented Oct 2, 2010 at 23:46

3 Answers 3

7

This is modified from the double underline macro of ulem (note that \MakeRobust is also defined by that package):

\def\dout{\bgroup
 \markoverwith{\lower-0.2ex\hbox
 {\kern-.03em\vbox{\hrule width.2em\kern0.45ex\hrule}\kern-.03em}}%
 \ULon}
\MakeRobust\dout

and seems to work quite well:

example

6
  • Works a treat, thanks! A small problem in that it doesn't work in captions ! Undefined control sequence... \markoverwith ...ULC@box } \else \def \UL@leadtype ... and then ! Tex capacity exceeded, sorry [input stack = 5000]. \UL@on 1->\leavevmode ... but not a problem for my case.
    – badroit
    Commented Oct 3, 2010 at 0:45
  • That (and a scaling problem) should be fixed now.
    – Caramdir
    Commented Oct 3, 2010 at 0:48
  • Hmmm... addition of \UL@setULdepth gives me an Undefined control sequence. for every use of \dout (inside or outside captions). \MakeRobust seems fine. Is \UL also in that package?
    – badroit
    Commented Oct 3, 2010 at 0:55
  • \UL@setULdepth is also from the package. Maybe you forgot the \makeatletter? Actually, that command was just a copy&paste error any you can remove it.
    – Caramdir
    Commented Oct 3, 2010 at 1:32
  • Better \DeclareRobustCommand instead of \def, and avoid \MakeRobust. I suppose this answer got \kern-.03em after the other answer was entered. Commented Jul 13, 2020 at 8:08
1

More an observation, then an answer, but too long for a comment: The effect dependens on the pdf viewer:

This is Evince (300%, 400%): evince 300 evince 400

It looks better in Acrobat (300%, 400%) acrobat 300 acrobat 400

At least until you zoom in really close (1600%):

acrobat 1600

How does it look when printed?

1
  • Good point. Was using SumatraPDF which looks similar to Evince above. It does look better on Acrobat. Printed, both look solid... though Acrobat a little more so (in fact a little too solid, making the text a little unreadable).
    – badroit
    Commented Oct 3, 2010 at 0:41
1

I think Inserting \hskip-0.1pt in the first proposed code solves the problem of hatching.

    \newcommand\dout{
        \bgroup
        \markoverwith{%
            \rule[0.2ex]{0.1pt}{0.4pt}%
            \hskip-0.1pt
            \rule[0.8ex]{0.1pt}{0.4pt}%
        }
        \ULon
     }
     \MakeRobust\dout

You must log in to answer this question.

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