文字中流动的图形

文字中流动的图形

我试图在幻灯片上绘制一个图形 G=,并在其下方和上方写一些文字,但该图形在其自己的页面上(并且该页面比正常页面小得多)

如何获取文本中的图形流?

我的文件:

   % Drawing a graph using the PG 3.0 graphdrawing library
   % Author: Mark Wibrow
   \documentclass[tikz,border=10pt]{standalone}
   %%%<
   \usepackage{verbatim}
   %%%>

   \usetikzlibrary{graphdrawing}
   \usetikzlibrary{graphs}
   \usegdlibrary{trees}

   \begin{document}

   hekejehjejhjkhejkhhjke
   \begin{tikzpicture}[>=stealth, every node/.style={circle, draw, minimum      size=0.75cm}]
   \graph [tree layout, grow=down, fresh nodes, level distance=0.5in, sibling distance=0.5in]
    {
        A -> {
          B -> { A -> {C}, C -> {D} ,D },
          C -> { A, B -> {C  ,D} },
          D -> { C }
        }
    };

\end{tikzpicture}

ijklsjjkkjdkljkjl

\end{document}

编译 lualatex filename.tex

答案1

使用LuaLaTeXbecause of运行graphdrawing并将 改为\documentclass类似的东西article(fpast 也建议如此)。standalone例如, 旨在用于单张图片,而不是连续的文本。

\documentclass{article}
\usepackage{tikz}
\usepackage{verbatim}
\usetikzlibrary{graphdrawing}
\usetikzlibrary{graphs}
\usegdlibrary{trees}

\begin{document}

Some text above.

\begin{tikzpicture}[>=stealth, every node/.style={circle, draw, minimum      size=0.75cm}]
   \graph [tree layout, grow=down, fresh nodes, level distance=0.5in, sibling distance=0.5in]
    {
        A -> {
          B -> { A -> {C}, C -> {D} ,D },
          C -> { A, B -> {C  ,D} },
          D -> { C }
        }
    };
\end{tikzpicture}

Some other text below.

\end{document}

结果:

在此处输入图片描述

相关内容