pdf 頁面大小與 `standalone` + `tikz`

pdf 頁面大小與 `standalone` + `tikz`

我製作了一張標準尺寸的簡單名片。然而,當我打開 pdf 時,它變大了 1.5 毫米(高度和寬度)。我嘗試更改geometry設定但無濟於事。

\documentclass[tikz]{standalone}
%\usepackage[margin=0pt,paperwidth=80mm,paperheight=50mm,pass,noheadfoot]{geometry}
\usepackage{tikzpagenodes}
\usetikzlibrary{arrows.meta,shapes.geometric,shadows,shadings}
\usepackage{xcolor-material}
\usepackage{graphicx}
\usepackage{fontspec}
\setmainfont{Alegreya}

\tikzstyle{linha} = [line width=7pt,MaterialGrey300]
\tikzstyle{linhafina} = [line width=3pt,MaterialGrey300]
\tikzstyle{bola} = [inner sep=0pt,minimum size=0pt]
% yes, I know \tikzstyle is oudated, it's just easier to type.

\colorlet{cinza}{MaterialGrey300}


\pagestyle{empty}


\begin{document}
\begin{tikzpicture}
[every node/.append style={text=MaterialGrey800, 
%   font=\Huge
},
\node[opacity=.6,overlay,inner sep=0pt] (figura) 
%at (current page.center) 
{\includegraphics[width=8cm,height=5cm]{example-image-a}};  
\draw[line width=4pt,MaterialRed900%,fill=MaterialGrey300
%rounded corners=12pt
] (figura.south west) rectangle (figura.north east);
\node[yshift=1.5cm] (texto) at (figura.center)
 {\itshape \LARGE John Doe};
\node[below= 3pt of texto,overlay] (prof) {\scshape \large o\,r\,i\,o\,n};
\node[xshift=6pt,yshift=6pt,
align=left,anchor=south west,fill=white,opacity=.5,
text opacity=1,
rectangle,draw,rounded corners=2pt] (address) at (figura.south west) {\small Contact:\\e-mail: --- \\ website};
\end{tikzpicture}
\end{document}

一切都很好,但是當我在 Acrobat Reader 中打開 pdf 時,尺寸稍大(1.5 毫米):

在此輸入影像描述

答案1

首先你是如何編譯這個檔案的?它有本質性的錯誤。您忘記關閉環境[前面tikzpicture。而且你還沒指定這個節點\node[opacity=.6,overlay,inner sep=0pt] (figura)應該在哪裡?您尚未指定您正在使用Laulatex!!最終輸出大小為29.8 mm * 19.8 mm1.17*0.78 in

在此輸入影像描述

相關內容