iTranslated by AI
[Zotero + BibLaTeX] Automating Citation Styles for Academic Reports with Mixed Japanese and English References (Practical Guide)
Introduction: Why Customize Your Bibliography Style?
With the widespread adoption of LuaLaTeX—which is Unicode-native and makes font configuration straightforward—bibliography management is shifting away from the legacy pBibTeX toward the more powerful BibLaTeX + Biber combination. However, while BibLaTeX is extremely powerful, its default optimization for "Japanese scientific paper styles" is insufficient. On the other hand, the former standard, junsrt (pBibTeX), handles Japanese perfectly but does not play well with Unicode.
In this article, we will implement a style file (.sty) that uses the modern LuaLaTeX + BibLaTeX configuration and automatically switches display formats using language detection (langid).
This time, I created a simple and orthodox style that complies with ISO 690 (an international standard for citing) and the Vancouver system (frequently used in scientific fields). Additionally, I have created a style file that adheres to the submission guidelines of the Physical Society of Japan. Please feel free to use it.
Acknowledgments
In creating the .sty files introduced in this article, I was greatly inspired by the methods presented in Ryoushin's article, LaTeX Templates for Writing Papers in Japanese. While the original article provided general-purpose settings for humanities and social science papers, I customized the files based on Ryoushin's work, focusing on a standard and as-simple-as-possible approach for the natural sciences. I would like to express my deepest gratitude to Ryoushin for sharing such wonderful insights.
What You Can Do: Generate Natural Bibliography Lists Based on Language
You can switch formats automatically based on the language, as shown below:
-
English literature
\rightarrow Smith J, Doe A.(Initial notation, half-width comma + half-width period) -
Japanese literature
\rightarrow 田中 太郎,鈴木 次郎.(Surname-Given name, full-width comma + full-width period)
The actual compiled result looks like this. By using full-width periods and full-width commas for Japanese literature, you can produce natural spacing.

