preview
加载包时,tikzpicture/figure
我试图隔离的环境设置得太高,导致图像顶部被切断。(这与“附加问题”部分的行为类似代码忽略除列表环境和部分之外的所有内容tikzpicture
,所以我不认为它与或figure
环境或选项直接相关floats
。)
但是,当我preview
使用该选项加载包时tightpage
,一切都会正常进行(只要我事先papersize
使用得足够大geometry
,正如在这个答案)。我希望能够将所有图形放在一个共同的页面大小上,所以tightpage
在这种情况下这并不是我真正想要的。
什么原因preview
导致内容放置不正确以及有效地修剪顶部?
preview
版本 11.87,发布日期 2010/02/14
梅威瑟:
\documentclass[]{article}
\usepackage[a3paper,landscape]{geometry} % Make paper super big, fixes tightpage option cutting off right of image
% This works okay now with tightpage option set once papersize is made bigger
%\usepackage[active,floats,delayed,tightpage,pdftex]{preview}
% Without tightpage, this form still cuts off the *top* of the image
\usepackage[active,floats,delayed,pdftex]{preview}
% Define a few styles for use in making the figures
\usepackage{tikz}
\usetikzlibrary{shadows,arrows,positioning}
\tikzstyle{block}=[
draw, fill=blue!80!black!20,
anchor=north,
text width=13.0em, text centered,
minimum height=1.5em,drop shadow]
\tikzstyle{flowline}=[
draw, very thick,
color=black, -latex,
font=\tt]
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}[]
% Nodes
\path node (p1) [block] {Flowchart Block Text};
\path (p1.south)+(0,-1.5) node (p2) [block] {Flowchart Block Text};
\path (p2.south)+(0,-1.5) node (p3) [block] {Flowchart Block Text};
\path (p3.south)+(0,-1.5) node (p4) [block] {Flowchart Block Text};
% Connectors
\path [flowline] (p1.south) -- node [right,align=left] {Flow Label} (p2);
\path [flowline] (p2.south) -- node [right] {Flow Label} (p3);
\path [flowline] (p3.south) -- node [right] {Flow Label} (p4);
% Alternate Start
\node (p1alt) [block,left=of p1,text width=10em] {Flowchart Block Text};
\path [flowline, dashed] (p1alt.south) |- node {} (p2.west);
% Optional Output
\node (next) [block,right=of p4,text width=10em] {Flowchart Block Text};
\path [flowline, dashed] (p4.east) -- node {} (next.west);
\end{tikzpicture}%
\label{workflow}%
\end{figure}%
\end{document}
答案1
我不知道为什么会发生这种情况,但这个选项baseline=0
似乎tikzpicture
可以解决问题:
无baseline=0
选择项:
带baseline=0
选项: