
我該怎麼辦呢?我可以使用 tikz 設定一些東西嗎?我希望能夠描述不同長度和複雜性的 ID。最好是一些類似腳本的功能。我對 Latex 或 tikz 並不陌生,但我的用法一直都很簡單。
謝謝你!
編輯:在重新審視我的這個老問題之後,我終於想出了一個解決方案,我對此感到非常滿意。因此,以防萬一有人偶然發現這一點,我將在下面發布類似的問題:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning, arrows}
\begin{document}
\def\myhbar{1mm}
\def\myvbar{.3mm}
\def\myyshift{0mm}
\def\myxshift{0mm}
\pgfmathsetmacro{\myinnersep}{0.5}
\begin{tikzpicture}[auto,node distance=.5mm,font=\tiny\ttfamily, minimum height={height("Ag")+\myinnersep*1mm},inner sep=\myinnersep*1mm]
\node [] (a1) at(2,0) {-rw-r--r--};
\foreach [count=\x from 2] \txt in {\phantom{0}6,michael,admins,4096,Apr 25 13:53,some\_file.txt}{
\pgfmathparse{\x-1}
\node [right = of a\pgfmathresult] (a\x) {\txt};
}
\node [below = -1mm of a1] (b1) {drwxr-xr-x};
\draw [] ([yshift=\myhbar+\myyshift,xshift=\myvbar]b1.south west) -- ([yshift=\myyshift,xshift=\myvbar]b1.south west) -- ([yshift=\myyshift,xshift=-\myvbar]b1.south east) -- ([yshift=\myhbar+\myyshift,xshift=-\myvbar]b1.south east);
\foreach [count=\x from 2] \txt in {22,collins,editor,4096,Apr 25 13:53,some\_folder}{
\pgfmathparse{\x-1}
\node [right = of b\pgfmathresult] (b\x) {\txt};
\draw [] ([yshift=\myhbar+\myyshift,xshift=\myvbar]b\x.south west) -- ([yshift=\myyshift,xshift=\myvbar]b\x.south west) -- ([yshift=\myyshift,xshift=-\myvbar]b\x.south east) -- ([yshift=\myhbar+\myyshift,xshift=-\myvbar]b\x.south east);
}
\foreach [count=\y from 1] \desc in {file permissions, number of links, user, group, size, date and time, name}{
\node [anchor=west](c\y) at (0,-\y*2mm-5mm){\desc};
\draw [<-,arrows={-[}] (c\y.east) -| ([yshift=\myyshift]b\y.south);
}
\end{tikzpicture}
\end{document}