I will introduce a method to achieve this "without having to manually edit the data imported from Zotero".
Execution Environment
- PC: MacBook Air (M1, 2020)
- OS: macOS Sequoia 15.6
- Editor: VS Code + LaTeX Workshop
- TeX Distribution: TeX Live 2025 (LuaLaTeX)
- Zotero: Version 7.0
Execution Steps
Step 0: Collecting Proper Data in Zotero
Since this style file automatically switches between English and Japanese formats by looking at the "Language (Langid)" field in the .bib file, Zotero must successfully retrieve this information. Importing from the following databases using the Zotero Connector will correctly reflect language information.
| Type of Literature | Recommended Source | URL / Search Method |
|---|---|---|
| English Paper | Each Journal Official Site | Nature, Science, Elsevier, Wiley, etc. |
| Japanese Paper | J-STAGE | jstage.jst.go.jp |
| Japanese Book | CiNii Books | ci.nii.ac.jp/books |
| English Book | WorldCat | worldcat.org |
After importing, confirm that en or english is written in the language field for English literature in Zotero. The values in the language field and the applied results are as follows:
-
If
enorenglish:
English format (for Western books and English papers) is applied. -
If
ja,japanese, or empty:
Japanese format (for Japanese books and Japanese papers) is applied.
Based on my personal experience, Japanese papers often do not have a value in the language field compared to English papers, so I have decided on the style application logic this way.
Step 1. Installing the .sty File
Copy the .sty file provided below, or download it from GitHub, to structure your directory as follows:
[Click to expand] mybibstyle.sty code
% mybibstyle.sty
% --------------------------------------------------
% BibLaTeX Style Definition File
% --------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{mybibstyle}[2025/01/01 My Custom BibLaTeX Settings]
% ==================================================
% Settings code starts here
% ==================================================
\RequirePackage[
backend=biber,
style=numeric,
minbibnames=999,
maxbibnames=999,
uniquelist=false,
sorting=none,
defernumbers=true,
labelnumber=true
]{biblatex}
% Language mapping
\DeclareLanguageMapping{japanese}{english}
% Surname-Given name order settings
\DeclareNameAlias{sortname}{family-given}
\DeclareNameAlias{default}{family-given}
% Author name display format
% Japanese: Surname Givenname (space separated)
% English: Surname, Given Initial (Einstein, A.)
\DeclareNameFormat{default}{%
% 1. Display name
\iffieldequalstr{langid}{english}
{\namepartfamily\space\namepartgiveni}%
{\namepartfamily\space\namepartgiven}%
\ifnumequal{\value{listcount}}{\value{liststop}}
{} % Do nothing if it's the last author
{% Add separator if it's not the last author
\iffieldequalstr{langid}{english}
{\addcomma\space} % [English] half-width comma + space
{,}% % [Japanese] full-width comma (no space)
}%
}
% Multiple citation delimiter (comma in [1, 2])
\DeclareDelimFormat{multicitedelim}{\addcomma\space}
% --------------------------------------------------
% 3. Display Format
% --------------------------------------------------
\DeclareFieldFormat[article]{title}{#1}
\DeclareFieldFormat[book]{title}{#1}
\DeclareFieldFormat{journaltitle}{#1}
\DeclareFieldFormat[article,book]{pages}{#1} % Page number display format
\renewbibmacro{in:}{}
%========-Macros for volume, number, and electronic journal ID display format-==========
\DeclareFieldFormat[article]{volume}{#1} % Volume
\DeclareFieldFormat[article]{number}{(#1)} % Number in parentheses
\renewbibmacro*{volume+number+eid}{%
\printfield{volume}%
\printfield{number}%
}
%======Article======================================
\DeclareBibliographyDriver{article}{%
\printnames{author}%
\setunit{\adddot\addspace}
\printfield[title]{title}
\iffieldequalstr{langid}{english}
{\setunit{\adddot\space}}% English: half-width period + space
{\setunit{.}}% Japanese: full-width period
% --- Journal Title ---
\printfield[journaltitle]{journaltitle}%
\iffieldequalstr{langid}{english}
{\setunit{\adddot\space}}% English: half-width period + space
{\setunit{.}}% Japanese: full-width period
\printfield{year}%
\setunit{\addsemicolon\space}% half-width semicolon
\usebibmacro{volume+number+eid}%
\setunit{\addcolon\space}
\printfield{pages}%
\usebibmacro{finentry}%
}
%=======Book======================================
\DeclareBibliographyDriver{book}{%
\printnames{author}%
\setunit{\adddot\addspace}% Period between author name and book title
% --- Book Title ---
\printfield[title]{title}%
% --- Check: Is it English? ---
\iffieldequalstr{langid}{english}
{\setunit{\adddot\space}}% English: half-width period + space
{\setunit{.}}% Japanese: full-width period
\printfield{edition}%
\iffieldequalstr{langid}{english}
{\addcomma\space}
{\setunit{,}}
% --- Publisher ---
\printlist{publisher}%
% --- Check: Is it English? ---
\iffieldequalstr{langid}{english}
{\setunit{\addsemicolon\space}}% English: half-width semicolon + space
{\setunit{;}}% Japanese: full-width semicolon
% --- Publication Year ---
\printfield{year}
\usebibmacro{finentry}
}
project-root/
├── main.tex # Thesis body
├── mybibstyle.sty # ★Style definition file created this time
└── references.bib # Bibliography database
Step 2. Compiling
Set up your preamble as shown below and compile it to create a bibliography that automatically switches formats based on the language.
\documentclass[a4paper]{article}
\usepackage{luatexja}
\usepackage{mybibstyle}
\addbibresource{references.bib}
\title{Title}
\author{Name}
\date{\today}
\begin{document}
\maketitle
Content
\printbibliography[title={References}]
\end{document}
Advanced: Customizing for the Journal of the Physical Society of Japan
Depending on the field, you may not be satisfied with this citation format. Here, I will briefly introduce how to customize it to common bibliographic standards. Simply replace the relevant sections with the commands below.
% Make journal titles Italic
\DeclareFieldFormat{journaltitle}{\mkbibemph{#1}}
\DeclareFieldFormat[book]{title}{\mkbibemph{#1}} % Make book titles Italic as well
% Make Volume Bold
\DeclareFieldFormat[article]{volume}{\textbf{#1}}
% Enclose Year in parentheses → (2024)
\DeclareFieldFormat{year}{(#1)}
Continuing with these customizations allows you to adapt to different rules even if the field varies slightly. Below is the .sty file that follows the JPSJ Submission Guidelines. While it does not fulfill all detailed rules, such as using abbreviations for journal titles, the results are generally consistent.
[Click to expand] myphys.sty code
% myphys.sty
% --------------------------------------------------
% JPSJ (Physical Society of Japan) Style Customization
% --------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{myphys}[2025/01/01 JPSJ Style Settings]
% 1. Basic Settings
\RequirePackage[
backend=biber,
style=numeric,
sorting=none,
maxbibnames=999,
minbibnames=1,
defernumbers=true,
labelnumber=true
]{biblatex}
% Language mapping
\DeclareLanguageMapping{japanese}{english}
% 2. Author Name Format (Key Part)
\DeclareNameAlias{default}{family-given}
\DeclareNameAlias{sortname}{family-given}
\DeclareNameFormat{default}{%
% --- Language check ---
\iffieldequalstr{langid}{english}
{% === For English literature ===
% Display up to 3 authors, truncate at 3 if there are 4 or more
\ifnumgreater{\value{listtotal}}{3}
{\ifnumgreater{\value{listcount}}{1}
{} % Do nothing for 4th author onwards (do not display)
{\namepartfamily\space\namepartgiveni}% Surname + Given Initial
}
{\namepartfamily\space\namepartgiveni}% Display as is if 3 or less
% --- Process separators and et al. ---
\ifnumgreater{\value{listtotal}}{3}
{% For 4 or more
\ifnumequal{\value{listcount}}{1}
{\space et al.,} % et al. after the first author
{\ifnumequal{\value{listcount}}{\value{listtotal}}{}{\addcomma\space}}% Comma otherwise
}
{% For 3 or less
\ifnumequal{\value{listcount}}{\value{listtotal}}
{}
{\addcomma\space}%
}
}
{% === For Japanese literature (Display all) ===
\namepartfamily\space\namepartgiven%
\ifnumequal{\value{listcount}}{\value{liststop}}
{}
{,}%
}%
}
% Book title format (differentiate 『』 and italics for Japanese/English)
\DeclareFieldFormat[book]{title}{%
\iffieldequalstr{langid}{english}
{\mkbibemph{#1}} % English: Italics
{『#1』} % Japanese: 『 』
}
% 4. Decoration for journal, volume, and year
% Assuming abbreviations for journal titles are written in the bib file for English
\DeclareFieldFormat{journaltitle}{#1}
% Volume is Bold
\DeclareFieldFormat[article]{volume}{\textbf{#1}}
% Enclose article year in ( )
\DeclareFieldFormat[article]{year}{(#1)}
% Book year as is
\DeclareFieldFormat[book]{year}{#1}
% Prefix page numbers with p. for articles
\DeclareFieldFormat[article]{pages}{\mkfirstpage{#1}}
\DeclareFieldFormat[book]{pages}{p.\mkfirstpage{#1}}
% 5. Redefine Article driver (Author, Journal, Volume, Page (Year))
\DeclareBibliographyDriver{article}{%
\printnames{author}%
\setunit{\addcomma\space}% Comma after author name
\printfield{journaltitle}%
\setunit{\space}% Space between journal and volume
\printfield{volume}%
\setunit{\addcomma\space}% Comma between volume and page
\printfield{pages}%
\setunit{\space}%
\printfield{year}% (Year)
\usebibmacro{finentry}%
}
% 6. Redefine Book driver
\DeclareBibliographyDriver{book}{%
\printnames{author}%
\setunit{\addcomma\space}%
\printfield{title}%
\setunit{\space}%
% Process for enclosing publisher and year in ( )
\printtext[parens]{%
\printlist{publisher}%
\setunit{\addcomma\space}%
\printfield{year}%
}%
\setunit{\space}%
\printfield{pages}%
\usebibmacro{finentry}%
}
\endinput
Output result following JPSJ guidelines:

Installation Method (Global Settings)
As introduced above, you can copy the .sty file for each project, but by placing it in your TeX "personal tree (TEXMFHOME)", you can call it with just \usepackage{...} from any TeX file in any directory.
I highly recommend this setup to save time when writing multiple papers. I will show how to set up mybibstyle.sty globally as an example, but the same applies to myphys.sty for physics students.
For macOS
With MacTeX (TeX Live), you must place it in ~/Library/texmf within your library folder, rather than the standard home directory (~/texmf). This is a common stumbling point.
Open your terminal and run the following commands to install (assuming mybibstyle.sty is in your current directory):
# 1. Create a directory for storage (important to create it inside Library)
mkdir -p ~/Library/texmf/tex/latex/mybibstyle
# 2. Copy the file
cp jpsj_style.sty ~/Library/texmf/tex/latex/mybibstyle/
For Windows
If you are using Windows (TeX Live), create a texmf folder directly under your user folder and place the file there. Use Explorer to follow these steps to create the folders:
- Open
C:\Users\YourUsername\(user folder). - Create a new folder named
texmfinside it. - Create folders
tex→latex→mybibstyleinside that in order. - Finally, place
mybibstyle.styinside the createdmybibstylefolder.
The final path will be:
C:\Users\YourUsername\texmf\tex\latex\mybibstyle\mybibstyle.sty
Verification:
After placement, open the Command Prompt (or PowerShell) and enter the following command:
kpsewhich mybibstyle.sty
If the path to the file is displayed, installation is successful. You can now use it as a normal package like this:
\documentclass[a4paper]{article}
\usepackage{luatexja}
\usepackage{mybibstyle}% BibLaTeX settings are all included in this package
\addbibresource{references.bib}% Specify bibliography database (.bib)
\begin{document}
...
\printbibliography
\end{document}
Summary
Building on the previous article, we have reached a stage where everything from acquiring and saving references to displaying them can be done with just a few clicks. Since the .sty file can be easily edited by anyone, you can further customize it to create the list exactly as you envision. Thank you for reading until the end.
References
I referenced these articles. I would like to express my gratitude once again here.
Discussion