我用它dirtree
来可视化目录结构。它需要嵌入到浮动中,以避免分页符出现问题。除了加载时,floatrow
我用它来获取边距标题等,这工作得很好。即使只是加载 floatrow 包也会搞砸dirtree
。有没有可能的解决方案让这两个配合起来?
dirtree
仅有的:
dirtree
和floatrow
:
代码:
\documentclass[8pt]{scrartcl}
\usepackage{dirtree}
%\usepackage{floatrow}
\usepackage{blindtext}
\begin{document}
\blindtext
%\thisfloatsetup{%
%floatwidth=\linewidth,
%capposition=beside,
%capbesideposition={top,right},
%capbesideframe=yes,
%capbesidewidth=\marginparwidth,
%capbesidesep=quad,
%floatrowsep=qquad}
\begin{figure}[t]
\dirtree{%
.1 Experiment/.
.2 Analysis/ \dotfill \begin{minipage}[t]{3cm}
Very important folder{.}\end{minipage}.
.2 TopSecret/ \dotfill \begin{minipage}[t]{3cm}
For your eyes only.\end{minipage}.
.3 Awesome Plots/.
.3 Output.txt.
.2 File.dat.
}
\caption{Directory Tree}
\end{figure}
\blindtext
\end{document}
答案1
默认情况下,floatrow
将浮动内容居中,因此objectset=raggedright
在浮动的设置中添加涉及dirtree
。
\documentclass[8pt]{scrartcl}
\usepackage{dirtree}
\usepackage{floatrow}
\usepackage{blindtext}
\begin{document}
\blindtext
\thisfloatsetup{%
objectset=raggedright,
%floatwidth=\linewidth,
%capposition=beside,
%capbesideposition={top,right},
%capbesideframe=yes,
%capbesidewidth=\marginparwidth,
%capbesidesep=quad,
%floatrowsep=qquad
}
\begin{figure}[t]
\dirtree{%
.1 Experiment/.
.2 Analysis/ \dotfill\begin{minipage}[t]{3cm}
Very important folder{.}\end{minipage}.
.2 TopSecret/ \dotfill \begin{minipage}[t]{3cm}
For your eyes only.\end{minipage}.
.3 Awesome Plots/.
.3 Output.txt.
.2 File.dat.
}
\caption{Directory Tree}
\end{figure}
\blindtext
\end{document}