引用和参考书目问题

引用和参考书目问题

我希望当我引用参考文献时,能够获得这些形式作为链接:

图1

这是文件.tex:

   \documentclass{article}
   \usepackage[style=apa]{biblatex}
   \usepackage[american]{babel}
   \DeclareLanguageMapping{american}{american-apa}
   \usepackage{filecontents}%
   \begin{filecontents*}{apabibli1.bib}
   @article{Sampson1989,
   author = {Sampson, R J and Groves, W B},
   year = {1989},
   title = {Community structure and crime: testing social-disorganization theory},
   volume = {94},
   number = {4},
   journal = {Am J Soc},
   pages = {774}
    }
   @book{Rijsbergen1979,
   author = {Rijsbergen, C V},
   year = {1979},
   title = {Information retrieval},
   address = {London},
   publisher = {Butter Worths}
   }
   \end{filecontents*}

   \addbibresource{apabibli1.bib}

   \renewcommand*{\labelnamepunct}{\addspace}

   \usepackage{xpatch}

   \xpatchbibmacro{author}
   {%
    \newunit\newblock
   }
  {%
  \setunit{\addspace}\newblock
  }{}{}

  \xpatchbibmacro{name:apa:last-first}
  {%
   \addcomma\addlowpenspace\mkbibnamefirst{#3}\isdot
   }
  {%
  \addlowpenspace\mkbibnamefirst{#3}\isdot
  }{}{}

  \renewbibmacro*{journal+issuetitle}{%
  \usebibmacro{journal}%
  \setunit*{\addspace\thinspace}%
  \iffieldundef{series}
   {}
   {\newunit
  \printfield{series}
  \setunit{\addspace}}%
  \printfield{volume}%
  \printfield{number}%
  \setunit{\addspace}\newblock
  \usebibmacro{issuename}%
  \newunit}

  \AtBeginBibliography{\renewcommand*{\finalnamedelim}{%
  \ifthenelse{\value{listcount}>\maxprtauth}
   {}
   {\ifthenelse{\value{liststop}>2}
     {\addcomma\space}%
     {\addcomma\space}}}}

  \renewcommand\bibinitperiod{}
  \renewcommand\bibinitdelim{}
  \renewcommand\bibpagespunct{\addcolon\space}
  \DeclareFieldFormat{journaltitle}{#1}
  \DeclareFieldFormat[article]{volume}{\apanum{#1}}
   \usepackage{floatrow}
   \usepackage{hyperref}
   \hypersetup{
   colorlinks   = true,
   citecolor    = blue,
   linkcolor = blue
  }
  \begin{document}
  ~\cite{Sampson1989,Rijsbergen1979}
  ~\cite{Sampson1989}
  \printbibliography
 \end{document} 

另一个问题是,我希望在显示书籍类型的参考文献时,书籍的标题不会像文章的标题那样用斜体显示。并且参考文献不会以点结尾。提前谢谢您。

答案1

像那样吗(除了彩色链接)?

\documentclass{article}
\usepackage[style=apa]{biblatex}
\usepackage[american]{babel}
\DeclareLanguageMapping{american}{american-apa}
\usepackage{filecontents}%
\begin{filecontents*}{apabibli1.bib}
@article{Sampson1989,
author = {Sampson, R J and Groves, W B},
year = {1989},
title = {Community structure and crime: testing social-disorganization theory},
volume = {94},
number = {4},
journal = {Am J Soc},
pages = {774}
}
@book{Rijsbergen1979,
author = {Rijsbergen, C V},
year = {1979},
title = {Information retrieval},
address = {London},
publisher = {Butter Worths}
}
\end{filecontents*}

\addbibresource{apabibli1.bib}

\renewcommand*{\labelnamepunct}{\addspace}

\usepackage{xpatch}

\xpatchbibmacro{author}
{%
\newunit\newblock
}
{%
\setunit{\addspace}\newblock
}{}{}

\xpatchbibmacro{name:apa:last-first}
{%
\addcomma\addlowpenspace\mkbibnamefirst{#3}\isdot
}
{%
\addlowpenspace\mkbibnamefirst{#3}\isdot
}{}{}

\renewbibmacro*{journal+issuetitle}{%
\usebibmacro{journal}%
\setunit*{\addspace\thinspace}%
\iffieldundef{series}
{}
{\newunit
\printfield{series}
\setunit{\addspace}}%
\printfield{volume}%
\printfield{number}%
\setunit{\addspace}\newblock
\usebibmacro{issuename}%
\newunit}

\AtBeginBibliography{\renewcommand*{\finalnamedelim}{%
\ifthenelse{\value{listcount}>\maxprtauth}
{}
{\ifthenelse{\value{liststop}>2}
 {\addcomma\space}%
 {\addcomma\space}}}}

\renewcommand\bibinitperiod{}
\renewcommand\bibinitdelim{}
\renewcommand\bibpagespunct{\addcolon\space}
\DeclareFieldFormat{journaltitle}{#1}
\DeclareFieldFormat[article]{volume}{\apanum{#1}}
\usepackage{floatrow}
\usepackage{hyperref}
\hypersetup{
colorlinks = true,
citecolor = blue,
linkcolor = blue
}

\DeclareFieldFormat{title}{\iffieldequalstr{titleisdescription}{true}{\mkbibbrackets{#1}}{#1\isdot}}
\renewcommand*{\finentrypunct}{\relax}

\begin{document}
~\cite{Sampson1989, Rijsbergen1979}
~\cite{Sampson1989}
\printbibliography
\end{document} 

在此处输入图片描述

相关内容