Tikz:根据线分隔符分隔项目

Tikz:根据线分隔符分隔项目

我正在编写一份文档,最终将以双倍行距提交(通过使用\linespread{1.6})。我正在使用包括tikz一些分离的图像(它们是分形,因此显示不同的构造阶段)。我想知道是否可以根据文本中行之间的分隔值在 Tikzpicture 中分隔行(因此当我将值更改为 1.6 时它会发生变化)。

我的最小工作示例

\begin{tikzpicture}[decoration=Cantor set]
    \draw (0,0) -- (7,0) node[right] {$E_{0}$};
    \draw decorate{ (0,-.5) -- (7,-.5)} node[right] {$E_{1}$};
    \draw decorate{ decorate{ (0,-1) -- (7,-1)}} node[right] {$E_{2}$};
    \draw decorate{ decorate{ decorate{ (0,-1.5) -- (7,-1.5)}}} node[right] {$E_{3}$};
    \draw decorate{ decorate{ decorate{ decorate{ (0,-2) -- (7,-2)}}}} node[right] {$E_{4}$};
\end{tikzpicture}

答案1

你可以人为地强制执行它,但除非你真的包括所有可能的情况,否则它不会那么强大。否则,简单的参数化就足够了。但现在你被正式警告不要这样使用:)

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.fractals}
\begin{document}

\linespread{3}
\begin{tikzpicture}[decoration=Cantor set]
    \draw (0,0) -- (7,0) node[right]  (z) {$E_{0}$};
    \draw decorate{ (0,-\baselineskip) -- (7,-\baselineskip)} node[right] {$E_{1}$};
    \draw decorate{ decorate{ (0,-2\baselineskip) -- (7,-2\baselineskip)}} node[right] {$E_{2}$};
    \draw decorate{ decorate{ decorate{ (0,-3\baselineskip) -- (7,-3\baselineskip)}}} node[right] {$E_{3}$};
    \draw decorate{ decorate{ decorate{ decorate{ (0,-4\baselineskip) -- (7,-4\baselineskip)}}}} node[right] {$E_{4}$};
\node[anchor=north west, align=left, text width=4cm] at (z.north east) {
asd fasdf afgsdf sdfgs dfg dsfgsd sdfga afasd adfa adfasdf adfa a asdf
asd fasdf afgsdf sdfgs dfg dsfgsd sdfga afasd adfa 
};
\end{tikzpicture}

\vspace{3cm}

\linespread{1.6}
\begin{tikzpicture}[decoration=Cantor set]
    \draw (0,0) -- (7,0) node[right]  (z) {$E_{0}$};
    \draw decorate{ (0,-\baselineskip) -- (7,-\baselineskip)} node[right] {$E_{1}$};
    \draw decorate{ decorate{ (0,-2\baselineskip) -- (7,-2\baselineskip)}} node[right] {$E_{2}$};
    \draw decorate{ decorate{ decorate{ (0,-3\baselineskip) -- (7,-3\baselineskip)}}} node[right] {$E_{3}$};
    \draw decorate{ decorate{ decorate{ decorate{ (0,-4\baselineskip) -- (7,-4\baselineskip)}}}} node[right] {$E_{4}$};
\node[anchor=north west, align=left, text width=4cm] at (z.north east) {
asd fasdf afgsdf sdfgs dfg dsfgsd sdfga afasd adfa adfasdf adfa a asdf
asd fasdf afgsdf sdfgs dfg dsfgsd sdfga afasd adfa adfasdf adfa
};
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容