4

I have some output from the tree command, which looks something like this:

.
├── Maildir/
└── scripts/
    ├── backup.sh*
    └── OLD/
        ├── backup_cleanup.sh.old
        └── backup.sh.old*

However, when I copy this into my XeLaTeX document, it ends up similar to this in it's final form:

.
??? Maildir/
??? scripts/
    ??? backup.sh*
    ??? OLD/
        ??? backup_cleanup.sh.old
        ??? backup.sh.old*

Having done some searching, I've tried using the verbatim, Verbatim, and VerbatimOut environments, however none have successfully presented it. I have also tried using the lstlisting which is what I would prefer to use as I'm using it elsewhere in the document, though that hasn't made any difference. My lstlisting environment is set up like this:

\lstset{
    frame=shadowbox,
    rulesepcolor=\color{blue},
    language=bash,
    basicstyle=\fontspec{PT Mono},
    %extendedchars=true,
    %literate={á}{{\'a}}1 {ã}{{\~a}}1 {é}{{\'e}}1,
}

Those last two lines I found here, and had hoped that I could find the equivalent escape codes for all the extra symbols, however after a couple of hours of searching, I have failed.

How can I get this structure into my document as text (I'd prefer not to import is as an image)?

Many thanks

EDIT 04/11/14: It turns out that in its default installation, TeXShop saves files in Wester (Mac OS Roman), and when I saved and reopened the file, it had replaced the 'special' files with ???. So changing it all to UTF-16, I can now save and reopen to see the 'special' characters, but when I typeset my document it just shows whitespace...

forquare
  • 185

1 Answers1

2

The main issue is whether the font used for typesetting has the needed characters in it.

The example below works on a linux system. Using Microsoft's truetype fonts also works using \setmonofont{Courier New}, instead.

 \documentclass{article}

 \usepackage{fontspec}

\setmonofont{FreeMono}

 \begin{document}

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

 \end{verbatim}

 \end{document}
Nigel
  • 1,221