我已经生成了以下内容使用 Tikz。然后我想用文本将其包裹起来,如(红色框):
有没有办法实现这一点?知道流程图(单独生成)以 pdf 格式包含在我的主文件中
更新:在第一条评论之后,我认为最好将流程图代码包含在主代码中。这是一个 MWE:
\documentclass{article}
\usepackage{ulem,tikz,amsmath, amssymb,bm,color}
\usepackage[english]{babel}
\usepackage{lipsum}
\usepackage[margin=0cm,nohead]{geometry}
\usetikzlibrary{shapes,arrows}
\usepackage{pgfplots}
\usepackage{wrapfig}
% needed for BB
\usetikzlibrary{calc}
\usetikzlibrary{shapes,arrows}
\tikzstyle{line} = [draw, -latex']
\begin{document}
\lipsum[5]
\begin{wrapfigure}{r}{0.5\textwidth}
\begin{center}
\begin{tikzpicture}[node distance =1.5cm,auto]
% Place nodes
\node [draw,rounded corners] (node1) {a};
\node [draw,rounded corners, below of=node1] (node2) {b};
\node [draw,rounded corners, below of=node2] (node3) {c};
\node [ below of=node3] (Inter1){};
\node [draw,rounded corners, right of=Inter1,node distance =2.5cm] (node4) {d};
\node [draw,rounded corners, right of=node4,node distance =3.5cm] (node5) {d};
\node [draw,rounded corners, left of=Inter1,node distance =2.5cm] (node6) {d};
\node [draw,rounded corners, left of=node6,node distance =3.5cm] (node7) {d};
\node [ below of=node7] (Inter2){};
\node [draw,rounded corners, right of=Inter2] (node8) {d};
\node [draw,rounded corners, left of=Inter2] (node9) {d};
\node [ below of=node8] (Inter3){};
% % Draw edges
\path[line] (node1) -- (node2);
\path [line] (node2) -- (node3);
\path [line] (node3) --++(-90:8mm)-| (node4.north);
\path [line] (node3) --++(-90:8mm)-| (node5.north);
\path [line] (node3) --++(-90:8mm)-| (node6.north);
\path [line] (node3) --++(-90:8mm)-| (node7.north);
\path [line] (node7)--++(-90:8mm)-| (node8.north);
\path [line] (node7) --++(-90:8mm)-| (node9.north);
\end{tikzpicture}\caption{Example graphic made with tikz.}
\end{center}
\end{wrapfigure}
\end{document}
答案1
扩展我在评论中给出的想法,下面的代码显示了一种实现此目的的可能方法:
\documentclass{article}
\usepackage{graphicx}
\usepackage{tikz}
\usepackage[margin=2.5cm,a4paper]{geometry}
\usepackage{lipsum}
\newcommand\smashfigure[1]{%
\marginpar{\llap{%
\includegraphics[width=0.6\textwidth]{#1}
}}
}
\begin{document}
\smashfigure{tree}
\parshape12
0cm 11.2cm
0cm 11.2cm
0cm 11.2cm
0cm 11.2cm
0cm 11.2cm
0cm 11.2cm
0cm 7.2cm
0cm 7.2cm
0cm 6.2cm
0cm 6.2cm
0cm 6.2cm
0cm \textwidth
\lipsum[1]
\end{document}
但是,恕我直言,输出非常丑陋: