在lstlisting中表示tree命令的输出,部分字符不可见.

2020-02-10 17:23发布

源码如下: ```tex %!TeX encoding = UTF-8 %!TeX program = xelatex \documentclass{article} \usepackage{list...

源码如下: ```tex %!TeX encoding = UTF-8 %!TeX program = xelatex \documentclass{article} \usepackage{listings} \usepackage[UTF8]{ctex} \usepackage{color} \usepackage{geometry} \usepackage{fontspec} \newfontfamily\monaco{Monaco} \usepackage[colorlinks=true,linkcolor=blue,urlcolor=blue,citecolor=black]{hyperref} \geometry{a4paper,left=1cm,right=1cm,top=1cm,bottom=1.2cm} \definecolor{codegreen}{rgb}{0,0.6,0} \definecolor{codegray}{rgb}{0.5,0.5,0.5} \definecolor{codepurple}{rgb}{0.58,0,0.82} \definecolor{backcolour}{rgb}{0.95,0.95,0.92} \lstdefinestyle{mystyle}{ backgroundcolor=\color{backcolour}, commentstyle=\color{codegreen}, keywordstyle=\color{magenta}, % numberstyle=\tiny\color{codegray}, stringstyle=\color{codepurple}, % basicstyle=\large\ttfamily, basicstyle=\large\fontfamily{monaco}\selectfont, breakatwhitespace=false, breaklines=true, captionpos=b, keepspaces=true, % numbers=left, % numbersep=5pt, numbers=none, showspaces=false, showstringspaces=false, showtabs=false, tabsize=4 } \lstset{style=mystyle} \begin{document} \begin{lstlisting} / ├── bin -> usr/bin ├── boot ├── dev ├── etc ├── home ├── lib -> usr/lib ├── lib64 -> usr/lib64 ├── media ├── mnt ├── opt ├── proc ├── root ├── run ├── sbin -> usr/sbin ├── srv ├── sys ├── tmp ├── usr └── var \end{lstlisting} \end{document} ``` 希望得到效果为: ![](https://pics.latexstudio.net/data/images/202002/905fb965a26cee7.png) 但是转换为pdf后的效果为:![](https://pics.latexstudio.net/data/images/202002/86205827ab6b271.png) 大家有什么办法能让在lstlisting环境下把左边的表格字符显示出来么?