引用文献に URL を追加する APA BiblaTex

引用文献に URL を追加する APA BiblaTex

URLのあるすべてのソースの脚注の引用にURLを追加する必要があります。脚注は次のようになります。1つのそしてbMWE 出力で次のものを見つけました:style=authortitle-icomp を使用して脚注に URL フィールドを追加します。しかし、受け入れられた解決策は私には機能せず、適切に機能するように変更することもできません (MWE でコメントしました)。

私はbiblatex、biber、APAスタイル、イタリア語を使用しています。Sharelatex.comで編集しています。

MWE:

\documentclass{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}    
\usepackage[italian]{babel}
\usepackage[babel]{csquotes}
\usepackage[style=apa,backend=biber]{biblatex}         
\DeclareLanguageMapping{italian}{italian-apa}

\defbibfilter{online}{
    type=online
}

\defbibfilter{offline}{
    type=book or
    type=article or
    type=report
}

%\renewbibmacro*{cite:title}{%
%\printtext[bibhyperref]{\printfield[citetitle]{labeltitle}
%\iffieldundef{url}{}{\nametitledelim\printfield{url}}}}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}

@online{cit1,
  title = {Title},
  url = {http://www.website.com},
  timestamp = {2013-04-11T17:20:44Z},
  titleaddon = {Example},
  urldate = {2013-04-10},
  date = {2004}
}

@report{cit2,
  author = {BBBAuthor, Name},
  title = {Title Title Title},
  url = {http://www.example.com},
  timestamp = {2013-04-11T17:20:44Z},
  titleaddon = {Website Name},
  urldate = {2013-04-10},
  date = {2004}
}

@book{cit3,
  location = {Location},
  title = {Title Title},
  timestamp = {2016-02-01T21:50:03Z},
  langid = {english},
  publisher = {Publisher},
  author = {Author, Name},
  date = {2001}
}

\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}

\begin{minipage}{\textwidth}

Bla bla\footnote{\cite[]{cit1}, \url{http://www.website.com}}.
Bla\footnote{\cite[]{cit2}, \url{http://www.example.com}}.
BLA BLA\footcite[]{cit1}
Blaaa blaa bla\footcite[]{cit3}.

\printbibliography[heading=bibintoc,filter=offline,title={Bibliography}] 
\printbibliography[title={Online},filter=online,heading=subbibliography]

\end{minipage}

\end{document}

出力:

出力

答え1

引用コマンドを変更する必要があるため、解決策はスタイルに大きく依存し、biblatex-apaの引用マクロは標準のものとはかなり異なりますauthortitle。これが、あなたの試みがうまくいかなかった理由です。

citeここでマクロを直接変更するのがおそらく最も簡単です(変更することもできますcite:plabelyear+extrayearが、他のコマンドに干渉する可能性があります)

\makeatletter
\renewbibmacro*{cite}{%
  \iffieldequals{namehash}{\cbx@lasthash}
% Multiple cites in one command
   {\setunit{\compcitedelim}%
    \usebibmacro{cite:plabelyear+extrayear}}%
% Single cite
   {\ifthenelse{\ifnameundef{labelname}\OR\iffieldequalstr{entrytype}{patent}}
% No author/editor
     {\usebibmacro{cite:noname}%
       \setunit{\nameyeardelim}%
       \usebibmacro{cite:plabelyear+extrayear}%
       \savefield{namehash}{\cbx@lasthash}}
% Normal cite
     {\ifnameundef{shortauthor}
        {\printnames[labelname][-\value{listtotal}]{labelname}}%
        {\cbx@apa@ifnamesaved
          {\printnames{shortauthor}}
          {\printnames[labelname][-\value{listtotal}]{author}\addspace\printnames[sabrackets]{shortauthor}}}%
      \setunit{\nameyeardelim}%
      \usebibmacro{cite:plabelyear+extrayear}%
      \savefield{namehash}{\cbx@lasthash}}}%
   \setunit{\addcomma\space}%<-- this is new
   \printfield[citeurl]{url}%<--- and so is this
   \setunit{\multicitedelim}}
\makeatother

は、 の定義のコピーで、apa.cbx末尾に 2 行が追加されています。

ムウェ

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}    
\usepackage[italian]{babel}
\usepackage[babel]{csquotes}
\usepackage[style=apa,backend=biber]{biblatex}         
\DeclareLanguageMapping{italian}{italian-apa}

%\renewbibmacro*{cite:title}{%
%\printtext[bibhyperref]{\printfield[citetitle]{labeltitle}
%\iffieldundef{url}{}{\nametitledelim\printfield{url}}}}

\makeatletter
\renewbibmacro*{cite}{%
  \iffieldequals{namehash}{\cbx@lasthash}
% Multiple cites in one command
   {\setunit{\compcitedelim}%
    \usebibmacro{cite:plabelyear+extrayear}}%
% Single cite
   {\ifthenelse{\ifnameundef{labelname}\OR\iffieldequalstr{entrytype}{patent}}
% No author/editor
     {\usebibmacro{cite:noname}%
       \setunit{\nameyeardelim}%
       \usebibmacro{cite:plabelyear+extrayear}%
       \savefield{namehash}{\cbx@lasthash}}
% Normal cite
     {\ifnameundef{shortauthor}
        {\printnames[labelname][-\value{listtotal}]{labelname}}%
        {\cbx@apa@ifnamesaved
          {\printnames{shortauthor}}
          {\printnames[labelname][-\value{listtotal}]{author}\addspace\printnames[sabrackets]{shortauthor}}}%
      \setunit{\nameyeardelim}%
      \usebibmacro{cite:plabelyear+extrayear}%
      \savefield{namehash}{\cbx@lasthash}}}%
   \setunit{\addcomma\space}%<-- this is new
   \printfield[citeurl]{url}%<--- and so is this
   \setunit{\multicitedelim}}
\makeatother

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@online{cit1,
  title = {Title},
  url = {http://www.website.com},
  titleaddon = {Example},
  urldate = {2013-04-10},
  date = {2004}
}

@report{cit2,
  author = {BBBAuthor, Name},
  title = {Title Title Title},
  url = {http://www.example.com},
  titleaddon = {Website Name},
  urldate = {2013-04-10},
  date = {2004}
}

@book{cit3,
  location = {Location},
  title = {Title Title},
  langid = {english},
  publisher = {Publisher},
  author = {Author, Name},
  date = {2001}
}

\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
Bla bla\footcite[]{cit1}.
Bla\footcite[]{cit2}
BLA BLA\footcite[]{cit1}
Blaaa blaa bla\footcite[]{cit3}.

\printbibliography[heading=bibintoc,nottype=online,title={Bibliography}] 
\printbibliography[title={Online},type=online,heading=subbibliography]
\end{document}

出力例

関連情報