Как сделать цветную связанную нумерацию страниц прилагаемых документов?

Как сделать цветную связанную нумерацию страниц прилагаемых документов?

Я пытаюсь понять последнюю часть ответа,Интерфейс ключ-значениенумерация страниц в темеКак сгенерировать оглавление с помощью пользовательских меток в начале прикрепленных документов? Я хотел бы сделать номер страницы красным и сделать ссылку на него, вернуться на первую страницу документа (например, ToC). Я думаю,fancypagestyle это не оптимально здесь в темеКак пометить все номера страниц как оглавление в красивом нижнем колонтитуле? Мое предложение, но я уверен, как применить их к христианамИнтерфейс ключ-значениенумерация страниц

  • \usepackage{xcolor}так{\color{red} pagenumber}
  • со ссылкой на ToC, следующий псевдокод, но не уверен, как сделать внутренний здесь

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

Соответствующая часть кодекса Кристиана

% 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

ОС: 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}

введите описание изображения здесь

Связанный контент