在下面的平均能量损失,我试图将附录中的\marginnote
与链接起来\item
。虽然链接确实显示在红色的,它不活跃。如果这个问题解决了,我的下一步将是创建一个返回链接,以便读者可以在文本中来回翻阅。这是一个足以进行构建和调试的片段。我已经阅读了超文本手册中关于和的少量内容,\hyperlink
并且\hypertarget
可以进行编译而不会出现错误——但正如所提到的,到达方向所有这些。其他一切都有效,并且可以轻松地补充到实际工作中。从其他TeX问题,我相信可以自动设置链接,但是他们的需求和我的需求不同,导致我没有一个可行的解决方案。
% arara: xelatex: { shell: true }
% chktex-file 1
\documentclass[twoside,12pt,colorlinks,linkcolor=red]{book}
\usepackage[main=latin, english]{babel}
\usepackage{verse}
\usepackage{xcolor}
\usepackage{bookmark}
\usepackage[fulladjust]{marginnote}
\usepackage{appendix}
\usepackage[columns=1,draft]{typogrid}
\usepackage{hyperref}
\definecolor{prussianblue}{rgb}{0.0, 0.19, 0.33}
\newenvironment{Poem}[1]{
% \numberedparsfalse
\vspace{-0.25in}
\settowidth{\versewidth}{#1}
\begin{em}
\begin{verse}[\versewidth]
}{
\end{verse}
\end{em}
% \numberedparstrue
}
\renewcommand*{\raggedleftmarginnote}{}
\renewcommand*{\raggedrightmarginnote}{}
\renewcommand*{\marginnotevadjust}{3.6pt}
\def\leftVrs{\em\hfill\footnotesize{carmen \Roman{Vrs}}\/}
\def\rightVrs{\em\footnotesize{carmen \Roman{Vrs}}\/}
\newcounter{Vrs}
\setcounter{Vrs}{0}
\newcommand{\Verse}[2]{
\stepcounter{Vrs}
\textcolor{prussianblue}{
\hyperlink{Vrs}{
\marginnote[\leftVrs]{\rightVrs}
}
\begin{Poem}{#1}#2\end{Poem}
}
}
\renewcommand{\appendixtocname}{Appendice}
\renewcommand{\appendixpagename}{Appendice}
\begin{document}
\chapter*{{\em Capvt\/} Primvm}
aliquot carminibus
\Verse{si nonnulla sint intacta,}{%
frange uitra et catilla!\\
\vin cultros tunde, furcas flecte!\\
Bilbo Baggins odit illa\,---\,\\
\vin nunc et cortices incende!\\
textum seca, sebum calca!\\
\vin lactem funde cellae terra!\\
linque in tapeto ossa!\\
\vin uinum sperge super porta!\\
has patellas aestu laua;\\
\vin has contunde magna claua;\\
si nonnulla sint intacta,\\
\vin uolue ea e culina!\\
\vskip 10pt
Bilbo Baggins odit illa!\\
\vin caue! caue! haec catilla!
}
\clearpage
\Verse{trans Montes Nebulae frigore dissitos}{%
trans Montes Nebulae frigore dissitos\\
altas ad latebras et ueteres specus\\
discedamus abhinc, ante oritur dies,\\
quaesitum in magicis auriferis locis.\\
\vskip 5pt
maiores faciunt carmina pristine\\
tinnituque sonant uerbera mallei\\
altis in spatiis quis mala dormiunt\\
effossis domibus sub scopulis iugi.\\
\vskip 5pt
et reges ueteres et Dryadum duces\\
thesauros nitidos et simul aureos\\
fingunt et fabricant, luminaque auferunt\\
quae gemmis tegerent in capulis ibi\\
\vskip 5pt
pendent florea nunc stella monilibus\\
albis, flectitur et uertice regio\\
anguis flammiferus, stamine ferreo\\
nunc nocturna ligant soleque lumina.\\
\vskip 5pt
trans Montes Nebulae frigore dissitos\\
altas ad latebras et ueteres specus\\
discedamus abhinc, ante oritur dies,\\
nostras immemores diuitias cape!\\
\vskip 5pt
caelant pocula nec non citharas sibi\\
auri sedibus in quis habitat nemo,\\
illic illa diu deposita atque ibi\\
inaudita canunt carmina gentibus.\\
\vskip 5pt
pinetisque datis flammibus editis\\
uentosae tenebrae cum gemitu fremunt,\\
diffusis roseis flammibus arduis\\
fulgentes radiant arboreae faces.\\
\vskip 5pt
tintinnat sonitus uallibus aereus,\\
spectantes homines palliduli pauent,\\
serpentis rabies acrior ignibus\\
turres tum spoliat tum fragiles lares.\\
\vskip 5pt
sub luna cineres montibus excidunt,\\
nani percipiunt exitii gradus,\\
aulas effugiunt, exanimes cadunt\\
eius sub pedibus, sidere sub fero.\\
\vskip 5pt
trans Montes Nebulae frigore dissitos\\
altas ad latebras et ueteres specus\\
discedamus abhinc, ante oritur dies,\\
furemur citharas, aurigeros locos.
}
\begin{appendices}
\chapter{carminibus}
\section{Caput I}
\begin{itemize}
\item \hypertarget{1}{\emph{frange uitra et catilla} – rhythmic trochaictrans}
\item \hypertarget{2}{\emph{Montes Nebulae frigore dissitos} – First Asclepiad}
\end{itemize}
\end{appendices}
\end{document}
答案1
首先,\hyperlink
锚点应该是\theVrs
,而不是 Vrs。其次,虽然 的内容\marginnote
出现在边距中,但宏本身是不可见的(像\hbox{}
),这使得几乎不可能定位或单击。
\documentclass[twoside,12pt,colorlinks,linkcolor=red,raiselinks]{book}
\usepackage[main=latin, english]{babel}
\usepackage{verse}
\usepackage{xcolor}
\usepackage{bookmark}
\usepackage[fulladjust]{marginnote}
\usepackage{appendix}
\usepackage[columns=1,draft]{typogrid}
\usepackage{hyperref}
\definecolor{prussianblue}{rgb}{0.0, 0.19, 0.33}
\newenvironment{Poem}[1]{
% \numberedparsfalse
\vspace{-0.25in}
\settowidth{\versewidth}{#1}
\begin{em}
\begin{verse}[\versewidth]
}{
\end{verse}
\end{em}
% \numberedparstrue
}
\renewcommand*{\raggedleftmarginnote}{}
\renewcommand*{\raggedrightmarginnote}{}
\renewcommand*{\marginnotevadjust}{3.6pt}
\def\leftVrs{\hyperlink{to\theVrs}{\em\hfill\footnotesize{carmen \Roman{Vrs}}\/}}
\def\rightVrs{\hyperlink{to\theVrs}{\em\footnotesize{carmen \Roman{Vrs}}\/}}
\newcounter{Vrs}
\setcounter{Vrs}{0}
\newcommand{\Verse}[2]{
\stepcounter{Vrs}
\textcolor{prussianblue}{%
\raisebox{\baselineskip}[0pt]{\hypertarget{from\theVrs}{\strut}}%
\marginnote[\leftVrs]{\rightVrs}
\begin{Poem}{#1}#2\end{Poem}
}
}
\renewcommand{\appendixtocname}{Appendice}
\renewcommand{\appendixpagename}{Appendice}
\begin{document}
\chapter*{{\em Capvt\/} Primvm}
aliquot carminibus
\Verse{si nonnulla sint intacta,}{%
frange uitra et catilla!\\
\vin cultros tunde, furcas flecte!\\
Bilbo Baggins odit illa\,---\,\\
\vin nunc et cortices incende!\\
textum seca, sebum calca!\\
\vin lactem funde cellae terra!\\
linque in tapeto ossa!\\
\vin uinum sperge super porta!\\
has patellas aestu laua;\\
\vin has contunde magna claua;\\
si nonnulla sint intacta,\\
\vin uolue ea e culina!\\
\vskip 10pt
Bilbo Baggins odit illa!\\
\vin caue! caue! haec catilla!
}
\clearpage
\Verse{trans Montes Nebulae frigore dissitos}{%
trans Montes Nebulae frigore dissitos\\
altas ad latebras et ueteres specus\\
discedamus abhinc, ante oritur dies,\\
quaesitum in magicis auriferis locis.\\
\vskip 5pt
maiores faciunt carmina pristine\\
tinnituque sonant uerbera mallei\\
altis in spatiis quis mala dormiunt\\
effossis domibus sub scopulis iugi.\\
\vskip 5pt
et reges ueteres et Dryadum duces\\
thesauros nitidos et simul aureos\\
fingunt et fabricant, luminaque auferunt\\
quae gemmis tegerent in capulis ibi\\
\vskip 5pt
pendent florea nunc stella monilibus\\
albis, flectitur et uertice regio\\
anguis flammiferus, stamine ferreo\\
nunc nocturna ligant soleque lumina.\\
\vskip 5pt
trans Montes Nebulae frigore dissitos\\
altas ad latebras et ueteres specus\\
discedamus abhinc, ante oritur dies,\\
nostras immemores diuitias cape!\\
\vskip 5pt
caelant pocula nec non citharas sibi\\
auri sedibus in quis habitat nemo,\\
illic illa diu deposita atque ibi\\
inaudita canunt carmina gentibus.\\
\vskip 5pt
pinetisque datis flammibus editis\\
uentosae tenebrae cum gemitu fremunt,\\
diffusis roseis flammibus arduis\\
fulgentes radiant arboreae faces.\\
\vskip 5pt
tintinnat sonitus uallibus aereus,\\
spectantes homines palliduli pauent,\\
serpentis rabies acrior ignibus\\
turres tum spoliat tum fragiles lares.\\
\vskip 5pt
sub luna cineres montibus excidunt,\\
nani percipiunt exitii gradus,\\
aulas effugiunt, exanimes cadunt\\
eius sub pedibus, sidere sub fero.\\
\vskip 5pt
trans Montes Nebulae frigore dissitos\\
altas ad latebras et ueteres specus\\
discedamus abhinc, ante oritur dies,\\
furemur citharas, aurigeros locos.
}
\begin{appendices}
\chapter{carminibus}
\section{Caput I}
\begin{itemize}
\item \hypertarget{to1}{\strut}\hyperlink{from1}{\emph{frange uitra et catilla} – rhythmic trochaictrans}
\item \hypertarget{to2}{\strut}\hyperlink{from2}{\emph{Montes Nebulae frigore dissitos} – First Asclepiad}
\end{itemize}
\end{appendices}
\end{document}