href는 클릭 가능한 링크 대신 각주를 생성합니다.

href는 클릭 가능한 링크 대신 각주를 생성합니다.

내 문서에서 hyperref 패키지를 사용하고 있습니다. 웹페이지에 대한 링크를 만들고 싶습니다. 그러나 이렇게 하면 항상 각주가 생성됩니다. 이는 패키지 충돌로 인한 것일 수 있지만 문제를 찾을 수 없습니다.. :(

나는 overleaf를 사용하고 내 프리앰프는 다음과 같습니다.

\documentclass[mainlanguage=english,colophon-location=nowhere,output=paper,localtocs/depth=subsection,version=final]{yathesis}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{kpfonts}

\usepackage{booktabs}

\usepackage{floatrow}
\usepackage{caption}
\usepackage{microtype}
\usepackage{lipsum}
% \usepackage[nospace]{varioref}


\usepackage{float}
\usepackage[hidelinks, hyperfootnotes=false]{hyperref}

\usepackage[capitalise,noabbrev,nameinlink]{cleveref}

\usepackage{siunitx}
\usepackage{physics}
% \usepackage{braket}

% \usepackage{floatrow}

\usepackage{pdfpages}
\usepackage{feynmp-auto}


\usepackage{csquotes}

\usepackage[perpage, symbol*]{footmisc}

\usepackage{autonum}
\cslet{blx@noerroretextools}\empty



\usepackage[backend=biber,style=numeric-comp,bibstyle=nature,arxiv=pdf,sorting=none,eprint=false,isbn=false,backref=true,url=true]{biblatex}

\DeclareFieldFormat{urldate}{}
  \DeclareFieldFormat{url}{\mkbibacro{URL}\addcolon\space\url{\thefield{urlraw}}}

%user commands
\newcommand{\ahdag}{\hat{a}^{\dagger}}
\newcommand{\ah}{\hat{a}}

\newcommand{\chdag}{\hat{c}^{\dagger}}
\newcommand{\ch}{\hat{c}}

\newcommand{\Sh}{\hat{S}}

\newcommand{\Hh}{\hat{H}}

\newcommand{\Psihdag}{\hat{\Psi}^{\dagger}}
\newcommand{\Psih}{\hat{\Psi}}



\newcommand{\sigmah}{\hat{\sigma}}
\newcommand{\hc}{ + \mathrm{H.c.} \, }



\newcommand{\ds}{\chi''(\Delta_{\mathrm{pa}})}
\newcommand{\dsa}{\chi_\mathrm{a}(\Delta_{\mathrm{pa}})}
\newcommand{\RR}{\mathbb{R}}
\newcommand{\renyi}{R\'{e}nyi }

\DeclareSIUnit\bar{bar}
\DeclareSIUnit\gauss{G}
\DeclareSIUnit\angstrom{\text {Å}}
\AtBeginDocument{\RenewCommandCopy\qty\SI}

문제를 일으키는 코드는 다음과 같습니다.

\subsection{Optical Layout}
\label{sec:optically_contacted_optics}
\begin{figure}[H]
    \centering
    \includegraphics[width=14.7cm, page= 1]{corps/ch1/figures/Optics_design_with_beams.pdf}
    \caption{\textbf{Design of Optically-Contacted Cavity-Microscope.} \textbf{a}, Schematic of optics including the main laser beams. The cavity mirror (light gray) and the aspheric lens (dark gray) are optically contacted together. The cavity mode is shown in red. The focused beams at \SI{460}{\nm} and \SI{780}{\nm} are drawn in blue and orange. \textbf{b}, Picture of final assembly. An open-access online 3D model of the cavity is shown in Ref.~\cite{sauerwein_quems_2023}. Click \href{https://sketchfab.com/3d-models/quems-cavity-v2018-45564251b3074b21a4fdbd6cc4cc4feb}{here} for quick access.}
    \label{fig:design_optically_contacted}
\end{figure}

결과는 다음과 같습니다. 여기에 이미지 설명을 입력하세요

또한 클릭 가능한 링크를 만들기 위해 참고문헌에서 href를 사용해야 했습니다. 이렇게 하면 각주도 생성됩니다.

도움을 주셔서 미리 감사드립니다 =)!

답변1

문서 클래스의 코드에는 다음 줄이 있습니다.

\ifbool{YAD@output@paper}{%
  \AddToHook{begindocument/before}{%
    \@ifpackageloaded{hyperref}{%
      \YAD@hypersetup{colorlinks=false}%
      \renewcommand{\YAD@href}[3][]{#3}%
      \let\YAD@ori@footnote\footnote%
      \renewcommand{\footnote}[1]{\booltrue{YAD@in@footnote}\YAD@ori@footnote{#1}\boolfalse{YAD@in@footnote}}%
      \renewcommand*\url[1]{\nolinkurl{#1}}%
      \renewcommand*\href[3][]{%
        \ifbool{YAD@in@footnote}{%
          #3 (\url{#2}) }{%
          #3\footnote{\url{#2}} }%
      }%
    }{%
    }%
  }%
}{%
}%

output=paper, 옵션을 설정하면 URL이 각주로 인쇄됩니다.

그러나 이 옵션은 output=paper문서에서 다른 사항도 설정합니다. 따라서 이 옵션을 사용하고 싶지만 각주에 URL을 인쇄하지 않으려면 머리말에 다음을 입력하면 됩니다.

\makeatletter
\ifbool{YAD@output@paper}{%
  \AddToHook{begindocument/before}{%
    \@ifpackageloaded{hyperref}{%
      \renewcommand*\href[3][]{%
          #3 (\url{#2}) }{%
      }%
    }{%
    }%
  }%
}{%
}%
\makeatother

전체 MWE:

\documentclass[output=paper]{yathesis}
\usepackage[T1]{fontenc}
\usepackage{hyperref}

\makeatletter
\ifbool{YAD@output@paper}{%
  \AddToHook{begindocument/before}{%
    \@ifpackageloaded{hyperref}{%
      \renewcommand*\href[3][]{%
          #3 (\url{#2}) }{%
      }%
    }{%
    }%
  }%
}{%
}%
\makeatother

\begin{document}

click \href{https://tex.stackexchange.com/}{here}

\end{document}

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

관련 정보