- Rmarkdown(Pandoc + citeproc) で文献情報を自動整形する
- CSL(Citation Style Language)で引用スタイルを変更できる
- Mendeleyを探すと多数のCSLがあるが、和英混在に対応したものは少ない
- CSLは本来単一言語を前提 → それでも日英混在の体裁を整える工夫をする
- 個人的に馴染み深い日本園芸学会の園芸学研究に準じた引用スタイルを目指す
- 有料ソフトは使わず、R Markdownだけで完結させる
参考させていただいたサイト
使用環境
- R Markdown / bookdown
- PDF出力(LaTeX)
- xelatexエンジンを使用
CSLを作成
作成方法
- 論文原稿作成要領の記載例をテスト用JSONに使用
- CSLはRStudioのエディタで作成
- 適宜KnitしながらCSLを調整
参照資料
- 園芸学研究論文原稿作成要領
- CSLの仕様
方針
- 使用する文献Type
- article・article-journal・paper-conference・report・book・chapter・patent・thesis
- 和英の判別
- curatorがある文献を日本語文献として判別
- curatorに日本語読みを格納 → bibliographyのソートに利用
- 品種登録の引用
- type: patent を使用
- genreに品種登録の詳細を記入し、numberに番号を入力
- 入力例:
"genre": "品種登録", "number":"6926"
- 出力例:"品種登録 6926"
- 入力例:
- 抄録のみの引用(英文)
- genreに"(Abst.)" を入力
- 出力時に (Abst.) を表示
- オンライン資料を引用
- sourceを使用
- sourceの有無でアクセス情報を表示
- 和名著者の4文字以下対策
- JSON側の著者名に 全角空白 を挿入して体裁調整(暫定)
- ※いずれPythonで自動化予定
PDF出力を確認
概ね、作成要領の引用例に沿った出力できました。
使用方法
- 下のコードボックスから任意の方法で保存
- メモ帳や任意のテキスト
- RmdファイルのYAMLヘッダにCSLとJSONファイルを指定
bibliography: 〇〇.json
csl: 〇〇.csl
- 引用したい文献情報のJSONを追加する
- RmarkdownではVisualエディタの「insert」→「citation」からDOIやPubMed IDなどで検索して追加可能
- RStudioからJSONファイルを開いて追加・編集も可能
- 文献管理ソフトのZoteroやEnd Noteで書き出す方法もあり
- JSONファイルを調整
- 日本語の文献を引用するときは、curatorを追加し、アルファベットで読みを記入する
- 引用文献がオンライン書誌の場合はsourceを追加する
- 雑誌名の短縮版を利用する場合はcontainer-title-shortを追加し、短縮名を追加
- 和名著者の文字数が4文字以下の場合、全角空白を入力して対応
- TypeがBookとChapterの場合、
- 第○巻/Vol.○の表記をVolumeから取得
- 第○版/Ed.○の表記をEditionから取得
- 第○集/No.○の表記をNumberから取得
- その他、適宜調整
---
title: "文献引用テスト"
output: pdf_document
bibliography: references.json
csl: jshs-like.csl
---
コードはこちらから
更新履歴
2025.09.17:公開
<?xml version="1.0" encoding="utf-8"?>
<style class="in-text" version="1.0" demote-non-dropping-particle="never" default-locale="ja-JP">
<info>
<title>JSHS-Like-CSL</title>
<author>
<name>Masa</name>
</author>
<updated>2025-09-10T00:00:00+00:00</updated>
</info>
<!-- 日本語ロケール設定 -->
<locale xml:lang="ja">
<style-options punctuation-in-quote="false"/>
<terms>
<term name="open-quote">'</term>
<term name="close-quote">'</term>
<term name="open-inner-quote">"</term>
<term name="close-inner-quote">"</term>
<term name="et-al">ら</term>
<term name="and">and</term>
</terms>
</locale>
<!-- 著者名(フル) -->
<macro name="author">
<choose>
<!-- curator がある場合(日本語風) -->
<if variable="curator">
<names variable="author">
<name name-as-sort-order="first" sort-separator=" " delimiter="・"
delimiter-precedes-last="always"/>
<label form="short" prefix=" (" suffix=")" text-case="capitalize-first"/>
<substitute>
<names variable="editor"/>
<names variable="translator"/>
<text macro="title"/>
</substitute>
</names>
</if>
<!-- それ以外(英語風) -->
<else>
<names variable="author">
<name and="text" name-as-sort-order="first" sort-separator=", "
initialize-with=". " delimiter=", " delimiter-precedes-last="never"/>
<label form="short" prefix=" (" suffix=")" text-case="capitalize-first"/>
<substitute>
<names variable="editor"/>
<names variable="translator"/>
<text macro="title"/>
</substitute>
</names>
</else>
</choose>
</macro>
<!-- 著者名(短縮形) -->
<macro name="author-short">
<names variable="author">
<name form="short" delimiter="・" initialize-with=". "/>
<substitute>
<names variable="editor"/>
<names variable="translator"/>
</substitute>
</names>
</macro>
<!-- bibliography 並び替え用著者名 -->
<macro name="author-bib-sort">
<choose>
<if variable="curator">
<names variable="curator">
<name name-as-sort-order="all" sort-separator=", " initialize-with=". "
delimiter=", " delimiter-precedes-last="always"/>
</names>
</if>
<else>
<names variable="author">
<name name-as-sort-order="all" sort-separator=", " initialize-with=". "
delimiter=", " delimiter-precedes-last="always" form="long"/>
</names>
</else>
</choose>
</macro>
<!-- 発行年 -->
<macro name="issued">
<date variable="issued">
<date-part name="year"/>
</date>
</macro>
<!-- タイトル -->
<macro name="title">
<text variable="title"/>
</macro>
<!-- 発行情報(巻・版・集) -->
<macro name="info">
<choose>
<!-- curator がある場合(日本語表記) -->
<if variable="curator" match="any">
<group delimiter=". ">
<choose>
<if variable="volume">
<text prefix="第" variable="volume" suffix="巻"/>
</if>
</choose>
<choose>
<if variable="edition">
<text prefix="第" variable="edition" suffix="版"/>
</if>
</choose>
<choose>
<if variable="number collection-number" match="any">
<choose>
<if variable="number">
<text prefix="第" variable="number" suffix="集"/>
</if>
<else>
<text prefix="第" variable="collection-number" suffix="集"/>
</else>
</choose>
</if>
</choose>
</group>
</if>
<!-- curator がない場合(英語表記) -->
<else>
<group delimiter=". ">
<choose>
<if variable="volume">
<text variable="volume" prefix="Vol. "/>
</if>
</choose>
<choose>
<if variable="edition">
<text variable="edition" prefix="Ed. "/>
</if>
</choose>
<choose>
<if variable="number collection-number" match="any">
<choose>
<if variable="number">
<text variable="number" prefix="No. "/>
</if>
<else>
<text variable="collection-number" prefix="No. "/>
</else>
</choose>
</if>
</choose>
</group>
</else>
</choose>
</macro>
<!-- 雑誌名・書名など -->
<macro name="container">
<text variable="container-title" form="short"/>
</macro>
<!-- 出版社情報 -->
<macro name="publisher">
<group delimiter=". ">
<text variable="publisher"/>
<text variable="publisher-place"/>
</group>
</macro>
<!-- ページ番号 -->
<macro name="pages">
<group>
<text value="p." suffix=" "/>
<text variable="page"/>
</group>
</macro>
<!-- アクセス情報 (DOI/ISBN/ISSN/URL) -->
<macro name="access">
<choose>
<if variable="source">
<group delimiter=". ">
<choose>
<if variable="DOI">
<text variable="DOI" prefix="DOI: "/>
</if>
<else-if variable="ISBN">
<text variable="ISBN" prefix="ISBN: "/>
</else-if>
<else-if variable="ISSN">
<text variable="ISSN" prefix="ISSN: "/>
</else-if>
</choose>
<text variable="URL" prefix="<" suffix=">"/>
</group>
</if>
</choose>
</macro>
<!-- 文献の種類ごとの書式 -->
<macro name="bibliography-entry">
<choose>
<!-- Journal/Proceedings/Report -->
<if type="article article-journal paper-conference report" match="any">
<group delimiter=". ">
<text macro="author"/>
<text macro="issued"/>
<text macro="title"/>
<text macro="container"/>
<group>
<text variable="volume"/>
<group prefix=" (" suffix=")">
<text variable="issue"/>
</group>
<text variable="page" prefix=" : "/>
<text variable="genre" prefix=" "/>
</group>
<text macro="access"/>
</group>
</if>
<!-- Book -->
<else-if type="book" match="any">
<group delimiter=". ">
<text macro="author"/>
<text macro="issued"/>
<text macro="title"/>
<text macro="info"/>
<names variable="translator">
<name prefix="(" suffix="訳)" delimiter="・"/>
</names>
<names variable="producer">
<name suffix="監修" delimiter="・"/>
</names>
<names variable="editor">
<name suffix="編" delimiter="・"/>
</names>
<text macro="pages"/>
<text macro="publisher"/>
<text macro="access"/>
</group>
</else-if>
<!-- Chapter -->
<else-if type="chapter" match="any">
<choose>
<!-- curator がある場合(日本語風) -->
<if variable="curator">
<group delimiter=". ">
<text macro="author"/>
<text macro="issued"/>
<text macro="title"/>
<text macro="info"/>
<text macro="pages"/>
<names variable="editor">
<name suffix="編著" delimiter="・"/>
</names>
<text macro="container"/>
<text macro="publisher"/>
<text macro="access"/>
</group>
</if>
<!-- それ以外(英語風) -->
<else>
<group delimiter=". ">
<text macro="author"/>
<text macro="issued"/>
<text macro="title"/>
<text macro="info"/>
<text macro="pages"/>
<group>
<names variable="editor" prefix="In: " suffix=" (eds.)">
<name name-as-sort-order="never" and="text"
delimiter=", " delimiter-precedes-last="never"/>
</names>
</group>
<text macro="container"/>
<text macro="publisher"/>
<text macro="access"/>
</group>
</else>
</choose>
</else-if>
<!-- Thesis -->
<else-if type="thesis" match="any">
<choose>
<!-- curator がある場合(日本語風) -->
<if variable="curator">
<group delimiter=". ">
<text macro="author"/>
<text macro="issued"/>
<text macro="title"/>
<group>
<text variable="publisher"/>
<text variable="genre"/>
</group>
</group>
</if>
<!-- それ以外(英語風) -->
<else>
<group delimiter=". ">
<text macro="author"/>
<text macro="issued"/>
<text macro="title"/>
<text variable="genre"/>
<text macro="publisher"/>
</group>
</else>
</choose>
</else-if>
<!-- Patent -->
<else-if type="patent" match="any">
<group delimiter=". ">
<text macro="author"/>
<text macro="issued"/>
<text macro="title"/>
<group delimiter=" ">
<text variable="genre"/>
<text variable="number"/>
</group>
</group>
</else-if>
<!-- その他 (fallback) -->
<else>
<group delimiter=". ">
<text macro="author"/>
<text macro="issued"/>
<text macro="title"/>
<text macro="container"/>
<group>
<text variable="volume"/>
<group prefix=" (" suffix=")">
<text variable="issue"/>
</group>
<text variable="page" prefix=" : "/>
</group>
<text macro="access"/>
</group>
</else>
</choose>
</macro>
<!-- 文中引用 -->
<citation et-al-min="3" et-al-use-first="1" disambiguate-add-givenname="true"
disambiguate-add-year-suffix="true" collapse="year" cite-group-delimiter=", ">
<sort>
<key macro="author-bib-sort"/>
<key macro="author"/>
<key macro="issued" sort="descending"/>
</sort>
<layout prefix="(" suffix=")" delimiter="; ">
<group delimiter=", ">
<text macro="author-short"/>
<text macro="issued"/>
<group delimiter=" ">
<label variable="locator" form="short"/>
<text variable="locator"/>
</group>
</group>
</layout>
</citation>
<!-- 参考文献リスト -->
<bibliography hanging-indent="true" entry-spacing="0" line-spacing="1">
<sort>
<key macro="author-bib-sort"/>
<key variable="sortkey"/>
<key macro="author"/>
<key macro="issued" sort="descending"/>
</sort>
<layout suffix=".">
<text macro="bibliography-entry"/>
</layout>
</bibliography>
</style>
[
{
"id": "journal_ja_1",
"type": "article-journal",
"author": [
{ "family": "西沢", "given": " 隆" },
{ "family": "伊藤", "given": "彩香" },
{ "family": "伊藤", "given": "政憲" }
],
"curator":[
{ "family": "nisizawa", "given": "takashi" },
{ "family": "itoh", "given": "ayaka" },
{ "family": "itoh", "given": "masanori" }
],
"title": "メロン 'プリンス' と比較した山形県在来マクワウリ '早田瓜' の生長,形態および生理的特性",
"container-title": "園芸学研究",
"container-title-short": "園学研",
"volume": "3",
"page": "399-403",
"issued": { "date-parts": [[2004]] }
},
{
"id": "journal_ja_2",
"type": "article-journal",
"author": [
{ "family": "杉浦", "given": "俊彦" }
],
"curator":[
{ "family": "sugiura", "given": "toshihiko" }
],
"title": "地球温暖化が果樹栽培に与える影響の現状と対策",
"container-title": "農業技術",
"volume": "61",
"page": "107-112",
"issued": { "date-parts": [[2006]] }
},
{
"id": "book_ja_1",
"type": "book",
"author": [
{ "family": "藤巻", "given": " 宏" }
],
"curator":[
{ "family": "fijimaki", "given": "hiroshi" }
],
"title": "生物統計解析と実験計画",
"publisher": "養賢堂",
"publisher-place": "東京",
"page": "86-98",
"issued": { "date-parts": [[2002]] }
},
{
"id": "book_translated_ja_1",
"type": "book",
"author": [
{ "family": "ハンス - ワルター", "given": "ヘルト" }
],
"curator":[
{ "family": "hansuwaruta", "given": "heruto" }
],
"title": "植物生化学",
"translator": [
{ "family": "金井", "given": "龍二" }
],
"publisher": "シュプリンガー・フェアラーク",
"publisher-place": "東京",
"page": "273-279",
"issued": { "date-parts": [[2000]] }
},
{
"id": "chapter_ja_1",
"type": "chapter",
"author": [
{ "family": "稲葉", "given": "昭次" }
],
"curator":[
{ "family": "inaba", "given": "akitsugu" }
],
"title": "野菜のポストハーベスト",
"editor": [
{ "family": "矢澤", "given": " 進" }
],
"container-title": "図説 野菜新書",
"publisher": "朝倉書店",
"publisher-place": "東京",
"page": "152-190",
"issued": { "date-parts": [[2003]] }
},
{
"id": "thesis_ja_1",
"type": "thesis",
"author": [
{ "family": "早見", "given": " 功" }
],
"curator":[
{ "family": "hayami", "given": "isao" }
],
"title": "リョクトウ芽生えの胚軸細胞壁多糖に関する研究",
"publisher": "岩手大学大学院連合農学研究科",
"genre": "博士論文",
"issued": { "date-parts": [[2004]] }
},
{
"id": "abstract_ja_1",
"type": "paper-conference",
"author": [
{ "family": "栗山", "given": "隆明" },
{ "family": "吉田", "given": " 守" }
],
"curator":[
{ "family": "kuriyama", "given": "takaaki" },
{ "family": "yoshida", "given": "mamoru" }
],
"title": "温州ミカンの品質に関する研究. 第13報. 開花時期と温州ミカンの品質について",
"container-title": "園芸学会大会研究発表要旨",
"container-title-short": "園学要旨",
"volume": "昭50春",
"page": "480-481",
"issued": { "date-parts": [[1975]] }
},
{
"id": "abstract_ja_2",
"type": "paper-conference",
"author": [
{ "family": "山下", "given": "英希" },
{ "family": "高村", "given": "武二郎" }
],
"curator":[
{ "family": "yamashita", "given": "hideki" },
{ "family": "takamura", "given": "takejirou" }
],
"title": "シクラメン野生種の核DNA量の種間差異",
"container-title": "園芸学研究",
"container-title-short": "園学研",
"volume": "6",
"issue": "別1",
"page": "460",
"issued": { "date-parts": [[2007]] }
},
{
"id": "patent_ja_1",
"type": "patent",
"author": [
{ "family": "千葉", "given": "直樹" },
{ "family": "足立", "given": "陽子" },
{ "family": "中村", "given": "茂雄" },
{ "family": "鹿野", "given": " 弘" }
],
"curator": [
{ "family": "chiba", "given": "naoki" },
{ "family": "adachi", "given": "youko" },
{ "family": "nakamura", "given": "sigeo" },
{ "family": "shikano", "given": "hiroshi" }
],
"title": "イチゴの四季成り性を検定するDNAマーカー",
"genre": "特許公開",
"number": "2006-42622",
"issued": { "date-parts": [[2006]] }
},
{
"id": "cultivar_ja_1",
"type": "patent",
"author": [
{ "family": "中條", "given": "忠久" },
{ "family": "堀込", "given": " 充" }
],
"curator": [
{ "family": "nakajou", "given": "tadahisa" },
{ "family": "horigome", "given": "mituru" }
],
"title": "おおつぶ星",
"genre": "品種登録",
"number": "6926",
"issued": { "date-parts": [[1998]] }
},
{
"id": "webpage_ja_1",
"type": "article-journal",
"author": [
{ "family": "南 ", "given": "泰明" }
],
"curator": [
{ "family": "minami", "given": "haruaki" }
],
"title": "シクラメン開花に及ぼす植物ホルモンの効果",
"container-title": "開花調節",
"volume": "4",
"page": "12-16",
"DOI": "10.1012/s011200550058",
"URL": "http://www.***.**/",
"issued": { "date-parts": [[2006]] },
"source":"online"
},
{
"id": "webpage_ja_2",
"type": "book",
"author": [
{ "family": "小川", "given": "健作" }
],
"curator": [
{ "family": "ogawa", "given": "kensaku" }
],
"title": "園芸学の基礎",
"container-title": "オンライン出版社",
"publisher": "オンライン出版社",
"publisher-place": "東京",
"page": "25-35",
"ISBN": "5-1256-9553",
"URL": "http://www.***.**/",
"issued": { "date-parts": [[2006]] },
"source":"online"
},
{
"id": "journal_en_1",
"type": "article-journal",
"author": [
{ "family": "Lee", "given": "O. N." },
{ "family": "Nemoto", "given": "K." },
{ "family": "Sugiyama", "given": "N." }
],
"title": "Histone H4 gene expression in shoot apices associated with floral initiation in lettuce",
"container-title": "Journal of the Japanese Society for Horticultural Science",
"container-title-short": "J. Japan. Soc. Hort. Sci.",
"volume": "74",
"page": "121-126",
"issued": { "date-parts": [[2005]] }
},
{
"id": "book_en_1",
"type": "book",
"author": [
{ "family": "Hancock", "given": "J. F." }
],
"title": "Strawberries",
"publisher": "CABI Publishing",
"publisher-place": "New York",
"page": "47-66",
"issued": { "date-parts": [[1999]] }
},
{
"id": "book_chapter_en_1",
"type": "chapter",
"author": [
{ "family": "Soeranto", "given": "H." },
{ "family": "Nakanishi", "given": "T. M." },
{ "family": "Razzak", "given": "M. T." }
],
"title": "Mutation breeding in sorghum in Indonesia",
"container-title": "Sustainable agriculture in rural Indonesia",
"editor": [
{ "family": "Hayashi", "given": "Y." },
{ "family": "Manuwoto", "given": "S." },
{ "family": "Hartono", "given": "S." }
],
"publisher": "Gadjah Mada Univ. Press",
"publisher-place": "Yogyakarta, Indonesia",
"page": "159-165",
"issued": { "date-parts": [[2003]] }
},
{
"id": "thesis_en_1",
"type": "thesis",
"author": [
{ "family": "Terasaki", "given": "S." }
],
"title": "Non-destructive measurement of fruit visco-elastic property using a laser Doppler method",
"genre": "Ph.D. Thesis",
"publisher": "Hiroshima University",
"publisher-place": "Hiroshima",
"issued": { "date-parts": [[2002]] }
},
{
"id": "bulletin_en_1",
"type": "report",
"author": [
{ "family": "Rollins", "given": "H. A." },
{ "family": "Howlett", "given": "F. S." },
{ "family": "Emmert", "given": "F. H." }
],
"title": "Factors affecting apple hardiness and methods of measuring resistance of tissue to low temperature injury",
"container-title": "Ohio Agricultural Experiment Station Research Bulletin",
"container-title-short": "Ohio Agr. Expt. Sta. Res. Bul",
"number": "901",
"issued": { "date-parts": [[1962]] }
},
{
"id": "abstract_en_1",
"type": "article-journal",
"author": [
{ "family": "Izumi", "given": "H." },
{ "family": "Tachibana", "given": "M." },
{ "family": "Yamamoto", "given": "C." },
{ "family": "Nagano", "given": "M." }
],
"title": "Physiological and microbiological characteristics of fresh-cut cucumber stored in CA/MAP in relation to high CO<sub>2</sub> atmosphere",
"container-title": "HortScience",
"volume": "39",
"page": "805",
"genre": "(Abst.)",
"issued": { "date-parts": [[2004]] }
},
{
"id": "patent_en_1",
"type": "patent",
"author": [
{ "family": "Krasutsky", "given": "P. A." },
{ "family": "Nesterenko", "given": "V. V." }
],
"title": "Process for extracting compounds from plants",
"genre": "United States Patent",
"number": "7198808",
"issued": { "date-parts": [[2007]] }
},
{
"id": "patent_en_2",
"type": "patent",
"author": [
{ "family": "Okudai", "given": "N." },
{ "family": "Matsumoto", "given": "R." },
{ "family": "Takahara", "given": "T." }
],
"title": "Tsunokaori",
"genre": "United States Patent",
"number": "PP8559",
"issued": { "date-parts": [[1994]] }
},
{
"id": "online_journal_en_1",
"type": "article-journal",
"author": [
{ "family": "Philippe", "given": "Vain" }
],
"title": "Thirty years of plant transformation technology development",
"container-title": "Plant Biotechnology Journal",
"volume": "5",
"page": "221-229",
"issued": { "date-parts": [[2007]] },
"DOI": "10.1111/j.1467-7652.2006.00225",
"URL": "http://www.***.**/",
"source":"online"
},
{
"id": "online_book_en_1",
"type": "chapter",
"author": [
{ "family": "Bommarius", "given": "A. S." },
{ "family": "Riebel", "given": "B. R." }
],
"title": "Biocatalysis",
"container-title": "Weily Interscience",
"publisher": "Weily Interscience",
"publisher-place": "New York",
"page": "10-25",
"issued": { "date-parts": [[2005]] },
"DOI": "10.1002/3527602364",
"URL": "http://www.***.**/",
"source":"online"
}
]
JSON作成ツール
上記の方法で、書誌情報のJSON配列を取得できない時用の入力ツールです。
まとめ
このCSLを作成するにあたり、多くの時間を要しました。せっかくなので、必要としてくださる人に使っていただけるように公開しますが、あくまで趣味として作ったものです。
今後も少しずつ修正や改良を重ねていく予定ですので、修正案や質問などありましたら教えていただけると嬉しく思います。
本スタイルの利用は自己責任となりますが、同じように日英混在の文献リストに悩む方にとって、参考の一助となれば幸いです。
広告

Amazonアフィリエイトでブログ運営しています。
応援いただけると嬉しいです。

ネスカフェ 香味焙煎 ひとときの贅沢 スティック ブラック 20P,箱,レギュラー ソリュブル コーヒー,個包装

AHMAD TEA(アーマッドティー) クラシックセレクション ティーバッグ 20袋