Перекрестные ссылки на 2 вида концевых сносок (разделенные и с разноцветными цифрами)

Перекрестные ссылки на 2 вида концевых сносок (разделенные и с разноцветными цифрами)

Вначале я использовал примечания и концевые сноски, чтобы различать два отдельных вида концевых сносок:


\documentclass{article}

\usepackage{changepage} % \begin{adjustwidth}{...cm}{...cm}

\usepackage[colorlinks=true,linkcolor=red]{hyperref} % colors endnotes red --- for hyperlinks --- hyperref permits use of color{blue}{...}
\usepackage{endnotes} % \endnote{...}
\input{hyperendnotes.sty} % LOADS (needs \usepackage{hyperref}) hyperendnotes.sty; which can be downloaded at
% https://github.com/bibliogum/latexamu/blob/master/hyperendnotes.sty

\def\enoteheading{} % endnotes without standard heading

\usepackage[breakwithin, roman]{parnotes} % parnotes

\makeatletter % needed for \renewcommand{...} and \patchcmd{...}
\renewcommand{\parnotemarkfmt}[1]{{{\color{blue}\PN@mark@set{#1}\hspace{0.5mm}}}} % color parnotes blue --- tweaks spacing --- adjusts size of parnotes to look like hyperendnotes (part 1)
\usepackage{etoolbox} % \patchcmd{...}
\patchcmd{\PN@parnote@real}
  {\parnotemarkfmt{PN@t}}
  {\textsuperscript{\hspace{1.23mm}\parnotemarkfmt{PN@t}\hspace{-0.67mm}}}
  {}{} % <<< adjusts size of parnotes to look like hyperendnotes (part 2) --- thanks a lot for this part @egreg; at
% https://tex.stackexchange.com/questions/219000/a-question-about-using-a-renewcommand-to-adapt-a-package/219007#219007
\makeatother % needed for \renewcommand{...} and \patchcmd{...}

\begin{document}

\noindent Some text \parnote{A parnote} \parnote{Another parnote} \endnote{An endnote} \parnote{Another parnote} \endnote{Another endnote} \endnote{Another endnote} \endnote{Another endnote} \parnote{Another parnote} \parnote{Another parnote} \parnote{Another parnote} \parnote{Another parnote} \endnote{Another endnote} \parnote{Another parnote} \endnote{Another endnote} \endnote{Another endnote} \endnote{Another endnote} \endnote{Another endnote} \endnote{Another endnote} \parnote{Another parnote} \endnote{Another endnote} \parnote{Another parnote} \parnote{Another parnote} \par
\noindent \textbf{Parnotes}
\parnotes
\textbf{Endnotes} \par
\begin{adjustwidth}{2.49mm}{0cm}
\theendnotes
\end{adjustwidth}

\end{document}

Поэтому онибылиразделены и «помечены» просто отлично (даже когда 2 «вида» концевых сносок переплетены).

Но затемне сделалполучить перекрестные ссылки (кликабельные ссылки) на примечаниях ...

Загрузка hyperendnotes.styпомещает кликабельные перекрестные ссылки только на \endnote{...}, но не на \parnote{...}.


Так что пользователь @cfr намекнул на enotez-package. Я нашел, по крайней мере, проще, так как не требуется больше \usepackage{enotez}загружать дополнительное .hyperendnotes.sty

Во втором испытании я использовал только концевые сноски (я отказался от дополнительных сносок, так как не смог добавить в них активные гиперссылки).


Во втором испытании я использовал только концевые сноски (я отказался от дополнительных сносок, так как не смог добавить в них активные гиперссылки).

  • Внимание: этот второй «серый ящик» пробного кода требует двойной компиляции (из-за enotez-package).

\documentclass{article}

\usepackage{enotez}
\DeclareInstance{enotez-list}{section}{paragraph}{heading={}}
\setenotez{backref=true, list-style=section, reset, split-title=\noindent}

\usepackage{hyperref}
\hypersetup{colorlinks=true}
\usepackage{biblatex}

\begin{document}

\hypersetup{linkcolor=red}

Som text here \endnote{Endnote}. \par
Some more text \endnote{Endnote} before the first call of \colorbox{gray!20}{\textbackslash printendnotes}. 

\vspace{1em} \textbf{A first person's endnotes} \printendnotes \vspace{1em}

\setenotez{counter-format={roman}} \hypersetup{linkcolor=blue}

See? I can get clickable endnotes in two different colours, which is what I wanted. \endnote{Endnote}. \par {\large{But the problem is that ALL of the endnotes (of a certain colour) have to be grouped together and originate before the first \colorbox{gray!20}{\textbackslash printendnotes} and before ALL of the other endnotes (of another colour): there is no freedom to use the endnotes "interwoven", unfortunately.}} \endnote{Endnote}.


\vspace{1em} \textbf{A second person's endnotes} \printendnotes \vspace{2em}

\setenotez{counter-format={arabic}} \hypersetup{linkcolor=red}

You can get both footnote sections to truly follow each-other at the end of the document \endnote{Endnote} (which is what i wanted), by using a lot of \colorbox{gray!20}{\textbackslash vspace}'s (see the .tex-code below this line). But having to constantly adjust the \colorbox{gray!20}{\textbackslash vspace}'s doesn't seem very elegant at all. \endnote{Endnote}

\vspace{8.2em}% extra \vspace{...} to group the endnote sections together at the end of the .pdf

\vspace{1em} \textbf{A first person's endnotes} \printendnotes \vspace{1em}

\setenotez{counter-format={roman}} \hypersetup{linkcolor=blue}

\vspace{-15em}% extra \vspace{...} to group the endnote sections together at the end of the .pdf

See?\endnote{Endnote} Now the the sections are really together \endnote{Endnote} at the very end of the document. \par However: the {\large{origins of the two different types of endnotes still have to be grouped together, and cannot get interwoven, unfortunately.}}

\vspace{8em}% extra \vspace{...} to group the endnote sections together at the end of the .pdf

\vspace{1em} \textbf{A second person's endnotes} \printendnotes \vspace{1em}

\end{document}

Сейчасявляетсяперекрестные ссылки (кликабельные ссылки) на всех примечаниях!

Но разные виды концевых сносокбольше не может бытьпереплетены.

Нет способа правильно кодировать различные «типы» концевых сносок таким образом (без парсносок). Если бы они были «переплетены», то два «типа» не были бы пронумерованы и размещены отдельно внизу документа.


Итак, вкратце. Любой из следующих вариантов мог бы решить мою проблему.

Или:

  • получение перекрестных ссылок на parnotes.

Или (при работе с перекрестными сносками):

  • обозначьте «тип(-концевой сноски)» (чтобы иметь отдельную нумерацию, цвет и, возможно, цифры) и напечатайте их отдельно.

Я начал задаваться вопросом, можно ли предложить решениенетиспользовать стандартные примечания, концевые сноски или сноски вообще? Но просто иметь другие кодовые метки для различения двух типов "примечаний", добавить какой-нибудь верхний индекс, нумерацию, раскраску (для "поддельных" концевых сносок). А затем печатать их отдельно? Возможно (в крайнем случае) с biblatex?

Полагаю, что эта «подделка» или «автономное определение сносок» была сделана на немецком сайте контроля качества texwelt:здесьилиздесь. Ниже я выложу английскую (немного адаптированную) версию:

\documentclass{article} 
\usepackage{xcolor}

%%%%%%%%%%%

\newcommand\newnotestype[2]{%
\newcounter{#1note}%
\expandafter\newwrite\csname the#1notes\endcsname
\expandafter\immediate\expandafter\openout\csname
the#1notes\endcsname=\jobname.#1\relax %
\expandafter\newcommand\csname  #1note\endcsname[1]{%
\stepcounter{#1note}%
{%
\tiny\textsuperscript\expandafter\textcolor{#2}{{%
\raisebox{1ex}{\hbox{\kern-0.0em\csname
the#1note\endcsname\kern-0.0em}}}}%
\expandafter\immediate\expandafter\write\csname the#1notes\endcsname%
{\csname the#1note\endcsname\ \unexpanded{##1 \par}}%
}}%

\expandafter\newcommand\csname display#1notes\endcsname[1]{%
\vspace{1\baselineskip}%
\expandafter\immediate\expandafter\closeout%
\csname the#1notes\endcsname%
\par\tiny\expandafter\textcolor{#2}{\textbf{##1}}\par%
\input\jobname.#1%
}}%

%%%%%%%%%%%

\newnotestype{first}{red}
\newnotestype{second}{blue}

%%%%%%%%%%%

\begin{document}

This is the test-text \firstnote{Endnote} \secondnote{Endnote} , some more \firstnote{Endnote} test-text, some more  \secondnote{Endnote} test-text \secondnote{Endnote}. 

%%%%%%%%%%%

\displayfirstnotes{A first person's endnotes}
\displaysecondnotes{A second person's endnotes}

\end{document}

Теперь различные виды концевых сносоквозможнолегко маркируются и переплетаются снова.

Но опять же естьбольше не надоперекрестные ссылки (кликабельные ссылки) налюбойсносок.

Этот простой способ \usepackage{hyperref}больше не работает, поскольку сноски на самом деле не являются «сносками»: они «подделаны», чтобы выглядеть таковыми.

Так знает ли кто-нибудь элегантное решение для создания перекрестных ссылок (кликабельных ссылок) на эти «объекты»?

Еще один вопрос:

  • Этот последний (третий) эксперимент также окрашивает заголовки сносок, нонетномера концевых сносок (по крайней мере, не там, где они напечатаны). Если бы кто-нибудь мог сделать цветную нумерацию концевых сносок, это было бы хорошо.
  • Также: сюда, тудабольше никогдакажется, это простой способ перейти от арабских цифр к римским (в целом и в частности для одного «типа» концевой сноски)?

Большое спасибо.

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