편집하다:

편집하다:

내 코드 mwe.tex는 다음과 같습니다

\documentclass{book}

\usepackage{ragged2e}%
\usepackage[pdftex,bookmarks=false,bookmarksopen=false,colorlinks=true,citecolor=blue,linkcolor=blue,urlcolor=blue,breaklinks=true,linktocpage=true,hyperfootnotes=true]{hyperref}%
\usepackage{endnotes}%
\makeatletter
\newbox\endnotebox%
\setbox\endnotebox=\hbox{11}%

\newlength{\enotehangalign}%
\setlength{\enotehangalign}{13\p@}%

\AtBeginDocument{%
\def\enoteformat{%
\def\@makeenmark{\hbox to \wd\endnotebox{\hss{\normalfont\@theenmark}}}%
\rightskip\z@ \leftskip\z@ \parindent=\z@\parskip\z@\def\@textsuperscript{}\hangindent\enotehangalign%
  \leavevmode{\makeenmark\ignorespaces\enskip\ignorespaces}\RaggedRight}%
\def\enoteheading{\section*{Notes}%
}%
\def\enotesize{\fontsize{8}{10}\selectfont}%
}%
\@addtoreset{endnote}{chapter}%
\usepackage{hyperendnote}

\makeatother
\begin{document}

This is for test\endnote{Test}

\clearpage

\theendnotes
\end{document}

hyperendnote.sty로드된 항목 에 대한 정의는 다음과 mwe.tex같습니다.

