# How to produce outlined characters using command

How could I produce characters which are outlined, like below:

It seemed like using some special command can add these outline to the character.

• In general you need a font with that design but that looks like just overprinting \textbf{f\hspace{-.3em}f} or whatever space works in each case/ – David Carlisle Jul 7 '15 at 12:55
• @DavidCarlisle I don't think the \hspace approach will work in the examples of the D or the E. However, overlaying a shifted I with the D or E just might. – Steven B. Segletes Jul 7 '15 at 13:38
• This post reminds me when I was student and used a lot of times IR for real numbers. After I discovered mathbb my life changed! – Sigur Jul 7 '15 at 13:52
• @Sigur sure yes but they all look like overprinting of something rather than using an outline font – David Carlisle Jul 7 '15 at 14:11

Here I introduce \varlet[stem]{letter}, where stem is used if the stem is not to be taken as the original letter. For example, in the case of D and E, the stem is a capital I.

The shift length is defined by \shiftgap. Thanks to barbara for suggesting it be measured in em (a horizontal font measure) and not ex (a vertical font measure).

Note that proper kerning following a \varlet is preserved, as in the case of Var.

\documentclass{article}
\newlength\shiftgap
\setlength\shiftgap{.11em}
\newcommand\varlet[2][\relax]{%
\ifx\relax#1%
\setbox0=\hbox{#2}\makebox[\wd0][l]{#2}\hspace{\dimexpr-\wd0+\shiftgap}#2%
\else%
\setbox0=\hbox{#2}\makebox[\wd0][l]{#1}\hspace{\dimexpr-\wd0+\shiftgap}#2%
\fi%
}
\begin{document}
\itshape

\varlet[I]{D}
\varlet[I]{E}

\varlet{f}
\varlet{I}

\varlet{V}ar
\end{document}


Here is the result in palatino, with a \shiftgap of 0.115em:

Depending on what level of effort one wants to go through, one can customize the result further (here using slants):

\documentclass{article}
\newlength\shiftgap
\setlength\shiftgap{.11em}
\newcommand\varlet[2][\relax]{%
\ifx\relax#1%
\setbox0=\hbox{#2}\makebox[\wd0][l]{#2}\hspace{\dimexpr-\wd0+\shiftgap}#2%
\else%
\setbox0=\hbox{#2}\makebox[\wd0][l]{#1}\hspace{\dimexpr-\wd0+\shiftgap}#2%
\fi%
}
\usepackage{graphicx}
\newsavebox\foobox
\newcommand{\slantbox}[2][.5]{\mbox{%
\sbox{\foobox}{#2}%
\hskip\wd\foobox
\pdfsave
\pdfsetmatrix{1 0 #1 1}%
\llap{\usebox{\foobox}}%
\pdfrestore
}}
\begin{document}
\itshape
\varlet{V}ar \textup{versus}\par
\varlet[\kern.2em\raisebox{-.19pt}{\scalebox{1.03}{\slantbox[-.36]{I}}}]{V}ar
\end{document}


• you're using ex here for a horizontal adjustment. ex, however, is a vertical font dimension. it would be better to use the equivalent horizontal dimension, em, so it will be consistent regardless of font size. (one shouldn't expect all font sizes to have the same relative proportions, vertical/horizontal.) – barbara beeton Jul 7 '15 at 14:48
• @barbarabeeton Thank you barbara. That is a good point. – Steven B. Segletes Jul 7 '15 at 14:54