[Tex/LaTex] Print box drawing characters with pdfLaTeX

pdftexunicodexetex

I need to print some unicode characters (of box drawing family) in my document. I found this question that is very similar to mine but is valid only for XeLaTeX. There is a valid way to do this with pdfLaTeX or I have to use XeLaTeX instead?

Best Answer

You can use the symbols, if available on the keyboard, or the macros.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{pmboxdraw}
\usepackage{newunicodechar}
\newunicodechar{└}{\textSFii}
\newunicodechar{├}{\textSFviii}
\newunicodechar{─}{\textSFx}
\begin{document}

\begin{verbatim}
├── Maildir/
└── scripts/
    ├── backup.sh*
    └── OLD/
        ├── backup_cleanup.sh.old
        └── backup.sh.old*
\end{verbatim}

\end{document}

enter image description here