\cite에서 @ONLINE의 URL을 인쇄하려면 어떻게 해야 하나요?

\cite에서 @ONLINE의 URL을 인쇄하려면 어떻게 해야 하나요?

{readon}나는 섹션 끝 부분에서 읽을 수 있는 추가 기사와 웹 사이트를 제공하기 위해 사용자 정의 환경을 사용합니다 . 이 목록에 있는 항목 \cite의 URL도 인쇄하도록 어떻게 변경할 수 있습니까 ?@ONLINE

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

\documentclass{scrbook}

\usepackage[style=authortitle]{biblatex}
\addbibresource{\jobname.bib}

\usepackage{lipsum}

\begin{filecontents}{\jobname.bib}
   @Online{penalties,
     author  = {David Carlisle},
     title   = {What are penalties and which ones are defined?},
     date    = {2012-04-09},
     url     = {https://tex.stackexchange.com/a/51264/4918},
     urldate = {2017-06-28},
   }
   @Book{texbytopic,
     author  = {Eijkhout, Victor},
     title   = {\TeX{} by Topic},
     address = {Berlin},
     year    = {2014},
   }
\end{filecontents}

\newenvironment{readon}{%
   \par\bigskip\noindent
   \footnotesize
   \textbf{Further reading \dots}
   \begin{itemize}
}{
   \end{itemize}
}

\begin{document}

\lipsum[1-3]

\begin{readon}
   \item \cite[155\psqq]{texbytopic}
   \item \cite{penalties} [[add URL here]]
\end{readon}

\printbibliography

\end{document}

답변1

@online항목 의 URL을 인쇄하도록 인용 매크로를 수정할 수 있습니다.

\renewbibmacro*{cite}{%
  \iffieldundef{shorthand}
    {\ifnameundef{labelname}
       {}
       {\printnames{labelname}%
        \setunit{\printdelim{nametitledelim}}}%
     \usebibmacro{cite:title}}%
    {\usebibmacro{cite:shorthand}}%
  \usebibmacro{cite:url}}

\newbibmacro{cite:url}{%
  \ifentrytype{online}
    {\setunit{\addspace}%
     \printfield{url}}
    {}}

이는 bibmacro를 수정하므로 cite솔루션은 스타일에 따라 다르지만 authoryear일반적인 아이디어는 모든 스타일에 적용될 수 있습니다.

답변2

와 함께

\usepackage[style=authortitle]{biblatex}
\addbibresource{\jobname.bib}
\DeclareFieldFormat{citeurl}{\ifentrytype{online}{[\url{#1}]}{}}

그런 다음

\begin{readon}
    \item \cite[155\psqq]{texbytopic} \citeurl{texbytopic}
    \item \cite{penalties} \citeurl{penalties}
\end{readon}

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

관련 정보