![將 biblatex 編輯為特定樣式](https://rvso.com/image/461884/%E5%B0%87%20biblatex%20%E7%B7%A8%E8%BC%AF%E7%82%BA%E7%89%B9%E5%AE%9A%E6%A8%A3%E5%BC%8F.png)
這是我想要實現的風格:
Smith J、Jones M Jr、Houghton L 等人 (1999) 健康保險的未來。新英格蘭醫學雜誌 965:325–329
我還需要兩個我無法弄清楚的更改:
- 刪除期刊名稱後的逗號
- 刪除作者中的 和 並強制所有作者按姓氏首字母排序
我提供我的程式碼:
\documentclass[12pt]{article}
\usepackage[dashed=false,style=authoryear,backend=biber,giveninits=true]{biblatex}
\DeclareNameAlias{default}{last-first}
\renewcommand*{\revsdnamepunct}{}
\renewbibmacro{in:}{%
\ifboolexpr{%
test {\ifentrytype{article}}%
or
test {\ifentrytype{inproceedings}}%
}{}{\printtext{\bibstring{in}\intitlepunct}}%
}
\DeclareFieldFormat
[article,inbook,incollection,inproceedings,patent,thesis,unpublished]
{title}{#1\isdot}
\DeclareFieldFormat{title}{#1}
\DeclareFieldFormat{pages}{:#1}
\DeclareFieldFormat{journaltitle}{#1\isdot}
\renewcommand{\labelnamepunct}{\addspace}
\addbibresource{\jobname.bib}
\begin{filecontents}{\jobname.bib}
@book{Andeweg2011,
title={Puzzles of Government Formation: Coalition Theory and Deviant Cases},
author={Andeweg, Rudy W. and De Winter, Lieven and Dumont, Patrick},
year={2011},
publisher={Taylor \& Francis}
}
@article{ansolabehere2005voting,
title={Voting weights and formateur advantages in the formation of coalition governments},
author={Ansolabehere, Stephen and Snyder Jr., James M. and Strauss, Aaron B. and Ting, Michael M.},
journal={American Journal of Political Science},
volume={49},
number={3},
pages={550--563},
year={2005},
publisher={Wiley Online Library}
}
\end{filecontents}
\begin{document}
\section{Section}
text
\textcite{Andeweg2011, ansolabehere2005voting}
\printbibliography
\end{document}
答案1
我發布解決方案。非常感謝大家
\documentclass[12pt]{article}
\usepackage[dashed=false,style=authoryear,backend=biber,giveninits=true]{biblatex}
\DeclareNameAlias{sortname}{family-given}
\renewcommand*{\revsdnamepunct}{}
\renewbibmacro{in:}{%
\ifboolexpr{%
test {\ifentrytype{article}}%
or
test {\ifentrytype{inproceedings}}%
}{}{\printtext{\bibstring{in}\intitlepunct}}%
}
\DeclareFieldFormat
[article,inbook,incollection,inproceedings,patent,thesis,unpublished]
{title}{#1\isdot}
\DeclareFieldFormat{title}{#1}
\DeclareFieldFormat{pages}{#1}
\renewcommand*{\bibpagespunct}{\addcolon}
\DeclareFieldFormat{journaltitle}{#1\isdot}
\renewcommand{\labelnamepunct}{\addspace}
\renewrobustcmd*{\bibinitperiod}{}
\renewrobustcmd*{\bibinitdelim}{}
\renewrobustcmd*{\bibinithyphendelim}{}
\addbibresource{\jobname.bib}
\DefineBibliographyExtras{english}{%
\renewcommand*{\finalnamedelim}{\addcomma\addspace}%
}
\begin{filecontents}{\jobname.bib}
@book{Andeweg2011,
title={Puzzles of Government Formation: Coalition Theory and Deviant Cases},
author={Andeweg, Rudy W. and De Winter, Lieven and Dumont, Patrick},
year={2011},
publisher={Taylor \& Francis}
}
@article{ansolabehere2005voting,
title={Voting weights and formateur advantages in the formation of coalition governments},
author={Ansolabehere, Stephen and Snyder Jr., James M. and Strauss, Aaron B. and Ting, Michael M.},
journal={American Journal of Political Science},
volume={49},
number={3},
pages={550--563},
year={2005},
publisher={Wiley Online Library}
}
\end{filecontents}
\begin{document}
\section{Section}
text
\textcite{Andeweg2011, ansolabehere2005voting}
\printbibliography
\end{document}