1페이지보다 긴 TOC가 다음 페이지의 Tikz 절대 위치 지정을 방해합니다.

1페이지보다 긴 TOC가 다음 페이지의 Tikz 절대 위치 지정을 방해합니다.

두 페이지 이상에 목차가 있으면 PDF의 나머지 부분에 대한 tikz 위치 지정이 손상되는 문제가 있습니다. 예:

여기에 이미지 설명을 입력하세요

헤더는 일반적으로 페이지 상단에 위치하는 페이지 하단으로 이동되었습니다.

이제 코드를 살펴보겠습니다. 다음과 같이 헤더를 페이지에 로드합니다.

\begin{document}

    \input{graphics/pagestyle/titlepage.tex}
    \pagecolor{none}
    \newpage

    \AddToShipoutPicture{\BackgroundPic}

    \tableofcontents

\BackgroundPic은 다음과 같이 정의됩니다.

\usepackage{kpfonts}
\usepackage[explicit]{titlesec}
\newcommand*\headerbg{
  {\begin{tikzpicture}[remember picture,overlay]
    \node[yshift=-3cm] at (current page.north west)
      {\begin{tikzpicture}[remember picture, overlay]
        \draw[fill=WLEBlue1] (0,0) rectangle
          (\paperwidth,3cm);
          \node (label) at (10,1.5){
            \includegraphics[width=660pt]{graphics/pagestyle/header_bg.png}
          };
          \node (label) at (1.4,1.5){
            \includegraphics[width=60pt]{graphics/pagestyle/WLE_Logo.png}
          };
       \end{tikzpicture}
      };
   \end{tikzpicture}
  }
  }

\usepackage{eso-pic}
\newcommand\BackgroundPic{
\headerbg
\put(0,0){
\parbox[b][\paperheight]{\paperwidth}{%
\vfill
\centering
\begin{tikzpicture}[remember picture,overlay]
    \node at (-10,12.5)
      {\begin{tikzpicture}[remember picture, overlay]
            \draw [WLEBlue1, fill=WLEBlue1] (0,0) -- (0.05,0) -- (0.05,-22.2) -- (0.25,-22.2) -- (0.25, -23) -- (0, -23);
       \end{tikzpicture}
      };
\end{tikzpicture}
\begin{tikzpicture}[remember picture,overlay]
\node at (8.5,12.5)
      {\begin{tikzpicture}[remember picture, overlay]
            \draw [WLEBlue1, fill=WLEBlue1] (-1, -23) -- (0, -23) -- (0, -22) -- (-0.08, -22) -- (-0.08, -22.92) -- (-1, -22.92);
       \end{tikzpicture}
      };
\end{tikzpicture}
\vfill
}}}
        \newpage

TOC의 길이가 1페이지에 불과할 때는 완전히 잘 작동하지만 2페이지에서는 버그가 발생합니다. 어떤 도움이라도 대단히 감사하겠습니다! 미리 감사드립니다.

업데이트:이 내용은 얼마 전에 댓글로 게시되었지만 더 많은 가시성을 위해 여기로 옮기기로 결정했습니다.여기문제를 보여주는 ShareLatex의 온라인 버전입니다. 거기에서 몇 가지 예제 코드를 보고 편집하고 직접 컴파일할 수 있습니다.

업데이트:TikzPictures의 중첩을 제거하려고 시도했지만 도움이 되지 않았습니다. 중첩된 그림이 없는 코드:

\newcommand*\headerbg{
    \begin{tikzpicture}[overlay]
        \node(base) at (current page.north west) {};
        \node at ($(base)+(9.1,0.7)$){
            \includegraphics[width=660pt]{header_bg.png}
        };
        \node at ($(base)+(0.5,0.7)$){
            \includegraphics[width=60pt]{WLE_Logo.png}
        };
    \end{tikzpicture}
}

업데이트:문제를 일으키는 것은 챕터 스타일입니다. 챕터 스타일을 제거하면 문제도 제거됩니다.

\newcommand*\chapterlabel{}
\titleformat{\chapter}
  {\gdef\chapterlabel{}
   \normalfont\sffamily\Huge\bfseries\scshape}
  {\gdef\chapterlabel{\thechapter\ }}{0pt}
  {\begin{tikzpicture}[remember picture,overlay]
    \node at (0,0)
      {\begin{tikzpicture}[remember picture, overlay]
        \draw[WLEBlue2, fill=WLEBlue2] (0,0) rectangle
          (\textwidth,1cm);
        \node[
            inner xsep=1ex,
            text width=\linewidth-2*\pgfkeysvalueof{/pgf/inner xsep},
            align=left] at (9,0.5)
              {\color{white}\chapterlabel#1};
       \end{tikzpicture}
      };
   \end{tikzpicture}
  }

답변1

문제가 챕터 스타일에 있었습니다. 나는사진 기억해문제를 해결한 것으로 보이는 tikzpictures의 옵션입니다. 나는 그 이유를 완전히 확신하지 못한다.사진 기억해옵션을 선택하면 이 문제가 발생합니다.

\newcommand*\chapterlabel{}
\titleformat{\chapter}
  {\gdef\chapterlabel{}
   \normalfont\sffamily\Huge\bfseries\scshape}
  {\gdef\chapterlabel{\thechapter\ }}{0pt}
  {\begin{tikzpicture}[overlay]
    \node at (0,0)
      {\begin{tikzpicture}[overlay]
        \draw[WLEBlue2, fill=WLEBlue2] (0,0) rectangle
          (\textwidth,1cm);
        \node[
            inner xsep=1ex,
            text width=\linewidth-2*\pgfkeysvalueof{/pgf/inner xsep},
            align=left] at (9,0.5)
              {\color{white}\chapterlabel#1};
       \end{tikzpicture}
      };
   \end{tikzpicture}
  }

관련 정보