첨부된 문서의 링크된 페이지 번호를 컬러로 지정하는 방법은 무엇입니까?

첨부된 문서의 링크된 페이지 번호를 컬러로 지정하는 방법은 무엇입니까?

답변의 마지막 부분을 이해하려고 노력하고 있습니다.키-값 인터페이스스레드의 페이지 번호 매기기첨부된 문서의 시작 부분에 사용자 정의 라벨로 목차를 생성하는 방법은 무엇입니까? 페이지 번호를 빨간색으로 채색하고 문서의 첫 번째 페이지(예: ToC)로 돌아가는 링크를 만들고 싶습니다. 내 생각에 fancypagestyle여기 스레드에서는 최적이 아닌 것 같습니다.멋진 바닥글에서 모든 페이지 번호를 TOC에 레이블을 지정하는 방법은 무엇입니까? 내 제안이지만 이를 기독교인의 제안에 적용하는 방법은 확실합니다.키-값 인터페이스님의 페이지 번호 매기기

  • \usepackage{xcolor}그래서{\color{red} pagenumber}
  • 다음 의사 코드인 ToC에 대한 링크가 있지만 여기에서 내부 의사 코드를 만드는 방법을 모르겠습니다.

    \href{some-how-link-to-1st-page-of-document}{{\color{red} pagenumber}}
    

Christian 코드의 관련 부분

% https://tex.stackexchange.com/a/365580/13173
\usepackage{pdfpages}
\usepackage{hyperref} % for links in TOC
% https://tex.stackexchange.com/q/56316/13173
\usepackage{fancyhdr}
\renewcommand{\headrulewidth}{0pt} % Werner, remove top margin border
% https://tex.stackexchange.com/a/338919/13173
\usepackage{letltxmacro}

\makeatletter
\LetLtxMacro\pdfpages@@includepdf\includepdf

\RenewDocumentCommand{\includepdf}{O{}mo}{%
  \begingroup
  \IfValueTF{#3}{% Is there a 3rd argument? Yes
    % Process the keys for the \includepdf first in order to get the value of 'pages=...' option
    % This is stored to \AM@pagestemp (see pdfpages.sty)
    \setkeys{pdfpages}{#1}%
    \SetupPdfInclude{label={label#2\AM@pagestemp},page={\AM@pagestemp}, heading={#2},#3}
    % Call the old command with the options for addtotoc
    \pdfpages@@includepdf[pagecommand={\thispagestyle{fancy}},addtotoc={\retrieveoption{page},\retrieveoption{section},\retrieveoption{level},\retrieveoption{heading},\retrieveoption{label}},#1]{#2}
  }{% No, no 3rd. argument}
    \pdfpages@@includepdf[pagecommand={\thispagestyle{fancy}},#1]{#2}
  }%
  \endgroup% Prevent leaking of key values to the next call of the command
}
\makeatother

OS: Debian 8.7
하드웨어: Asus Zenbook UX303UB

답변1

시도해 보세요 \hypersetup{linkcolor}{red}\hyperlink{mytoc\jobname}{\thepage}}( red어쨌든 링크의 기본 색상은 입니다)`

그룹 내에서 발생하므로 \hypersetup로컬 그룹 이외의 외부로 유출되지 않습니다.

\documentclass{article}
\usepackage{blindtext}
\usepackage{fancyhdr}
\usepackage{xcolor}
\usepackage[colorlinks]{hyperref} % for links in TOC
\renewcommand{\headrulewidth}{0pt} 

\fancypagestyle{plain}{%
  \fancyhf{}
  \fancyfoot[L]{\hypersetup{linkcolor=blue}\hyperlink{docstart\jobname}{First page}}
  \fancyfoot[C]{\hypersetup{linkcolor=red}\hyperlink{mytoc\jobname}{\thepage}}
}

\begin{document}
\pagestyle{plain}
\phantomsection
\hypertarget{docstart\jobname}{}
\blindtext[10]
\phantomsection
\hypertarget{mytoc\jobname}{}
\tableofcontents
\clearpage


\section{Beginning Foo}
\blindtext[10]

\end{document}

페이지 스타일 사용 fancy:

\documentclass{article}
\usepackage{blindtext}
\usepackage{fancyhdr}
\usepackage{xcolor}
\usepackage[colorlinks]{hyperref} % for links in TOC
\renewcommand{\headrulewidth}{0pt} 

% Now for fancy pagestyle
\fancyhf{}
\fancyfoot[L]{\hypersetup{linkcolor=blue}\hyperlink{docstart\jobname}{First page}}
\fancyfoot[C]{\hypersetup{linkcolor=red}\hyperlink{mytoc\jobname}{\thepage}}

\begin{document}
\pagestyle{fancy}
\phantomsection
\hypertarget{docstart\jobname}{}
\blindtext[10]
\phantomsection
\hypertarget{mytoc\jobname}{}
\tableofcontents
\clearpage


\section{Beginning Foo}
\blindtext[10]

\end{document}

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

관련 정보