乳胶逐字记录:如何显示由tree命令创建的文件directoy? [英] Latex verbatim:how to show the file directoy created by tree command?

查看:52
本文介绍了乳胶逐字记录:如何显示由tree命令创建的文件directoy?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用逐字环境插入由tree命令创建的文件目录图.但是在输出文档中,仅保留文件名,并且不显示连接线.

I want to insert a file directory diagram created by tree command using verbatim enviroment. But in the output document, only file names are kept, and the connection lines are disapeared.

\documentclass{article}
\usepackage{fancyvrb}
\begin{document}

\begin{Verbatim}
 .
 ├── app
 ├── bakery
 ├── build
 ├── CHANGELOG.md
 ├── composer.json
 ├── composer.lock
 ├── docker
 ├── sponsors
 ├── STYLE-GUIDE.md
 └── webserver-configs

 \end{Verbatim}

 \end{document}

我已尝试通过将showtabs设置为true来使用fancyvrb软件包,但连接线仍未打印在文档中.

I have tried using fancyvrb package by setting showtabs true, but the connection lines are still not printed in the document.

有什么办法吗?

推荐答案

问题是这些unicode字符未包含在默认的单色字体中.如果您使用支持Unicode的引擎(例如xelatex)以及包含它们的字体,例如DejaVu Sans Mono,它将在文档中可见:

The problem is that these unicode characters are not included in the default mono font. If you use an unicode-capable engine, such as xelatex, and a font which contains them, e.g. DejaVu Sans Mono, the will be visible in the document:

% !TeX TS-program = xelatex

\documentclass{article}
\usepackage{fancyvrb}


\usepackage{fontspec}
\setmonofont{DejaVu Sans Mono}

\begin{document}

\begin{Verbatim}
 .
 ├── app
 ├── bakery
 ├── build
 ├── CHANGELOG.md
 ├── composer.json
 ├── composer.lock
 ├── docker
 ├── sponsors
 ├── STYLE-GUIDE.md
 └── webserver-configs

 \end{Verbatim}

 \end{document}

如果您更喜欢 pdflatex ,则可以使用 pmboxdraw 软件包:

If you prefer pdflatex, the pmboxdraw package can be used:

\documentclass{article}
\usepackage{fancyvrb}

\usepackage[utf8]{inputenc}
\usepackage{pmboxdraw}

\begin{document}

\begin{Verbatim}
 .
 ├── app
 ├── bakery
 ├── build
 ├── CHANGELOG.md
 ├── composer.json
 ├── composer.lock
 ├── docker
 ├── sponsors
 ├── STYLE-GUIDE.md
 └── webserver-configs

 \end{Verbatim}

 \end{document}

这篇关于乳胶逐字记录:如何显示由tree命令创建的文件directoy?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