%%% hyperendnotes.sty
\makeatletter
\newif\ifenotelinks
\newcounter{Hendnote}
% Redefining portions of endnotes-package:
\let\savedhref\href
\let\savedurl\url
\def\endnotemark{%
\@ifnextchar[\@xendnotemark{%
\stepcounter{endnote}%
\protected@xdef\@theenmark{\theendnote}%
\protected@xdef\@theenvalue{\number\c@endnote}%
\@endnotemark
}%
}%
\def\@xendnotemark[#1]{%
\begingroup\c@endnote#1\relax
\unrestored@protected@xdef\@theenmark{\theendnote}%
\unrestored@protected@xdef\@theenvalue{\number\c@endnote}%
\endgroup
\@endnotemark
}%
\def\endnotetext{%
\@ifnextchar[\@xendnotenext{%
\protected@xdef\@theenmark{\theendnote}%
\protected@xdef\@theenvalue{\number\c@endnote}%
\@endnotetext
}%
}%
\def\@xendnotenext[#1]{%
\begingroup
\c@endnote=#1\relax
\unrestored@protected@xdef\@theenmark{\theendnote}%
\unrestored@protected@xdef\@theenvalue{\number\c@endnote}%
\endgroup
\@endnotetext
}%
\def\endnote{%
\@ifnextchar[\@xendnote{%
\stepcounter{endnote}%
\protected@xdef\@theenmark{\theendnote}%
\protected@xdef\@theenvalue{\number\c@endnote}%
\@endnotemark\@endnotetext
}%
}%
\def\@xendnote[#1]{%
\begingroup
\c@endnote=#1\relax
\unrestored@protected@xdef\@theenmark{\theendnote}%
\unrestored@protected@xdef\@theenvalue{\number\c@endnote}%
\show\@theenvalue
\endgroup
\@endnotemark\@endnotetext
}%
\def\@endnotemark{%
\leavevmode
\ifhmode
\edef\@x@sf{\the\spacefactor}\nobreak
\fi
\ifenotelinks
\expandafter\@firstofone
\else
\expandafter\@gobble
\fi
{%
\Hy@raisedlink{%
\hyper@@anchor{Hendnotepage.\@theenvalue}{\empty}%
}%
}%
\hyper@linkstart{link}{Hendnote.\@theenvalue}%
\makeenmark
\hyper@linkend
\ifhmode
\spacefactor\@x@sf
\fi
\relax
}%
\long\def\@endnotetext#1{%
\if@enotesopen
\else
\@openenotes
\fi
\immediate\write\@enotes{%
\@doanenote{\@theenmark}{\@theenvalue}%
}%
\begingroup
\def\next{#1}%
\newlinechar='40
\immediate\write\@enotes{\meaning\next}%
\endgroup
\immediate\write\@enotes{%
\@endanenote
}%
}%
\def\theendnotes{%
\immediate\closeout\@enotes
\global\@enotesopenfalse
\begingroup
\makeatletter
\edef\@tempa{`\string>}%
\ifnum\catcode\@tempa=12
\let\@ResetGT\relax
\else
\edef\@ResetGT{\noexpand\catcode\@tempa=\the\catcode\@tempa}%
\@makeother\>%
\fi
\def\@doanenote##1##2##3>{%
\def\@theenmark{##1}%
\def\@theenvalue{##2}%
\par
\smallskip %<-small vertical gap between endnotes
\begingroup
\def\href{\expandafter\savedhref}%
\def\url{\expandafter\savedurl}%
\@ResetGT
\edef\@currentlabel{\csname p@endnote\endcsname\@theenmark}%
\enoteformat
}%
\def\@endanenote{%
\par\endgroup
}%
% Redefine, how numbers are formatted in the endnotes-section:
\renewcommand*\@makeenmark{%
\hbox{\normalfont\@theenmark~}%
}%
% header of endnotes-section
\enoteheading
% font-size of endnotes
\enotesize
\input{\jobname.ent}%
\endgroup
}%
\def\enoteformat{%
\rightskip\z@
\leftskip1.8em
\parindent\z@
\leavevmode\llap{%
\setcounter{Hendnote}{\@theenvalue}%
\addtocounter{Hendnote}{-1}%
\refstepcounter{Hendnote}%
\ifenotelinks
\expandafter\@secondoftwo
\else
\expandafter\@firstoftwo
\fi
{\@firstofone}%
{\hyperlink{Hendnotepage.\@theenvalue}}%
{\makeenmark}%
}%
}%
% stop redefining portions of endnotes-package:
\makeatother
% Toggle switch in order to turn on/off back-links in the
% endnote-section:
\enotelinkstrue
%\enotelinksfalse

하지만 링크가 endnote작동하지 않습니다. 내가 무엇을 잘못했는지 제안할 수 있는 사람이 있습니까?

그런데: 나에게 다음 코드가 있습니다.hyperendnote.sty그런데: 다음 사람이 질문.

미주 출력에 대한 이미지를 참조하세요. 설정해야 했던 내용은 다음과 같습니다.

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

답변1

41페이지 의 문서를 열면 다음을 hyperref찾을 수 있습니다.

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

그리고 그것은 또한 언급된다이미 연결한 질문에 대한 답변입니다..

그럼에도 불구하고 package를 호출한 후 사용한 코드를 삭제/주석을 추가하면 endnotes결과 pdf에 연결된 각주 1이 표시되고 이를 클릭하면 각주 1이 표시됩니다.

다음 MWE

\begin{filecontents*}{hyperendnote.sty}
%%% hyperendnotes.sty
\makeatletter
\newif\ifenotelinks
\newcounter{Hendnote}
% Redefining portions of endnotes-package:
\let\savedhref\href
\let\savedurl\url
\def\endnotemark{%
\@ifnextchar[\@xendnotemark{%
\stepcounter{endnote}%
\protected@xdef\@theenmark{\theendnote}%
\protected@xdef\@theenvalue{\number\c@endnote}%
\@endnotemark
}%
}%
\def\@xendnotemark[#1]{%
\begingroup\c@endnote#1\relax
\unrestored@protected@xdef\@theenmark{\theendnote}%
\unrestored@protected@xdef\@theenvalue{\number\c@endnote}%
\endgroup
\@endnotemark
}%
\def\endnotetext{%
\@ifnextchar[\@xendnotenext{%
\protected@xdef\@theenmark{\theendnote}%
\protected@xdef\@theenvalue{\number\c@endnote}%
\@endnotetext
}%
}%
\def\@xendnotenext[#1]{%
\begingroup
\c@endnote=#1\relax
\unrestored@protected@xdef\@theenmark{\theendnote}%
\unrestored@protected@xdef\@theenvalue{\number\c@endnote}%
\endgroup
\@endnotetext
}%
\def\endnote{%
\@ifnextchar[\@xendnote{%
\stepcounter{endnote}%
\protected@xdef\@theenmark{\theendnote}%
\protected@xdef\@theenvalue{\number\c@endnote}%
\@endnotemark\@endnotetext
}%
}%
\def\@xendnote[#1]{%
\begingroup
\c@endnote=#1\relax
\unrestored@protected@xdef\@theenmark{\theendnote}%
\unrestored@protected@xdef\@theenvalue{\number\c@endnote}%
\show\@theenvalue
\endgroup
\@endnotemark\@endnotetext
}%
\def\@endnotemark{%
\leavevmode
\ifhmode
\edef\@x@sf{\the\spacefactor}\nobreak
\fi
\ifenotelinks
\expandafter\@firstofone
\else
\expandafter\@gobble
\fi
{%
\Hy@raisedlink{%
\hyper@@anchor{Hendnotepage.\@theenvalue}{\empty}%
}%
}%
\hyper@linkstart{link}{Hendnote.\@theenvalue}%
\makeenmark
\hyper@linkend
\ifhmode
\spacefactor\@x@sf
\fi
\relax
}%
\long\def\@endnotetext#1{%
\if@enotesopen
\else
\@openenotes
\fi
\immediate\write\@enotes{%
\@doanenote{\@theenmark}{\@theenvalue}%
}%
\begingroup
\def\next{#1}%
\newlinechar='40
\immediate\write\@enotes{\meaning\next}%
\endgroup
\immediate\write\@enotes{%
\@endanenote
}%
}%
\def\theendnotes{%
\immediate\closeout\@enotes
\global\@enotesopenfalse
\begingroup
\makeatletter
\edef\@tempa{`\string>}%
\ifnum\catcode\@tempa=12
\let\@ResetGT\relax
\else
\edef\@ResetGT{\noexpand\catcode\@tempa=\the\catcode\@tempa}%
\@makeother\>%
\fi
\def\@doanenote##1##2##3>{%
\def\@theenmark{##1}%
\def\@theenvalue{##2}%
\par
\smallskip %<-small vertical gap between endnotes
\begingroup
\def\href{\expandafter\savedhref}%
\def\url{\expandafter\savedurl}%
\@ResetGT
\edef\@currentlabel{\csname p@endnote\endcsname\@theenmark}%
\enoteformat
}%
\def\@endanenote{%
\par\endgroup
}%
% Redefine, how numbers are formatted in the endnotes-section:
\renewcommand*\@makeenmark{%
\hbox{\normalfont\@theenmark~}%
}%
% header of endnotes-section
\enoteheading
% font-size of endnotes
\enotesize
\input{\jobname.ent}%
\endgroup
}%
\def\enoteformat{%
\rightskip\z@
\leftskip1.8em
\parindent\z@
\leavevmode\llap{%
\setcounter{Hendnote}{\@theenvalue}%
\addtocounter{Hendnote}{-1}%
\refstepcounter{Hendnote}%
\ifenotelinks
\expandafter\@secondoftwo
\else
\expandafter\@firstoftwo
\fi
{\@firstofone}%
{\hyperlink{Hendnotepage.\@theenvalue}}%
{\makeenmark}%
}%
}%
% stop redefining portions of endnotes-package:
\makeatother
% Toggle switch in order to turn on/off back-links in the
% endnote-section:
\enotelinkstrue
%\enotelinksfalse
\end{filecontents*}


\documentclass{book}

\usepackage{ragged2e}
\usepackage[%  
  pdftex,
  bookmarks=false,bookmarksopen=false,
  colorlinks=true,citecolor=blue,linkcolor=blue,urlcolor=blue,
  breaklinks=true,
  linktocpage=true,
  hyperfootnotes=true
]{hyperref}
\usepackage{endnotes}

%\makeatletter
%\newbox\endnotebox%
%\setbox\endnotebox=\hbox{11}%
%
%\newlength{\enotehangalign}%
%\setlength{\enotehangalign}{13\p@}%
%
%\AtBeginDocument{%
  %\def\enoteformat{%
  %\def\@makeenmark{\hbox to \wd\endnotebox{\hss{\normalfont\@theenmark}}}%
  %\rightskip\z@ \leftskip\z@ \parindent=\z@\parskip\z@\def\@textsuperscript{}\hangindent\enotehangalign%
    %\leavevmode{\makeenmark\ignorespaces\enskip\ignorespaces}\RaggedRight}%
  %\def\enoteheading{\section*{Notes}%
  %}%
  %\def\enotesize{\fontsize{8}{10}\selectfont}%
%}%
%\@addtoreset{endnote}{chapter}%
%\makeatother
\usepackage{hyperendnote}


\begin{document}

This is for test\endnote{Test}

\clearpage

\theendnotes
\end{document}

결과 PDF는 다음과 같습니다.

링크가 있는 첫 번째 페이지

빨간색 원 안의 링크를 클릭하면 요청한 대로 2페이지가 표시됩니다.

2 쪽

편집하다:

코드를 추가하면

\chapter{Test 1}
This is for test\endnote{Test}. 
This is for test\endnote{Test 2}. 
This is for test\endnote{Test 3}. 
This is for test\endnote{Test 4}. 
This is for test\endnote{Test 5}. 
This is for test\endnote{Test 6}. 
This is for test\endnote{Test 7 Test 7 Test 7 Test 7 Test 7 Test 7 
  Test 7 Test 7 Test 7 Test 7 Test 7 Test 7 Test 7 Test 7 Test 7 Test 7
  Test 7 Test 7 Test 7 Test 7 Test 7 Test 7 Test 7 Test 7 Test 7 
  Test 7 Test 7 Test 7 Test 7}. 
This is for test\endnote{Test 8}. 
This is for test\endnote{Test 9}. 
This is for test\endnote{Test 10}. 
This is for test\endnote{Test 11}. 

내가 제공한 초기 MWE에는 다른 변경 사항이 없으며 다음과 같은 결과를 얻었습니다. 이는 파란색 링크를 포함하여 귀하의 결과와 동일한 것 같습니다.

결과 미주

관련 정보