如何自定义引用样式和参考文献?

如何自定义引用样式和参考文献?

我有三个问题:

  • 如何删除脚注中的括号?

  • 如何编辑参考信息以显示作者/机构的全名?(已解决)

  • 如何在 footcite 和 bibliography 中将引用显示为“[1]作者,书籍”?我尝试过 \setcitestyle{square},但出现错误。

谢谢

\documentclass[12pt]{article}
\usepackage[english]{babel}
\usepackage[a4paper, text={16.5cm, 25.2cm}, centering]{geometry}
\usepackage[sfdefault]{ClearSans}
\usepackage[utf8]{inputenc}
\setlength{\parskip}{1.2ex}
\setlength{\parindent}{0em}
\usepackage{filecontents}
\usepackage[backend=bibtex,
        style=authortitle-comp,
        natbib=true, 
        ]{biblatex}
\begin{filecontents}{\jobname.bib}
\documentclass[12pt]{article}
\usepackage[english]{babel}
\usepackage[a4paper, text={16.5cm, 25.2cm}, centering]{geometry}
\usepackage[sfdefault]{ClearSans}
\usepackage[utf8]{inputenc}
\usepackage{hyperref}
\usepackage{xcolor}
\hypersetup{
colorlinks,
linkcolor={black},
citecolor={blue!50!black},
}
\setlength{\parskip}{1.2ex}
\setlength{\parindent}{0em}
\usepackage{filecontents}
\usepackage[backend=bibtex,
        style=authortitle-comp,
        natbib=true, 
        ]{biblatex}
\begin{filecontents}{\jobname.bib}
@Electronic{unintentional,
Title                    = {Accidents or Unintentional Injuries},
Author                   = {National Center for Health Statistics},
Note                     = {[Accessed on August 10, 2016]. Available on:\textcolor{blue}{http://www.cdc.gov/nchs/fastats/accidental-injury.htm}}
}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
here is just a test . \footnote{\label{note1}\footcite{unintentional}}

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

\begin{document}
here is just a test . \footnote{\label{note1}\footcite{unintentional}}
\printbibliography
\end{document}

答案1

示例代码有问题(例如 two \documentclass)。修复此问题后,问题仍然存在,因为biblatex尝试拆分组织名称美国国家卫生统计中心author字段中输入 firstname 和 lastname。您可以使用额外的括号来避免这种情况:

\documentclass[12pt]{article}
\usepackage[english]{babel}
\usepackage[a4paper, text={16.5cm, 25.2cm}, centering]{geometry}
\usepackage[sfdefault]{ClearSans}
\usepackage[utf8]{inputenc}
\usepackage{hyperref}
\usepackage{xcolor}
\hypersetup{
colorlinks,
linkcolor={black},
citecolor={blue!50!black},
}
\setlength{\parskip}{1.2ex}
\setlength{\parindent}{0em}
\usepackage{filecontents}
\usepackage[backend=bibtex,
        style=authortitle-comp,
        natbib=true, 
        ]{biblatex}
\begin{filecontents}{\jobname.bib}
@Electronic{unintentional,
Title                    = {Accidents or Unintentional Injuries},
Author                   = {{National Center for Health Statistics}},
Note                     = {[Accessed on August 10, 2016]. Available on:\textcolor{blue}{http://www.cdc.gov/nchs/fastats/accidental-injury.htm}}
}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
here is just a test. \footcite{unintentional}

\printbibliography
\end{document}

顺便说一句:\footcite不是用来在内部使用的\footnote,而是本身就是一种脚注。

一般来说我建议使用biber而不是bibtexbiblatex需要新功能biber。是时候改变了。

要获取括号中带有数字的引用,您可以使用 样式numericbiblatex\footcite在这种情况下不会显示作者和标题。奥黛丽已经显示如何定义这样的脚引文命令

\documentclass[12pt]{article}
\usepackage[english]{babel}
\usepackage[a4paper, text={16.5cm, 25.2cm}, centering]{geometry}
\usepackage[sfdefault]{ClearSans}
\usepackage[utf8]{inputenc}
\usepackage{xcolor}
\usepackage{parskip}% Much better than:
% \setlength{\parskip}{1.2ex}
% \setlength{\parindent}{0em}
\usepackage{filecontents}
\usepackage[backend=bibtex,
        style=numeric,
        natbib=true, 
        ]{biblatex}
\usepackage{hyperref}% Generally last package loaded
\hypersetup{
colorlinks,
linkcolor={black},
citecolor={blue!50!black},
}
\begin{filecontents}{\jobname.bib}
@Electronic{unintentional,
Title                    = {Accidents or Unintentional Injuries},
Author                   = {{National Center for Health Statistics}},
URL                      = {http://www.cdc.gov/nchs/fastats/accidental-injury.htm},
urldate                  = {2016-08-10},
}
\end{filecontents}
% Define new \footcite like command with number and author
\DeclareCiteCommand{\footpartcite}[\mkbibfootnote]
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \mkbibbrackets{\usebibmacro{cite}}%
   \setunit{\addnbspace}
   \printnames{labelname}%
   \setunit{\labelnamepunct}
   \printfield[citetitle]{title}%
   \newunit
   \printfield{year}}
  {\addsemicolon\space}
  {\usebibmacro{postnote}}

\DeclareMultiCiteCommand{\footpartcites}[\mkbibfootnote]{\footpartcite}{\addsemicolon\space}

\addbibresource{\jobname.bib}

\begin{document}
here is just a test. \footpartcite{unintentional}

\printbibliography
\end{document}

这将产生:

参考

脚注

注意,我还将Note字段替换为URLurldate。请参阅biblatex手动的有关这些内容以及如何自定义 URL 日期输出的更多信息。

如果您需要类似的 cite 命令,它本身不会创建脚注,但可以在内部\footnote或其他地方使用而不创建脚注,只需使用相同的定义而不使用可选参数\mkbibfootnote

\DeclareCiteCommand{\partcite}
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \mkbibbrackets{\usebibmacro{cite}}%
   \setunit{\addnbspace}
   \printnames{labelname}%
   \setunit{\labelnamepunct}
   \printfield[citetitle]{title}%
   \newunit
   \printfield{year}}
  {\addsemicolon\space}
  {\usebibmacro{postnote}}
\DeclareMultiCiteCommand{\partcites}{\partcite}{\addsemicolon\space}

通过这个你可以使用:

Test: \footnote{\label{ftn:unintentional}\partcite{unintentional}}

See footnote \ref{ftn:unintentional}.

创建带有标签的脚注。

请阅读所用命令的文档,\DeclareCiteCommandbiblatex手动的有关创建新的引用命令的更多信息。

相关内容