Skip to content

Instantly share code, notes, and snippets.

@whatalnk
Last active September 8, 2016 15:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whatalnk/34a369b6da584ebb23ed0378bbe93745 to your computer and use it in GitHub Desktop.
Save whatalnk/34a369b6da584ebb23ed0378bbe93745 to your computer and use it in GitHub Desktop.
biblatex + biber [latex]
\documentclass[uplatex]{jsarticle}
% biberを使う
% Author-Year スタイル
% 著者を全て(99人まで)et al.せずに出力
% First Nameを頭文字に(?)
\usepackage[backend=biber, style=authoryear, maxbibnames=99, firstinits=true]{biblatex}
% 使うbibtexファイルの場所
\addbibresource{references.bib}
% 不要なfieldを無視
% http://tex.stackexchange.com/questions/133809/ignore-specific-url-fields-in-biber
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map[overwrite=true]{
\step[fieldset = issn, null]
\step[fieldset = month, null]
\step[fieldset = url, null]
}
}
}
% 雑誌名の前の "In: "をやめる
% http://tex.stackexchange.com/questions/10682/suppress-in-biblatex
\renewbibmacro{in:}{}
% タイトルをクオートするの("title")ををやめる
% http://tex.stackexchange.com/questions/94089/remove-quotes-from-inbook-reference-title-with-biblatex
\DeclareFieldFormat[article]{title}{#1}
% Volume.Number となるのを Volume (Number)にする
% http://tex.stackexchange.com/questions/81569/biblatex-parentheses-around-the-volume-number-of-an-article
\renewbibmacro*{volume+number+eid}{%
\printfield{volume}%
\setunit*{\addnbspace}%
\printfield{number}%
\setunit{\addcomma\space}%
\printfield{eid}}
\DeclareFieldFormat[article]{number}{\mkbibparens{#1}}
% DOI: を doi: にする
\DeclareFieldFormat[article]{doi}{doi: #1}
% 雑誌名を斜体(\emph{})しない
\DeclareFieldFormat[article]{journaltitle}{#1}
\begin{document}
% 文中引用(\citet)
\textcite{aaa1990}によると...
% 文末引用(\citep)
...であった\autocite{bbb2001}.
% 引用文献リストを出力
\printbibliography
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment