
다음 MWE를 고려하십시오.
% to rebuild:
% rm test-testplot.pdf ; pdflatex -shell-escape test.tex
\RequirePackage{filecontents}
\begin{filecontents*}{testplot.tikz}
\begin{tikzpicture}
\begin{axis}[
width=500pt,
height=195pt,
clip=true,
axis x line=middle,
axis y line=middle,
]
\end{axis}
\end{tikzpicture}
\end{filecontents*}
\documentclass[11pt]{book}
\usepackage[
paperwidth=15cm,
paperheight=20cm,
outer=2.5cm,
inner=2.5cm,
top=2.5cm,
bottom=2.5cm
]{geometry}
\usepackage[a4,cam,center]{crop}
\usepackage{tikz,pgfplots,adjustbox,lipsum}
\usetikzlibrary{external}
\tikzexternalize[] %activate!
\begin{document}
\lipsum[1]
\tikzsetnextfilename{\tikzexternalrealjob-testplot}
\begin{figure}[!ht]
\begin{adjustbox}{width=\textwidth}%
\input{./testplot.tikz}
\end{adjustbox}
\caption{Just trying to insert a plot picture here}
\label{fig:test}
\end{figure}
\end{document}
tikz
결과는 약간 이상합니다. 실제 페이지 상단의 자르기 표시가 pgfplots
! 자세히 살펴보기(PDF 뷰어에서 해당 영역 주변을 선택, 전체 해상도를 보려면 클릭):
crop
... 패키지 서명도 숨겨져 있지만 캡처된 것으로 나타났습니다 . 외부화된 PDF를 포함한 전체 페이지가 오른쪽에 표시됩니다.
이번에 내가 무엇을 잘못했으며, 자르기 표시를 캡처하지 않고 이 tikz pgfplot을 어떻게 외부화할 수 있습니까? (말할 필요도 없이, 기본 문서에서 외부화가 이루어지길 원하므로 모든 페이지 크기, 글꼴 등의 변경 사항이 고려됩니다.)
편집: 나는 동일한 문서에서 다른 여러 tikz 이미지와 함께 tikz 외부화를 사용하고 있지만(그러나 사용하지 않음 pgfplots
) 내가 볼 수 있는 한 그들에게는 아무런 문제가 없었습니다... 하지만 다시 해야 할 수도 있습니다 -확인하다
답변1
다음을 사용하여 이미지를 생성할 때 자르기 로드를 억제합니다 \tikzifexternalizing
. (오래된 사진을 삭제하거나 강제로 재생성하는 것을 잊지 마세요)
\documentclass[11pt]{book}
\usepackage[
paperwidth=15cm,
paperheight=20cm,
outer=2.5cm,
inner=2.5cm,
top=2.5cm,
bottom=2.5cm
]{geometry}
\usepackage{tikz,pgfplots,adjustbox,lipsum}
\usetikzlibrary{external}
\tikzexternalize[] %activate!
\tikzifexternalizing{}{\usepackage[a4,cam,center]{crop}}
\begin{document}
\lipsum[1]
\tikzsetnextfilename{\tikzexternalrealjob-testplot}
\begin{figure}[!ht]
\begin{adjustbox}{width=\textwidth}%
\input{./testplot.tikz}
\end{adjustbox}
\caption{Just trying to insert a plot picture here}
\label{fig:test}
\end{figure}
\end{document}