
A4 페이지 중앙에 가로 모드로 tikzpicture를 배치하고 싶습니다. 그러나 오류 가 발생하고 첫 번째 페이지가 비어 있으므로 \textwidth
및 명령을 사용할 수 없습니다 . 어딘가에 작은 여백이나 들여쓰기가 있는 것 같은데요?\textheight
overfull \hbox...
overfull \vbox...
나는 다음을 살펴보았다.커플~의스레드여기에 있지만 지금까지는 아무것도 작동하지 않았습니다. MWE:
\documentclass[a4paper,landscape]{minimal}
\usepackage[margin=1cm]{geometry}
\usepackage{tikz}
\begin{document}
\begin{center}
\begin{tikzpicture}
\draw (0, 0) rectangle (0.999\textwidth,0.999\textheight);
% this will give "overfull \hbox..." or "overfull \vbox..." errors
% and create an empty first page
% \draw (0, 0) rectangle (\textwidth,\textheight);
\end{tikzpicture}
\end{center}
\end{document}
감사합니다!
답변1
환영! 선 너비를 고려해야 합니다. (프랙탈에서 제안한 대로 기사로 전환했습니다.) 각 끝에서 경계 상자가 만큼 증가하므로 \pgflinewidth/2
이를 수정해야 합니다.
\documentclass{article}
\usepackage[margin=1cm]{geometry}
\usepackage{tikz}
\begin{document}
%\begin{center} %<- not needed
\noindent\begin{tikzpicture}
\draw (0, 0) rectangle (\textwidth-\pgflinewidth,\textheight-\pgflinewidth);
\end{tikzpicture}
%\end{center}
\end{document}