-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathhowtouse.tex
791 lines (704 loc) · 30.3 KB
/
howtouse.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
\RequirePackage{plautopatch}
% \documentclass[10pt, a4paper, dvipdfmx, platex]{jsarticle} % for platex
\documentclass[10pt, a4paper, dvipdfmx, uplatex]{jsarticle} % for uplatex
\usepackage[top=20truemm, bottom=20truemm, left=25truemm, right=25truemm]{geometry}
\setlength{\columnsep}{3zw}
\usepackage{listings, jlisting}
\usepackage[sectionbib]{bibunits}
\usepackage{url}
\usepackage{cite}
\usepackage{textcomp}[=2018/08/11]
\usepackage[T1]{fontenc}
\usepackage[dvipdfmx]{hyperref}
\usepackage{pxjahyper}
\usepackage{IEEEtrantools}
\hypersetup{
colorlinks=false,
bookmarksnumbered=true,
pdfborder={0 0 0},
}
\setcounter{tocdepth}{3}
\renewcommand{\refname}{\small 参考文献}
\usepackage{multicol}
\usepackage{enumitem}
\setitemize{itemsep=-0.1\baselineskip}
\newsavebox{\mybox}
\lstdefinestyle{twocol}{
basicstyle={\scriptsize\ttfamily},
identifierstyle={\footnotesize},
commentstyle={\footnotesizeitshape},
keywordstyle={\footnotesize\bfseries},
ndkeywordstyle={\footnotesize},
stringstyle={\footnotesize\ttfamily},
breaklines=true,
columns=[l]{fullflexible},
multicols=2
}
\lstdefinestyle{onecol}{
basicstyle={\scriptsize\ttfamily},
identifierstyle={\footnotesize},
commentstyle={\footnotesizeitshape},
keywordstyle={\footnotesize\bfseries},
ndkeywordstyle={\footnotesize},
stringstyle={\footnotesize\ttfamily},
breaklines=true,
columns=[l]{fullflexible}
}
\newcommand{\putlst}[1]{
\noindent\makebox[\linewidth]{\rule{\linewidth}{0.4pt}}\vspace{-1.5zw}
\lstinputlisting[style=twocol,firstline=5]{#1}\vspace{-1.8zw}
\noindent\makebox[\linewidth]{\rule{\linewidth}{0.4pt}}\vspace{0.5zw}\par
}
\begin{filecontents}[overwrite]{article.bib}
@article{Article,
author = {Author(s)},
title = {Title},
language = {Language},
journal = {Journal},
month = {Month},
year = {Year},
volume = {Volume},
note = {Note},
url = {URL}
}
@article{jpArticle1,
author = {山田 一郎 and 山田 次郎 and 山田 三郎 and 山田 四郎},
year = {2019},
journal = {日本語学会},
title = {文献1},
number = {10},
pages = {20--30},
volume = {15},
month = {3}
}
@article{jpArticle2,
author = {{山田 五郎} and {山田 六郎}},
year = {2019},
journal = {日本語学会},
title = {文献2},
number = {10},
pages = {21},
volume = {15},
month = {12}
}
@article{jpArticle3,
author = {{山田 八郎} and {山田 六郎}},
year = {2010},
journal = {日本語学会},
title = {手法1と手法2の比較検討},
number = {1},
pages = {15},
volume = {5}
}
@article{enArticle1,
author = {Ichiro Yamada and Jiro Yamada and Saburo Yamada and Shiro Yamada},
year = {2019},
journal = {Japanese Journal},
title = {Title1},
number = {10},
pages = {20--30},
volume = {15},
month = {march},
language = {Japanese}
}
@article{enArticle2,
author = {Goro Yamada and Rokuro Yamada},
year = {2019},
journal = {Japanese Journal},
title = {Title2},
volume = {15},
number = {10},
pages = {21},
month = {dec.},
language = {Japanese}
}
@article{enArticle3,
author = {Hachiro Yamada and Rokuro Yamada},
year = {2010},
journal = {Japanese Journal},
title = {Comparison Between Method 1 and Method 2},
number = {1},
pages = {15},
volume = {5}
}
@article{enArticle4,
author = {Hiroshi Sato and Jiro Sasaki},
year = {2010},
journal = {IEEJ Sample Transactions},
title = {Article with language field},
month = {march},
language = {japanese}
}
\end{filecontents}
\begin{filecontents}[overwrite]{articleabbrev.bib}
@IEEEtranBSTCTL{BSTctlabbrev,
CTLuse_ieej_abbrev = "yes",
CTLmax_names_forced_etal = "2",
}
@article{jpArticle1,
author = {山田 一郎},
year = {2019},
journal = {日本語学会},
title = {省略形ではタイトルは非表示},
number = {10},
pages = {20--30},
volume = {15},
}
@article{jpArticle2,
author = {{山田 二郎} and {佐藤 三郎}},
year = {2019},
journal = {日本語学会},
title = {省略形ではタイトルは非表示},
number = {10},
pages = {21},
volume = {15},
month = {12}
}
@article{jpArticle3,
author = {林 四郎 and 田中 五郎 and 小林 六郎},
year = {2010},
journal = {学会誌},
title = {省略形ではタイトルは非表示},
number = {1},
pages = {15},
volume = {5}
}
@article{enArticle1,
author = {Ichiro Yamada},
year = {2019},
journal = {JP Journal},
title = {Title1},
number = {10},
pages = {20--30},
volume = {15},
month = {march},
}
@article{enArticle2,
author = {Jiro Yamada and Saburo Yamada},
year = {2019},
journal = {IEEE TCAS},
title = {Title not shown},
volume = {15},
number = {10},
pages = {21},
month = {dec.},
}
@article{enArticle3,
author = {Shiro Tanaka and Goro Yamada and Rokuro},
year = {2010},
journal = {IEEJ Trans. Sample.},
title = {Not shown},
}
@inproceedings{jpInproceedings1,
author = {山田, 一郎 and 山田, 次郎},
title = {文献タイトル},
booktitle = {令和2年日本語大会},
address = {大阪},
year = {2010},
month = {3},
number = {10},
pages = {20--30}
}
@inproceedings{jpInproceedings2,
author = {山田, 三郎 and 佐藤, 四郎},
title = {タイトル},
booktitle = {第30回部門大会},
address = {東京},
year = {2005},
month = {2},
number = {2},
pages = {15--19}
}
@inproceedings{enInproceedings1,
author = {Hayashi, Shinji and Ogura, Yasuhiro},
title = {Sample Conference Article Title},
booktitle = {Proc. 5th ISC},
address = {Tokyo, Japan},
month = {jan},
year = {1997},
pages = {S01-5},
}
@inproceedings{enInproceedings2,
author = {Yamada, Sabuso and Sato, Shiro and Sato, Nishida},
title = {Title},
booktitle = {Proc. 30th CNOF},
address = {Tokyo},
year = {2005},
month = {2},
pages = {O1-15},
language = {Japanese}
}
\end{filecontents}
\begin{filecontents}[overwrite]{inproceedings.bib}
@inproceedings{Inproceedings,
author = {Author(s)},
title = {Title},
intype = {Intype},
booktitle = {Booktitle},
language = {Language},
series = {Series},
editor = {Editor(s)},
volume = {Volume},
number = {Number},
organization = {Organization},
address = {Address},
publisher = {Publisher},
month = {Month},
year = {Year},
paper = {Paper},
type = {Type},
pages = {Pages},
note = {Note},
url = {URL}
}
@inproceedings{jpInproceedings1,
author = {山田, 一郎 and 山田, 次郎},
title = {文献タイトル},
booktitle = {令和2年日本語大会},
address = {大阪},
year = {2010},
month = {3},
number = {10},
pages = {20--30}
}
@inproceedings{jpInproceedings2,
author = {山田, 三郎 and 佐藤, 四郎},
title = {タイトル},
booktitle = {第30回部門大会},
address = {東京},
year = {2005},
month = {2},
number = {2},
pages = {15--19}
}
@inproceedings{enInproceedings1,
author = {Hayashi, Shinji and Ogura, Yasuhiro},
title = {Sample Conference Article Title},
booktitle = {Proc. 5th Internatinoal Sample Conference (ISC)},
address = {Tokyo, Japan},
month = {jan},
year = {1997},
pages = {290-294},
number = {2}
}
@inproceedings{enInproceedings2,
author = {Yamada, Sabuso and Sato, Shiro},
title = {Title},
booktitle = {Proc. 30th Society Conference},
address = {Tokyo},
year = {2005},
month = {2},
number = {2},
pages = {15--19},
language = {Japanese}
}
\end{filecontents}
\begin{filecontents}[overwrite]{incollection.bib}
@incollection{Incollection,
author = {Author(s)},
title = {Title},
booktitle = {Booktitle},
language = {Language},
edition = {Edition},
series = {Series},
editor = {Editor},
address = {Address},
publisher = {Publisher},
month = {Month},
year = {Year},
volume = {Volume},
number = {Number},
organization = {Organization},
paper = {Paper},
type = {Type},
pages = {Pages},
note = {Note},
url = {URL}
}
@incollection{jpIncollection1,
author = {{佐藤 二郎} and {林 三郎}},
year = {2012},
publisher = {日本語出版},
address = {東京},
title = {日本語本2の中の抜粋},
booktitle = {日本語本2},
edition = {2},
pages = {100--200}
}
@incollection{jpIncollection2,
author = {山田, 一郎},
year = {1900},
publisher = {出版会社},
address = {東京},
title = {タイトル},
booktitle = {日本語本3},
chapter = {3},
edition = {1},
pages = {100--150},
}
@incollection{enIncollection1,
address = {Tokyo, Japan},
publisher = {JP Press},
author = {Sato, Jiro and Hayashi, Saburo},
booktitle = {Jpbook2},
title = {Part of Jpbook2},
pages = {100--200},
edition = {2},
year = {2012},
}
\end{filecontents}
\begin{filecontents}[overwrite]{book.bib}
@book{Book,
author = {Author(s)},
editor = {Editor(s)},
title = {Title},
language = {Language},
edition = {Edition},
series = {Series},
address = {Address},
publisher = {Publisher},
month = {Month},
year = {Year},
volume = {Volume},
note = {Note},
url = {URL}
}
@book{jpBook1,
author = {佐藤, 一郎},
year = {2010},
publisher = {日本語出版},
address = {東京},
title = {日本語本},
edition = {1},
pages = {100--200}
}
@book{jpBook2,
author = {佐藤, 二郎 and 佐藤, 三郎},
year = {2012},
publisher = {日本語出版},
address = {東京},
title = {日本語本2},
edition = {2},
pages = {100--200}
}
@book{jpBook3,
author = {学会委員会},
year = {2020},
publisher = {学会出版},
title = {学会本},
edition = {1}
}
@book{enBook1,
address = {City, Country},
publisher = {Publisher},
author = {Sato, Jiro and Hayashi, Saburo},
year = {2000},
title = {Title, not booktitle},
edition = {3},
pages = {1-10},
}
@book{enjBook1,
author = {Ichiro Sato},
year = {2010},
publisher = {Japanese Publisher},
address = {Tokyo},
title = {Japanese Book title},
edition = {1},
pages = {100--200},
language = {japaneese}
}
@book{jpjBook1,
author = {佐藤 一郎},
year = {2010},
publisher = {日本語出版},
address = {東京},
title = {日本語本},
edition = {1},
pages = {100--200}
}
\end{filecontents}
\begin{filecontents}[overwrite]{ref.bib}
@misc{IEEEtran,
author = {Michael Shell},
url = {https://www.ctan.org/tex-archive/macros/latex/contrib/IEEEtran/bibtex},
title = {{IEEEtran}},
month = {August},
year = {2015}
}
@misc{jIEEEtran,
author = {ehki},
url = {https://github.com/ehki/jIEEEtran},
title = {{jIEEEtran}},
month = {March},
year = {2020}
}
@misc{jeconbst,
author = {ShiroTakeda},
url = {http://shirotakeda.org/ja/tex-ja/jecon-ja.html},
title = {{jecon.bst}},
month = {August},
year = {2019}
}
\end{filecontents}
\title{\texttt{jIEEEtran.bst}/\texttt{IEEJtran.bst}:\\電気系日本人ユーザ向け\BibTeX スタイルファイル\\(ver. 0.19)}
\author{江尻 開}
\begin{document}
\maketitle
\tableofcontents
\section{概要}
\begin{bibunit}[jIEEEtran]
電気系の論文を執筆する日本人ユーザ向けに,IEEEと電気学会の引用スタイルを保ったまま日本語の取り扱いを自然にした\BibTeX スタイル(\texttt{.bst})ファイルです。
電気学会原稿の下書きや卒業論文,修士論文など,\LaTeX を使用した文献管理の一助になることを目的としています。
Michael Shell氏による\texttt{IEEEtran.bst}\cite{IEEEtran}をもとにYoshiRi氏が日本語の自然な表記を実装し,現在は著者らがリポジトリを譲渡していただきGitHub上\cite{jIEEEtran}で継続して開発しています。
オプションの追記方法や日本語の判別方法については,武田氏らによる\texttt{jecon.bst}\cite{jeconbst}を参考にしています。
間違いがあった場合でも大きな被害が出るレポジトリではありませんので,ご要望や問題があればお気軽にIssueやPull Requestを飛ばしてください。
なお,電気学会公認ではありませんし,全ての環境で動作を保証するものではありません。不具合が生じても責任を負うことはできませんのでご容赦ください。
なお,\TeX Live 2019以降の使用を想定しています。\texttt{w32tex}や古い\TeX Liveでの動作は確認していません。\TeX エンジンとしてplatex/pbibtexもしくはuplatex/upbibtexを推奨し,本マニュアルはuplatexでコンパイルしています。\TeX エンジンが出力する中間ファイルの改変にPythonを使用します。Pythonは\texttt{3.7}以降での動作を確認しています。
{\small \putbib[./ref]}
\end{bibunit}
\section{使用例}
まずはいくつかの文献タイプについて\texttt{.bib}ファイルの中身とコンパイル結果の例を示します。
\subsection{article}
\texttt{article}タイプのエントリでは次のフィールドをサポートします。
\begin{center}
\textbf{author}, \textbf{title}, \textsl{language}, \textbf{journal}, volume, number, pages, month, year, note, \textsl{url}.
\end{center}
このうち\textbf{textbf}で示したフィールドは必須,レギュラーフォントで示したフィールドはオプションです。
\textsl{textsl}で示したフィールドは拡張用のフィールドで,標準的な\BibTeX ではサポートされていない可能性があります。
\texttt{article}タイプのエントリでは,\texttt{language}フィールドに例えば``Japanese''を書くと,\texttt{IEEJtran.bst}では各エントリの最後に``(in Japanese)''を追記し,\texttt{jIEEEtran.bst}では\texttt{title}と\texttt{journal}の間に``(in Japanese)''を記載します。
\texttt{.bib}ファイルの例と,\texttt{IEEJtran.bst}および\texttt{jIEEEtran.bst}を使用して引用した際の出力例を次に示します。
\putlst{article.bib}
\begin{bibunit}[IEEJtran]
\nocite{Article,jpArticle1,jpArticle2,jpArticle3,enArticle1,enArticle2,enArticle3,enArticle4}
\renewcommand{\refname}{\small 参考文献(IEEJtran.bst)}
{\small \putbib[./article]}
\end{bibunit}
\begin{bibunit}[jIEEEtran]
\nocite{Article,jpArticle1,jpArticle2,jpArticle3,enArticle1,enArticle2,enArticle3,enArticle4}
\renewcommand{\refname}{\small 参考文献(jIEEEtran.bst)}
{\small \putbib[./article]}
\end{bibunit}
\vspace{2em}
電気学会の引用スタイルで求められているように英語と日本語を併記する場合,例えば
\begin{center}
\verb*|\cite{enArticle1/ej/jpArticle1}|
\end{center}
と記載すれば\texttt{enArticle1}と\texttt{jpArticle1}を一つのエントリとして扱えます。これには外部pythonファイルの\texttt{mixej.py}が必要ですので,\ref{sec:compile_procedure}節と\ref{sec:compile_config}節において後述します。英語と日本語の併記は\texttt{IEEJtran.bst}だけでなく\texttt{jIEEEtran.bst}でも使用することができます。
例えば\texttt{enArticle1}と\texttt{jpArticle1},\texttt{enArticle2}と\texttt{jpArticle2}を一つの文献としてまとめると,次のように出力されます。
\begin{bibunit}[IEEJtran]
\nocite{enArticle1/ej/jpArticle1,enArticle2/ej/jpArticle2}
\renewcommand{\refname}{\small 英日を併記した参考文献(IEEJtran.bst)}
{\small \putbib[./article]}
\end{bibunit}
\begin{bibunit}[jIEEEtran]
\nocite{enArticle1/ej/jpArticle1,enArticle2/ej/jpArticle2}
\renewcommand{\refname}{\small 英日を併記した参考文献(jIEEEtran.bst)}
{\small \putbib[./article]}
\end{bibunit}
\subsection{book}
\texttt{book}タイプのエントリでは次のフィールドをサポートします。
\begin{center}
\textbf{author} and/or \textbf{editor}, \textbf{title}, \textsl{language}, edition,
series, \\
address, \textbf{publisher}, month, \textbf{year}, volume, note, \textsl{url}.
\end{center}
\texttt{.bib}ファイルの例とそれぞれの\texttt{bst}ファイルの出力例を以下に示します。
\putlst{book.bib}
\begin{bibunit}[IEEJtran]
\nocite{Book,jpBook1,jpBook2,jpBook3,enBook1}
\renewcommand{\refname}{\small 参考文献(IEEJtran.bst)}
{\small \putbib[./book]}
\end{bibunit}
\begin{bibunit}[jIEEEtran]
\nocite{Book,jpBook1,jpBook2,jpBook3,enBook1}
\renewcommand{\refname}{\small 参考文献(jIEEEtran.bst)}
{\small \putbib[./book]}
\end{bibunit}
\begin{bibunit}[IEEJtran]
\nocite{enjBook1/ej/jpjBook1}
\renewcommand{\refname}{\small 英日を併記した参考文献(IEEJtran.bst)}
{\small \putbib[./book]}
\end{bibunit}
\begin{bibunit}[jIEEEtran]
\nocite{enjBook1/ej/jpjBook1}
\renewcommand{\refname}{\small 英日を併記した参考文献(jIEEEtran.bst)}
{\small \putbib[./book]}
\end{bibunit}
\subsection{inproceedings/conference}
\texttt{inproceedings}タイプのエントリや\texttt{conference}タイプのエントリでは次のフィールドをサポートします。なお,どちらのタイプが指定されても\texttt{bst}内部ではエイリアスにより\texttt{inproceedings}タイプとして処理されます。
\begin{center}
\textbf{author}, \textbf{title}, \textsl{intype}, \textbf{booktitle}, \textsl{language}, series, editor, volume, number, \\
organization, address, publisher, month, \textbf{year}, \textsl{paper}, \textsl{type}, pages, note, \textsl{url}.
\end{center}
このうち,\textsl{intype}フィールドや\textsl{paper}フィールド,\textsl{type}フィールドについては本家の\texttt{IEEEtran.bst}のマニュアルを参照ください。\texttt{.bib}ファイルの例とそれぞれの\texttt{bst}ファイルの出力例を以下に示します。
\putlst{inproceedings.bib}
\begin{bibunit}[IEEJtran]
\nocite{Inproceedings,jpInproceedings1,enInproceedings1,jpInproceedings2,enInproceedings2}
\renewcommand{\refname}{\small 参考文献(IEEJtran.bst)}
{\small \putbib[./inproceedings]}
\end{bibunit}
\begin{bibunit}[jIEEEtran]
\nocite{Inproceedings,jpInproceedings1,enInproceedings1,jpInproceedings2,enInproceedings2}
\renewcommand{\refname}{\small 参考文献(jIEEEtran.bst)}
{\small \putbib[./inproceedings]}
\end{bibunit}
\begin{bibunit}[IEEJtran]
\nocite{jpInproceedings1/ej/enInproceedings1,jpInproceedings2/ej/enInproceedings2}
\renewcommand{\refname}{\small 英日を併記した参考文献(IEEJtran.bst)}
{\small \putbib[./inproceedings]}
\end{bibunit}
\begin{bibunit}[jIEEEtran]
\nocite{jpInproceedings1/ej/enInproceedings1,jpInproceedings2/ej/enInproceedings2}
\renewcommand{\refname}{\small 英日を併記した参考文献(jIEEEtran.bst)}
{\small \putbib[./inproceedings]}
\end{bibunit}
\subsection{incollection}
\texttt{incollection}タイプのエントリは,書籍のうちタイトルのある一部分を引用したい場合に使用されます。次のフィールドをサポートします。
\begin{center}
\textbf{author}, \textbf{title}, \textbf{booktitle}, \textsl{language}, edition, series, editor, address, publisher, \\
month, \textbf{year}, volume, number, chapter, type, pages, note, \textsl{url}.
\end{center}
\texttt{.bib}ファイルの例とそれぞれの\texttt{bst}ファイルの出力例を以下に示します。
\putlst{incollection.bib}
\begin{bibunit}[IEEJtran]
\nocite{Incollection,jpIncollection1,jpIncollection2,enIncollection1}
\renewcommand{\refname}{\small 参考文献(IEEJtran.bst)}
{\small \putbib[./incollection]}
\end{bibunit}
\begin{bibunit}[jIEEEtran]
\nocite{Incollection,jpIncollection1,jpIncollection2,enIncollection1}
\renewcommand{\refname}{\small 参考文献(jIEEEtran.bst)}
{\small \putbib[./incollection]}
\end{bibunit}
\begin{bibunit}[IEEJtran]
\nocite{enIncollection1/ej/jpIncollection1}
\renewcommand{\refname}{\small 英日を併記した参考文献(IEEJtran.bst)}
{\small \putbib[./incollection]}
\end{bibunit}
\begin{bibunit}[jIEEEtran]
\nocite{enIncollection1/ej/jpIncollection1}
\renewcommand{\refname}{\small 英日を併記した参考文献(jIEEEtran.bst)}
{\small \putbib[./incollection]}
\end{bibunit}
\section{使用方法}
\subsection{必要環境}
\texttt{jIEEEtran.bst}や\texttt{IEEJtran.bst}は\BibTeX 用のスタイルファイルですので,当然\BibTeX を利用できる環境と使用する\texttt{.bib}ファイルが必要です。
\BibTeX の環境構築方法については本マニュアルの範囲外とします。
また,日本人ユーザを想定していますので,\texttt{platex}/\texttt{pbibtex}または\texttt{uplatex}/\texttt{upbibtex}は既に使用可能であるものとします。
\texttt{jIEEEtran.bst},\texttt{IEEJtran.bst}いずれも\texttt{pbibtex}と\texttt{upbibtex}に用意されている\texttt{is.kanji.str\$} 関数を使用しています。
そのため,\BibTeX コンパイラとして\texttt{bibtex}ではなく必ず\texttt{pbibtex}もしくは\texttt{upbibtex}を使用してください。
なお,\texttt{is.kanji.str\$} 関数による日本語の判定は,\texttt{author},\texttt{title},\texttt{journal},\texttt{publisher}の4つのフィールドに限定しています。
\subsection{\texttt{jIEEEtran.bst}/\texttt{IEEJtran.bst}の置き場所}
\texttt{jIEEEtran.bst}と\texttt{IEEJtran.bst}は\LaTeX のコンパイラが認識できる場所に置いてください。
すなわち,コンパイル対象の\texttt{.tex}ファイルと同一のディレクトリに置いてもよいですし,パスの通った場所に置いても動作します。
例えば\texttt{ieeetr.bst}が置かれている\texttt{texmf-dist/bibtex/bst/base}に置いてもよいでしょう。
この場合,ファイル一覧表の更新コマンドである\texttt{mktexlsr}を実行するのを忘れないでください。
英語と日本語の併記を実現する\texttt{mixej.py}はコンパイル対象の\texttt{.tex}ファイルから相対パスで参照できる場所であれば実行可能ですが,\texttt{.tex}ファイルと同一のディレクトリに置くことを推奨します。
\subsection{\texttt{bib}ファイルの書き方}
\texttt{.bib}ファイルの書き方は通常通りで構いません。
日本人著者の取り扱いは,\texttt{author = \{\{}\textgt{姓姓 名名}\texttt{\} and \{}\textgt{姓姓 名名}\texttt{\}\}}と,\texttt{\{\}}で挟んでもいいですし,\texttt{author = \{姓姓, 名名 and 姓姓, 名名\}}と,\texttt{\{\}}で挟まず半角カンマを挿入しても大丈夫です。
\texttt{.bst}内部では\texttt{\{\}}は消去して処理しています。
Mendeleyでは,前者はAuthorをInstitutoin/Organizationとして記載した場合,後者は通常のLastname, Firstnameとして記載した場合に相当します。
タイトルの後,出版社の後,文献の最後など,適切な箇所に(in Japanese)と言語表記をする場合にはlanguageフィールドが必要です。
MendeleyではPreferenceからDocument Detailsへと進めば常に表示させることが可能です。
\subsection{\texttt{tex}ファイルの書き方}
\texttt{jIEEEtran.bst}や\texttt{IEEJtran.bst}へのパスが通っている,もしくはコンパイルする\texttt{.tex}ファイルと同一ディレクトリにこれらの\texttt{.bst}ファイルが置かれていれば,\BibTeX スタイルファイルとして\texttt{jIEEEtran.bst}や\texttt{IEEJtran.bst}を指定するのは簡単です。
他の\texttt{bst}ファイルを指定するのと同様に,\texttt{tex}ファイル中で
\noindent\makebox[\linewidth]{\rule{\linewidth}{0.4pt}}\vspace{-0.5zw}
\begin{lstlisting}[style=onecol]
\bibliographystyle{jIEEEtran}
\end{lstlisting}\vspace{-1.8zw}
\noindent\makebox[\linewidth]{\rule{\linewidth}{0.4pt}}\vspace{0.5zw}\par
\noindent
や
\noindent\makebox[\linewidth]{\rule{\linewidth}{0.4pt}}\vspace{-0.5zw}
\begin{lstlisting}[style=onecol]
\bibliographystyle{IEEJtran}
\end{lstlisting}\vspace{-1.8zw}
\noindent\makebox[\linewidth]{\rule{\linewidth}{0.4pt}}\vspace{0.5zw}\par
\noindent
と書けば実行できます。
\subsection{文字コードについて}
UTF-8を使用しましょう。
SHIFT-JISやEUC-JPは非対応です。
\subsection{コンパイル手順}
\label{sec:compile_procedure}
英語と日本語の併記を行わない場合,通常通りのコンパイル手順で\texttt{.pdf}を生成することができます。
例えば\texttt{uplatex}で\texttt{.dvi}を生成し,\texttt{.dvi}から\texttt{.pdf}を生成,\BibTeX コマンドには\texttt{upbibtex}を使う場合,
\begin{center}
\texttt{uplatex → upbibtex → uplatex → uplatex → dvipdfmx}
\end{center}
という手順です。
英語と日本語の併記を行う場合,通常のコンパイル手順での\texttt{upbibtex}前後に\texttt{python}による\texttt{mixej.py}の処理を一回ずつ挟みます。
前と同様に,\texttt{uplatex}で\texttt{.dvi}を生成し,\texttt{.dvi}から\texttt{.pdf}を生成,\BibTeX コマンドには\texttt{upbibtex}を使う場合,
\begin{center}
\texttt{uplatex → python mixej.py → upbibtex → python mixej.py\\→ uplatex → uplatex → dvipdfmx}
\end{center}
という手順に変更されます。
論文誌や学内資料の原稿のように\texttt{.tex}ファイル中に文献リストを1つしか出力しない場合,上の処理を1ステップずつ実行しても問題ありません。
しかし,このマニュアルや学位論文,書籍などで文献リストを複数出力するために\texttt{bibunits}パッケージを使用して文献リストを複数出力する場合には,Latexmkの使用を推奨します。
これは,\texttt{bu1.aux, bu1.bbl, bu5.aux, bu5.bbl}のように,\texttt{bibunits}パッケージが何個の\texttt{bu}ファイルを出力するかが不明で,1ステップずつの実行では\texttt{bu}ファイルの個数をユーザが把握する必要があり面倒だからです。
Latexmkを使用していれば,各\texttt{bu}ファイルをそれぞれ必要な回数だけ処理してくれます。
\subsection{コンパイラの設定の例}
\label{sec:compile_config}
% 英語と日本語の併記を実現するためには\texttt{pbibtex}の前後にpythonでの処理を挟む必要があります。
% そのため,コンパイラではBibTeXコマンドの設定方法に注意が必要です。
\ref{sec:compile_procedure}節においても触れましたが,本マニュアルのように英語と日本語の併記を実現するために\texttt{/ej/}のコマンドが含まれているものを適切に扱うためには,\texttt{python mixej.py}のコマンドを\BibTeX コマンドの前後に1回ずつ実行する必要があります。
そのため,コンパイラでは\BibTeX コマンドの設定方法に注意が必要です。
Latexmkを使用している場合,MacやLinuxなどのUNIX系列では\texttt{.latexmkrc}に対して次のように設定することで実現可能です。
\noindent\makebox[\linewidth]{\rule{\linewidth}{0.4pt}}\vspace{-0.5zw}
\begin{lstlisting}[style=onecol]
#!/usr/bin/perl
$latex = 'uplatex %O -synctex=1 -interaction=nonstopmode -kanji=utf8 -file-line-error %S';
$bibtex = 'python mixej.py %B; upbibtex %O %B; python mixej.py %B';
$dvipdf = 'dvipdfmx -V 7 %O -o %D %S';
$pdf_previewer = "open -ga /Applications/Skim.app";
\end{lstlisting}\vspace{-1.8zw}
\noindent\makebox[\linewidth]{\rule{\linewidth}{0.4pt}}\vspace{0.5zw}\par
\noindent
Windowsでは,cmd, powershellともに\texttt{bibtex}の設定を次のようにすれば動きます。ただし,\texttt{\&}前後の半角スペースを忘れずに記入してください。
\noindent\makebox[\linewidth]{\rule{\linewidth}{0.4pt}}\vspace{-0.5zw}
\begin{lstlisting}[style=onecol]
$bibtex = '@cd & python mixej.py %B & upbibtex %B & python mixej.py %B';
\end{lstlisting}\vspace{-1.8zw}
\noindent\makebox[\linewidth]{\rule{\linewidth}{0.4pt}}\vspace{0.5zw}\par
最近ではVisual Studio Codeを使用している方が多いと思いますが,MacやLinuxでのVSCodeのLaTeX Workshop Extension用の設定は次のように書けます。Windowsの場合は\texttt{.latexmkrc}の場合と同様に\texttt{bibtex}コマンドを書き換えてください。
\noindent\makebox[\linewidth]{\rule{\linewidth}{0.4pt}}\vspace{-0.5zw}
\begin{lstlisting}[style=onecol]
"latex-workshop.latex.tools": [
{
"command": "latexmk",
"name": "latexmk uplatex/upbibtex/mixej",
"args": [
"-e", "$latex='uplatex %O -synctex=1 -interaction=nonstopmode -kanji=utf8 -file-line-error %S'",
"-e", "$bibtex='python mixej.py %B; upbibtex %O %B; python mixej.py %B'",
"-e", "$dvipdf='dvipdfmx -V 7 %O -o %D %S'",
"-norc", "-pdfdvi", "%DOC%"
],
}
],
"latex-workshop.latex.recipes": [
{ "name": "latexmk uplatex/upbibtex/mixej", "tools": [ "latexmk uplatex/upbibtex/mixej" ] }
],
\end{lstlisting}\vspace{-1.8zw}
\noindent\makebox[\linewidth]{\rule{\linewidth}{0.4pt}}\vspace{0.5zw}\par
\subsection{カスタマイズの例:電気学会の省略形式}
電気学会の研究会や大会の原稿では,タイトルやVol.等の文字を表記せずに,「著者・他,電学論A,\textbf{10}(15),20--25(2020)」と省略して一行形式とすることがあります。
IEEJtran.bstのオプションとして省略形での出力を可能としています。
なお,現状では\texttt{article}タイプと\texttt{inproceedings}のエントリのみに対応しています。
省略形式への変更は\texttt{.bst}ファイルを変更することでも実現可能ですが,元としている\texttt{IEEEtran.bst}に習い,\texttt{IEEEtranBSTCTL}で操作できるようにしました。
\texttt{IEEEtranBSTCTL}の使用方法は本マニュアルの範囲外としますが,\texttt{\textbackslash bstctlcite}を使用して\texttt{IEEEtranBSTCTL}エントリを一番はじめに引用してください。
なお,本マニュアルでは\texttt{bibunit.sty}を使用しており,相性問題で\texttt{\textbackslash bstctlcite}が動きません。
そのため,Warningが出てしまいますが\texttt{\textbackslash nocite\{BSTctlabbrev\}}として引用しています。
なお,雑誌名を省略するには\texttt{.bib}ファイルに記載する情報を省略形としておく必要があります。
\texttt{.bst}ファイルは\texttt{.bib}ファイルの\texttt{journal}フィールドの情報をそのまま出力するためです。
従って,文献管理ソフトで省略形を予め定義しておく必要があります。
\texttt{.bib}ファイルと出力の例を下記に示します。
\putlst{articleabbrev.bib}
\begin{bibunit}[IEEJtran]
\nocite{BSTctlabbrev}
\nocite{jpArticle1,jpArticle2,jpArticle3,enArticle1,enArticle2,enArticle3,jpInproceedings1,jpInproceedings2,enInproceedings1,enInproceedings2}
\renewcommand{\refname}{\small 参考文献(IEEJtran.bst)}
{\small \putbib[./articleabbrev]}
\end{bibunit}
\end{document}