Here, I introduce \pigpenXXXX
where XXXX
is some combination of 0
and 1
that signify strokes on the left, top, right, bottom (i.e., clockwise starting on left). Stroke length and width are defined by \rlln
and \rlwd
, respectively. The symbols are defined to sit on the baseline.
Naturally, one could define letters like \def\ppA{\pigpen0011}
, etc.
EDITED to make suitable for use in math mode, though it will also function in text mode.
\documentclass{article}
\usepackage{stackengine}
\newlength\rlln
\newlength\rlwd
\newlength\brlwd
\newlength\trlwd
\newlength\lrlwd
\newlength\rrlwd
\rlwd=.5pt
\rlln=5pt
\def\bstr{\rule{\rlln}{\brlwd}\rule{0pt}{\rlwd}}
\def\tstr{\rule{\rlln}{\trlwd}\rule{0pt}{\rlwd}}
\def\lstr{\ooalign{\rule{\lrlwd}{\rlln}\cr\rule{\rlwd}{0pt}}}
\def\rstr{\ooalign{\rule{\rrlwd}{\rlln}\cr\rule{\rlwd}{0pt}}}
\def\gap{\rule{\dimexpr\rlln-2\rlwd}{0pt}}
\def\pigpen#1#2#3#4{\kern1pt% FOUR ARGUMENTS ARE LEFT, TOP, RIGHT, BOTTOM STROKES
\brlwd=#4\rlwd\relax%
\trlwd=#2\rlwd\relax%
\lrlwd=#1\rlwd\relax%
\rrlwd=#3\rlwd\relax%
\stackengine{\dimexpr\rlln-\rlwd}{%
\stackengine{0pt}{\bstr}{\lstr\gap\rstr}{O}{c}{F}{F}{L}%
}{\tstr}{O}{c}{F}{F}{L}\kern1pt%
}
\begin{document}
$x\pigpen0011 \pigpen1011 \pigpen1001 \pigpen0111
\pigpen1111 \pigpen1101 \pigpen0110 \pigpen1110
\pigpen1100 \pigpen1010 \pigpen0101 y$
\end{document}
UPDATE:
The OP requested a version with rounded endcaps. To do so, I use my custom style file roundrule.sty
, found exclusively at the end of this answer:
Is there such a thing as a `\mathrule`? (rounded endcaps)
I then modify my above answer to use round rules instead of rules. I probably need to update roundrule.sty
, because I found that if one of the rule dimensions is 0pt, it still outputs a thin line. To circumvent that problem for this answer, I perform a check on the roundrule dimensions.
\documentclass{article}
\usepackage{stackengine,roundrule}
\newlength\rlln
\newlength\rlwd
\newlength\brlwd
\newlength\trlwd
\newlength\lrlwd
\newlength\rrlwd
\newcommand\rrule[2]{\ifdim#1>0pt\relax\ifdim#2>0pt\relax\roundrule{#1}{#2}\else\fi\else\fi}
\rlwd=.5pt
\rlln=5pt
\def\bstr{\rrule{\rlln}{\brlwd}\rule{0pt}{\rlwd}}
\def\tstr{\rrule{\rlln}{\trlwd}\rule{0pt}{\rlwd}}
\def\lstr{\ooalign{\rrule{\lrlwd}{\rlln}\cr\rule{\rlwd}{0pt}}}
\def\rstr{\ooalign{\rrule{\rrlwd}{\rlln}\cr\rule{\rlwd}{0pt}}}
\def\gap{\rule{\dimexpr\rlln-2\rlwd}{0pt}}
\def\pigpen#1#2#3#4{\kern1pt% FOUR ARGUMENTS ARE LEFT, TOP, RIGHT, BOTTOM STROKES
\brlwd=#4\rlwd\relax%
\trlwd=#2\rlwd\relax%
\lrlwd=#1\rlwd\relax%
\rrlwd=#3\rlwd\relax%
\stackengine{\dimexpr\rlln-\rlwd}{%
\stackengine{0pt}{\bstr}{\lstr\gap\rstr}{O}{c}{F}{F}{L}%
}{\tstr}{O}{c}{F}{F}{L}\kern1pt%
}
\begin{document}
$x\pigpen0011 \pigpen1011 \pigpen1001 \pigpen0111
\pigpen1111 \pigpen1101 \pigpen0110 \pigpen1110
\pigpen1100 \pigpen1010 \pigpen0101 y$
\end{document}
A TikZ answer; you could personalize the appeareance passing TikZ style commands in the optional argument.
\documentclass{article}
\usepackage{tikz}
\newcommand{\myarrow}[1][]{%
\begin{tikzpicture}[#1]%
\draw (0,0.7ex) -- (0,0) -- (0.75em,0);
\draw (0.55em,0.2em) -- (0.75em,0) -- (0.55em,-0.2em);
\end{tikzpicture}%
}
\begin{document}
\myarrow
\myarrow[scale=5]
\myarrow[draw=red]
\end{document}
Best Answer
You can use Zapf Dingbats through the
pifont
package features.There is a similar one at slot 111
If you want to use it as a math symbol, here analogous to the Alembertian,