TikZ 图片无法打印

TikZ 图片无法打印

添加使用 TikZ 制作的图形时,在某些情况下似乎无法打印图形。对我来说,我目前无法找出导致此问题的确切情况。

作为最小的例子,当我使用pdflatex编译时

\documentclass{scrartcl}

\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{graphicx}

\usepackage{tikz}
\usetikzlibrary{shapes,arrows}

\title{Test}

\begin{document}

\begin{figure}
\centering
\begin{tikzpicture}[activity/.style={line width = 1pt, draw, shape = rectangle, rounded corners, minimum width=2.5cm}]
   \node[activity] (master) at (1, 0){master}; 
  \end{tikzpicture}
  \caption{Test}
\end{figure}

test

\end{document}

主节点按预期打印,但如果我%在测试前面添加,pdf 就只包含,,

一个更现实的例子是

\documentclass{scrartcl}

\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{graphicx}

\usepackage{tikz}
\usetikzlibrary{shapes,arrows}
\usetikzlibrary{fit,positioning}
\usetikzlibrary{shapes,arrows}
\tikzstyle{line} = [draw, rounded corners, -latex']


\title{Test}

\begin{document}

\section{Test section}

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.   

Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet,

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.   

\begin{figure}
\centering
\begin{tikzpicture}[activity/.style={line width = 1pt, draw, shape = rectangle, rounded corners, minimum width=2.5cm}]
 
  \node[activity] (a) at (1, 0){a};
  \node[activity, below left= 0.5cm and -1.0cm of a]  (b) {b};
  \node[activity, below right = 0.5cm  and -1.0cm of a] (c) {c};
  \node[activity, below = 1.5cm of a] (d) {d};
  
  \node[activity, left=2cm of a, minimum height=4cm] (e) {
       Test e
   };
   
   \node[activity, right=2cm of e, minimum height=3cm] (f) {
       Test f
   };
   
   \node[activity, below=of f, minimum height=3cm] (g) {
       Test g
   };
   
   
  \end{tikzpicture}
\caption{Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat}
\label{fig:branches}
\end{figure}

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.  

\end{document}

在图片后添加大量文字(3 段)可解决此问题。日志中有Overfull \vbox (11.0pt too high) has occurred while \output is active [3],因此,过大的数字可能是警告的原因(什么是未满的水平盒子和垂直盒子以及如何去除它们?)。目前我看到的唯一解决方法是改变图形的位置或添加\newpage,这暂时解决了这个问题,但不能创建好的文档。

这是一个已知问题吗/是否有一些解决方法或方法可以进一步追踪此行为?

我的版本是:

pdfTeX 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian)
kpathsea version 6.3.1
Copyright 2019 Han The Thanh (pdfTeX) et al.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Han The Thanh (pdfTeX) et al.
Compiled with libpng 1.6.37; using libpng 1.6.37
Compiled with zlib 1.2.11; using zlib 1.2.11
Compiled with xpdf version 4.01

相关内容