├── howtouse.pdf ├── .gitattributes ├── ieejtran ├── ieejtran.pdf ├── ieejtran-en.pdf ├── README ├── ieejtran-en.tex ├── ieejtran.tex └── mixej.py ├── jieeetran ├── jieeetran.pdf ├── jieeetran-en.pdf ├── README ├── jieeetran-en.tex ├── jieeetran.tex └── mixej.py ├── .gitignore ├── README.md ├── LICENSE ├── release.sh ├── ieejtran-en.tex ├── jieeetran-en.tex ├── jieeetran.tex ├── ieejtran.tex ├── mixej.py └── howtouse.tex /howtouse.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ehki/jIEEEtran/HEAD/howtouse.pdf -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /ieejtran/ieejtran.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ehki/jIEEEtran/HEAD/ieejtran/ieejtran.pdf -------------------------------------------------------------------------------- /ieejtran/ieejtran-en.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ehki/jIEEEtran/HEAD/ieejtran/ieejtran-en.pdf -------------------------------------------------------------------------------- /jieeetran/jieeetran.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ehki/jIEEEtran/HEAD/jieeetran/jieeetran.pdf -------------------------------------------------------------------------------- /jieeetran/jieeetran-en.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ehki/jIEEEtran/HEAD/jieeetran/jieeetran-en.pdf -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Tex files 2 | *.aux 3 | *.blg 4 | *.log 5 | *.synctex 6 | *.dvi 7 | *.bbl 8 | *.fdb_latexmk 9 | *.fls 10 | *.synctex.gz 11 | *.vscode 12 | *.ejp 13 | *.bcf 14 | *.run.xml 15 | *.toc 16 | *.out 17 | 18 | article.bib 19 | articleabbrev.bib 20 | book.bib 21 | incollection.bib 22 | inproceedings.bib 23 | ref.bib 24 | library.bib 25 | 26 | .DS_Store 27 | -------------------------------------------------------------------------------- /jieeetran/README: -------------------------------------------------------------------------------- 1 | January 26, 2023 2 | 3 | 4 | jIEEEtran is an UNOFFICIAL BibTeX style for authors trying to cite Japanese 5 | articles in the Institute of Electrical and Electronics Engineers (IEEE) format. 6 | jIEEEtran is an expansion package of Michael Shell's IEEEtran package. 7 | The latest version of the jIEEEtran package can be found at CTAN: 8 | 9 | http://www.ctan.org/pkg/jieeetran 10 | 11 | Problems, requests, tips, beta releases, and other support, can be seen 12 | in jIEEEtran's GitHub page: 13 | 14 | https://github.com/ehki/jIEEEtran 15 | 16 | jIEEEtran may be distributed and/or modified under the terms of MIT license. 17 | 18 | Best wishes for all your publication endeavors, 19 | 20 | Haruki Ejiri 21 | -------------------------------------------------------------------------------- /ieejtran/README: -------------------------------------------------------------------------------- 1 | January 26, 2023 2 | 3 | 4 | IEEJtran is an UNOFFICIAL BibTeX style for authors of the Institute of 5 | Electrical Engineers of Japan (IEEJ) transactions journals and conferences. 6 | IEEJtran is an expansion package of Michael Shell's IEEEtran package. 7 | The latest version of the IEEJtran package can be found at CTAN: 8 | 9 | http://www.ctan.org/pkg/ieejtran 10 | 11 | Problems, requests, tips, beta releases, and other support, can be seen 12 | in IEEJtran's GitHub page: 13 | 14 | https://github.com/ehki/jIEEEtran 15 | 16 | NOTE: The author also developing jIEEEtran.bst in the same repository. 17 | 18 | IEEJtran may be distributed and/or modified under the terms of MIT license. 19 | 20 | Best wishes for all your publication endeavors, 21 | 22 | Haruki Ejiri 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 電気学会/IEEE, 日英両対応bstファイル 2 | 日本語と英語文献を同時に扱えるように調整を加えたbstファイルです。IEEEtranとjIEEJtranの2形式を用意しています。 3 | 4 | - ieejtran:電気学会の日英両対応版 5 | - jieeetran:IEEEtranの日本語対応版 6 | - mixej.py:同一文献で日本語と英語を併記するためのスクリプト 7 | - howtouse.pdf:使い方と実際の引用例 8 | 9 | なお、CTANへのアップロードの都合上、開発作業はプロジェクトルート下で行い、ieejtranとjieeetranのディレクトリはリリース時にのみ更新します。 10 | 11 | # 参考文献 12 | - [日本語と英語を混ぜられるようにbibtexスタイルファイルを改造しよう](https://qiita.com/HexagramNM/items/3ad757a9f5ee5d15e363#_reference-2be0cc9a71381591bb17) 13 | - [IEEEtran.bst](http://tug.ctan.org/tex-archive/macros/latex/contrib/IEEEtran/bibtex/IEEEtran.bst) 14 | - [How to Use the IEEEtran BIBTEX Style](http://ftp.jaist.ac.jp/pub/CTAN/macros/latex/contrib/IEEEtran/bibtex/IEEEtran_bst_HOWTO.pdf) 15 | - [IEEE Reference Guide - IEEE Author Center](https://ieeeauthorcenter.ieee.org/wp-content/uploads/IEEE-Reference-Guide.pdf) 16 | - [ShiroTakeda/jecon-bst](https://github.com/ShiroTakeda/jecon-bst) -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020-2023 Haruki Ejiri and Yoshi Ri 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /release.sh: -------------------------------------------------------------------------------- 1 | latexmk \ 2 | -e '$latex=q/uplatex %O -synctex=1 -interaction=nonstopmode -kanji=utf8 -file-line-error %S/' \ 3 | -e '$bibtex=q/python mixej.py %B; upbibtex %O %B; python mixej.py %B/' \ 4 | -e '$dvipdf=q/dvipdfmx -V 7 %O -o %D %S/' \ 5 | -norc \ 6 | -pdfdvi \ 7 | howtouse.tex 8 | 9 | latexmk \ 10 | -e '$latex=q/uplatex %O -synctex=1 -interaction=nonstopmode -kanji=utf8 -file-line-error %S/' \ 11 | -e '$bibtex=q/python mixej.py %B; upbibtex %O %B; python mixej.py %B/' \ 12 | -e '$dvipdf=q/dvipdfmx -V 7 %O -o %D %S/' \ 13 | -norc \ 14 | -pdfdvi \ 15 | ieejtran.tex 16 | 17 | latexmk \ 18 | -e '$latex=q/uplatex %O -synctex=1 -interaction=nonstopmode -kanji=utf8 -file-line-error %S/' \ 19 | -e '$bibtex=q/python mixej.py %B; upbibtex %O %B; python mixej.py %B/' \ 20 | -e '$dvipdf=q/dvipdfmx -V 7 %O -o %D %S/' \ 21 | -norc \ 22 | -pdfdvi \ 23 | jieeetran.tex 24 | 25 | latexmk \ 26 | -e '$latex=q/latex %O -synctex=1 -interaction=nonstopmode -file-line-error %S/' \ 27 | -e '$bibtex=q/bibtex %O %B/' \ 28 | -e '$dvipdf=q/dvipdfmx -V 7 %O -o %D %S/' \ 29 | -norc \ 30 | -pdfdvi \ 31 | ieejtran-en.tex 32 | 33 | latexmk \ 34 | -e '$latex=q/latex %O -synctex=1 -interaction=nonstopmode -file-line-error %S/' \ 35 | -e '$bibtex=q/bibtex %O %B/' \ 36 | -e '$dvipdf=q/dvipdfmx -V 7 %O -o %D %S/' \ 37 | -norc \ 38 | -pdfdvi \ 39 | jieeetran-en.tex 40 | 41 | rm *.aux *.bbl *.bib *.log *.out *.synctex.gz *.toc *.ejp *.blg *.dvi *.fdb_latexmk *.fls 42 | 43 | cp ieejtran.tex ieejtran/ 44 | mv ieejtran.pdf ieejtran/ 45 | cp ieejtran-en.tex ieejtran/ 46 | mv ieejtran-en.pdf ieejtran/ 47 | cp mixej.py ieejtran/ 48 | cp IEEJtran.bst ieejtran/ 49 | 50 | cp jieeetran.tex jieeetran/ 51 | mv jieeetran.pdf jieeetran/ 52 | cp jieeetran-en.tex jieeetran/ 53 | mv jieeetran-en.pdf jieeetran/ 54 | cp mixej.py jieeetran/ 55 | cp jIEEEtran.bst jieeetran/ 56 | 57 | git add ieejtran jieeetran . 58 | git commit -m "v0.19" 59 | -------------------------------------------------------------------------------- /ieejtran-en.tex: -------------------------------------------------------------------------------- 1 | \documentclass[11pt, a4paper, dvipdfmx]{article} 2 | 3 | \usepackage{bxtexlogo} 4 | 5 | \begin{filecontents}[overwrite]{library.bib} 6 | @misc{IEEEtran, 7 | author = {Michael Shell}, 8 | url = {https://www.ctan.org/tex-archive/macros/latex/contrib/IEEEtran/bibtex}, 9 | title = {{IEEEtran}}, 10 | month = {August}, 11 | year = {2015} 12 | } 13 | @misc{jIEEEtran, 14 | author = {ehki}, 15 | url = {https://github.com/ehki/jIEEEtran}, 16 | title = {{jIEEEtran}}, 17 | month = {March}, 18 | year = {2020} 19 | } 20 | @misc{jeconbst, 21 | author = {ShiroTakeda}, 22 | url = {http://shirotakeda.org/ja/tex-ja/jecon-ja.html}, 23 | title = {{jecon.bst}}, 24 | month = {August}, 25 | year = {2019} 26 | } 27 | \end{filecontents} 28 | 29 | 30 | \title{\texttt{IEEJtran.bst}:\\Unofficial IEEJ \BibTeX\ style\\(ver. 0.19)} 31 | \author{Haruki EJIRI} 32 | 33 | \begin{document} 34 | 35 | \maketitle 36 | 37 | \begin{abstract} 38 | The IEEJtran \BibTeX\ style is an unofficial citation format for Institute of Electrical Engineers of Japan transactions. 39 | It is a customization of Michael Shell's IEEEtran.bst. 40 | A Python script named mixej.py enables one content with both English and Japanese format to be handled properly. 41 | \end{abstract} 42 | 43 | 44 | \section{Introduction} 45 | 46 | IEEJtran.bst is an unofficial \BibTeX-style (.bst) file in IEEJ format developed for Japanese users engaging in electrical engineering. 47 | YoshiRi implemented natural Japanese notation based on Michael Shell's IEEEtran.bst[?]. 48 | And now the author develops it in GitHub repository [?] after taking it over. 49 | Please note IEEJtran.bst is unofficial. 50 | The author does not guarantee that it will work in all environments. 51 | We cannot be held responsible for any problems that may occur. 52 | We recommend platex/pbibtex or uplatex/upbibtex as \TeX\ engines. 53 | 54 | 55 | \section{Configuration} 56 | 57 | If IEEJtran.bst has been installed by \TeX\ Live package manager, etc., and placed under PATH, write \texttt{\string\bibliographystyle\string{IEEJtran\string}} in the preamble to complete the setup. 58 | In the case that IEEJtran.bst is individually downloaded and placed in the same directory as the main \TeX\ file such a reason for customization, state \texttt{\string\bibliographystyle\string{IEEJtran\string}} in the preamble in the same way to complete the setting. 59 | In the .bib file containing bibliographic information, Japanese authors' names should be written as: 60 | \begin{center} 61 | \texttt{author = \string{\string{Yamada Taro\string} and \string{Sato Jiro\string}\string}}, 62 | \end{center} 63 | or 64 | \begin{center} 65 | \texttt{author = \string{Yamada, Taro and Sato, Jiro\string}}. 66 | \end{center} 67 | 68 | 69 | \section{Combine English and Japanese entries} 70 | 71 | Japanese users are sometimes required to write both English and Japanese citation formats as one bibliography entry. 72 | A python script named \texttt{mixej.py} included in the \texttt{ieejtran} package enables combining English and Japanese entries. 73 | To combine two entries of enkey and jpkey, users have to cite as \texttt{\string\cite\string{enkye/ej/jpkey\string}}, where enkey and jpkey are English and Japanese citation keys, respectively. 74 | Then compile by the following seven steps: 75 | \begin{center} 76 | \texttt{uplatex → python mixej.py → upbibtex → python mixej.py\\→ uplatex → uplatex → dvipdfmx} 77 | \end{center} 78 | instead of the typical five steps: 79 | \begin{center} 80 | \texttt{uplatex → upbibtex → uplatex → uplatex → dvipdfmx}. 81 | \end{center} 82 | Note that the uplatex command is Unicode and Japanese compatible latex command. 83 | 84 | The Japanese version of this document, \texttt{ieejtran.pdf}, shows examples for English and Japanese combined citations. 85 | 86 | \end{document} 87 | -------------------------------------------------------------------------------- /ieejtran/ieejtran-en.tex: -------------------------------------------------------------------------------- 1 | \documentclass[11pt, a4paper, dvipdfmx]{article} 2 | 3 | \usepackage{bxtexlogo} 4 | 5 | \begin{filecontents}[overwrite]{library.bib} 6 | @misc{IEEEtran, 7 | author = {Michael Shell}, 8 | url = {https://www.ctan.org/tex-archive/macros/latex/contrib/IEEEtran/bibtex}, 9 | title = {{IEEEtran}}, 10 | month = {August}, 11 | year = {2015} 12 | } 13 | @misc{jIEEEtran, 14 | author = {ehki}, 15 | url = {https://github.com/ehki/jIEEEtran}, 16 | title = {{jIEEEtran}}, 17 | month = {March}, 18 | year = {2020} 19 | } 20 | @misc{jeconbst, 21 | author = {ShiroTakeda}, 22 | url = {http://shirotakeda.org/ja/tex-ja/jecon-ja.html}, 23 | title = {{jecon.bst}}, 24 | month = {August}, 25 | year = {2019} 26 | } 27 | \end{filecontents} 28 | 29 | 30 | \title{\texttt{IEEJtran.bst}:\\Unofficial IEEJ \BibTeX\ style\\(ver. 0.19)} 31 | \author{Haruki EJIRI} 32 | 33 | \begin{document} 34 | 35 | \maketitle 36 | 37 | \begin{abstract} 38 | The IEEJtran \BibTeX\ style is an unofficial citation format for Institute of Electrical Engineers of Japan transactions. 39 | It is a customization of Michael Shell's IEEEtran.bst. 40 | A Python script named mixej.py enables one content with both English and Japanese format to be handled properly. 41 | \end{abstract} 42 | 43 | 44 | \section{Introduction} 45 | 46 | IEEJtran.bst is an unofficial \BibTeX-style (.bst) file in IEEJ format developed for Japanese users engaging in electrical engineering. 47 | YoshiRi implemented natural Japanese notation based on Michael Shell's IEEEtran.bst[?]. 48 | And now the author develops it in GitHub repository [?] after taking it over. 49 | Please note IEEJtran.bst is unofficial. 50 | The author does not guarantee that it will work in all environments. 51 | We cannot be held responsible for any problems that may occur. 52 | We recommend platex/pbibtex or uplatex/upbibtex as \TeX\ engines. 53 | 54 | 55 | \section{Configuration} 56 | 57 | If IEEJtran.bst has been installed by \TeX\ Live package manager, etc., and placed under PATH, write \texttt{\string\bibliographystyle\string{IEEJtran\string}} in the preamble to complete the setup. 58 | In the case that IEEJtran.bst is individually downloaded and placed in the same directory as the main \TeX\ file such a reason for customization, state \texttt{\string\bibliographystyle\string{IEEJtran\string}} in the preamble in the same way to complete the setting. 59 | In the .bib file containing bibliographic information, Japanese authors' names should be written as: 60 | \begin{center} 61 | \texttt{author = \string{\string{Yamada Taro\string} and \string{Sato Jiro\string}\string}}, 62 | \end{center} 63 | or 64 | \begin{center} 65 | \texttt{author = \string{Yamada, Taro and Sato, Jiro\string}}. 66 | \end{center} 67 | 68 | 69 | \section{Combine English and Japanese entries} 70 | 71 | Japanese users are sometimes required to write both English and Japanese citation formats as one bibliography entry. 72 | A python script named \texttt{mixej.py} included in the \texttt{ieejtran} package enables combining English and Japanese entries. 73 | To combine two entries of enkey and jpkey, users have to cite as \texttt{\string\cite\string{enkye/ej/jpkey\string}}, where enkey and jpkey are English and Japanese citation keys, respectively. 74 | Then compile by the following seven steps: 75 | \begin{center} 76 | \texttt{uplatex → python mixej.py → upbibtex → python mixej.py\\→ uplatex → uplatex → dvipdfmx} 77 | \end{center} 78 | instead of the typical five steps: 79 | \begin{center} 80 | \texttt{uplatex → upbibtex → uplatex → uplatex → dvipdfmx}. 81 | \end{center} 82 | Note that the uplatex command is Unicode and Japanese compatible latex command. 83 | 84 | The Japanese version of this document, \texttt{ieejtran.pdf}, shows examples for English and Japanese combined citations. 85 | 86 | \end{document} 87 | -------------------------------------------------------------------------------- /jieeetran-en.tex: -------------------------------------------------------------------------------- 1 | \documentclass[11pt, a4paper, dvipdfmx]{article} 2 | 3 | \usepackage{bxtexlogo} 4 | 5 | \begin{filecontents}[overwrite]{library.bib} 6 | @misc{IEEEtran, 7 | author = {Michael Shell}, 8 | url = {https://www.ctan.org/tex-archive/macros/latex/contrib/IEEEtran/bibtex}, 9 | title = {{IEEEtran}}, 10 | month = {August}, 11 | year = {2015} 12 | } 13 | @misc{jIEEEtran, 14 | author = {ehki}, 15 | url = {https://github.com/ehki/jIEEEtran}, 16 | title = {{jIEEEtran}}, 17 | month = {March}, 18 | year = {2020} 19 | } 20 | @misc{jeconbst, 21 | author = {ShiroTakeda}, 22 | url = {http://shirotakeda.org/ja/tex-ja/jecon-ja.html}, 23 | title = {{jecon.bst}}, 24 | month = {August}, 25 | year = {2019} 26 | } 27 | \end{filecontents} 28 | 29 | 30 | \title{\texttt{jIEEEtran.bst}:\\Unofficial IEEE \BibTeX\ style for Japanese\\(ver. 0.19)} 31 | \author{Haruki EJIRI} 32 | 33 | \begin{document} 34 | 35 | \maketitle 36 | 37 | \begin{abstract} 38 | The jIEEEtran \BibTeX\ style is an unofficial IEEE style citation format for Japanese users. 39 | It is a customization of Michael Shell's IEEEtran.bst, and provides natural Japanese name handling. 40 | A Python script named mixej.py enables one content with both English and Japanese format to be handled properly. 41 | \end{abstract} 42 | 43 | 44 | \section{Introduction} 45 | 46 | IEEJtran.bst is an unofficial \BibTeX-style (.bst) file in IEEJ format developed for Japanese users engaging in electrical engineering. 47 | YoshiRi implemented natural Japanese notation based on Michael Shell's IEEEtran.bst[?]. 48 | And now the author develops it in GitHub repository [?] after taking it over. 49 | Please note jIEEEtran.bst is unofficial. 50 | The author does not guarantee that it will work in all environments. 51 | We cannot be held responsible for any problems that may occur. 52 | We recommend platex/pbibtex or uplatex/upbibtex as \TeX\ engines. 53 | 54 | 55 | \section{Configuration} 56 | 57 | If jIEEEtran.bst has been installed by \TeX\ Live package manager, etc., and placed under PATH, write \texttt{\string\bibliographystyle\string{jIEEEtran\string}} in the preamble to complete the setup. 58 | In the case that jIEEEtran.bst is individually downloaded and placed in the same directory as the main \TeX\ file such a reason for customization, state \texttt{\string\bibliographystyle\string{jIEEEtran\string}} in the preamble in the same way to complete the setting. 59 | In the .bib file containing bibliographic information, Japanese authors' names should be written as: 60 | \begin{center} 61 | \texttt{author = \string{\string{Yamada Taro\string} and \string{Sato Jiro\string}\string}}, 62 | \end{center} 63 | or 64 | \begin{center} 65 | \texttt{author = \string{Yamada, Taro and Sato, Jiro\string}}. 66 | \end{center} 67 | 68 | 69 | \section{Combine English and Japanese entries} 70 | 71 | Japanese users are sometimes required to write both English and Japanese citation formats as one bibliography entry. 72 | A python script named \texttt{mixej.py} included in the \texttt{jieeetran} package enables combining English and Japanese entries. 73 | To combine two entries of enkey and jpkey, users have to cite as \texttt{\string\cite\string{enkye/ej/jpkey\string}}, where enkey and jpkey are English and Japanese citation keys, respectively. 74 | Then compile by the following seven steps: 75 | \begin{center} 76 | \texttt{uplatex → python mixej.py → upbibtex → python mixej.py\\→ uplatex → uplatex → dvipdfmx} 77 | \end{center} 78 | instead of the typical five steps: 79 | \begin{center} 80 | \texttt{uplatex → upbibtex → uplatex → uplatex → dvipdfmx}. 81 | \end{center} 82 | Note that the uplatex command is Unicode and Japanese compatible latex command. 83 | 84 | The Japanese version of this document, \texttt{jieeetran.pdf}, shows examples for English and Japanese combined citations. 85 | 86 | \end{document} 87 | -------------------------------------------------------------------------------- /jieeetran/jieeetran-en.tex: -------------------------------------------------------------------------------- 1 | \documentclass[11pt, a4paper, dvipdfmx]{article} 2 | 3 | \usepackage{bxtexlogo} 4 | 5 | \begin{filecontents}[overwrite]{library.bib} 6 | @misc{IEEEtran, 7 | author = {Michael Shell}, 8 | url = {https://www.ctan.org/tex-archive/macros/latex/contrib/IEEEtran/bibtex}, 9 | title = {{IEEEtran}}, 10 | month = {August}, 11 | year = {2015} 12 | } 13 | @misc{jIEEEtran, 14 | author = {ehki}, 15 | url = {https://github.com/ehki/jIEEEtran}, 16 | title = {{jIEEEtran}}, 17 | month = {March}, 18 | year = {2020} 19 | } 20 | @misc{jeconbst, 21 | author = {ShiroTakeda}, 22 | url = {http://shirotakeda.org/ja/tex-ja/jecon-ja.html}, 23 | title = {{jecon.bst}}, 24 | month = {August}, 25 | year = {2019} 26 | } 27 | \end{filecontents} 28 | 29 | 30 | \title{\texttt{jIEEEtran.bst}:\\Unofficial IEEE \BibTeX\ style for Japanese\\(ver. 0.19)} 31 | \author{Haruki EJIRI} 32 | 33 | \begin{document} 34 | 35 | \maketitle 36 | 37 | \begin{abstract} 38 | The jIEEEtran \BibTeX\ style is an unofficial IEEE style citation format for Japanese users. 39 | It is a customization of Michael Shell's IEEEtran.bst, and provides natural Japanese name handling. 40 | A Python script named mixej.py enables one content with both English and Japanese format to be handled properly. 41 | \end{abstract} 42 | 43 | 44 | \section{Introduction} 45 | 46 | IEEJtran.bst is an unofficial \BibTeX-style (.bst) file in IEEJ format developed for Japanese users engaging in electrical engineering. 47 | YoshiRi implemented natural Japanese notation based on Michael Shell's IEEEtran.bst[?]. 48 | And now the author develops it in GitHub repository [?] after taking it over. 49 | Please note jIEEEtran.bst is unofficial. 50 | The author does not guarantee that it will work in all environments. 51 | We cannot be held responsible for any problems that may occur. 52 | We recommend platex/pbibtex or uplatex/upbibtex as \TeX\ engines. 53 | 54 | 55 | \section{Configuration} 56 | 57 | If jIEEEtran.bst has been installed by \TeX\ Live package manager, etc., and placed under PATH, write \texttt{\string\bibliographystyle\string{jIEEEtran\string}} in the preamble to complete the setup. 58 | In the case that jIEEEtran.bst is individually downloaded and placed in the same directory as the main \TeX\ file such a reason for customization, state \texttt{\string\bibliographystyle\string{jIEEEtran\string}} in the preamble in the same way to complete the setting. 59 | In the .bib file containing bibliographic information, Japanese authors' names should be written as: 60 | \begin{center} 61 | \texttt{author = \string{\string{Yamada Taro\string} and \string{Sato Jiro\string}\string}}, 62 | \end{center} 63 | or 64 | \begin{center} 65 | \texttt{author = \string{Yamada, Taro and Sato, Jiro\string}}. 66 | \end{center} 67 | 68 | 69 | \section{Combine English and Japanese entries} 70 | 71 | Japanese users are sometimes required to write both English and Japanese citation formats as one bibliography entry. 72 | A python script named \texttt{mixej.py} included in the \texttt{jieeetran} package enables combining English and Japanese entries. 73 | To combine two entries of enkey and jpkey, users have to cite as \texttt{\string\cite\string{enkye/ej/jpkey\string}}, where enkey and jpkey are English and Japanese citation keys, respectively. 74 | Then compile by the following seven steps: 75 | \begin{center} 76 | \texttt{uplatex → python mixej.py → upbibtex → python mixej.py\\→ uplatex → uplatex → dvipdfmx} 77 | \end{center} 78 | instead of the typical five steps: 79 | \begin{center} 80 | \texttt{uplatex → upbibtex → uplatex → uplatex → dvipdfmx}. 81 | \end{center} 82 | Note that the uplatex command is Unicode and Japanese compatible latex command. 83 | 84 | The Japanese version of this document, \texttt{jieeetran.pdf}, shows examples for English and Japanese combined citations. 85 | 86 | \end{document} 87 | -------------------------------------------------------------------------------- /jieeetran.tex: -------------------------------------------------------------------------------- 1 | \documentclass[11pt, a4paper, dvipdfmx, uplatex]{jsarticle} 2 | \bibliographystyle{jIEEEtran} 3 | 4 | \usepackage{listings, jlisting} 5 | \lstdefinestyle{onecol}{ 6 | basicstyle={\scriptsize\ttfamily}, 7 | identifierstyle={\footnotesize}, 8 | commentstyle={\footnotesizeitshape}, 9 | keywordstyle={\footnotesize\bfseries}, 10 | ndkeywordstyle={\footnotesize}, 11 | stringstyle={\footnotesize\ttfamily}, 12 | breaklines=true, 13 | columns=[l]{fullflexible} 14 | } 15 | 16 | \begin{filecontents}[overwrite]{library.bib} 17 | @misc{IEEEtran, 18 | author = {Michael Shell}, 19 | url = {https://www.ctan.org/tex-archive/macros/latex/contrib/IEEEtran/bibtex}, 20 | title = {{IEEEtran}}, 21 | month = {August}, 22 | year = {2015} 23 | } 24 | @misc{jIEEEtran, 25 | author = {ehki}, 26 | url = {https://github.com/ehki/jIEEEtran}, 27 | title = {{jIEEEtran}}, 28 | month = {March}, 29 | year = {2020} 30 | } 31 | @misc{jeconbst, 32 | author = {ShiroTakeda}, 33 | url = {http://shirotakeda.org/ja/tex-ja/jecon-ja.html}, 34 | title = {{jecon.bst}}, 35 | month = {August}, 36 | year = {2019} 37 | } 38 | @article{jpArticle1, 39 | author = {山田 一郎 and 山田 次郎 and 山田 三郎 and 山田 四郎}, 40 | year = {2019}, 41 | journal = {日本語学会}, 42 | title = {文献1}, 43 | number = {10}, 44 | pages = {20--30}, 45 | volume = {15}, 46 | month = {3} 47 | } 48 | @article{jpArticle2, 49 | author = {{山田 五郎} and {山田 六郎}}, 50 | year = {2019}, 51 | journal = {日本語学会}, 52 | title = {文献2}, 53 | number = {10}, 54 | pages = {21}, 55 | volume = {15}, 56 | month = {12} 57 | } 58 | @article{jpArticle3, 59 | author = {{山田 八郎} and {山田 六郎}}, 60 | year = {2010}, 61 | journal = {日本語学会}, 62 | title = {手法1と手法2の比較検討}, 63 | number = {1}, 64 | pages = {15}, 65 | volume = {5} 66 | } 67 | @article{enArticle1, 68 | author = {Ichiro Yamada and Jiro Yamada and Saburo Yamada and Shiro Yamada}, 69 | year = {2019}, 70 | journal = {Japanese Journal}, 71 | title = {Title1}, 72 | number = {10}, 73 | pages = {20--30}, 74 | volume = {15}, 75 | month = {march}, 76 | language = {Japanese} 77 | } 78 | @article{enArticle2, 79 | author = {Goro Yamada and Rokuro Yamada}, 80 | year = {2019}, 81 | journal = {Japanese Journal}, 82 | title = {Title2}, 83 | volume = {15}, 84 | number = {10}, 85 | pages = {21}, 86 | month = {dec.}, 87 | language = {Japanese} 88 | } 89 | @article{enArticle3, 90 | author = {Hachiro Yamada and Rokuro Yamada}, 91 | year = {2010}, 92 | journal = {Japanese Journal}, 93 | title = {Comparison Between Method 1 and Method 2}, 94 | number = {1}, 95 | pages = {15}, 96 | volume = {5} 97 | } 98 | @inproceedings{jpInproceedings1, 99 | author = {山田, 一郎 and 山田, 次郎}, 100 | title = {文献タイトル}, 101 | booktitle = {令和2年日本語大会}, 102 | address = {大阪}, 103 | year = {2010}, 104 | month = {3}, 105 | number = {10}, 106 | pages = {20--30} 107 | } 108 | @inproceedings{jpInproceedings2, 109 | author = {山田, 三郎 and 佐藤, 四郎}, 110 | title = {タイトル}, 111 | booktitle = {第30回部門大会}, 112 | address = {東京}, 113 | year = {2005}, 114 | month = {2}, 115 | number = {2}, 116 | pages = {15--19} 117 | } 118 | @inproceedings{enInproceedings1, 119 | author = {Hayashi, Shinji and Ogura, Yasuhiro}, 120 | title = {Sample Conference Article Title}, 121 | booktitle = {Proc. 5th Internatinoal Sample Conference (ISC)}, 122 | address = {Tokyo, Japan}, 123 | month = {jan}, 124 | year = {1997}, 125 | pages = {290-294}, 126 | number = {2} 127 | } 128 | @inproceedings{enInproceedings2, 129 | author = {Yamada, Sabuso and Sato, Shiro}, 130 | title = {Title}, 131 | booktitle = {Proc. 30th Society Conference}, 132 | address = {Tokyo}, 133 | year = {2005}, 134 | month = {2}, 135 | number = {2}, 136 | pages = {15--19}, 137 | language = {Japanese} 138 | } 139 | @incollection{jpIncollection1, 140 | author = {{佐藤 二郎} and {林 三郎}}, 141 | year = {2012}, 142 | publisher = {日本語出版}, 143 | address = {東京}, 144 | title = {日本語本2の中の抜粋}, 145 | booktitle = {日本語本2}, 146 | edition = {2}, 147 | pages = {100--200} 148 | } 149 | @incollection{jpIncollection2, 150 | author = {山田, 一郎}, 151 | year = {1900}, 152 | publisher = {出版会社}, 153 | address = {東京}, 154 | title = {タイトル}, 155 | booktitle = {日本語本3}, 156 | chapter = {3}, 157 | edition = {1}, 158 | pages = {100--150}, 159 | } 160 | @incollection{enIncollection1, 161 | address = {Tokyo, Japan}, 162 | publisher = {JP Press}, 163 | author = {Sato, Jiro and Hayashi, Saburo}, 164 | booktitle = {Jpbook2}, 165 | title = {Part of Jpbook2}, 166 | pages = {100--200}, 167 | edition = {2}, 168 | year = {2012}, 169 | } 170 | @book{jpBook1, 171 | author = {佐藤, 一郎}, 172 | year = {2010}, 173 | publisher = {日本語出版}, 174 | address = {東京}, 175 | title = {日本語本}, 176 | edition = {1}, 177 | pages = {100--200} 178 | } 179 | @book{jpBook2, 180 | author = {佐藤, 二郎 and 佐藤, 三郎}, 181 | year = {2012}, 182 | publisher = {日本語出版}, 183 | address = {東京}, 184 | title = {日本語本2}, 185 | edition = {2}, 186 | pages = {100--200} 187 | } 188 | @book{jpBook3, 189 | author = {学会委員会}, 190 | year = {2020}, 191 | publisher = {学会出版}, 192 | title = {学会本}, 193 | edition = {1} 194 | } 195 | @book{enBook1, 196 | address = {City, Country}, 197 | publisher = {Publisher}, 198 | author = {Sato, Jiro and Hayashi, Saburo}, 199 | year = {2000}, 200 | title = {Title, not booktitle}, 201 | edition = {3}, 202 | pages = {1-10}, 203 | } 204 | @book{enjBook1, 205 | author = {Ichiro Sato}, 206 | year = {2010}, 207 | publisher = {Japanese Publisher}, 208 | address = {Tokyo}, 209 | title = {Japanese Book title}, 210 | edition = {1}, 211 | pages = {100--200}, 212 | language = {japaneese} 213 | } 214 | @book{jpjBook1, 215 | author = {佐藤 一郎}, 216 | year = {2010}, 217 | publisher = {日本語出版}, 218 | address = {東京}, 219 | title = {日本語本}, 220 | edition = {1}, 221 | pages = {100--200} 222 | } 223 | \end{filecontents} 224 | 225 | 226 | \title{\texttt{jIEEEtran.bst}:\\日本語対応IEEE非公式\BibTeX スタイル\\(ver. 0.19)} 227 | \author{江尻 開} 228 | 229 | \begin{document} 230 | 231 | \maketitle 232 | 233 | \begin{abstract} 234 | jIEEEtranは日本人ユーザ向けに調整されたIEEE形式の非公式\BibTeX スタイルです。 235 | Michael Shell氏のIEEEtran.bstを基に、日本語著者の自然な姓名処理を実現します。 236 | 一つのエントリに英語と日本語を併記可能とするPythonスクリプトmixej.pyも提供します。 237 | \end{abstract} 238 | 239 | 240 | \section{はじめに} 241 | 242 | \texttt{jIEEEtran.bst}はIEEEの引用スタイルを保ったまま日本語の取り扱いを自然にした\BibTeX スタイル(\texttt{.bst})ファイルです。 243 | 卒業論文や修士論文など,\LaTeX を使用した文献管理の一助になることを目的としています。 244 | Michael Shell氏による\texttt{IEEEtran.bst}\cite{IEEEtran}をもとにYoshiRi氏が日本語の自然な表記を実装し,現在は著者がリポジトリを譲渡していただきGitHub上\cite{jIEEEtran}で継続して開発しています。 245 | 同レポジトリでは電気学会形式の非公式\BibTeX スタイルである\texttt{IEEJtran.bst}も取り扱っています。 246 | オプションの追記方法や日本語の判別方法については,武田氏らによる\texttt{jecon.bst}\cite{jeconbst}を参考にしています。 247 | \TeX Live 2019以降の使用を想定しています。 248 | \texttt{w32tex}や古い\TeX Liveでの動作は確認していません。 249 | \TeX エンジンとしてplatex/pbibtexもしくはuplatex/upbibtexを推奨し,本マニュアルはuplatexでコンパイルしています。 250 | \TeX エンジンが出力する中間ファイルの改変にPythonを使用します。 251 | Pythonは\texttt{3.7}以降での動作を確認しています。 252 | 253 | 254 | \section{使用方法} 255 | 256 | \texttt{jIEEEtran.bst}が\TeX Liveのパッケージマネージャ等でインストールされ,PATHの通った場所に配置されている場合,プリアンブルに\texttt{\string\bibliographystyle\string{jIEEEtran\string}}と記載すれば設定は完了です。 257 | 後述のカスタマイズ等の目的で\texttt{jIEEEtran.bst}を個別にダウンロードして配置する場合,メインの\TeX ファイルと同じディレクトリに格納し,同様にプリアンブルに\texttt{\string\bibliographystyle\string{jIEEEtran\string}}と記載すれば設定は完了です。 258 | 259 | 文献情報が記載される\texttt{.bib}ファイル上では,日本人著者は 260 | \begin{center} 261 | \texttt{author = \string{\string{\textgt{姓姓 名名}\string} and \string{\textgt{姓姓 名名}\string}\string}} 262 | \end{center} 263 | と,\texttt{\string{\string}}で挟むか, 264 | \begin{center} 265 | \texttt{author = \string{姓姓, 名名 and 姓姓, 名名\string}} 266 | \end{center} 267 | と,\texttt{\string{\string}}で挟まず半角カンマを挿入して記入してください。 268 | 269 | 270 | \section{カスタマイズ} 271 | \texttt{jIEEEtran}はテキストファイルである\texttt{jIEEEtran.bst}を直接変更することでカスタマイズが可能です。 272 | 例えば、IEEE形式では同一著者の文献が連続した場合に著者名を長ダッシュで代用しますが、この処理を行いたくない場合、\texttt{jIEEEtran.bst}の 273 | \begin{center} 274 | \texttt{FUNCTION \string{default.is.dash.repeated.names.ieee\string} \string{ \#1 \string}} 275 | \end{center} 276 | を 277 | \begin{center} 278 | \texttt{FUNCTION \string{default.is.dash.repeated.names.ieee\string} \string{ \#0 \string}} 279 | \end{center} 280 | に変更します。 281 | 他の設定項目は\texttt{jIEEEtran.bst}を直接ご確認ください。 282 | 283 | 284 | \section{英語と日本語の併記方法} 285 | 286 | 電気学会の引用スタイルで求められているように,一つの文献エントリに英語と日本語の情報を併記する場合,\texttt{.tex}ファイルには次のように記載してください。 287 | \begin{center} 288 | \texttt{\string\cite\string{enArticle1/ej/jpArticle1\string}} 289 | \end{center} 290 | 加えて,外部pythonファイルの\texttt{mixej.py}を用いて\texttt{.aux}ファイルと\texttt{.bbl}ファイルを改変する必要があります。 291 | 具体的には,\BibTeX コマンドの実行前に\texttt{enArticle1/ej/jpArticle1\string}を\texttt{enArticle1}と\texttt{jpArticle1}の2つのエントリに分け,\BibTeX コマンドが文献情報を書き出した後に再度結合させる操作を行います。 292 | 293 | 294 | \subsection{コンパイル手順} 295 | 296 | 英語と日本語の併記を行わない場合,通常通りのコンパイル手順で\texttt{.pdf}を生成することができます。 297 | 例えば\texttt{uplatex}で\texttt{.dvi}を生成し,\texttt{.dvi}から\texttt{.pdf}を生成,\BibTeX コマンドには\texttt{upbibtex}を使う場合, 298 | \begin{center} 299 | \texttt{uplatex → upbibtex → uplatex → uplatex → dvipdfmx} 300 | \end{center} 301 | という手順です。 302 | 303 | 英語と日本語の併記を行う場合,通常のコンパイル手順での\texttt{upbibtex}前後に\texttt{python}による\texttt{mixej.py}の処理を一回ずつ挟みます。 304 | 前と同様に,\texttt{uplatex}で\texttt{.dvi}を生成し,\texttt{.dvi}から\texttt{.pdf}を生成,\BibTeX コマンドには\texttt{upbibtex}を使う場合, 305 | \begin{center} 306 | \texttt{uplatex → python mixej.py → upbibtex → python mixej.py\\→ uplatex → uplatex → dvipdfmx} 307 | \end{center} 308 | という手順に変更されます。 309 | 310 | 311 | \subsection{コンパイラの設定の例} 312 | 313 | Latexmkを使用している場合,MacやLinuxなどのUNIX系列では\texttt{.latexmkrc}に対して次のように設定することで実現可能です。 314 | 315 | \noindent\makebox[\linewidth]{\rule{\linewidth}{0.4pt}}\vspace{-0.5zw} 316 | \begin{lstlisting}[style=onecol] 317 | #!/usr/bin/perl 318 | 319 | $latex = 'uplatex %O -synctex=1 -interaction=nonstopmode -kanji=utf8 -file-line-error %S'; 320 | $bibtex = 'python mixej.py %B; upbibtex %O %B; python mixej.py %B'; 321 | $dvipdf = 'dvipdfmx -V 7 %O -o %D %S'; 322 | $pdf_previewer = "open -ga /Applications/Skim.app"; 323 | \end{lstlisting}\vspace{-1.8zw} 324 | \noindent\makebox[\linewidth]{\rule{\linewidth}{0.4pt}}\vspace{0.5zw}\par 325 | 326 | \noindent 327 | Windowsでは,cmd, powershellともに\texttt{bibtex}の設定を次のようにすれば動きます。ただし,\texttt{\&}前後の半角スペースを忘れずに記入してください。 328 | 329 | \noindent\makebox[\linewidth]{\rule{\linewidth}{0.4pt}}\vspace{-0.5zw} 330 | \begin{lstlisting}[style=onecol] 331 | $bibtex = '@cd & python mixej.py %B & upbibtex %B & python mixej.py %B'; 332 | \end{lstlisting}\vspace{-1.8zw} 333 | \noindent\makebox[\linewidth]{\rule{\linewidth}{0.4pt}}\vspace{0.5zw}\par 334 | 335 | 336 | 最近ではVisual Studio Codeを使用している方が多いと思いますが,MacやLinuxでのVSCodeのLaTeX Workshop Extension用の設定は次のように書けます。Windowsの場合は\texttt{.latexmkrc}の場合と同様に\texttt{bibtex}コマンドを書き換えてください。 337 | 338 | \noindent\makebox[\linewidth]{\rule{\linewidth}{0.4pt}}\vspace{-0.5zw} 339 | \begin{lstlisting}[style=onecol] 340 | "latex-workshop.latex.tools": [ 341 | { 342 | "command": "latexmk", 343 | "name": "latexmk uplatex/upbibtex/mixej", 344 | "args": [ 345 | "-e", "$latex='uplatex %O -synctex=1 -interaction=nonstopmode -kanji=utf8 -file-line-error %S'", 346 | "-e", "$bibtex='python mixej.py %B; upbibtex %O %B; python mixej.py %B'", 347 | "-e", "$dvipdf='dvipdfmx -V 7 %O -o %D %S'", 348 | "-norc", "-pdfdvi", "%DOC%" 349 | ], 350 | } 351 | ], 352 | "latex-workshop.latex.recipes": [ 353 | { "name": "latexmk uplatex/upbibtex/mixej", "tools": [ "latexmk uplatex/upbibtex/mixej" ] } 354 | ], 355 | \end{lstlisting}\vspace{-1.8zw} 356 | \noindent\makebox[\linewidth]{\rule{\linewidth}{0.4pt}}\vspace{0.5zw}\par 357 | 358 | 359 | \subsection{引用例} 360 | 361 | いくつかの引用例を示します。 362 | 英語Articleの例\cite{enArticle1}。 363 | 日本語Articleの例\cite{jpArticle1}。 364 | 英語と日本語を併記したArticleの例\cite{enArticle2/ej/jpArticle2,enArticle3/ej/jpArticle3}。 365 | 英語Inproceedingsの例\cite{enInproceedings1}。 366 | 日本語Inproceedingsの例\cite{jpInproceedings1}。 367 | 英語と日本語を併記したInproceedingsの例\cite{enInproceedings2/ej/jpInproceedings2}。 368 | 英語Incollectionの例\cite{enIncollection1}。 369 | 日本語Incollectionの例\cite{jpIncollection1,jpIncollection2}。 370 | 英語Bookの例\cite{enBook1}。 371 | 日本語Bookの例\cite{jpBook1,jpBook2,jpBook3}。 372 | 英語と日本語を併記したBookの例\cite{enjBook1/ej/jpjBook1}。 373 | 374 | \bibliography{library.bib} 375 | 376 | \end{document} 377 | -------------------------------------------------------------------------------- /jieeetran/jieeetran.tex: -------------------------------------------------------------------------------- 1 | \documentclass[11pt, a4paper, dvipdfmx, uplatex]{jsarticle} 2 | \bibliographystyle{jIEEEtran} 3 | 4 | \usepackage{listings, jlisting} 5 | \lstdefinestyle{onecol}{ 6 | basicstyle={\scriptsize\ttfamily}, 7 | identifierstyle={\footnotesize}, 8 | commentstyle={\footnotesizeitshape}, 9 | keywordstyle={\footnotesize\bfseries}, 10 | ndkeywordstyle={\footnotesize}, 11 | stringstyle={\footnotesize\ttfamily}, 12 | breaklines=true, 13 | columns=[l]{fullflexible} 14 | } 15 | 16 | \begin{filecontents}[overwrite]{library.bib} 17 | @misc{IEEEtran, 18 | author = {Michael Shell}, 19 | url = {https://www.ctan.org/tex-archive/macros/latex/contrib/IEEEtran/bibtex}, 20 | title = {{IEEEtran}}, 21 | month = {August}, 22 | year = {2015} 23 | } 24 | @misc{jIEEEtran, 25 | author = {ehki}, 26 | url = {https://github.com/ehki/jIEEEtran}, 27 | title = {{jIEEEtran}}, 28 | month = {March}, 29 | year = {2020} 30 | } 31 | @misc{jeconbst, 32 | author = {ShiroTakeda}, 33 | url = {http://shirotakeda.org/ja/tex-ja/jecon-ja.html}, 34 | title = {{jecon.bst}}, 35 | month = {August}, 36 | year = {2019} 37 | } 38 | @article{jpArticle1, 39 | author = {山田 一郎 and 山田 次郎 and 山田 三郎 and 山田 四郎}, 40 | year = {2019}, 41 | journal = {日本語学会}, 42 | title = {文献1}, 43 | number = {10}, 44 | pages = {20--30}, 45 | volume = {15}, 46 | month = {3} 47 | } 48 | @article{jpArticle2, 49 | author = {{山田 五郎} and {山田 六郎}}, 50 | year = {2019}, 51 | journal = {日本語学会}, 52 | title = {文献2}, 53 | number = {10}, 54 | pages = {21}, 55 | volume = {15}, 56 | month = {12} 57 | } 58 | @article{jpArticle3, 59 | author = {{山田 八郎} and {山田 六郎}}, 60 | year = {2010}, 61 | journal = {日本語学会}, 62 | title = {手法1と手法2の比較検討}, 63 | number = {1}, 64 | pages = {15}, 65 | volume = {5} 66 | } 67 | @article{enArticle1, 68 | author = {Ichiro Yamada and Jiro Yamada and Saburo Yamada and Shiro Yamada}, 69 | year = {2019}, 70 | journal = {Japanese Journal}, 71 | title = {Title1}, 72 | number = {10}, 73 | pages = {20--30}, 74 | volume = {15}, 75 | month = {march}, 76 | language = {Japanese} 77 | } 78 | @article{enArticle2, 79 | author = {Goro Yamada and Rokuro Yamada}, 80 | year = {2019}, 81 | journal = {Japanese Journal}, 82 | title = {Title2}, 83 | volume = {15}, 84 | number = {10}, 85 | pages = {21}, 86 | month = {dec.}, 87 | language = {Japanese} 88 | } 89 | @article{enArticle3, 90 | author = {Hachiro Yamada and Rokuro Yamada}, 91 | year = {2010}, 92 | journal = {Japanese Journal}, 93 | title = {Comparison Between Method 1 and Method 2}, 94 | number = {1}, 95 | pages = {15}, 96 | volume = {5} 97 | } 98 | @inproceedings{jpInproceedings1, 99 | author = {山田, 一郎 and 山田, 次郎}, 100 | title = {文献タイトル}, 101 | booktitle = {令和2年日本語大会}, 102 | address = {大阪}, 103 | year = {2010}, 104 | month = {3}, 105 | number = {10}, 106 | pages = {20--30} 107 | } 108 | @inproceedings{jpInproceedings2, 109 | author = {山田, 三郎 and 佐藤, 四郎}, 110 | title = {タイトル}, 111 | booktitle = {第30回部門大会}, 112 | address = {東京}, 113 | year = {2005}, 114 | month = {2}, 115 | number = {2}, 116 | pages = {15--19} 117 | } 118 | @inproceedings{enInproceedings1, 119 | author = {Hayashi, Shinji and Ogura, Yasuhiro}, 120 | title = {Sample Conference Article Title}, 121 | booktitle = {Proc. 5th Internatinoal Sample Conference (ISC)}, 122 | address = {Tokyo, Japan}, 123 | month = {jan}, 124 | year = {1997}, 125 | pages = {290-294}, 126 | number = {2} 127 | } 128 | @inproceedings{enInproceedings2, 129 | author = {Yamada, Sabuso and Sato, Shiro}, 130 | title = {Title}, 131 | booktitle = {Proc. 30th Society Conference}, 132 | address = {Tokyo}, 133 | year = {2005}, 134 | month = {2}, 135 | number = {2}, 136 | pages = {15--19}, 137 | language = {Japanese} 138 | } 139 | @incollection{jpIncollection1, 140 | author = {{佐藤 二郎} and {林 三郎}}, 141 | year = {2012}, 142 | publisher = {日本語出版}, 143 | address = {東京}, 144 | title = {日本語本2の中の抜粋}, 145 | booktitle = {日本語本2}, 146 | edition = {2}, 147 | pages = {100--200} 148 | } 149 | @incollection{jpIncollection2, 150 | author = {山田, 一郎}, 151 | year = {1900}, 152 | publisher = {出版会社}, 153 | address = {東京}, 154 | title = {タイトル}, 155 | booktitle = {日本語本3}, 156 | chapter = {3}, 157 | edition = {1}, 158 | pages = {100--150}, 159 | } 160 | @incollection{enIncollection1, 161 | address = {Tokyo, Japan}, 162 | publisher = {JP Press}, 163 | author = {Sato, Jiro and Hayashi, Saburo}, 164 | booktitle = {Jpbook2}, 165 | title = {Part of Jpbook2}, 166 | pages = {100--200}, 167 | edition = {2}, 168 | year = {2012}, 169 | } 170 | @book{jpBook1, 171 | author = {佐藤, 一郎}, 172 | year = {2010}, 173 | publisher = {日本語出版}, 174 | address = {東京}, 175 | title = {日本語本}, 176 | edition = {1}, 177 | pages = {100--200} 178 | } 179 | @book{jpBook2, 180 | author = {佐藤, 二郎 and 佐藤, 三郎}, 181 | year = {2012}, 182 | publisher = {日本語出版}, 183 | address = {東京}, 184 | title = {日本語本2}, 185 | edition = {2}, 186 | pages = {100--200} 187 | } 188 | @book{jpBook3, 189 | author = {学会委員会}, 190 | year = {2020}, 191 | publisher = {学会出版}, 192 | title = {学会本}, 193 | edition = {1} 194 | } 195 | @book{enBook1, 196 | address = {City, Country}, 197 | publisher = {Publisher}, 198 | author = {Sato, Jiro and Hayashi, Saburo}, 199 | year = {2000}, 200 | title = {Title, not booktitle}, 201 | edition = {3}, 202 | pages = {1-10}, 203 | } 204 | @book{enjBook1, 205 | author = {Ichiro Sato}, 206 | year = {2010}, 207 | publisher = {Japanese Publisher}, 208 | address = {Tokyo}, 209 | title = {Japanese Book title}, 210 | edition = {1}, 211 | pages = {100--200}, 212 | language = {japaneese} 213 | } 214 | @book{jpjBook1, 215 | author = {佐藤 一郎}, 216 | year = {2010}, 217 | publisher = {日本語出版}, 218 | address = {東京}, 219 | title = {日本語本}, 220 | edition = {1}, 221 | pages = {100--200} 222 | } 223 | \end{filecontents} 224 | 225 | 226 | \title{\texttt{jIEEEtran.bst}:\\日本語対応IEEE非公式\BibTeX スタイル\\(ver. 0.19)} 227 | \author{江尻 開} 228 | 229 | \begin{document} 230 | 231 | \maketitle 232 | 233 | \begin{abstract} 234 | jIEEEtranは日本人ユーザ向けに調整されたIEEE形式の非公式\BibTeX スタイルです。 235 | Michael Shell氏のIEEEtran.bstを基に、日本語著者の自然な姓名処理を実現します。 236 | 一つのエントリに英語と日本語を併記可能とするPythonスクリプトmixej.pyも提供します。 237 | \end{abstract} 238 | 239 | 240 | \section{はじめに} 241 | 242 | \texttt{jIEEEtran.bst}はIEEEの引用スタイルを保ったまま日本語の取り扱いを自然にした\BibTeX スタイル(\texttt{.bst})ファイルです。 243 | 卒業論文や修士論文など,\LaTeX を使用した文献管理の一助になることを目的としています。 244 | Michael Shell氏による\texttt{IEEEtran.bst}\cite{IEEEtran}をもとにYoshiRi氏が日本語の自然な表記を実装し,現在は著者がリポジトリを譲渡していただきGitHub上\cite{jIEEEtran}で継続して開発しています。 245 | 同レポジトリでは電気学会形式の非公式\BibTeX スタイルである\texttt{IEEJtran.bst}も取り扱っています。 246 | オプションの追記方法や日本語の判別方法については,武田氏らによる\texttt{jecon.bst}\cite{jeconbst}を参考にしています。 247 | \TeX Live 2019以降の使用を想定しています。 248 | \texttt{w32tex}や古い\TeX Liveでの動作は確認していません。 249 | \TeX エンジンとしてplatex/pbibtexもしくはuplatex/upbibtexを推奨し,本マニュアルはuplatexでコンパイルしています。 250 | \TeX エンジンが出力する中間ファイルの改変にPythonを使用します。 251 | Pythonは\texttt{3.7}以降での動作を確認しています。 252 | 253 | 254 | \section{使用方法} 255 | 256 | \texttt{jIEEEtran.bst}が\TeX Liveのパッケージマネージャ等でインストールされ,PATHの通った場所に配置されている場合,プリアンブルに\texttt{\string\bibliographystyle\string{jIEEEtran\string}}と記載すれば設定は完了です。 257 | 後述のカスタマイズ等の目的で\texttt{jIEEEtran.bst}を個別にダウンロードして配置する場合,メインの\TeX ファイルと同じディレクトリに格納し,同様にプリアンブルに\texttt{\string\bibliographystyle\string{jIEEEtran\string}}と記載すれば設定は完了です。 258 | 259 | 文献情報が記載される\texttt{.bib}ファイル上では,日本人著者は 260 | \begin{center} 261 | \texttt{author = \string{\string{\textgt{姓姓 名名}\string} and \string{\textgt{姓姓 名名}\string}\string}} 262 | \end{center} 263 | と,\texttt{\string{\string}}で挟むか, 264 | \begin{center} 265 | \texttt{author = \string{姓姓, 名名 and 姓姓, 名名\string}} 266 | \end{center} 267 | と,\texttt{\string{\string}}で挟まず半角カンマを挿入して記入してください。 268 | 269 | 270 | \section{カスタマイズ} 271 | \texttt{jIEEEtran}はテキストファイルである\texttt{jIEEEtran.bst}を直接変更することでカスタマイズが可能です。 272 | 例えば、IEEE形式では同一著者の文献が連続した場合に著者名を長ダッシュで代用しますが、この処理を行いたくない場合、\texttt{jIEEEtran.bst}の 273 | \begin{center} 274 | \texttt{FUNCTION \string{default.is.dash.repeated.names.ieee\string} \string{ \#1 \string}} 275 | \end{center} 276 | を 277 | \begin{center} 278 | \texttt{FUNCTION \string{default.is.dash.repeated.names.ieee\string} \string{ \#0 \string}} 279 | \end{center} 280 | に変更します。 281 | 他の設定項目は\texttt{jIEEEtran.bst}を直接ご確認ください。 282 | 283 | 284 | \section{英語と日本語の併記方法} 285 | 286 | 電気学会の引用スタイルで求められているように,一つの文献エントリに英語と日本語の情報を併記する場合,\texttt{.tex}ファイルには次のように記載してください。 287 | \begin{center} 288 | \texttt{\string\cite\string{enArticle1/ej/jpArticle1\string}} 289 | \end{center} 290 | 加えて,外部pythonファイルの\texttt{mixej.py}を用いて\texttt{.aux}ファイルと\texttt{.bbl}ファイルを改変する必要があります。 291 | 具体的には,\BibTeX コマンドの実行前に\texttt{enArticle1/ej/jpArticle1\string}を\texttt{enArticle1}と\texttt{jpArticle1}の2つのエントリに分け,\BibTeX コマンドが文献情報を書き出した後に再度結合させる操作を行います。 292 | 293 | 294 | \subsection{コンパイル手順} 295 | 296 | 英語と日本語の併記を行わない場合,通常通りのコンパイル手順で\texttt{.pdf}を生成することができます。 297 | 例えば\texttt{uplatex}で\texttt{.dvi}を生成し,\texttt{.dvi}から\texttt{.pdf}を生成,\BibTeX コマンドには\texttt{upbibtex}を使う場合, 298 | \begin{center} 299 | \texttt{uplatex → upbibtex → uplatex → uplatex → dvipdfmx} 300 | \end{center} 301 | という手順です。 302 | 303 | 英語と日本語の併記を行う場合,通常のコンパイル手順での\texttt{upbibtex}前後に\texttt{python}による\texttt{mixej.py}の処理を一回ずつ挟みます。 304 | 前と同様に,\texttt{uplatex}で\texttt{.dvi}を生成し,\texttt{.dvi}から\texttt{.pdf}を生成,\BibTeX コマンドには\texttt{upbibtex}を使う場合, 305 | \begin{center} 306 | \texttt{uplatex → python mixej.py → upbibtex → python mixej.py\\→ uplatex → uplatex → dvipdfmx} 307 | \end{center} 308 | という手順に変更されます。 309 | 310 | 311 | \subsection{コンパイラの設定の例} 312 | 313 | Latexmkを使用している場合,MacやLinuxなどのUNIX系列では\texttt{.latexmkrc}に対して次のように設定することで実現可能です。 314 | 315 | \noindent\makebox[\linewidth]{\rule{\linewidth}{0.4pt}}\vspace{-0.5zw} 316 | \begin{lstlisting}[style=onecol] 317 | #!/usr/bin/perl 318 | 319 | $latex = 'uplatex %O -synctex=1 -interaction=nonstopmode -kanji=utf8 -file-line-error %S'; 320 | $bibtex = 'python mixej.py %B; upbibtex %O %B; python mixej.py %B'; 321 | $dvipdf = 'dvipdfmx -V 7 %O -o %D %S'; 322 | $pdf_previewer = "open -ga /Applications/Skim.app"; 323 | \end{lstlisting}\vspace{-1.8zw} 324 | \noindent\makebox[\linewidth]{\rule{\linewidth}{0.4pt}}\vspace{0.5zw}\par 325 | 326 | \noindent 327 | Windowsでは,cmd, powershellともに\texttt{bibtex}の設定を次のようにすれば動きます。ただし,\texttt{\&}前後の半角スペースを忘れずに記入してください。 328 | 329 | \noindent\makebox[\linewidth]{\rule{\linewidth}{0.4pt}}\vspace{-0.5zw} 330 | \begin{lstlisting}[style=onecol] 331 | $bibtex = '@cd & python mixej.py %B & upbibtex %B & python mixej.py %B'; 332 | \end{lstlisting}\vspace{-1.8zw} 333 | \noindent\makebox[\linewidth]{\rule{\linewidth}{0.4pt}}\vspace{0.5zw}\par 334 | 335 | 336 | 最近ではVisual Studio Codeを使用している方が多いと思いますが,MacやLinuxでのVSCodeのLaTeX Workshop Extension用の設定は次のように書けます。Windowsの場合は\texttt{.latexmkrc}の場合と同様に\texttt{bibtex}コマンドを書き換えてください。 337 | 338 | \noindent\makebox[\linewidth]{\rule{\linewidth}{0.4pt}}\vspace{-0.5zw} 339 | \begin{lstlisting}[style=onecol] 340 | "latex-workshop.latex.tools": [ 341 | { 342 | "command": "latexmk", 343 | "name": "latexmk uplatex/upbibtex/mixej", 344 | "args": [ 345 | "-e", "$latex='uplatex %O -synctex=1 -interaction=nonstopmode -kanji=utf8 -file-line-error %S'", 346 | "-e", "$bibtex='python mixej.py %B; upbibtex %O %B; python mixej.py %B'", 347 | "-e", "$dvipdf='dvipdfmx -V 7 %O -o %D %S'", 348 | "-norc", "-pdfdvi", "%DOC%" 349 | ], 350 | } 351 | ], 352 | "latex-workshop.latex.recipes": [ 353 | { "name": "latexmk uplatex/upbibtex/mixej", "tools": [ "latexmk uplatex/upbibtex/mixej" ] } 354 | ], 355 | \end{lstlisting}\vspace{-1.8zw} 356 | \noindent\makebox[\linewidth]{\rule{\linewidth}{0.4pt}}\vspace{0.5zw}\par 357 | 358 | 359 | \subsection{引用例} 360 | 361 | いくつかの引用例を示します。 362 | 英語Articleの例\cite{enArticle1}。 363 | 日本語Articleの例\cite{jpArticle1}。 364 | 英語と日本語を併記したArticleの例\cite{enArticle2/ej/jpArticle2,enArticle3/ej/jpArticle3}。 365 | 英語Inproceedingsの例\cite{enInproceedings1}。 366 | 日本語Inproceedingsの例\cite{jpInproceedings1}。 367 | 英語と日本語を併記したInproceedingsの例\cite{enInproceedings2/ej/jpInproceedings2}。 368 | 英語Incollectionの例\cite{enIncollection1}。 369 | 日本語Incollectionの例\cite{jpIncollection1,jpIncollection2}。 370 | 英語Bookの例\cite{enBook1}。 371 | 日本語Bookの例\cite{jpBook1,jpBook2,jpBook3}。 372 | 英語と日本語を併記したBookの例\cite{enjBook1/ej/jpjBook1}。 373 | 374 | \bibliography{library.bib} 375 | 376 | \end{document} 377 | -------------------------------------------------------------------------------- /ieejtran.tex: -------------------------------------------------------------------------------- 1 | \documentclass[11pt, a4paper, dvipdfmx, uplatex]{jsarticle} 2 | \bibliographystyle{IEEJtran} 3 | 4 | \usepackage{listings, jlisting} 5 | \lstdefinestyle{onecol}{ 6 | basicstyle={\scriptsize\ttfamily}, 7 | identifierstyle={\footnotesize}, 8 | commentstyle={\footnotesizeitshape}, 9 | keywordstyle={\footnotesize\bfseries}, 10 | ndkeywordstyle={\footnotesize}, 11 | stringstyle={\footnotesize\ttfamily}, 12 | breaklines=true, 13 | columns=[l]{fullflexible} 14 | } 15 | 16 | \begin{filecontents}[overwrite]{library.bib} 17 | @misc{IEEEtran, 18 | author = {Michael Shell}, 19 | url = {https://www.ctan.org/tex-archive/macros/latex/contrib/IEEEtran/bibtex}, 20 | title = {{IEEEtran}}, 21 | month = {August}, 22 | year = {2015} 23 | } 24 | @misc{jIEEEtran, 25 | author = {ehki}, 26 | url = {https://github.com/ehki/jIEEEtran}, 27 | title = {{jIEEEtran}}, 28 | month = {March}, 29 | year = {2020} 30 | } 31 | @misc{jeconbst, 32 | author = {ShiroTakeda}, 33 | url = {http://shirotakeda.org/ja/tex-ja/jecon-ja.html}, 34 | title = {{jecon.bst}}, 35 | month = {August}, 36 | year = {2019} 37 | } 38 | @article{jpArticle1, 39 | author = {山田 一郎 and 山田 次郎 and 山田 三郎 and 山田 四郎}, 40 | year = {2019}, 41 | journal = {日本語学会}, 42 | title = {文献1}, 43 | number = {10}, 44 | pages = {20--30}, 45 | volume = {15}, 46 | month = {3} 47 | } 48 | @article{jpArticle2, 49 | author = {{山田 五郎} and {山田 六郎}}, 50 | year = {2019}, 51 | journal = {日本語学会}, 52 | title = {文献2}, 53 | number = {10}, 54 | pages = {21}, 55 | volume = {15}, 56 | month = {12} 57 | } 58 | @article{jpArticle3, 59 | author = {{山田 八郎} and {山田 六郎}}, 60 | year = {2010}, 61 | journal = {日本語学会}, 62 | title = {手法1と手法2の比較検討}, 63 | number = {1}, 64 | pages = {15}, 65 | volume = {5} 66 | } 67 | @article{enArticle1, 68 | author = {Ichiro Yamada and Jiro Yamada and Saburo Yamada and Shiro Yamada}, 69 | year = {2019}, 70 | journal = {Japanese Journal}, 71 | title = {Title1}, 72 | number = {10}, 73 | pages = {20--30}, 74 | volume = {15}, 75 | month = {march}, 76 | language = {Japanese} 77 | } 78 | @article{enArticle2, 79 | author = {Goro Yamada and Rokuro Yamada}, 80 | year = {2019}, 81 | journal = {Japanese Journal}, 82 | title = {Title2}, 83 | volume = {15}, 84 | number = {10}, 85 | pages = {21}, 86 | month = {dec.}, 87 | language = {Japanese} 88 | } 89 | @article{enArticle3, 90 | author = {Hachiro Yamada and Rokuro Yamada}, 91 | year = {2010}, 92 | journal = {Japanese Journal}, 93 | title = {Comparison Between Method 1 and Method 2}, 94 | number = {1}, 95 | pages = {15}, 96 | volume = {5} 97 | } 98 | @inproceedings{jpInproceedings1, 99 | author = {山田, 一郎 and 山田, 次郎}, 100 | title = {文献タイトル}, 101 | booktitle = {令和2年日本語大会}, 102 | address = {大阪}, 103 | year = {2010}, 104 | month = {3}, 105 | number = {10}, 106 | pages = {20--30} 107 | } 108 | @inproceedings{jpInproceedings2, 109 | author = {山田, 三郎 and 佐藤, 四郎}, 110 | title = {タイトル}, 111 | booktitle = {第30回部門大会}, 112 | address = {東京}, 113 | year = {2005}, 114 | month = {2}, 115 | number = {2}, 116 | pages = {15--19} 117 | } 118 | @inproceedings{enInproceedings1, 119 | author = {Hayashi, Shinji and Ogura, Yasuhiro}, 120 | title = {Sample Conference Article Title}, 121 | booktitle = {Proc. 5th Internatinoal Sample Conference (ISC)}, 122 | address = {Tokyo, Japan}, 123 | month = {jan}, 124 | year = {1997}, 125 | pages = {290-294}, 126 | number = {2} 127 | } 128 | @inproceedings{enInproceedings2, 129 | author = {Yamada, Sabuso and Sato, Shiro}, 130 | title = {Title}, 131 | booktitle = {Proc. 30th Society Conference}, 132 | address = {Tokyo}, 133 | year = {2005}, 134 | month = {2}, 135 | number = {2}, 136 | pages = {15--19}, 137 | language = {Japanese} 138 | } 139 | @incollection{jpIncollection1, 140 | author = {{佐藤 二郎} and {林 三郎}}, 141 | year = {2012}, 142 | publisher = {日本語出版}, 143 | address = {東京}, 144 | title = {日本語本2の中の抜粋}, 145 | booktitle = {日本語本2}, 146 | edition = {2}, 147 | pages = {100--200} 148 | } 149 | @incollection{jpIncollection2, 150 | author = {山田, 一郎}, 151 | year = {1900}, 152 | publisher = {出版会社}, 153 | address = {東京}, 154 | title = {タイトル}, 155 | booktitle = {日本語本3}, 156 | chapter = {3}, 157 | edition = {1}, 158 | pages = {100--150}, 159 | } 160 | @incollection{enIncollection1, 161 | address = {Tokyo, Japan}, 162 | publisher = {JP Press}, 163 | author = {Sato, Jiro and Hayashi, Saburo}, 164 | booktitle = {Jpbook2}, 165 | title = {Part of Jpbook2}, 166 | pages = {100--200}, 167 | edition = {2}, 168 | year = {2012}, 169 | } 170 | @book{jpBook1, 171 | author = {佐藤, 一郎}, 172 | year = {2010}, 173 | publisher = {日本語出版}, 174 | address = {東京}, 175 | title = {日本語本}, 176 | edition = {1}, 177 | pages = {100--200} 178 | } 179 | @book{jpBook2, 180 | author = {佐藤, 二郎 and 佐藤, 三郎}, 181 | year = {2012}, 182 | publisher = {日本語出版}, 183 | address = {東京}, 184 | title = {日本語本2}, 185 | edition = {2}, 186 | pages = {100--200} 187 | } 188 | @book{jpBook3, 189 | author = {学会委員会}, 190 | year = {2020}, 191 | publisher = {学会出版}, 192 | title = {学会本}, 193 | edition = {1} 194 | } 195 | @book{enBook1, 196 | address = {City, Country}, 197 | publisher = {Publisher}, 198 | author = {Sato, Jiro and Hayashi, Saburo}, 199 | year = {2000}, 200 | title = {Title, not booktitle}, 201 | edition = {3}, 202 | pages = {1-10}, 203 | } 204 | @book{enjBook1, 205 | author = {Ichiro Sato}, 206 | year = {2010}, 207 | publisher = {Japanese Publisher}, 208 | address = {Tokyo}, 209 | title = {Japanese Book title}, 210 | edition = {1}, 211 | pages = {100--200}, 212 | language = {japaneese} 213 | } 214 | @book{jpjBook1, 215 | author = {佐藤 一郎}, 216 | year = {2010}, 217 | publisher = {日本語出版}, 218 | address = {東京}, 219 | title = {日本語本}, 220 | edition = {1}, 221 | pages = {100--200} 222 | } 223 | \end{filecontents} 224 | 225 | 226 | \title{\texttt{IEEJtran.bst}:\\電気学会非公式\BibTeX スタイル\\(ver. 0.19)} 227 | \author{江尻 開} 228 | 229 | \begin{document} 230 | 231 | \maketitle 232 | 233 | \begin{abstract} 234 | IEEJtranは電気学会形式の非公式\BibTeX スタイルです。 235 | Michael Shell氏のIEEEtran.bstを基に開発されています。 236 | 一つのエントリに英語と日本語を併記可能とするPythonスクリプトmixej.pyも提供します。 237 | \end{abstract} 238 | 239 | 240 | \section{はじめに} 241 | 242 | \texttt{IEEJtran.bst}は電気系の論文を執筆する日本人ユーザ向けに開発された電気学会形式の非公式\BibTeX スタイル(\texttt{.bst})ファイルです。 243 | 電気学会論文誌の下書きや卒業論文,修士論文など,\LaTeX を使用した文献管理の一助になることを目的としています。 244 | Michael Shell氏による\texttt{IEEEtran.bst}\cite{IEEEtran}をもとにYoshiRi氏が日本語の自然な表記を実装し,現在は著者がリポジトリを譲渡していただきGitHub上\cite{jIEEEtran}で継続して開発しています。 245 | 同レポジトリではIEEEの引用スタイルを保ったまま日本語の取り扱いを自然にした\BibTeX スタイルである\texttt{jIEEEtran.bst}も取り扱っています。 246 | オプションの追記方法や日本語の判別方法については,武田氏らによる\texttt{jecon.bst}\cite{jeconbst}を参考にしています。 247 | \TeX Live 2019以降の使用を想定しています。 248 | \texttt{w32tex}や古い\TeX Liveでの動作は確認していません。 249 | \TeX エンジンとしてplatex/pbibtexもしくはuplatex/upbibtexを推奨し,本マニュアルはuplatexでコンパイルしています。 250 | \TeX エンジンが出力する中間ファイルの改変にPythonを使用します。 251 | Pythonは\texttt{3.7}以降での動作を確認しています。 252 | 253 | 254 | \section{使用方法} 255 | 256 | \texttt{IEEJtran.bst}が\TeX Liveのパッケージマネージャ等でインストールされ,PATHの通った場所に配置されている場合,プリアンブルに\texttt{\string\bibliographystyle\string{IEEJtran\string}}と記載すれば設定は完了です。 257 | 後述のカスタマイズ等の目的で\texttt{IEEJtran.bst}を個別にダウンロードして配置する場合,メインの\TeX ファイルと同じディレクトリに格納し,同様にプリアンブルに\texttt{\string\bibliographystyle\string{IEEJtran\string}}と記載すれば設定は完了です。 258 | 259 | 文献情報が記載される\texttt{.bib}ファイル上では,日本人著者は 260 | \begin{center} 261 | \texttt{author = \string{\string{\textgt{姓姓 名名}\string} and \string{\textgt{姓姓 名名}\string}\string}} 262 | \end{center} 263 | と,\texttt{\string{\string}}で挟むか, 264 | \begin{center} 265 | \texttt{author = \string{姓姓, 名名 and 姓姓, 名名\string}} 266 | \end{center} 267 | と,\texttt{\string{\string}}で挟まず半角カンマを挿入して記入してください。 268 | 269 | 270 | \section{カスタマイズ} 271 | \texttt{IEEJtran}はテキストファイルである\texttt{IEEJtran.bst}を直接変更することでカスタマイズが可能です。 272 | 例えば、著者とタイトルの間に挿入される文字を「かぎ括弧」から『二重かぎ括弧』に変更する場合、\texttt{IEEJtran.bst}の 273 | \begin{center} 274 | \texttt{FUNCTION \string{bbl.ieej.jp.title.pre\string} \string{ \string"「\string" \string}}\par 275 | \texttt{FUNCTION \string{bbl.ieej.jp.title.aft\string} \string{ \string"」\string" \string}} 276 | \end{center} 277 | を 278 | \begin{center} 279 | \texttt{FUNCTION \string{bbl.ieej.jp.title.pre\string} \string{ \string"『\string" \string}}\par 280 | \texttt{FUNCTION \string{bbl.ieej.jp.title.aft\string} \string{ \string"』\string" \string}} 281 | \end{center} 282 | に変更します。 283 | 他の設定項目は\texttt{IEEJtran.bst}を直接ご確認ください。 284 | 285 | 286 | \section{英語と日本語の併記方法} 287 | 288 | 電気学会の引用スタイルで求められているように,一つの文献エントリに英語と日本語の情報を併記する場合,\texttt{.tex}ファイルには次のように記載してください。 289 | \begin{center} 290 | \texttt{\string\cite\string{enArticle1/ej/jpArticle1\string}} 291 | \end{center} 292 | 加えて,外部pythonファイルの\texttt{mixej.py}を用いて\texttt{.aux}ファイルと\texttt{.bbl}ファイルを改変する必要があります。 293 | 具体的には,\BibTeX コマンドの実行前に\texttt{enArticle1/ej/jpArticle1\string}を\texttt{enArticle1}と\texttt{jpArticle1}の2つのエントリに分け,\BibTeX コマンドが文献情報を書き出した後に再度結合させる操作を行います。 294 | 295 | 296 | \subsection{コンパイル手順} 297 | 298 | 英語と日本語の併記を行わない場合,通常通りのコンパイル手順で\texttt{.pdf}を生成することができます。 299 | 例えば\texttt{uplatex}で\texttt{.dvi}を生成し,\texttt{.dvi}から\texttt{.pdf}を生成,\BibTeX コマンドには\texttt{upbibtex}を使う場合, 300 | \begin{center} 301 | \texttt{uplatex → upbibtex → uplatex → uplatex → dvipdfmx} 302 | \end{center} 303 | という手順です。 304 | 305 | 英語と日本語の併記を行う場合,通常のコンパイル手順での\texttt{upbibtex}前後に\texttt{python}による\texttt{mixej.py}の処理を一回ずつ挟みます。 306 | 前と同様に,\texttt{uplatex}で\texttt{.dvi}を生成し,\texttt{.dvi}から\texttt{.pdf}を生成,\BibTeX コマンドには\texttt{upbibtex}を使う場合, 307 | \begin{center} 308 | \texttt{uplatex → python mixej.py → upbibtex → python mixej.py\\→ uplatex → uplatex → dvipdfmx} 309 | \end{center} 310 | という手順に変更されます。 311 | 312 | 313 | \subsection{コンパイラの設定の例} 314 | 315 | Latexmkを使用している場合,MacやLinuxなどのUNIX系列では\texttt{.latexmkrc}に対して次のように設定することで実現可能です。 316 | 317 | \noindent\makebox[\linewidth]{\rule{\linewidth}{0.4pt}}\vspace{-0.5zw} 318 | \begin{lstlisting}[style=onecol] 319 | #!/usr/bin/perl 320 | 321 | $latex = 'uplatex %O -synctex=1 -interaction=nonstopmode -kanji=utf8 -file-line-error %S'; 322 | $bibtex = 'python mixej.py %B; upbibtex %O %B; python mixej.py %B'; 323 | $dvipdf = 'dvipdfmx -V 7 %O -o %D %S'; 324 | $pdf_previewer = "open -ga /Applications/Skim.app"; 325 | \end{lstlisting}\vspace{-1.8zw} 326 | \noindent\makebox[\linewidth]{\rule{\linewidth}{0.4pt}}\vspace{0.5zw}\par 327 | 328 | \noindent 329 | Windowsでは,cmd, powershellともに\texttt{bibtex}の設定を次のようにすれば動きます。ただし,\texttt{\&}前後の半角スペースを忘れずに記入してください。 330 | 331 | \noindent\makebox[\linewidth]{\rule{\linewidth}{0.4pt}}\vspace{-0.5zw} 332 | \begin{lstlisting}[style=onecol] 333 | $bibtex = '@cd & python mixej.py %B & upbibtex %B & python mixej.py %B'; 334 | \end{lstlisting}\vspace{-1.8zw} 335 | \noindent\makebox[\linewidth]{\rule{\linewidth}{0.4pt}}\vspace{0.5zw}\par 336 | 337 | 338 | 最近ではVisual Studio Codeを使用している方が多いと思いますが,MacやLinuxでのVSCodeのLaTeX Workshop Extension用の設定は次のように書けます。Windowsの場合は\texttt{.latexmkrc}の場合と同様に\texttt{bibtex}コマンドを書き換えてください。 339 | 340 | \noindent\makebox[\linewidth]{\rule{\linewidth}{0.4pt}}\vspace{-0.5zw} 341 | \begin{lstlisting}[style=onecol] 342 | "latex-workshop.latex.tools": [ 343 | { 344 | "command": "latexmk", 345 | "name": "latexmk uplatex/upbibtex/mixej", 346 | "args": [ 347 | "-e", "$latex='uplatex %O -synctex=1 -interaction=nonstopmode -kanji=utf8 -file-line-error %S'", 348 | "-e", "$bibtex='python mixej.py %B; upbibtex %O %B; python mixej.py %B'", 349 | "-e", "$dvipdf='dvipdfmx -V 7 %O -o %D %S'", 350 | "-norc", "-pdfdvi", "%DOC%" 351 | ], 352 | } 353 | ], 354 | "latex-workshop.latex.recipes": [ 355 | { "name": "latexmk uplatex/upbibtex/mixej", "tools": [ "latexmk uplatex/upbibtex/mixej" ] } 356 | ], 357 | \end{lstlisting}\vspace{-1.8zw} 358 | \noindent\makebox[\linewidth]{\rule{\linewidth}{0.4pt}}\vspace{0.5zw}\par 359 | 360 | 361 | \subsection{引用例} 362 | 363 | いくつかの引用例を示します。 364 | 英語Articleの例\cite{enArticle1}。 365 | 日本語Articleの例\cite{jpArticle1}。 366 | 英語と日本語を併記したArticleの例\cite{enArticle2/ej/jpArticle2,enArticle3/ej/jpArticle3}。 367 | 英語Inproceedingsの例\cite{enInproceedings1}。 368 | 日本語Inproceedingsの例\cite{jpInproceedings1}。 369 | 英語と日本語を併記したInproceedingsの例\cite{enInproceedings2/ej/jpInproceedings2}。 370 | 英語Incollectionの例\cite{enIncollection1}。 371 | 日本語Incollectionの例\cite{jpIncollection1,jpIncollection2}。 372 | 英語Bookの例\cite{enBook1}。 373 | 日本語Bookの例\cite{jpBook1,jpBook2,jpBook3}。 374 | 英語と日本語を併記したBookの例\cite{enjBook1/ej/jpjBook1}。 375 | 376 | \bibliography{library.bib} 377 | 378 | \end{document} 379 | -------------------------------------------------------------------------------- /ieejtran/ieejtran.tex: -------------------------------------------------------------------------------- 1 | \documentclass[11pt, a4paper, dvipdfmx, uplatex]{jsarticle} 2 | \bibliographystyle{IEEJtran} 3 | 4 | \usepackage{listings, jlisting} 5 | \lstdefinestyle{onecol}{ 6 | basicstyle={\scriptsize\ttfamily}, 7 | identifierstyle={\footnotesize}, 8 | commentstyle={\footnotesizeitshape}, 9 | keywordstyle={\footnotesize\bfseries}, 10 | ndkeywordstyle={\footnotesize}, 11 | stringstyle={\footnotesize\ttfamily}, 12 | breaklines=true, 13 | columns=[l]{fullflexible} 14 | } 15 | 16 | \begin{filecontents}[overwrite]{library.bib} 17 | @misc{IEEEtran, 18 | author = {Michael Shell}, 19 | url = {https://www.ctan.org/tex-archive/macros/latex/contrib/IEEEtran/bibtex}, 20 | title = {{IEEEtran}}, 21 | month = {August}, 22 | year = {2015} 23 | } 24 | @misc{jIEEEtran, 25 | author = {ehki}, 26 | url = {https://github.com/ehki/jIEEEtran}, 27 | title = {{jIEEEtran}}, 28 | month = {March}, 29 | year = {2020} 30 | } 31 | @misc{jeconbst, 32 | author = {ShiroTakeda}, 33 | url = {http://shirotakeda.org/ja/tex-ja/jecon-ja.html}, 34 | title = {{jecon.bst}}, 35 | month = {August}, 36 | year = {2019} 37 | } 38 | @article{jpArticle1, 39 | author = {山田 一郎 and 山田 次郎 and 山田 三郎 and 山田 四郎}, 40 | year = {2019}, 41 | journal = {日本語学会}, 42 | title = {文献1}, 43 | number = {10}, 44 | pages = {20--30}, 45 | volume = {15}, 46 | month = {3} 47 | } 48 | @article{jpArticle2, 49 | author = {{山田 五郎} and {山田 六郎}}, 50 | year = {2019}, 51 | journal = {日本語学会}, 52 | title = {文献2}, 53 | number = {10}, 54 | pages = {21}, 55 | volume = {15}, 56 | month = {12} 57 | } 58 | @article{jpArticle3, 59 | author = {{山田 八郎} and {山田 六郎}}, 60 | year = {2010}, 61 | journal = {日本語学会}, 62 | title = {手法1と手法2の比較検討}, 63 | number = {1}, 64 | pages = {15}, 65 | volume = {5} 66 | } 67 | @article{enArticle1, 68 | author = {Ichiro Yamada and Jiro Yamada and Saburo Yamada and Shiro Yamada}, 69 | year = {2019}, 70 | journal = {Japanese Journal}, 71 | title = {Title1}, 72 | number = {10}, 73 | pages = {20--30}, 74 | volume = {15}, 75 | month = {march}, 76 | language = {Japanese} 77 | } 78 | @article{enArticle2, 79 | author = {Goro Yamada and Rokuro Yamada}, 80 | year = {2019}, 81 | journal = {Japanese Journal}, 82 | title = {Title2}, 83 | volume = {15}, 84 | number = {10}, 85 | pages = {21}, 86 | month = {dec.}, 87 | language = {Japanese} 88 | } 89 | @article{enArticle3, 90 | author = {Hachiro Yamada and Rokuro Yamada}, 91 | year = {2010}, 92 | journal = {Japanese Journal}, 93 | title = {Comparison Between Method 1 and Method 2}, 94 | number = {1}, 95 | pages = {15}, 96 | volume = {5} 97 | } 98 | @inproceedings{jpInproceedings1, 99 | author = {山田, 一郎 and 山田, 次郎}, 100 | title = {文献タイトル}, 101 | booktitle = {令和2年日本語大会}, 102 | address = {大阪}, 103 | year = {2010}, 104 | month = {3}, 105 | number = {10}, 106 | pages = {20--30} 107 | } 108 | @inproceedings{jpInproceedings2, 109 | author = {山田, 三郎 and 佐藤, 四郎}, 110 | title = {タイトル}, 111 | booktitle = {第30回部門大会}, 112 | address = {東京}, 113 | year = {2005}, 114 | month = {2}, 115 | number = {2}, 116 | pages = {15--19} 117 | } 118 | @inproceedings{enInproceedings1, 119 | author = {Hayashi, Shinji and Ogura, Yasuhiro}, 120 | title = {Sample Conference Article Title}, 121 | booktitle = {Proc. 5th Internatinoal Sample Conference (ISC)}, 122 | address = {Tokyo, Japan}, 123 | month = {jan}, 124 | year = {1997}, 125 | pages = {290-294}, 126 | number = {2} 127 | } 128 | @inproceedings{enInproceedings2, 129 | author = {Yamada, Sabuso and Sato, Shiro}, 130 | title = {Title}, 131 | booktitle = {Proc. 30th Society Conference}, 132 | address = {Tokyo}, 133 | year = {2005}, 134 | month = {2}, 135 | number = {2}, 136 | pages = {15--19}, 137 | language = {Japanese} 138 | } 139 | @incollection{jpIncollection1, 140 | author = {{佐藤 二郎} and {林 三郎}}, 141 | year = {2012}, 142 | publisher = {日本語出版}, 143 | address = {東京}, 144 | title = {日本語本2の中の抜粋}, 145 | booktitle = {日本語本2}, 146 | edition = {2}, 147 | pages = {100--200} 148 | } 149 | @incollection{jpIncollection2, 150 | author = {山田, 一郎}, 151 | year = {1900}, 152 | publisher = {出版会社}, 153 | address = {東京}, 154 | title = {タイトル}, 155 | booktitle = {日本語本3}, 156 | chapter = {3}, 157 | edition = {1}, 158 | pages = {100--150}, 159 | } 160 | @incollection{enIncollection1, 161 | address = {Tokyo, Japan}, 162 | publisher = {JP Press}, 163 | author = {Sato, Jiro and Hayashi, Saburo}, 164 | booktitle = {Jpbook2}, 165 | title = {Part of Jpbook2}, 166 | pages = {100--200}, 167 | edition = {2}, 168 | year = {2012}, 169 | } 170 | @book{jpBook1, 171 | author = {佐藤, 一郎}, 172 | year = {2010}, 173 | publisher = {日本語出版}, 174 | address = {東京}, 175 | title = {日本語本}, 176 | edition = {1}, 177 | pages = {100--200} 178 | } 179 | @book{jpBook2, 180 | author = {佐藤, 二郎 and 佐藤, 三郎}, 181 | year = {2012}, 182 | publisher = {日本語出版}, 183 | address = {東京}, 184 | title = {日本語本2}, 185 | edition = {2}, 186 | pages = {100--200} 187 | } 188 | @book{jpBook3, 189 | author = {学会委員会}, 190 | year = {2020}, 191 | publisher = {学会出版}, 192 | title = {学会本}, 193 | edition = {1} 194 | } 195 | @book{enBook1, 196 | address = {City, Country}, 197 | publisher = {Publisher}, 198 | author = {Sato, Jiro and Hayashi, Saburo}, 199 | year = {2000}, 200 | title = {Title, not booktitle}, 201 | edition = {3}, 202 | pages = {1-10}, 203 | } 204 | @book{enjBook1, 205 | author = {Ichiro Sato}, 206 | year = {2010}, 207 | publisher = {Japanese Publisher}, 208 | address = {Tokyo}, 209 | title = {Japanese Book title}, 210 | edition = {1}, 211 | pages = {100--200}, 212 | language = {japaneese} 213 | } 214 | @book{jpjBook1, 215 | author = {佐藤 一郎}, 216 | year = {2010}, 217 | publisher = {日本語出版}, 218 | address = {東京}, 219 | title = {日本語本}, 220 | edition = {1}, 221 | pages = {100--200} 222 | } 223 | \end{filecontents} 224 | 225 | 226 | \title{\texttt{IEEJtran.bst}:\\電気学会非公式\BibTeX スタイル\\(ver. 0.19)} 227 | \author{江尻 開} 228 | 229 | \begin{document} 230 | 231 | \maketitle 232 | 233 | \begin{abstract} 234 | IEEJtranは電気学会形式の非公式\BibTeX スタイルです。 235 | Michael Shell氏のIEEEtran.bstを基に開発されています。 236 | 一つのエントリに英語と日本語を併記可能とするPythonスクリプトmixej.pyも提供します。 237 | \end{abstract} 238 | 239 | 240 | \section{はじめに} 241 | 242 | \texttt{IEEJtran.bst}は電気系の論文を執筆する日本人ユーザ向けに開発された電気学会形式の非公式\BibTeX スタイル(\texttt{.bst})ファイルです。 243 | 電気学会論文誌の下書きや卒業論文,修士論文など,\LaTeX を使用した文献管理の一助になることを目的としています。 244 | Michael Shell氏による\texttt{IEEEtran.bst}\cite{IEEEtran}をもとにYoshiRi氏が日本語の自然な表記を実装し,現在は著者がリポジトリを譲渡していただきGitHub上\cite{jIEEEtran}で継続して開発しています。 245 | 同レポジトリではIEEEの引用スタイルを保ったまま日本語の取り扱いを自然にした\BibTeX スタイルである\texttt{jIEEEtran.bst}も取り扱っています。 246 | オプションの追記方法や日本語の判別方法については,武田氏らによる\texttt{jecon.bst}\cite{jeconbst}を参考にしています。 247 | \TeX Live 2019以降の使用を想定しています。 248 | \texttt{w32tex}や古い\TeX Liveでの動作は確認していません。 249 | \TeX エンジンとしてplatex/pbibtexもしくはuplatex/upbibtexを推奨し,本マニュアルはuplatexでコンパイルしています。 250 | \TeX エンジンが出力する中間ファイルの改変にPythonを使用します。 251 | Pythonは\texttt{3.7}以降での動作を確認しています。 252 | 253 | 254 | \section{使用方法} 255 | 256 | \texttt{IEEJtran.bst}が\TeX Liveのパッケージマネージャ等でインストールされ,PATHの通った場所に配置されている場合,プリアンブルに\texttt{\string\bibliographystyle\string{IEEJtran\string}}と記載すれば設定は完了です。 257 | 後述のカスタマイズ等の目的で\texttt{IEEJtran.bst}を個別にダウンロードして配置する場合,メインの\TeX ファイルと同じディレクトリに格納し,同様にプリアンブルに\texttt{\string\bibliographystyle\string{IEEJtran\string}}と記載すれば設定は完了です。 258 | 259 | 文献情報が記載される\texttt{.bib}ファイル上では,日本人著者は 260 | \begin{center} 261 | \texttt{author = \string{\string{\textgt{姓姓 名名}\string} and \string{\textgt{姓姓 名名}\string}\string}} 262 | \end{center} 263 | と,\texttt{\string{\string}}で挟むか, 264 | \begin{center} 265 | \texttt{author = \string{姓姓, 名名 and 姓姓, 名名\string}} 266 | \end{center} 267 | と,\texttt{\string{\string}}で挟まず半角カンマを挿入して記入してください。 268 | 269 | 270 | \section{カスタマイズ} 271 | \texttt{IEEJtran}はテキストファイルである\texttt{IEEJtran.bst}を直接変更することでカスタマイズが可能です。 272 | 例えば、著者とタイトルの間に挿入される文字を「かぎ括弧」から『二重かぎ括弧』に変更する場合、\texttt{IEEJtran.bst}の 273 | \begin{center} 274 | \texttt{FUNCTION \string{bbl.ieej.jp.title.pre\string} \string{ \string"「\string" \string}}\par 275 | \texttt{FUNCTION \string{bbl.ieej.jp.title.aft\string} \string{ \string"」\string" \string}} 276 | \end{center} 277 | を 278 | \begin{center} 279 | \texttt{FUNCTION \string{bbl.ieej.jp.title.pre\string} \string{ \string"『\string" \string}}\par 280 | \texttt{FUNCTION \string{bbl.ieej.jp.title.aft\string} \string{ \string"』\string" \string}} 281 | \end{center} 282 | に変更します。 283 | 他の設定項目は\texttt{IEEJtran.bst}を直接ご確認ください。 284 | 285 | 286 | \section{英語と日本語の併記方法} 287 | 288 | 電気学会の引用スタイルで求められているように,一つの文献エントリに英語と日本語の情報を併記する場合,\texttt{.tex}ファイルには次のように記載してください。 289 | \begin{center} 290 | \texttt{\string\cite\string{enArticle1/ej/jpArticle1\string}} 291 | \end{center} 292 | 加えて,外部pythonファイルの\texttt{mixej.py}を用いて\texttt{.aux}ファイルと\texttt{.bbl}ファイルを改変する必要があります。 293 | 具体的には,\BibTeX コマンドの実行前に\texttt{enArticle1/ej/jpArticle1\string}を\texttt{enArticle1}と\texttt{jpArticle1}の2つのエントリに分け,\BibTeX コマンドが文献情報を書き出した後に再度結合させる操作を行います。 294 | 295 | 296 | \subsection{コンパイル手順} 297 | 298 | 英語と日本語の併記を行わない場合,通常通りのコンパイル手順で\texttt{.pdf}を生成することができます。 299 | 例えば\texttt{uplatex}で\texttt{.dvi}を生成し,\texttt{.dvi}から\texttt{.pdf}を生成,\BibTeX コマンドには\texttt{upbibtex}を使う場合, 300 | \begin{center} 301 | \texttt{uplatex → upbibtex → uplatex → uplatex → dvipdfmx} 302 | \end{center} 303 | という手順です。 304 | 305 | 英語と日本語の併記を行う場合,通常のコンパイル手順での\texttt{upbibtex}前後に\texttt{python}による\texttt{mixej.py}の処理を一回ずつ挟みます。 306 | 前と同様に,\texttt{uplatex}で\texttt{.dvi}を生成し,\texttt{.dvi}から\texttt{.pdf}を生成,\BibTeX コマンドには\texttt{upbibtex}を使う場合, 307 | \begin{center} 308 | \texttt{uplatex → python mixej.py → upbibtex → python mixej.py\\→ uplatex → uplatex → dvipdfmx} 309 | \end{center} 310 | という手順に変更されます。 311 | 312 | 313 | \subsection{コンパイラの設定の例} 314 | 315 | Latexmkを使用している場合,MacやLinuxなどのUNIX系列では\texttt{.latexmkrc}に対して次のように設定することで実現可能です。 316 | 317 | \noindent\makebox[\linewidth]{\rule{\linewidth}{0.4pt}}\vspace{-0.5zw} 318 | \begin{lstlisting}[style=onecol] 319 | #!/usr/bin/perl 320 | 321 | $latex = 'uplatex %O -synctex=1 -interaction=nonstopmode -kanji=utf8 -file-line-error %S'; 322 | $bibtex = 'python mixej.py %B; upbibtex %O %B; python mixej.py %B'; 323 | $dvipdf = 'dvipdfmx -V 7 %O -o %D %S'; 324 | $pdf_previewer = "open -ga /Applications/Skim.app"; 325 | \end{lstlisting}\vspace{-1.8zw} 326 | \noindent\makebox[\linewidth]{\rule{\linewidth}{0.4pt}}\vspace{0.5zw}\par 327 | 328 | \noindent 329 | Windowsでは,cmd, powershellともに\texttt{bibtex}の設定を次のようにすれば動きます。ただし,\texttt{\&}前後の半角スペースを忘れずに記入してください。 330 | 331 | \noindent\makebox[\linewidth]{\rule{\linewidth}{0.4pt}}\vspace{-0.5zw} 332 | \begin{lstlisting}[style=onecol] 333 | $bibtex = '@cd & python mixej.py %B & upbibtex %B & python mixej.py %B'; 334 | \end{lstlisting}\vspace{-1.8zw} 335 | \noindent\makebox[\linewidth]{\rule{\linewidth}{0.4pt}}\vspace{0.5zw}\par 336 | 337 | 338 | 最近ではVisual Studio Codeを使用している方が多いと思いますが,MacやLinuxでのVSCodeのLaTeX Workshop Extension用の設定は次のように書けます。Windowsの場合は\texttt{.latexmkrc}の場合と同様に\texttt{bibtex}コマンドを書き換えてください。 339 | 340 | \noindent\makebox[\linewidth]{\rule{\linewidth}{0.4pt}}\vspace{-0.5zw} 341 | \begin{lstlisting}[style=onecol] 342 | "latex-workshop.latex.tools": [ 343 | { 344 | "command": "latexmk", 345 | "name": "latexmk uplatex/upbibtex/mixej", 346 | "args": [ 347 | "-e", "$latex='uplatex %O -synctex=1 -interaction=nonstopmode -kanji=utf8 -file-line-error %S'", 348 | "-e", "$bibtex='python mixej.py %B; upbibtex %O %B; python mixej.py %B'", 349 | "-e", "$dvipdf='dvipdfmx -V 7 %O -o %D %S'", 350 | "-norc", "-pdfdvi", "%DOC%" 351 | ], 352 | } 353 | ], 354 | "latex-workshop.latex.recipes": [ 355 | { "name": "latexmk uplatex/upbibtex/mixej", "tools": [ "latexmk uplatex/upbibtex/mixej" ] } 356 | ], 357 | \end{lstlisting}\vspace{-1.8zw} 358 | \noindent\makebox[\linewidth]{\rule{\linewidth}{0.4pt}}\vspace{0.5zw}\par 359 | 360 | 361 | \subsection{引用例} 362 | 363 | いくつかの引用例を示します。 364 | 英語Articleの例\cite{enArticle1}。 365 | 日本語Articleの例\cite{jpArticle1}。 366 | 英語と日本語を併記したArticleの例\cite{enArticle2/ej/jpArticle2,enArticle3/ej/jpArticle3}。 367 | 英語Inproceedingsの例\cite{enInproceedings1}。 368 | 日本語Inproceedingsの例\cite{jpInproceedings1}。 369 | 英語と日本語を併記したInproceedingsの例\cite{enInproceedings2/ej/jpInproceedings2}。 370 | 英語Incollectionの例\cite{enIncollection1}。 371 | 日本語Incollectionの例\cite{jpIncollection1,jpIncollection2}。 372 | 英語Bookの例\cite{enBook1}。 373 | 日本語Bookの例\cite{jpBook1,jpBook2,jpBook3}。 374 | 英語と日本語を併記したBookの例\cite{enjBook1/ej/jpjBook1}。 375 | 376 | \bibliography{library.bib} 377 | 378 | \end{document} 379 | -------------------------------------------------------------------------------- /mixej.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import platform 3 | import json 4 | import logging 5 | 6 | 7 | SPLIT_KEY = '/ej/' 8 | ITEM_SEP = '\\hspace{0mm}\\\\' 9 | 10 | FILE_VERSION = '0.19' 11 | FILE_DATE = '2023/01/26' 12 | FILE_AUTHOR = 'Haruki Ejiri' 13 | FILE_URL = 'https://github.com/ehki/jIEEEtran/' 14 | 15 | logger = logging.getLogger(__name__) 16 | 17 | 18 | def check_load_file(fn, asjson=False): 19 | """load file if exist else return -1. 20 | 21 | This code load text and json file if exist. 22 | If the file not exist, return -1 23 | 24 | Parameters 25 | ---------- 26 | fn : str 27 | Path to the file to load 28 | asjson : bool 29 | whether the fn should be loaded using json or normal text file 30 | 31 | Returns 32 | ------- 33 | int 34 | 0 if success 35 | """ 36 | 37 | logger.info('-- Checking file %s, ' % fn) 38 | try: 39 | with open(fn, 'r', encoding='utf-8') as f: 40 | logger.info('exist, load.') 41 | if asjson: 42 | return json.load(f) 43 | else: 44 | return f.read() 45 | except FileNotFoundError: 46 | logger.info('not found.') 47 | return -1 48 | 49 | 50 | def save_pairs(fn, pairs): 51 | """save pairs to the JSON format file with the extensions of ".ejp". 52 | 53 | This code save the pairs to the file in JSON format. 54 | 55 | Parameters 56 | ---------- 57 | fn : str 58 | Path to the file to write pairs 59 | pairs : list of two strings 60 | for example: [["en1", "jp1"], ["en2", "jp2"], ["en3", "jp3"]] 61 | 62 | Returns 63 | ------- 64 | int 65 | 0 if success 66 | """ 67 | 68 | logger.info('-- Saving found pairs to %s, ' % fn) 69 | with open(fn, 'w', encoding='utf-8') as f: 70 | json.dump(pairs, f) 71 | logger.info('done.') 72 | return 0 73 | 74 | 75 | def divide_aux(fn, pairs): 76 | """divide comined citation(s) and bibcite(s) in aux file. 77 | 78 | This code divide the combined key(s) in aux file. 79 | For example, the following citation(s) and bibcite(s) in aux file 80 | -- 81 | \\citation{englishTest7/ej/japaneseTest7} 82 | 83 | \\bibcite{englishTest7/ej/japaneseTest7}{16} 84 | -- 85 | will be converted to the following two divided citations and bibitems. 86 | -- 87 | \\citation{englishTest7,japaneseTest7} 88 | 89 | \\bibcite{englishTest7,japaneseTest7}{16} 90 | -- 91 | 92 | Parameters 93 | ---------- 94 | fn : str 95 | Path to the aux file to proceess 96 | pairs : list of two strings 97 | for example: [["en1", "jp1"], ["en2", "jp2"], ["en3", "jp3"]] 98 | 99 | Returns 100 | ------- 101 | int 102 | -1 if the file to process not found, 0 if success 103 | """ 104 | 105 | aux = check_load_file(fn) 106 | if aux == -1: # file not found 107 | return -1 # failed 108 | for k1, k2 in pairs: 109 | combi = SPLIT_KEY.join([k1, k2]) 110 | # for example, combi is "engkey/ej/jpkey", wehere SPLIT_KEY is "/ej/" 111 | logger.info('-- Dividing %s into %s and %s' % (combi, k1, k2)) 112 | aux = aux.replace('%s' % combi, 113 | '%s,%s' % (k1, k2)) 114 | with open(fn, 'w', encoding='utf-8') as f: 115 | f.write(aux) 116 | return 0 117 | 118 | 119 | def divide_bbl(fn, pairs): 120 | """divide comined bibitem(s) in bbl file. 121 | 122 | This code divide the combined key(s) in bbl file. 123 | For example, the following combined bibitem(s) in bbl file 124 | -- 125 | \\bibitem{englishTest5/ej/japaneseTest5} 126 | I.~Yamada, J.~Sato, S.~Tanaka, S.~Suzuki: ``Article title'', Japanese 127 | Transaction, Vol.10, No.5, pp.45--60 (2016-3)\\hspace{0mm}\\\\ 128 | 山田~一郎・佐藤~次郎・田中~三郎・鈴木~四郎:「文献タイトル」, 129 | 日本語学会,Vol.10,No.5,pp.45--60(2016-3) 130 | -- 131 | will be converted to the following two divided bibitems. 132 | -- 133 | \\bibitem{englishTest5} 134 | I.~Yamada, J.~Sato, S.~Tanaka, S.~Suzuki: ``Article title'', Japanese 135 | Transaction, Vol.10, No.5, pp.45--60 (2016-3) 136 | 137 | \\bibitem{japaneseTest5} 138 | 山田~一郎・佐藤~次郎・田中~三郎・鈴木~四郎:「文献タイトル」, 139 | 日本語学会,Vol.10,No.5,pp.45--60(2016-3) 140 | -- 141 | 142 | Parameters 143 | ---------- 144 | fn : str 145 | Path to the bbl file to proceess 146 | pairs : list of two strings 147 | for example: [["en1", "jp1"], ["en2", "jp2"], ["en3", "jp3"]] 148 | 149 | Returns 150 | ------- 151 | int 152 | -1 if the file to process not found, 0 if success 153 | """ 154 | 155 | bbl = check_load_file(fn) 156 | if bbl == -1: # file not found 157 | return -1 # failed 158 | for k1, k2 in pairs: 159 | combi = SPLIT_KEY.join([k1, k2]) 160 | # for example, combi is "engkey/ej/jpkey", wehere SPLIT_KEY is "/ej/" 161 | logger.info('-- Dividing %s into %s and %s' % (combi, k1, k2)) 162 | bbl = bbl.replace(ITEM_SEP, '\n\n\\bibitem{%s}' % k2) 163 | bbl = bbl.replace('\\bibitem{%s}' % combi, '\\bibitem{%s}' % k1) 164 | logger.info('-- Saving divided bbl to %s, ' % fn) 165 | with open(fn, 'w', encoding='utf-8') as f: 166 | f.write(bbl) 167 | logger.info('done.') 168 | return 0 # successfully finished 169 | 170 | 171 | def find_pairs(fn, aux): 172 | """find english/japanese pair from string in aux. 173 | 174 | This code find and store english/japanese pair. 175 | Reading each line in aux strings, the engligh and japanese keys 176 | are extracted if SPLIT_KEY is in the line. 177 | If the combined english/japanese keys in the aux file, 178 | the pairs are stored to the external JSON file 179 | 180 | Parameters 181 | ---------- 182 | fn : str 183 | Path to the aux file to proceess 184 | aux : strings in aux file 185 | loaded string 186 | 187 | Returns 188 | ------- 189 | int 190 | 0 if no combined keys found 191 | num-of-pairs if successfully processed 192 | """ 193 | 194 | pairs = [] 195 | logger.info('-- ') 196 | for line in aux.split('\n'): 197 | if SPLIT_KEY not in line or '\\citation' not in line: 198 | continue 199 | # the line contains \citation and /ej/ 200 | for ln in line.replace('\\citation{', '').replace('}', '').split(','): 201 | # convert '\citation{hoge1/ej/hoge2}' to 'hoge1/ej/hoge2' 202 | if len(ln.split(SPLIT_KEY)) == 2: 203 | pairs.append(ln.split(SPLIT_KEY)) 204 | # store as ['hoge1', 'hoge2'] pairs 205 | logger.info('%s' % str(ln.split(SPLIT_KEY))) 206 | if len(pairs) == 0: 207 | logger.info('No combined keys found.') 208 | ret = 0 209 | if len(pairs) > 0: 210 | logger.info(' %d combined keys found.' % len(pairs)) 211 | ret = pairs 212 | save_pairs(fn, pairs) 213 | return ret 214 | 215 | 216 | def combine_aux(fn, pairs): 217 | """combine divided citation(s) and bibcite(s) in aux file. 218 | 219 | This code combine the divided key(s) in aux file. 220 | For example, the following two divided citation(s) and bibcite(s) 221 | in aux file 222 | -- 223 | \\citation{englishTest7,japaneseTest7} 224 | 225 | \\bibcite{englishTest7,japaneseTest7}{16} 226 | -- 227 | will be converted to the following combined citations and bibitems. 228 | -- 229 | \\citation{englishTest7/ej/japaneseTest7} 230 | 231 | \\bibcite{englishTest7/ej/japaneseTest7}{16} 232 | -- 233 | 234 | Parameters 235 | ---------- 236 | fn : str 237 | Path to the aux file to proceess 238 | pairs : list of two strings 239 | for example: [["en1", "jp1"], ["en2", "jp2"], ["en3", "jp3"]] 240 | 241 | Returns 242 | ------- 243 | int 244 | -1 if the file to process not found, 0 if success 245 | """ 246 | 247 | aux = check_load_file(fn) 248 | if aux == -1: # file not found 249 | return -1 # failed 250 | for k1, k2 in pairs: 251 | combi = SPLIT_KEY.join([k1, k2]) 252 | # for example, combi is "engkey/ej/jpkey", wehere SPLIT_KEY is "/ej/" 253 | logger.info('-- Combining %s and %s to %s' % (k1, k2, combi)) 254 | aux = aux.replace('%s,%s' % (k1, k2), '%s' % combi) 255 | logger.info('-- Saving combined aux to %s, ' % fn) 256 | with open(fn, 'w', encoding='utf-8') as f: 257 | f.write(aux) 258 | logger.info('done.') 259 | 260 | 261 | def combine_bbl(fn, pairs): 262 | """combine divided bibitem(s) in bbl file. 263 | 264 | This code divide the combined key(s) in bbl file. 265 | For example, the following two divided bibitem(s) in bbl file 266 | -- 267 | \\bibitem{englishTest5} 268 | I.~Yamada, J.~Sato, S.~Tanaka, S.~Suzuki: ``Article title'', Japanese 269 | Transaction, Vol.10, No.5, pp.45--60 (2016-3) 270 | 271 | \\bibitem{japaneseTest5} 272 | 山田~一郎・佐藤~次郎・田中~三郎・鈴木~四郎:「文献タイトル」, 273 | 日本語学会,Vol.10,No.5,pp.45--60(2016-3) 274 | -- 275 | will be converted to the following combined citations and bibitems. 276 | -- 277 | \\bibitem{englishTest5/ej/japaneseTest5} 278 | I.~Yamada, J.~Sato, S.~Tanaka, S.~Suzuki: ``Article title'', Japanese 279 | Transaction, Vol.10, No.5, pp.45--60 (2016-3)\\hspace{0mm}\\\\ 280 | 山田~一郎・佐藤~次郎・田中~三郎・鈴木~四郎:「文献タイトル」, 281 | 日本語学会,Vol.10,No.5,pp.45--60(2016-3) 282 | -- 283 | 284 | Parameters 285 | ---------- 286 | fn : str 287 | Path to the aux file to proceess 288 | pairs : list of two strings 289 | for example: [["en1", "jp1"], ["en2", "jp2"], ["en3", "jp3"]] 290 | 291 | Returns 292 | ------- 293 | int 294 | -1 if the file to process not found, 0 if success 295 | """ 296 | 297 | bbl = check_load_file(fn) 298 | if bbl == -1: # file not found 299 | return -1 # failed 300 | for k1, k2 in pairs: 301 | combi = SPLIT_KEY.join([k1, k2]) 302 | # for example, combi is "engkey/ej/jpkey", wehere SPLIT_KEY is "/ej/" 303 | logger.info('-- Combining %s and %s to %s' % (k1, k2, combi)) 304 | bbl = bbl.replace('\n\n\\bibitem{%s}' % k2, ITEM_SEP) 305 | bbl = bbl.replace('\\bibitem{%s}' % k1, 306 | '\\bibitem{%s}' % combi) 307 | logger.info('-- Saving combined bbl to %s, ' % fn) 308 | with open(fn, 'w', encoding='utf-8') as f: 309 | f.write(bbl) 310 | logger.info('done.') 311 | 312 | 313 | def divide_ej_key(bn): 314 | """divide combined english and japanese bibiteems in bbl and aux file. 315 | 316 | This code divide the combined key(s) in aux and bbl file. 317 | For example, the following combined bibitem(s) in bbl file 318 | -- 319 | \\bibitem{englishTest5/ej/japaneseTest5} 320 | I.~Yamada, J.~Sato, S.~Tanaka, S.~Suzuki: ``Article title'', Japanese 321 | Transaction, Vol.10, No.5, pp.45--60 (2016-3)\\hspace{0mm}\\\\ 322 | 山田~一郎・佐藤~次郎・田中~三郎・鈴木~四郎:「文献タイトル」, 323 | 日本語学会,Vol.10,No.5,pp.45--60(2016-3) 324 | -- 325 | will be converted to the following two divided bibitems. 326 | -- 327 | \\bibitem{englishTest5} 328 | I.~Yamada, J.~Sato, S.~Tanaka, S.~Suzuki: ``Article title'', Japanese 329 | Transaction, Vol.10, No.5, pp.45--60 (2016-3) 330 | 331 | \\bibitem{japaneseTest5} 332 | 山田~一郎・佐藤~次郎・田中~三郎・鈴木~四郎:「文献タイトル」, 333 | 日本語学会,Vol.10,No.5,pp.45--60(2016-3) 334 | -- 335 | The following two combined citation(s) and bibcite(s) in aux file 336 | -- 337 | \\citation{englishTest7/ej/japaneseTest7} 338 | 339 | \\bibcite{englishTest7/ej/japaneseTest7}{16} 340 | -- 341 | will also be converted to the following combined citations and bibitems. 342 | -- 343 | \\citation{englishTest7} 344 | \\citation{japaneseTest7} 345 | 346 | \\bibcite{englishTest7}{1} 347 | \\bibcite{japaneseTest7}{16} 348 | -- 349 | The first process during LaTeX compile, there would no bbl file. 350 | If the bbl file not exist, the dividing process would be skipped. 351 | A list of english/japanese pairs will be extracted from aux file, 352 | and if will be saved in the JSON file with 353 | ".ejp" (english-japanese-pair) extension 354 | 355 | Parameters 356 | ---------- 357 | bn : str 358 | Target file to process without extension. 359 | if your target tex file is '/DIRNAME/main.tex' 360 | the bn would be '/DIRNAME/main' 361 | 362 | Returns 363 | ------- 364 | int 365 | -1 if the file to process not found 366 | 0 if no combined keys found 367 | num-of-pairs if successfully processed 368 | """ 369 | 370 | logger.info('--') 371 | logger.info('-- Dividing combinecd keys.') 372 | aux = check_load_file(bn + '.aux') 373 | if aux == -1: # aux file not found 374 | return -1 # abort 375 | logger.info('-- Search combined keys from %s.aux.' % bn) 376 | pairs = find_pairs(bn + '.ejp', aux) 377 | if pairs == 0: # no combined keys 378 | return 0 # probably already divided 379 | divide_aux(bn + '.aux', pairs) 380 | divide_bbl(bn + '.bbl', pairs) 381 | return len(pairs) 382 | 383 | 384 | def combine_ej_key(bn): 385 | """combine english and japanese bibiteems in bbl and aux file. 386 | 387 | This code combine the divided key(s) in aux and bbl file. 388 | For example, the following divided bibitem(s) in bbl file 389 | -- 390 | \\bibitem{englishTest5} 391 | I.~Yamada, J.~Sato, S.~Tanaka, S.~Suzuki: ``Article title'', Japanese 392 | Transaction, Vol.10, No.5, pp.45--60 (2016-3) 393 | 394 | \\bibitem{japaneseTest5} 395 | 山田~一郎・佐藤~次郎・田中~三郎・鈴木~四郎:「文献タイトル」, 396 | 日本語学会,Vol.10,No.5,pp.45--60(2016-3) 397 | -- 398 | will be converted to the following two divided bibitems. 399 | -- 400 | \\bibitem{englishTest5/ej/japaneseTest5} 401 | I.~Yamada, J.~Sato, S.~Tanaka, S.~Suzuki: ``Article title'', Japanese 402 | Transaction, Vol.10, No.5, pp.45--60 (2016-3)\\hspace{0mm}\\\\ 403 | 山田~一郎・佐藤~次郎・田中~三郎・鈴木~四郎:「文献タイトル」, 404 | 日本語学会,Vol.10,No.5,pp.45--60(2016-3) 405 | -- 406 | The following two divided citation(s) and bibcite(s) in aux file 407 | -- 408 | \\citation{englishTest7} 409 | \\citation{japaneseTest7} 410 | 411 | \\bibcite{englishTest7}{1} 412 | \\bibcite{japaneseTest7}{16} 413 | -- 414 | will also be converted to the following combined citations and bibitems. 415 | -- 416 | \\citation{englishTest7/ej/japaneseTest7} 417 | 418 | \\bibcite{englishTest7/ej/japaneseTest7}{16} 419 | -- 420 | 421 | Parameters 422 | ---------- 423 | bn : str 424 | Target file to process without extension. 425 | if your target tex file is '/DIRNAME/main.tex' 426 | the bn would be '/DIRNAME/main' 427 | 428 | Returns 429 | ------- 430 | int 431 | -1 if the file to process not found 432 | 0 if no combined keys found 433 | num-of-pairs if successfully processed 434 | """ 435 | 436 | logger.info('--') 437 | logger.info('-- Combining divided keys.') 438 | pairs = check_load_file(bn + '.ejp', asjson=True) 439 | if pairs == -1: # file not found 440 | return -1 441 | if len(pairs) == 0: # no combined keys 442 | return 0 443 | combine_aux(bn + '.aux', pairs) 444 | combine_bbl(bn + '.bbl', pairs) 445 | return len(pairs) 446 | 447 | 448 | if __name__ == '__main__': 449 | 450 | logger = logging.getLogger() 451 | logger.setLevel(logging.INFO) 452 | 453 | sh = logging.StreamHandler() 454 | logger.addHandler(sh) 455 | 456 | logger.info( 457 | 'This is python version %s ' % platform.python_version()) 458 | logger.info( 459 | 'mixje.py version %s (%s) by %s.' % 460 | (FILE_VERSION, FILE_DATE, FILE_AUTHOR) 461 | ) 462 | logger.info('See web site: %s' % FILE_URL) 463 | try: 464 | fname = sys.argv[1] 465 | logger.info('Target: %s' % fname) 466 | except IndexError: 467 | logger.info('Fatal error: You must assign target.') 468 | sys.exit(0) 469 | 470 | sk = divide_ej_key(fname) 471 | if sk > 0: # combined keys existed 472 | logger.info('-- Fin, %d keys were divided.' % sk) 473 | sys.exit(0) 474 | elif sk < 0: # Abort 475 | sys.exit(0) 476 | 477 | ck = combine_ej_key(fname) 478 | if ck != 0: 479 | # print('-- %d divided citation keys were successfully combined' % ck) 480 | logger.info('-- Fin, %d keys were combined.' % ck) 481 | sys.exit(0) 482 | with open(sys.argv[1] + '.ejp', 'w', encoding='utf-8') as f: 483 | json.dump([], f) 484 | logger.info( 485 | '-- No cmobined nor divided citation key in the aux file') 486 | sys.exit(0) 487 | -------------------------------------------------------------------------------- /ieejtran/mixej.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import platform 3 | import json 4 | import logging 5 | 6 | 7 | SPLIT_KEY = '/ej/' 8 | ITEM_SEP = '\\hspace{0mm}\\\\' 9 | 10 | FILE_VERSION = '0.19' 11 | FILE_DATE = '2023/01/26' 12 | FILE_AUTHOR = 'Haruki Ejiri' 13 | FILE_URL = 'https://github.com/ehki/jIEEEtran/' 14 | 15 | logger = logging.getLogger(__name__) 16 | 17 | 18 | def check_load_file(fn, asjson=False): 19 | """load file if exist else return -1. 20 | 21 | This code load text and json file if exist. 22 | If the file not exist, return -1 23 | 24 | Parameters 25 | ---------- 26 | fn : str 27 | Path to the file to load 28 | asjson : bool 29 | whether the fn should be loaded using json or normal text file 30 | 31 | Returns 32 | ------- 33 | int 34 | 0 if success 35 | """ 36 | 37 | logger.info('-- Checking file %s, ' % fn) 38 | try: 39 | with open(fn, 'r', encoding='utf-8') as f: 40 | logger.info('exist, load.') 41 | if asjson: 42 | return json.load(f) 43 | else: 44 | return f.read() 45 | except FileNotFoundError: 46 | logger.info('not found.') 47 | return -1 48 | 49 | 50 | def save_pairs(fn, pairs): 51 | """save pairs to the JSON format file with the extensions of ".ejp". 52 | 53 | This code save the pairs to the file in JSON format. 54 | 55 | Parameters 56 | ---------- 57 | fn : str 58 | Path to the file to write pairs 59 | pairs : list of two strings 60 | for example: [["en1", "jp1"], ["en2", "jp2"], ["en3", "jp3"]] 61 | 62 | Returns 63 | ------- 64 | int 65 | 0 if success 66 | """ 67 | 68 | logger.info('-- Saving found pairs to %s, ' % fn) 69 | with open(fn, 'w', encoding='utf-8') as f: 70 | json.dump(pairs, f) 71 | logger.info('done.') 72 | return 0 73 | 74 | 75 | def divide_aux(fn, pairs): 76 | """divide comined citation(s) and bibcite(s) in aux file. 77 | 78 | This code divide the combined key(s) in aux file. 79 | For example, the following citation(s) and bibcite(s) in aux file 80 | -- 81 | \\citation{englishTest7/ej/japaneseTest7} 82 | 83 | \\bibcite{englishTest7/ej/japaneseTest7}{16} 84 | -- 85 | will be converted to the following two divided citations and bibitems. 86 | -- 87 | \\citation{englishTest7,japaneseTest7} 88 | 89 | \\bibcite{englishTest7,japaneseTest7}{16} 90 | -- 91 | 92 | Parameters 93 | ---------- 94 | fn : str 95 | Path to the aux file to proceess 96 | pairs : list of two strings 97 | for example: [["en1", "jp1"], ["en2", "jp2"], ["en3", "jp3"]] 98 | 99 | Returns 100 | ------- 101 | int 102 | -1 if the file to process not found, 0 if success 103 | """ 104 | 105 | aux = check_load_file(fn) 106 | if aux == -1: # file not found 107 | return -1 # failed 108 | for k1, k2 in pairs: 109 | combi = SPLIT_KEY.join([k1, k2]) 110 | # for example, combi is "engkey/ej/jpkey", wehere SPLIT_KEY is "/ej/" 111 | logger.info('-- Dividing %s into %s and %s' % (combi, k1, k2)) 112 | aux = aux.replace('%s' % combi, 113 | '%s,%s' % (k1, k2)) 114 | with open(fn, 'w', encoding='utf-8') as f: 115 | f.write(aux) 116 | return 0 117 | 118 | 119 | def divide_bbl(fn, pairs): 120 | """divide comined bibitem(s) in bbl file. 121 | 122 | This code divide the combined key(s) in bbl file. 123 | For example, the following combined bibitem(s) in bbl file 124 | -- 125 | \\bibitem{englishTest5/ej/japaneseTest5} 126 | I.~Yamada, J.~Sato, S.~Tanaka, S.~Suzuki: ``Article title'', Japanese 127 | Transaction, Vol.10, No.5, pp.45--60 (2016-3)\\hspace{0mm}\\\\ 128 | 山田~一郎・佐藤~次郎・田中~三郎・鈴木~四郎:「文献タイトル」, 129 | 日本語学会,Vol.10,No.5,pp.45--60(2016-3) 130 | -- 131 | will be converted to the following two divided bibitems. 132 | -- 133 | \\bibitem{englishTest5} 134 | I.~Yamada, J.~Sato, S.~Tanaka, S.~Suzuki: ``Article title'', Japanese 135 | Transaction, Vol.10, No.5, pp.45--60 (2016-3) 136 | 137 | \\bibitem{japaneseTest5} 138 | 山田~一郎・佐藤~次郎・田中~三郎・鈴木~四郎:「文献タイトル」, 139 | 日本語学会,Vol.10,No.5,pp.45--60(2016-3) 140 | -- 141 | 142 | Parameters 143 | ---------- 144 | fn : str 145 | Path to the bbl file to proceess 146 | pairs : list of two strings 147 | for example: [["en1", "jp1"], ["en2", "jp2"], ["en3", "jp3"]] 148 | 149 | Returns 150 | ------- 151 | int 152 | -1 if the file to process not found, 0 if success 153 | """ 154 | 155 | bbl = check_load_file(fn) 156 | if bbl == -1: # file not found 157 | return -1 # failed 158 | for k1, k2 in pairs: 159 | combi = SPLIT_KEY.join([k1, k2]) 160 | # for example, combi is "engkey/ej/jpkey", wehere SPLIT_KEY is "/ej/" 161 | logger.info('-- Dividing %s into %s and %s' % (combi, k1, k2)) 162 | bbl = bbl.replace(ITEM_SEP, '\n\n\\bibitem{%s}' % k2) 163 | bbl = bbl.replace('\\bibitem{%s}' % combi, '\\bibitem{%s}' % k1) 164 | logger.info('-- Saving divided bbl to %s, ' % fn) 165 | with open(fn, 'w', encoding='utf-8') as f: 166 | f.write(bbl) 167 | logger.info('done.') 168 | return 0 # successfully finished 169 | 170 | 171 | def find_pairs(fn, aux): 172 | """find english/japanese pair from string in aux. 173 | 174 | This code find and store english/japanese pair. 175 | Reading each line in aux strings, the engligh and japanese keys 176 | are extracted if SPLIT_KEY is in the line. 177 | If the combined english/japanese keys in the aux file, 178 | the pairs are stored to the external JSON file 179 | 180 | Parameters 181 | ---------- 182 | fn : str 183 | Path to the aux file to proceess 184 | aux : strings in aux file 185 | loaded string 186 | 187 | Returns 188 | ------- 189 | int 190 | 0 if no combined keys found 191 | num-of-pairs if successfully processed 192 | """ 193 | 194 | pairs = [] 195 | logger.info('-- ') 196 | for line in aux.split('\n'): 197 | if SPLIT_KEY not in line or '\\citation' not in line: 198 | continue 199 | # the line contains \citation and /ej/ 200 | for ln in line.replace('\\citation{', '').replace('}', '').split(','): 201 | # convert '\citation{hoge1/ej/hoge2}' to 'hoge1/ej/hoge2' 202 | if len(ln.split(SPLIT_KEY)) == 2: 203 | pairs.append(ln.split(SPLIT_KEY)) 204 | # store as ['hoge1', 'hoge2'] pairs 205 | logger.info('%s' % str(ln.split(SPLIT_KEY))) 206 | if len(pairs) == 0: 207 | logger.info('No combined keys found.') 208 | ret = 0 209 | if len(pairs) > 0: 210 | logger.info(' %d combined keys found.' % len(pairs)) 211 | ret = pairs 212 | save_pairs(fn, pairs) 213 | return ret 214 | 215 | 216 | def combine_aux(fn, pairs): 217 | """combine divided citation(s) and bibcite(s) in aux file. 218 | 219 | This code combine the divided key(s) in aux file. 220 | For example, the following two divided citation(s) and bibcite(s) 221 | in aux file 222 | -- 223 | \\citation{englishTest7,japaneseTest7} 224 | 225 | \\bibcite{englishTest7,japaneseTest7}{16} 226 | -- 227 | will be converted to the following combined citations and bibitems. 228 | -- 229 | \\citation{englishTest7/ej/japaneseTest7} 230 | 231 | \\bibcite{englishTest7/ej/japaneseTest7}{16} 232 | -- 233 | 234 | Parameters 235 | ---------- 236 | fn : str 237 | Path to the aux file to proceess 238 | pairs : list of two strings 239 | for example: [["en1", "jp1"], ["en2", "jp2"], ["en3", "jp3"]] 240 | 241 | Returns 242 | ------- 243 | int 244 | -1 if the file to process not found, 0 if success 245 | """ 246 | 247 | aux = check_load_file(fn) 248 | if aux == -1: # file not found 249 | return -1 # failed 250 | for k1, k2 in pairs: 251 | combi = SPLIT_KEY.join([k1, k2]) 252 | # for example, combi is "engkey/ej/jpkey", wehere SPLIT_KEY is "/ej/" 253 | logger.info('-- Combining %s and %s to %s' % (k1, k2, combi)) 254 | aux = aux.replace('%s,%s' % (k1, k2), '%s' % combi) 255 | logger.info('-- Saving combined aux to %s, ' % fn) 256 | with open(fn, 'w', encoding='utf-8') as f: 257 | f.write(aux) 258 | logger.info('done.') 259 | 260 | 261 | def combine_bbl(fn, pairs): 262 | """combine divided bibitem(s) in bbl file. 263 | 264 | This code divide the combined key(s) in bbl file. 265 | For example, the following two divided bibitem(s) in bbl file 266 | -- 267 | \\bibitem{englishTest5} 268 | I.~Yamada, J.~Sato, S.~Tanaka, S.~Suzuki: ``Article title'', Japanese 269 | Transaction, Vol.10, No.5, pp.45--60 (2016-3) 270 | 271 | \\bibitem{japaneseTest5} 272 | 山田~一郎・佐藤~次郎・田中~三郎・鈴木~四郎:「文献タイトル」, 273 | 日本語学会,Vol.10,No.5,pp.45--60(2016-3) 274 | -- 275 | will be converted to the following combined citations and bibitems. 276 | -- 277 | \\bibitem{englishTest5/ej/japaneseTest5} 278 | I.~Yamada, J.~Sato, S.~Tanaka, S.~Suzuki: ``Article title'', Japanese 279 | Transaction, Vol.10, No.5, pp.45--60 (2016-3)\\hspace{0mm}\\\\ 280 | 山田~一郎・佐藤~次郎・田中~三郎・鈴木~四郎:「文献タイトル」, 281 | 日本語学会,Vol.10,No.5,pp.45--60(2016-3) 282 | -- 283 | 284 | Parameters 285 | ---------- 286 | fn : str 287 | Path to the aux file to proceess 288 | pairs : list of two strings 289 | for example: [["en1", "jp1"], ["en2", "jp2"], ["en3", "jp3"]] 290 | 291 | Returns 292 | ------- 293 | int 294 | -1 if the file to process not found, 0 if success 295 | """ 296 | 297 | bbl = check_load_file(fn) 298 | if bbl == -1: # file not found 299 | return -1 # failed 300 | for k1, k2 in pairs: 301 | combi = SPLIT_KEY.join([k1, k2]) 302 | # for example, combi is "engkey/ej/jpkey", wehere SPLIT_KEY is "/ej/" 303 | logger.info('-- Combining %s and %s to %s' % (k1, k2, combi)) 304 | bbl = bbl.replace('\n\n\\bibitem{%s}' % k2, ITEM_SEP) 305 | bbl = bbl.replace('\\bibitem{%s}' % k1, 306 | '\\bibitem{%s}' % combi) 307 | logger.info('-- Saving combined bbl to %s, ' % fn) 308 | with open(fn, 'w', encoding='utf-8') as f: 309 | f.write(bbl) 310 | logger.info('done.') 311 | 312 | 313 | def divide_ej_key(bn): 314 | """divide combined english and japanese bibiteems in bbl and aux file. 315 | 316 | This code divide the combined key(s) in aux and bbl file. 317 | For example, the following combined bibitem(s) in bbl file 318 | -- 319 | \\bibitem{englishTest5/ej/japaneseTest5} 320 | I.~Yamada, J.~Sato, S.~Tanaka, S.~Suzuki: ``Article title'', Japanese 321 | Transaction, Vol.10, No.5, pp.45--60 (2016-3)\\hspace{0mm}\\\\ 322 | 山田~一郎・佐藤~次郎・田中~三郎・鈴木~四郎:「文献タイトル」, 323 | 日本語学会,Vol.10,No.5,pp.45--60(2016-3) 324 | -- 325 | will be converted to the following two divided bibitems. 326 | -- 327 | \\bibitem{englishTest5} 328 | I.~Yamada, J.~Sato, S.~Tanaka, S.~Suzuki: ``Article title'', Japanese 329 | Transaction, Vol.10, No.5, pp.45--60 (2016-3) 330 | 331 | \\bibitem{japaneseTest5} 332 | 山田~一郎・佐藤~次郎・田中~三郎・鈴木~四郎:「文献タイトル」, 333 | 日本語学会,Vol.10,No.5,pp.45--60(2016-3) 334 | -- 335 | The following two combined citation(s) and bibcite(s) in aux file 336 | -- 337 | \\citation{englishTest7/ej/japaneseTest7} 338 | 339 | \\bibcite{englishTest7/ej/japaneseTest7}{16} 340 | -- 341 | will also be converted to the following combined citations and bibitems. 342 | -- 343 | \\citation{englishTest7} 344 | \\citation{japaneseTest7} 345 | 346 | \\bibcite{englishTest7}{1} 347 | \\bibcite{japaneseTest7}{16} 348 | -- 349 | The first process during LaTeX compile, there would no bbl file. 350 | If the bbl file not exist, the dividing process would be skipped. 351 | A list of english/japanese pairs will be extracted from aux file, 352 | and if will be saved in the JSON file with 353 | ".ejp" (english-japanese-pair) extension 354 | 355 | Parameters 356 | ---------- 357 | bn : str 358 | Target file to process without extension. 359 | if your target tex file is '/DIRNAME/main.tex' 360 | the bn would be '/DIRNAME/main' 361 | 362 | Returns 363 | ------- 364 | int 365 | -1 if the file to process not found 366 | 0 if no combined keys found 367 | num-of-pairs if successfully processed 368 | """ 369 | 370 | logger.info('--') 371 | logger.info('-- Dividing combinecd keys.') 372 | aux = check_load_file(bn + '.aux') 373 | if aux == -1: # aux file not found 374 | return -1 # abort 375 | logger.info('-- Search combined keys from %s.aux.' % bn) 376 | pairs = find_pairs(bn + '.ejp', aux) 377 | if pairs == 0: # no combined keys 378 | return 0 # probably already divided 379 | divide_aux(bn + '.aux', pairs) 380 | divide_bbl(bn + '.bbl', pairs) 381 | return len(pairs) 382 | 383 | 384 | def combine_ej_key(bn): 385 | """combine english and japanese bibiteems in bbl and aux file. 386 | 387 | This code combine the divided key(s) in aux and bbl file. 388 | For example, the following divided bibitem(s) in bbl file 389 | -- 390 | \\bibitem{englishTest5} 391 | I.~Yamada, J.~Sato, S.~Tanaka, S.~Suzuki: ``Article title'', Japanese 392 | Transaction, Vol.10, No.5, pp.45--60 (2016-3) 393 | 394 | \\bibitem{japaneseTest5} 395 | 山田~一郎・佐藤~次郎・田中~三郎・鈴木~四郎:「文献タイトル」, 396 | 日本語学会,Vol.10,No.5,pp.45--60(2016-3) 397 | -- 398 | will be converted to the following two divided bibitems. 399 | -- 400 | \\bibitem{englishTest5/ej/japaneseTest5} 401 | I.~Yamada, J.~Sato, S.~Tanaka, S.~Suzuki: ``Article title'', Japanese 402 | Transaction, Vol.10, No.5, pp.45--60 (2016-3)\\hspace{0mm}\\\\ 403 | 山田~一郎・佐藤~次郎・田中~三郎・鈴木~四郎:「文献タイトル」, 404 | 日本語学会,Vol.10,No.5,pp.45--60(2016-3) 405 | -- 406 | The following two divided citation(s) and bibcite(s) in aux file 407 | -- 408 | \\citation{englishTest7} 409 | \\citation{japaneseTest7} 410 | 411 | \\bibcite{englishTest7}{1} 412 | \\bibcite{japaneseTest7}{16} 413 | -- 414 | will also be converted to the following combined citations and bibitems. 415 | -- 416 | \\citation{englishTest7/ej/japaneseTest7} 417 | 418 | \\bibcite{englishTest7/ej/japaneseTest7}{16} 419 | -- 420 | 421 | Parameters 422 | ---------- 423 | bn : str 424 | Target file to process without extension. 425 | if your target tex file is '/DIRNAME/main.tex' 426 | the bn would be '/DIRNAME/main' 427 | 428 | Returns 429 | ------- 430 | int 431 | -1 if the file to process not found 432 | 0 if no combined keys found 433 | num-of-pairs if successfully processed 434 | """ 435 | 436 | logger.info('--') 437 | logger.info('-- Combining divided keys.') 438 | pairs = check_load_file(bn + '.ejp', asjson=True) 439 | if pairs == -1: # file not found 440 | return -1 441 | if len(pairs) == 0: # no combined keys 442 | return 0 443 | combine_aux(bn + '.aux', pairs) 444 | combine_bbl(bn + '.bbl', pairs) 445 | return len(pairs) 446 | 447 | 448 | if __name__ == '__main__': 449 | 450 | logger = logging.getLogger() 451 | logger.setLevel(logging.INFO) 452 | 453 | sh = logging.StreamHandler() 454 | logger.addHandler(sh) 455 | 456 | logger.info( 457 | 'This is python version %s ' % platform.python_version()) 458 | logger.info( 459 | 'mixje.py version %s (%s) by %s.' % 460 | (FILE_VERSION, FILE_DATE, FILE_AUTHOR) 461 | ) 462 | logger.info('See web site: %s' % FILE_URL) 463 | try: 464 | fname = sys.argv[1] 465 | logger.info('Target: %s' % fname) 466 | except IndexError: 467 | logger.info('Fatal error: You must assign target.') 468 | sys.exit(0) 469 | 470 | sk = divide_ej_key(fname) 471 | if sk > 0: # combined keys existed 472 | logger.info('-- Fin, %d keys were divided.' % sk) 473 | sys.exit(0) 474 | elif sk < 0: # Abort 475 | sys.exit(0) 476 | 477 | ck = combine_ej_key(fname) 478 | if ck != 0: 479 | # print('-- %d divided citation keys were successfully combined' % ck) 480 | logger.info('-- Fin, %d keys were combined.' % ck) 481 | sys.exit(0) 482 | with open(sys.argv[1] + '.ejp', 'w', encoding='utf-8') as f: 483 | json.dump([], f) 484 | logger.info( 485 | '-- No cmobined nor divided citation key in the aux file') 486 | sys.exit(0) 487 | -------------------------------------------------------------------------------- /jieeetran/mixej.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import platform 3 | import json 4 | import logging 5 | 6 | 7 | SPLIT_KEY = '/ej/' 8 | ITEM_SEP = '\\hspace{0mm}\\\\' 9 | 10 | FILE_VERSION = '0.19' 11 | FILE_DATE = '2023/01/26' 12 | FILE_AUTHOR = 'Haruki Ejiri' 13 | FILE_URL = 'https://github.com/ehki/jIEEEtran/' 14 | 15 | logger = logging.getLogger(__name__) 16 | 17 | 18 | def check_load_file(fn, asjson=False): 19 | """load file if exist else return -1. 20 | 21 | This code load text and json file if exist. 22 | If the file not exist, return -1 23 | 24 | Parameters 25 | ---------- 26 | fn : str 27 | Path to the file to load 28 | asjson : bool 29 | whether the fn should be loaded using json or normal text file 30 | 31 | Returns 32 | ------- 33 | int 34 | 0 if success 35 | """ 36 | 37 | logger.info('-- Checking file %s, ' % fn) 38 | try: 39 | with open(fn, 'r', encoding='utf-8') as f: 40 | logger.info('exist, load.') 41 | if asjson: 42 | return json.load(f) 43 | else: 44 | return f.read() 45 | except FileNotFoundError: 46 | logger.info('not found.') 47 | return -1 48 | 49 | 50 | def save_pairs(fn, pairs): 51 | """save pairs to the JSON format file with the extensions of ".ejp". 52 | 53 | This code save the pairs to the file in JSON format. 54 | 55 | Parameters 56 | ---------- 57 | fn : str 58 | Path to the file to write pairs 59 | pairs : list of two strings 60 | for example: [["en1", "jp1"], ["en2", "jp2"], ["en3", "jp3"]] 61 | 62 | Returns 63 | ------- 64 | int 65 | 0 if success 66 | """ 67 | 68 | logger.info('-- Saving found pairs to %s, ' % fn) 69 | with open(fn, 'w', encoding='utf-8') as f: 70 | json.dump(pairs, f) 71 | logger.info('done.') 72 | return 0 73 | 74 | 75 | def divide_aux(fn, pairs): 76 | """divide comined citation(s) and bibcite(s) in aux file. 77 | 78 | This code divide the combined key(s) in aux file. 79 | For example, the following citation(s) and bibcite(s) in aux file 80 | -- 81 | \\citation{englishTest7/ej/japaneseTest7} 82 | 83 | \\bibcite{englishTest7/ej/japaneseTest7}{16} 84 | -- 85 | will be converted to the following two divided citations and bibitems. 86 | -- 87 | \\citation{englishTest7,japaneseTest7} 88 | 89 | \\bibcite{englishTest7,japaneseTest7}{16} 90 | -- 91 | 92 | Parameters 93 | ---------- 94 | fn : str 95 | Path to the aux file to proceess 96 | pairs : list of two strings 97 | for example: [["en1", "jp1"], ["en2", "jp2"], ["en3", "jp3"]] 98 | 99 | Returns 100 | ------- 101 | int 102 | -1 if the file to process not found, 0 if success 103 | """ 104 | 105 | aux = check_load_file(fn) 106 | if aux == -1: # file not found 107 | return -1 # failed 108 | for k1, k2 in pairs: 109 | combi = SPLIT_KEY.join([k1, k2]) 110 | # for example, combi is "engkey/ej/jpkey", wehere SPLIT_KEY is "/ej/" 111 | logger.info('-- Dividing %s into %s and %s' % (combi, k1, k2)) 112 | aux = aux.replace('%s' % combi, 113 | '%s,%s' % (k1, k2)) 114 | with open(fn, 'w', encoding='utf-8') as f: 115 | f.write(aux) 116 | return 0 117 | 118 | 119 | def divide_bbl(fn, pairs): 120 | """divide comined bibitem(s) in bbl file. 121 | 122 | This code divide the combined key(s) in bbl file. 123 | For example, the following combined bibitem(s) in bbl file 124 | -- 125 | \\bibitem{englishTest5/ej/japaneseTest5} 126 | I.~Yamada, J.~Sato, S.~Tanaka, S.~Suzuki: ``Article title'', Japanese 127 | Transaction, Vol.10, No.5, pp.45--60 (2016-3)\\hspace{0mm}\\\\ 128 | 山田~一郎・佐藤~次郎・田中~三郎・鈴木~四郎:「文献タイトル」, 129 | 日本語学会,Vol.10,No.5,pp.45--60(2016-3) 130 | -- 131 | will be converted to the following two divided bibitems. 132 | -- 133 | \\bibitem{englishTest5} 134 | I.~Yamada, J.~Sato, S.~Tanaka, S.~Suzuki: ``Article title'', Japanese 135 | Transaction, Vol.10, No.5, pp.45--60 (2016-3) 136 | 137 | \\bibitem{japaneseTest5} 138 | 山田~一郎・佐藤~次郎・田中~三郎・鈴木~四郎:「文献タイトル」, 139 | 日本語学会,Vol.10,No.5,pp.45--60(2016-3) 140 | -- 141 | 142 | Parameters 143 | ---------- 144 | fn : str 145 | Path to the bbl file to proceess 146 | pairs : list of two strings 147 | for example: [["en1", "jp1"], ["en2", "jp2"], ["en3", "jp3"]] 148 | 149 | Returns 150 | ------- 151 | int 152 | -1 if the file to process not found, 0 if success 153 | """ 154 | 155 | bbl = check_load_file(fn) 156 | if bbl == -1: # file not found 157 | return -1 # failed 158 | for k1, k2 in pairs: 159 | combi = SPLIT_KEY.join([k1, k2]) 160 | # for example, combi is "engkey/ej/jpkey", wehere SPLIT_KEY is "/ej/" 161 | logger.info('-- Dividing %s into %s and %s' % (combi, k1, k2)) 162 | bbl = bbl.replace(ITEM_SEP, '\n\n\\bibitem{%s}' % k2) 163 | bbl = bbl.replace('\\bibitem{%s}' % combi, '\\bibitem{%s}' % k1) 164 | logger.info('-- Saving divided bbl to %s, ' % fn) 165 | with open(fn, 'w', encoding='utf-8') as f: 166 | f.write(bbl) 167 | logger.info('done.') 168 | return 0 # successfully finished 169 | 170 | 171 | def find_pairs(fn, aux): 172 | """find english/japanese pair from string in aux. 173 | 174 | This code find and store english/japanese pair. 175 | Reading each line in aux strings, the engligh and japanese keys 176 | are extracted if SPLIT_KEY is in the line. 177 | If the combined english/japanese keys in the aux file, 178 | the pairs are stored to the external JSON file 179 | 180 | Parameters 181 | ---------- 182 | fn : str 183 | Path to the aux file to proceess 184 | aux : strings in aux file 185 | loaded string 186 | 187 | Returns 188 | ------- 189 | int 190 | 0 if no combined keys found 191 | num-of-pairs if successfully processed 192 | """ 193 | 194 | pairs = [] 195 | logger.info('-- ') 196 | for line in aux.split('\n'): 197 | if SPLIT_KEY not in line or '\\citation' not in line: 198 | continue 199 | # the line contains \citation and /ej/ 200 | for ln in line.replace('\\citation{', '').replace('}', '').split(','): 201 | # convert '\citation{hoge1/ej/hoge2}' to 'hoge1/ej/hoge2' 202 | if len(ln.split(SPLIT_KEY)) == 2: 203 | pairs.append(ln.split(SPLIT_KEY)) 204 | # store as ['hoge1', 'hoge2'] pairs 205 | logger.info('%s' % str(ln.split(SPLIT_KEY))) 206 | if len(pairs) == 0: 207 | logger.info('No combined keys found.') 208 | ret = 0 209 | if len(pairs) > 0: 210 | logger.info(' %d combined keys found.' % len(pairs)) 211 | ret = pairs 212 | save_pairs(fn, pairs) 213 | return ret 214 | 215 | 216 | def combine_aux(fn, pairs): 217 | """combine divided citation(s) and bibcite(s) in aux file. 218 | 219 | This code combine the divided key(s) in aux file. 220 | For example, the following two divided citation(s) and bibcite(s) 221 | in aux file 222 | -- 223 | \\citation{englishTest7,japaneseTest7} 224 | 225 | \\bibcite{englishTest7,japaneseTest7}{16} 226 | -- 227 | will be converted to the following combined citations and bibitems. 228 | -- 229 | \\citation{englishTest7/ej/japaneseTest7} 230 | 231 | \\bibcite{englishTest7/ej/japaneseTest7}{16} 232 | -- 233 | 234 | Parameters 235 | ---------- 236 | fn : str 237 | Path to the aux file to proceess 238 | pairs : list of two strings 239 | for example: [["en1", "jp1"], ["en2", "jp2"], ["en3", "jp3"]] 240 | 241 | Returns 242 | ------- 243 | int 244 | -1 if the file to process not found, 0 if success 245 | """ 246 | 247 | aux = check_load_file(fn) 248 | if aux == -1: # file not found 249 | return -1 # failed 250 | for k1, k2 in pairs: 251 | combi = SPLIT_KEY.join([k1, k2]) 252 | # for example, combi is "engkey/ej/jpkey", wehere SPLIT_KEY is "/ej/" 253 | logger.info('-- Combining %s and %s to %s' % (k1, k2, combi)) 254 | aux = aux.replace('%s,%s' % (k1, k2), '%s' % combi) 255 | logger.info('-- Saving combined aux to %s, ' % fn) 256 | with open(fn, 'w', encoding='utf-8') as f: 257 | f.write(aux) 258 | logger.info('done.') 259 | 260 | 261 | def combine_bbl(fn, pairs): 262 | """combine divided bibitem(s) in bbl file. 263 | 264 | This code divide the combined key(s) in bbl file. 265 | For example, the following two divided bibitem(s) in bbl file 266 | -- 267 | \\bibitem{englishTest5} 268 | I.~Yamada, J.~Sato, S.~Tanaka, S.~Suzuki: ``Article title'', Japanese 269 | Transaction, Vol.10, No.5, pp.45--60 (2016-3) 270 | 271 | \\bibitem{japaneseTest5} 272 | 山田~一郎・佐藤~次郎・田中~三郎・鈴木~四郎:「文献タイトル」, 273 | 日本語学会,Vol.10,No.5,pp.45--60(2016-3) 274 | -- 275 | will be converted to the following combined citations and bibitems. 276 | -- 277 | \\bibitem{englishTest5/ej/japaneseTest5} 278 | I.~Yamada, J.~Sato, S.~Tanaka, S.~Suzuki: ``Article title'', Japanese 279 | Transaction, Vol.10, No.5, pp.45--60 (2016-3)\\hspace{0mm}\\\\ 280 | 山田~一郎・佐藤~次郎・田中~三郎・鈴木~四郎:「文献タイトル」, 281 | 日本語学会,Vol.10,No.5,pp.45--60(2016-3) 282 | -- 283 | 284 | Parameters 285 | ---------- 286 | fn : str 287 | Path to the aux file to proceess 288 | pairs : list of two strings 289 | for example: [["en1", "jp1"], ["en2", "jp2"], ["en3", "jp3"]] 290 | 291 | Returns 292 | ------- 293 | int 294 | -1 if the file to process not found, 0 if success 295 | """ 296 | 297 | bbl = check_load_file(fn) 298 | if bbl == -1: # file not found 299 | return -1 # failed 300 | for k1, k2 in pairs: 301 | combi = SPLIT_KEY.join([k1, k2]) 302 | # for example, combi is "engkey/ej/jpkey", wehere SPLIT_KEY is "/ej/" 303 | logger.info('-- Combining %s and %s to %s' % (k1, k2, combi)) 304 | bbl = bbl.replace('\n\n\\bibitem{%s}' % k2, ITEM_SEP) 305 | bbl = bbl.replace('\\bibitem{%s}' % k1, 306 | '\\bibitem{%s}' % combi) 307 | logger.info('-- Saving combined bbl to %s, ' % fn) 308 | with open(fn, 'w', encoding='utf-8') as f: 309 | f.write(bbl) 310 | logger.info('done.') 311 | 312 | 313 | def divide_ej_key(bn): 314 | """divide combined english and japanese bibiteems in bbl and aux file. 315 | 316 | This code divide the combined key(s) in aux and bbl file. 317 | For example, the following combined bibitem(s) in bbl file 318 | -- 319 | \\bibitem{englishTest5/ej/japaneseTest5} 320 | I.~Yamada, J.~Sato, S.~Tanaka, S.~Suzuki: ``Article title'', Japanese 321 | Transaction, Vol.10, No.5, pp.45--60 (2016-3)\\hspace{0mm}\\\\ 322 | 山田~一郎・佐藤~次郎・田中~三郎・鈴木~四郎:「文献タイトル」, 323 | 日本語学会,Vol.10,No.5,pp.45--60(2016-3) 324 | -- 325 | will be converted to the following two divided bibitems. 326 | -- 327 | \\bibitem{englishTest5} 328 | I.~Yamada, J.~Sato, S.~Tanaka, S.~Suzuki: ``Article title'', Japanese 329 | Transaction, Vol.10, No.5, pp.45--60 (2016-3) 330 | 331 | \\bibitem{japaneseTest5} 332 | 山田~一郎・佐藤~次郎・田中~三郎・鈴木~四郎:「文献タイトル」, 333 | 日本語学会,Vol.10,No.5,pp.45--60(2016-3) 334 | -- 335 | The following two combined citation(s) and bibcite(s) in aux file 336 | -- 337 | \\citation{englishTest7/ej/japaneseTest7} 338 | 339 | \\bibcite{englishTest7/ej/japaneseTest7}{16} 340 | -- 341 | will also be converted to the following combined citations and bibitems. 342 | -- 343 | \\citation{englishTest7} 344 | \\citation{japaneseTest7} 345 | 346 | \\bibcite{englishTest7}{1} 347 | \\bibcite{japaneseTest7}{16} 348 | -- 349 | The first process during LaTeX compile, there would no bbl file. 350 | If the bbl file not exist, the dividing process would be skipped. 351 | A list of english/japanese pairs will be extracted from aux file, 352 | and if will be saved in the JSON file with 353 | ".ejp" (english-japanese-pair) extension 354 | 355 | Parameters 356 | ---------- 357 | bn : str 358 | Target file to process without extension. 359 | if your target tex file is '/DIRNAME/main.tex' 360 | the bn would be '/DIRNAME/main' 361 | 362 | Returns 363 | ------- 364 | int 365 | -1 if the file to process not found 366 | 0 if no combined keys found 367 | num-of-pairs if successfully processed 368 | """ 369 | 370 | logger.info('--') 371 | logger.info('-- Dividing combinecd keys.') 372 | aux = check_load_file(bn + '.aux') 373 | if aux == -1: # aux file not found 374 | return -1 # abort 375 | logger.info('-- Search combined keys from %s.aux.' % bn) 376 | pairs = find_pairs(bn + '.ejp', aux) 377 | if pairs == 0: # no combined keys 378 | return 0 # probably already divided 379 | divide_aux(bn + '.aux', pairs) 380 | divide_bbl(bn + '.bbl', pairs) 381 | return len(pairs) 382 | 383 | 384 | def combine_ej_key(bn): 385 | """combine english and japanese bibiteems in bbl and aux file. 386 | 387 | This code combine the divided key(s) in aux and bbl file. 388 | For example, the following divided bibitem(s) in bbl file 389 | -- 390 | \\bibitem{englishTest5} 391 | I.~Yamada, J.~Sato, S.~Tanaka, S.~Suzuki: ``Article title'', Japanese 392 | Transaction, Vol.10, No.5, pp.45--60 (2016-3) 393 | 394 | \\bibitem{japaneseTest5} 395 | 山田~一郎・佐藤~次郎・田中~三郎・鈴木~四郎:「文献タイトル」, 396 | 日本語学会,Vol.10,No.5,pp.45--60(2016-3) 397 | -- 398 | will be converted to the following two divided bibitems. 399 | -- 400 | \\bibitem{englishTest5/ej/japaneseTest5} 401 | I.~Yamada, J.~Sato, S.~Tanaka, S.~Suzuki: ``Article title'', Japanese 402 | Transaction, Vol.10, No.5, pp.45--60 (2016-3)\\hspace{0mm}\\\\ 403 | 山田~一郎・佐藤~次郎・田中~三郎・鈴木~四郎:「文献タイトル」, 404 | 日本語学会,Vol.10,No.5,pp.45--60(2016-3) 405 | -- 406 | The following two divided citation(s) and bibcite(s) in aux file 407 | -- 408 | \\citation{englishTest7} 409 | \\citation{japaneseTest7} 410 | 411 | \\bibcite{englishTest7}{1} 412 | \\bibcite{japaneseTest7}{16} 413 | -- 414 | will also be converted to the following combined citations and bibitems. 415 | -- 416 | \\citation{englishTest7/ej/japaneseTest7} 417 | 418 | \\bibcite{englishTest7/ej/japaneseTest7}{16} 419 | -- 420 | 421 | Parameters 422 | ---------- 423 | bn : str 424 | Target file to process without extension. 425 | if your target tex file is '/DIRNAME/main.tex' 426 | the bn would be '/DIRNAME/main' 427 | 428 | Returns 429 | ------- 430 | int 431 | -1 if the file to process not found 432 | 0 if no combined keys found 433 | num-of-pairs if successfully processed 434 | """ 435 | 436 | logger.info('--') 437 | logger.info('-- Combining divided keys.') 438 | pairs = check_load_file(bn + '.ejp', asjson=True) 439 | if pairs == -1: # file not found 440 | return -1 441 | if len(pairs) == 0: # no combined keys 442 | return 0 443 | combine_aux(bn + '.aux', pairs) 444 | combine_bbl(bn + '.bbl', pairs) 445 | return len(pairs) 446 | 447 | 448 | if __name__ == '__main__': 449 | 450 | logger = logging.getLogger() 451 | logger.setLevel(logging.INFO) 452 | 453 | sh = logging.StreamHandler() 454 | logger.addHandler(sh) 455 | 456 | logger.info( 457 | 'This is python version %s ' % platform.python_version()) 458 | logger.info( 459 | 'mixje.py version %s (%s) by %s.' % 460 | (FILE_VERSION, FILE_DATE, FILE_AUTHOR) 461 | ) 462 | logger.info('See web site: %s' % FILE_URL) 463 | try: 464 | fname = sys.argv[1] 465 | logger.info('Target: %s' % fname) 466 | except IndexError: 467 | logger.info('Fatal error: You must assign target.') 468 | sys.exit(0) 469 | 470 | sk = divide_ej_key(fname) 471 | if sk > 0: # combined keys existed 472 | logger.info('-- Fin, %d keys were divided.' % sk) 473 | sys.exit(0) 474 | elif sk < 0: # Abort 475 | sys.exit(0) 476 | 477 | ck = combine_ej_key(fname) 478 | if ck != 0: 479 | # print('-- %d divided citation keys were successfully combined' % ck) 480 | logger.info('-- Fin, %d keys were combined.' % ck) 481 | sys.exit(0) 482 | with open(sys.argv[1] + '.ejp', 'w', encoding='utf-8') as f: 483 | json.dump([], f) 484 | logger.info( 485 | '-- No cmobined nor divided citation key in the aux file') 486 | sys.exit(0) 487 | -------------------------------------------------------------------------------- /howtouse.tex: -------------------------------------------------------------------------------- 1 | \RequirePackage{plautopatch} 2 | % \documentclass[10pt, a4paper, dvipdfmx, platex]{jsarticle} % for platex 3 | \documentclass[10pt, a4paper, dvipdfmx, uplatex]{jsarticle} % for uplatex 4 | \usepackage[top=20truemm, bottom=20truemm, left=25truemm, right=25truemm]{geometry} 5 | \setlength{\columnsep}{3zw} 6 | \usepackage{listings, jlisting} 7 | \usepackage[sectionbib]{bibunits} 8 | \usepackage{url} 9 | \usepackage{cite} 10 | \usepackage{textcomp}[=2018/08/11] 11 | \usepackage[T1]{fontenc} 12 | \usepackage[dvipdfmx]{hyperref} 13 | \usepackage{pxjahyper} 14 | \usepackage{IEEEtrantools} 15 | \hypersetup{ 16 | colorlinks=false, 17 | bookmarksnumbered=true, 18 | pdfborder={0 0 0}, 19 | } 20 | \setcounter{tocdepth}{3} 21 | \renewcommand{\refname}{\small 参考文献} 22 | \usepackage{multicol} 23 | \usepackage{enumitem} 24 | \setitemize{itemsep=-0.1\baselineskip} 25 | \newsavebox{\mybox} 26 | \lstdefinestyle{twocol}{ 27 | basicstyle={\scriptsize\ttfamily}, 28 | identifierstyle={\footnotesize}, 29 | commentstyle={\footnotesizeitshape}, 30 | keywordstyle={\footnotesize\bfseries}, 31 | ndkeywordstyle={\footnotesize}, 32 | stringstyle={\footnotesize\ttfamily}, 33 | breaklines=true, 34 | columns=[l]{fullflexible}, 35 | multicols=2 36 | } 37 | \lstdefinestyle{onecol}{ 38 | basicstyle={\scriptsize\ttfamily}, 39 | identifierstyle={\footnotesize}, 40 | commentstyle={\footnotesizeitshape}, 41 | keywordstyle={\footnotesize\bfseries}, 42 | ndkeywordstyle={\footnotesize}, 43 | stringstyle={\footnotesize\ttfamily}, 44 | breaklines=true, 45 | columns=[l]{fullflexible} 46 | } 47 | \newcommand{\putlst}[1]{ 48 | \noindent\makebox[\linewidth]{\rule{\linewidth}{0.4pt}}\vspace{-1.5zw} 49 | \lstinputlisting[style=twocol,firstline=5]{#1}\vspace{-1.8zw} 50 | \noindent\makebox[\linewidth]{\rule{\linewidth}{0.4pt}}\vspace{0.5zw}\par 51 | } 52 | \begin{filecontents}[overwrite]{article.bib} 53 | @article{Article, 54 | author = {Author(s)}, 55 | title = {Title}, 56 | language = {Language}, 57 | journal = {Journal}, 58 | month = {Month}, 59 | year = {Year}, 60 | volume = {Volume}, 61 | note = {Note}, 62 | url = {URL} 63 | } 64 | @article{jpArticle1, 65 | author = {山田 一郎 and 山田 次郎 and 山田 三郎 and 山田 四郎}, 66 | year = {2019}, 67 | journal = {日本語学会}, 68 | title = {文献1}, 69 | number = {10}, 70 | pages = {20--30}, 71 | volume = {15}, 72 | month = {3} 73 | } 74 | @article{jpArticle2, 75 | author = {{山田 五郎} and {山田 六郎}}, 76 | year = {2019}, 77 | journal = {日本語学会}, 78 | title = {文献2}, 79 | number = {10}, 80 | pages = {21}, 81 | volume = {15}, 82 | month = {12} 83 | } 84 | @article{jpArticle3, 85 | author = {{山田 八郎} and {山田 六郎}}, 86 | year = {2010}, 87 | journal = {日本語学会}, 88 | title = {手法1と手法2の比較検討}, 89 | number = {1}, 90 | pages = {15}, 91 | volume = {5} 92 | } 93 | @article{enArticle1, 94 | author = {Ichiro Yamada and Jiro Yamada and Saburo Yamada and Shiro Yamada}, 95 | year = {2019}, 96 | journal = {Japanese Journal}, 97 | title = {Title1}, 98 | number = {10}, 99 | pages = {20--30}, 100 | volume = {15}, 101 | month = {march}, 102 | language = {Japanese} 103 | } 104 | @article{enArticle2, 105 | author = {Goro Yamada and Rokuro Yamada}, 106 | year = {2019}, 107 | journal = {Japanese Journal}, 108 | title = {Title2}, 109 | volume = {15}, 110 | number = {10}, 111 | pages = {21}, 112 | month = {dec.}, 113 | language = {Japanese} 114 | } 115 | @article{enArticle3, 116 | author = {Hachiro Yamada and Rokuro Yamada}, 117 | year = {2010}, 118 | journal = {Japanese Journal}, 119 | title = {Comparison Between Method 1 and Method 2}, 120 | number = {1}, 121 | pages = {15}, 122 | volume = {5} 123 | } 124 | @article{enArticle4, 125 | author = {Hiroshi Sato and Jiro Sasaki}, 126 | year = {2010}, 127 | journal = {IEEJ Sample Transactions}, 128 | title = {Article with language field}, 129 | month = {march}, 130 | language = {japanese} 131 | } 132 | \end{filecontents} 133 | \begin{filecontents}[overwrite]{articleabbrev.bib} 134 | @IEEEtranBSTCTL{BSTctlabbrev, 135 | CTLuse_ieej_abbrev = "yes", 136 | CTLmax_names_forced_etal = "2", 137 | } 138 | @article{jpArticle1, 139 | author = {山田 一郎}, 140 | year = {2019}, 141 | journal = {日本語学会}, 142 | title = {省略形ではタイトルは非表示}, 143 | number = {10}, 144 | pages = {20--30}, 145 | volume = {15}, 146 | } 147 | @article{jpArticle2, 148 | author = {{山田 二郎} and {佐藤 三郎}}, 149 | year = {2019}, 150 | journal = {日本語学会}, 151 | title = {省略形ではタイトルは非表示}, 152 | number = {10}, 153 | pages = {21}, 154 | volume = {15}, 155 | month = {12} 156 | } 157 | @article{jpArticle3, 158 | author = {林 四郎 and 田中 五郎 and 小林 六郎}, 159 | year = {2010}, 160 | journal = {学会誌}, 161 | title = {省略形ではタイトルは非表示}, 162 | number = {1}, 163 | pages = {15}, 164 | volume = {5} 165 | } 166 | @article{enArticle1, 167 | author = {Ichiro Yamada}, 168 | year = {2019}, 169 | journal = {JP Journal}, 170 | title = {Title1}, 171 | number = {10}, 172 | pages = {20--30}, 173 | volume = {15}, 174 | month = {march}, 175 | } 176 | @article{enArticle2, 177 | author = {Jiro Yamada and Saburo Yamada}, 178 | year = {2019}, 179 | journal = {IEEE TCAS}, 180 | title = {Title not shown}, 181 | volume = {15}, 182 | number = {10}, 183 | pages = {21}, 184 | month = {dec.}, 185 | } 186 | @article{enArticle3, 187 | author = {Shiro Tanaka and Goro Yamada and Rokuro}, 188 | year = {2010}, 189 | journal = {IEEJ Trans. Sample.}, 190 | title = {Not shown}, 191 | } 192 | @inproceedings{jpInproceedings1, 193 | author = {山田, 一郎 and 山田, 次郎}, 194 | title = {文献タイトル}, 195 | booktitle = {令和2年日本語大会}, 196 | address = {大阪}, 197 | year = {2010}, 198 | month = {3}, 199 | number = {10}, 200 | pages = {20--30} 201 | } 202 | @inproceedings{jpInproceedings2, 203 | author = {山田, 三郎 and 佐藤, 四郎}, 204 | title = {タイトル}, 205 | booktitle = {第30回部門大会}, 206 | address = {東京}, 207 | year = {2005}, 208 | month = {2}, 209 | number = {2}, 210 | pages = {15--19} 211 | } 212 | @inproceedings{enInproceedings1, 213 | author = {Hayashi, Shinji and Ogura, Yasuhiro}, 214 | title = {Sample Conference Article Title}, 215 | booktitle = {Proc. 5th ISC}, 216 | address = {Tokyo, Japan}, 217 | month = {jan}, 218 | year = {1997}, 219 | pages = {S01-5}, 220 | } 221 | @inproceedings{enInproceedings2, 222 | author = {Yamada, Sabuso and Sato, Shiro and Sato, Nishida}, 223 | title = {Title}, 224 | booktitle = {Proc. 30th CNOF}, 225 | address = {Tokyo}, 226 | year = {2005}, 227 | month = {2}, 228 | pages = {O1-15}, 229 | language = {Japanese} 230 | } 231 | \end{filecontents} 232 | \begin{filecontents}[overwrite]{inproceedings.bib} 233 | @inproceedings{Inproceedings, 234 | author = {Author(s)}, 235 | title = {Title}, 236 | intype = {Intype}, 237 | booktitle = {Booktitle}, 238 | language = {Language}, 239 | series = {Series}, 240 | editor = {Editor(s)}, 241 | volume = {Volume}, 242 | number = {Number}, 243 | organization = {Organization}, 244 | address = {Address}, 245 | publisher = {Publisher}, 246 | month = {Month}, 247 | year = {Year}, 248 | paper = {Paper}, 249 | type = {Type}, 250 | pages = {Pages}, 251 | note = {Note}, 252 | url = {URL} 253 | } 254 | @inproceedings{jpInproceedings1, 255 | author = {山田, 一郎 and 山田, 次郎}, 256 | title = {文献タイトル}, 257 | booktitle = {令和2年日本語大会}, 258 | address = {大阪}, 259 | year = {2010}, 260 | month = {3}, 261 | number = {10}, 262 | pages = {20--30} 263 | } 264 | @inproceedings{jpInproceedings2, 265 | author = {山田, 三郎 and 佐藤, 四郎}, 266 | title = {タイトル}, 267 | booktitle = {第30回部門大会}, 268 | address = {東京}, 269 | year = {2005}, 270 | month = {2}, 271 | number = {2}, 272 | pages = {15--19} 273 | } 274 | @inproceedings{enInproceedings1, 275 | author = {Hayashi, Shinji and Ogura, Yasuhiro}, 276 | title = {Sample Conference Article Title}, 277 | booktitle = {Proc. 5th Internatinoal Sample Conference (ISC)}, 278 | address = {Tokyo, Japan}, 279 | month = {jan}, 280 | year = {1997}, 281 | pages = {290-294}, 282 | number = {2} 283 | } 284 | @inproceedings{enInproceedings2, 285 | author = {Yamada, Sabuso and Sato, Shiro}, 286 | title = {Title}, 287 | booktitle = {Proc. 30th Society Conference}, 288 | address = {Tokyo}, 289 | year = {2005}, 290 | month = {2}, 291 | number = {2}, 292 | pages = {15--19}, 293 | language = {Japanese} 294 | } 295 | \end{filecontents} 296 | \begin{filecontents}[overwrite]{incollection.bib} 297 | @incollection{Incollection, 298 | author = {Author(s)}, 299 | title = {Title}, 300 | booktitle = {Booktitle}, 301 | language = {Language}, 302 | edition = {Edition}, 303 | series = {Series}, 304 | editor = {Editor}, 305 | address = {Address}, 306 | publisher = {Publisher}, 307 | month = {Month}, 308 | year = {Year}, 309 | volume = {Volume}, 310 | number = {Number}, 311 | organization = {Organization}, 312 | paper = {Paper}, 313 | type = {Type}, 314 | pages = {Pages}, 315 | note = {Note}, 316 | url = {URL} 317 | } 318 | @incollection{jpIncollection1, 319 | author = {{佐藤 二郎} and {林 三郎}}, 320 | year = {2012}, 321 | publisher = {日本語出版}, 322 | address = {東京}, 323 | title = {日本語本2の中の抜粋}, 324 | booktitle = {日本語本2}, 325 | edition = {2}, 326 | pages = {100--200} 327 | } 328 | @incollection{jpIncollection2, 329 | author = {山田, 一郎}, 330 | year = {1900}, 331 | publisher = {出版会社}, 332 | address = {東京}, 333 | title = {タイトル}, 334 | booktitle = {日本語本3}, 335 | chapter = {3}, 336 | edition = {1}, 337 | pages = {100--150}, 338 | } 339 | @incollection{enIncollection1, 340 | address = {Tokyo, Japan}, 341 | publisher = {JP Press}, 342 | author = {Sato, Jiro and Hayashi, Saburo}, 343 | booktitle = {Jpbook2}, 344 | title = {Part of Jpbook2}, 345 | pages = {100--200}, 346 | edition = {2}, 347 | year = {2012}, 348 | } 349 | \end{filecontents} 350 | \begin{filecontents}[overwrite]{book.bib} 351 | @book{Book, 352 | author = {Author(s)}, 353 | editor = {Editor(s)}, 354 | title = {Title}, 355 | language = {Language}, 356 | edition = {Edition}, 357 | series = {Series}, 358 | address = {Address}, 359 | publisher = {Publisher}, 360 | month = {Month}, 361 | year = {Year}, 362 | volume = {Volume}, 363 | note = {Note}, 364 | url = {URL} 365 | } 366 | @book{jpBook1, 367 | author = {佐藤, 一郎}, 368 | year = {2010}, 369 | publisher = {日本語出版}, 370 | address = {東京}, 371 | title = {日本語本}, 372 | edition = {1}, 373 | pages = {100--200} 374 | } 375 | @book{jpBook2, 376 | author = {佐藤, 二郎 and 佐藤, 三郎}, 377 | year = {2012}, 378 | publisher = {日本語出版}, 379 | address = {東京}, 380 | title = {日本語本2}, 381 | edition = {2}, 382 | pages = {100--200} 383 | } 384 | @book{jpBook3, 385 | author = {学会委員会}, 386 | year = {2020}, 387 | publisher = {学会出版}, 388 | title = {学会本}, 389 | edition = {1} 390 | } 391 | @book{enBook1, 392 | address = {City, Country}, 393 | publisher = {Publisher}, 394 | author = {Sato, Jiro and Hayashi, Saburo}, 395 | year = {2000}, 396 | title = {Title, not booktitle}, 397 | edition = {3}, 398 | pages = {1-10}, 399 | } 400 | @book{enjBook1, 401 | author = {Ichiro Sato}, 402 | year = {2010}, 403 | publisher = {Japanese Publisher}, 404 | address = {Tokyo}, 405 | title = {Japanese Book title}, 406 | edition = {1}, 407 | pages = {100--200}, 408 | language = {japaneese} 409 | } 410 | @book{jpjBook1, 411 | author = {佐藤 一郎}, 412 | year = {2010}, 413 | publisher = {日本語出版}, 414 | address = {東京}, 415 | title = {日本語本}, 416 | edition = {1}, 417 | pages = {100--200} 418 | } 419 | \end{filecontents} 420 | \begin{filecontents}[overwrite]{ref.bib} 421 | @misc{IEEEtran, 422 | author = {Michael Shell}, 423 | url = {https://www.ctan.org/tex-archive/macros/latex/contrib/IEEEtran/bibtex}, 424 | title = {{IEEEtran}}, 425 | month = {August}, 426 | year = {2015} 427 | } 428 | @misc{jIEEEtran, 429 | author = {ehki}, 430 | url = {https://github.com/ehki/jIEEEtran}, 431 | title = {{jIEEEtran}}, 432 | month = {March}, 433 | year = {2020} 434 | } 435 | @misc{jeconbst, 436 | author = {ShiroTakeda}, 437 | url = {http://shirotakeda.org/ja/tex-ja/jecon-ja.html}, 438 | title = {{jecon.bst}}, 439 | month = {August}, 440 | year = {2019} 441 | } 442 | \end{filecontents} 443 | 444 | \title{\texttt{jIEEEtran.bst}/\texttt{IEEJtran.bst}:\\電気系日本人ユーザ向け\BibTeX スタイルファイル\\(ver. 0.19)} 445 | \author{江尻 開} 446 | 447 | 448 | 449 | \begin{document} 450 | 451 | \maketitle 452 | \tableofcontents 453 | 454 | 455 | 456 | \section{概要} 457 | \begin{bibunit}[jIEEEtran] 458 | 459 | 電気系の論文を執筆する日本人ユーザ向けに,IEEEと電気学会の引用スタイルを保ったまま日本語の取り扱いを自然にした\BibTeX スタイル(\texttt{.bst})ファイルです。 460 | 電気学会原稿の下書きや卒業論文,修士論文など,\LaTeX を使用した文献管理の一助になることを目的としています。 461 | Michael Shell氏による\texttt{IEEEtran.bst}\cite{IEEEtran}をもとにYoshiRi氏が日本語の自然な表記を実装し,現在は著者らがリポジトリを譲渡していただきGitHub上\cite{jIEEEtran}で継続して開発しています。 462 | オプションの追記方法や日本語の判別方法については,武田氏らによる\texttt{jecon.bst}\cite{jeconbst}を参考にしています。 463 | 間違いがあった場合でも大きな被害が出るレポジトリではありませんので,ご要望や問題があればお気軽にIssueやPull Requestを飛ばしてください。 464 | なお,電気学会公認ではありませんし,全ての環境で動作を保証するものではありません。不具合が生じても責任を負うことはできませんのでご容赦ください。 465 | なお,\TeX Live 2019以降の使用を想定しています。\texttt{w32tex}や古い\TeX Liveでの動作は確認していません。\TeX エンジンとしてplatex/pbibtexもしくはuplatex/upbibtexを推奨し,本マニュアルはuplatexでコンパイルしています。\TeX エンジンが出力する中間ファイルの改変にPythonを使用します。Pythonは\texttt{3.7}以降での動作を確認しています。 466 | 467 | {\small \putbib[./ref]} 468 | \end{bibunit} 469 | 470 | 471 | \section{使用例} 472 | まずはいくつかの文献タイプについて\texttt{.bib}ファイルの中身とコンパイル結果の例を示します。 473 | 474 | \subsection{article} 475 | 476 | \texttt{article}タイプのエントリでは次のフィールドをサポートします。 477 | \begin{center} 478 | \textbf{author}, \textbf{title}, \textsl{language}, \textbf{journal}, volume, number, pages, month, year, note, \textsl{url}. 479 | \end{center} 480 | このうち\textbf{textbf}で示したフィールドは必須,レギュラーフォントで示したフィールドはオプションです。 481 | \textsl{textsl}で示したフィールドは拡張用のフィールドで,標準的な\BibTeX ではサポートされていない可能性があります。 482 | \texttt{article}タイプのエントリでは,\texttt{language}フィールドに例えば``Japanese''を書くと,\texttt{IEEJtran.bst}では各エントリの最後に``(in Japanese)''を追記し,\texttt{jIEEEtran.bst}では\texttt{title}と\texttt{journal}の間に``(in Japanese)''を記載します。 483 | 484 | \texttt{.bib}ファイルの例と,\texttt{IEEJtran.bst}および\texttt{jIEEEtran.bst}を使用して引用した際の出力例を次に示します。 485 | 486 | \putlst{article.bib} 487 | 488 | \begin{bibunit}[IEEJtran] 489 | \nocite{Article,jpArticle1,jpArticle2,jpArticle3,enArticle1,enArticle2,enArticle3,enArticle4} 490 | \renewcommand{\refname}{\small 参考文献(IEEJtran.bst)} 491 | {\small \putbib[./article]} 492 | \end{bibunit} 493 | \begin{bibunit}[jIEEEtran] 494 | \nocite{Article,jpArticle1,jpArticle2,jpArticle3,enArticle1,enArticle2,enArticle3,enArticle4} 495 | \renewcommand{\refname}{\small 参考文献(jIEEEtran.bst)} 496 | {\small \putbib[./article]} 497 | \end{bibunit} 498 | 499 | \vspace{2em} 500 | 電気学会の引用スタイルで求められているように英語と日本語を併記する場合,例えば 501 | \begin{center} 502 | \verb*|\cite{enArticle1/ej/jpArticle1}| 503 | \end{center} 504 | と記載すれば\texttt{enArticle1}と\texttt{jpArticle1}を一つのエントリとして扱えます。これには外部pythonファイルの\texttt{mixej.py}が必要ですので,\ref{sec:compile_procedure}節と\ref{sec:compile_config}節において後述します。英語と日本語の併記は\texttt{IEEJtran.bst}だけでなく\texttt{jIEEEtran.bst}でも使用することができます。 505 | 例えば\texttt{enArticle1}と\texttt{jpArticle1},\texttt{enArticle2}と\texttt{jpArticle2}を一つの文献としてまとめると,次のように出力されます。 506 | 507 | \begin{bibunit}[IEEJtran] 508 | \nocite{enArticle1/ej/jpArticle1,enArticle2/ej/jpArticle2} 509 | \renewcommand{\refname}{\small 英日を併記した参考文献(IEEJtran.bst)} 510 | {\small \putbib[./article]} 511 | \end{bibunit} 512 | \begin{bibunit}[jIEEEtran] 513 | \nocite{enArticle1/ej/jpArticle1,enArticle2/ej/jpArticle2} 514 | \renewcommand{\refname}{\small 英日を併記した参考文献(jIEEEtran.bst)} 515 | {\small \putbib[./article]} 516 | \end{bibunit} 517 | 518 | 519 | \subsection{book} 520 | 521 | \texttt{book}タイプのエントリでは次のフィールドをサポートします。 522 | 523 | \begin{center} 524 | \textbf{author} and/or \textbf{editor}, \textbf{title}, \textsl{language}, edition, 525 | series, \\ 526 | address, \textbf{publisher}, month, \textbf{year}, volume, note, \textsl{url}. 527 | \end{center} 528 | 529 | \texttt{.bib}ファイルの例とそれぞれの\texttt{bst}ファイルの出力例を以下に示します。 530 | 531 | \putlst{book.bib} 532 | 533 | \begin{bibunit}[IEEJtran] 534 | \nocite{Book,jpBook1,jpBook2,jpBook3,enBook1} 535 | \renewcommand{\refname}{\small 参考文献(IEEJtran.bst)} 536 | {\small \putbib[./book]} 537 | \end{bibunit} 538 | \begin{bibunit}[jIEEEtran] 539 | \nocite{Book,jpBook1,jpBook2,jpBook3,enBook1} 540 | \renewcommand{\refname}{\small 参考文献(jIEEEtran.bst)} 541 | {\small \putbib[./book]} 542 | \end{bibunit} 543 | \begin{bibunit}[IEEJtran] 544 | \nocite{enjBook1/ej/jpjBook1} 545 | \renewcommand{\refname}{\small 英日を併記した参考文献(IEEJtran.bst)} 546 | {\small \putbib[./book]} 547 | \end{bibunit} 548 | \begin{bibunit}[jIEEEtran] 549 | \nocite{enjBook1/ej/jpjBook1} 550 | \renewcommand{\refname}{\small 英日を併記した参考文献(jIEEEtran.bst)} 551 | {\small \putbib[./book]} 552 | \end{bibunit} 553 | 554 | 555 | \subsection{inproceedings/conference} 556 | 557 | \texttt{inproceedings}タイプのエントリや\texttt{conference}タイプのエントリでは次のフィールドをサポートします。なお,どちらのタイプが指定されても\texttt{bst}内部ではエイリアスにより\texttt{inproceedings}タイプとして処理されます。 558 | \begin{center} 559 | \textbf{author}, \textbf{title}, \textsl{intype}, \textbf{booktitle}, \textsl{language}, series, editor, volume, number, \\ 560 | organization, address, publisher, month, \textbf{year}, \textsl{paper}, \textsl{type}, pages, note, \textsl{url}. 561 | \end{center} 562 | このうち,\textsl{intype}フィールドや\textsl{paper}フィールド,\textsl{type}フィールドについては本家の\texttt{IEEEtran.bst}のマニュアルを参照ください。\texttt{.bib}ファイルの例とそれぞれの\texttt{bst}ファイルの出力例を以下に示します。 563 | 564 | \putlst{inproceedings.bib} 565 | 566 | \begin{bibunit}[IEEJtran] 567 | \nocite{Inproceedings,jpInproceedings1,enInproceedings1,jpInproceedings2,enInproceedings2} 568 | \renewcommand{\refname}{\small 参考文献(IEEJtran.bst)} 569 | {\small \putbib[./inproceedings]} 570 | \end{bibunit} 571 | \begin{bibunit}[jIEEEtran] 572 | \nocite{Inproceedings,jpInproceedings1,enInproceedings1,jpInproceedings2,enInproceedings2} 573 | \renewcommand{\refname}{\small 参考文献(jIEEEtran.bst)} 574 | {\small \putbib[./inproceedings]} 575 | \end{bibunit} 576 | \begin{bibunit}[IEEJtran] 577 | \nocite{jpInproceedings1/ej/enInproceedings1,jpInproceedings2/ej/enInproceedings2} 578 | \renewcommand{\refname}{\small 英日を併記した参考文献(IEEJtran.bst)} 579 | {\small \putbib[./inproceedings]} 580 | \end{bibunit} 581 | \begin{bibunit}[jIEEEtran] 582 | \nocite{jpInproceedings1/ej/enInproceedings1,jpInproceedings2/ej/enInproceedings2} 583 | \renewcommand{\refname}{\small 英日を併記した参考文献(jIEEEtran.bst)} 584 | {\small \putbib[./inproceedings]} 585 | \end{bibunit} 586 | 587 | 588 | 589 | \subsection{incollection} 590 | 591 | \texttt{incollection}タイプのエントリは,書籍のうちタイトルのある一部分を引用したい場合に使用されます。次のフィールドをサポートします。 592 | 593 | \begin{center} 594 | \textbf{author}, \textbf{title}, \textbf{booktitle}, \textsl{language}, edition, series, editor, address, publisher, \\ 595 | month, \textbf{year}, volume, number, chapter, type, pages, note, \textsl{url}. 596 | \end{center} 597 | 598 | \texttt{.bib}ファイルの例とそれぞれの\texttt{bst}ファイルの出力例を以下に示します。 599 | 600 | \putlst{incollection.bib} 601 | 602 | \begin{bibunit}[IEEJtran] 603 | \nocite{Incollection,jpIncollection1,jpIncollection2,enIncollection1} 604 | \renewcommand{\refname}{\small 参考文献(IEEJtran.bst)} 605 | {\small \putbib[./incollection]} 606 | \end{bibunit} 607 | \begin{bibunit}[jIEEEtran] 608 | \nocite{Incollection,jpIncollection1,jpIncollection2,enIncollection1} 609 | \renewcommand{\refname}{\small 参考文献(jIEEEtran.bst)} 610 | {\small \putbib[./incollection]} 611 | \end{bibunit} 612 | \begin{bibunit}[IEEJtran] 613 | \nocite{enIncollection1/ej/jpIncollection1} 614 | \renewcommand{\refname}{\small 英日を併記した参考文献(IEEJtran.bst)} 615 | {\small \putbib[./incollection]} 616 | \end{bibunit} 617 | \begin{bibunit}[jIEEEtran] 618 | \nocite{enIncollection1/ej/jpIncollection1} 619 | \renewcommand{\refname}{\small 英日を併記した参考文献(jIEEEtran.bst)} 620 | {\small \putbib[./incollection]} 621 | \end{bibunit} 622 | 623 | 624 | 625 | 626 | \section{使用方法} 627 | 628 | \subsection{必要環境} 629 | 630 | \texttt{jIEEEtran.bst}や\texttt{IEEJtran.bst}は\BibTeX 用のスタイルファイルですので,当然\BibTeX を利用できる環境と使用する\texttt{.bib}ファイルが必要です。 631 | \BibTeX の環境構築方法については本マニュアルの範囲外とします。 632 | また,日本人ユーザを想定していますので,\texttt{platex}/\texttt{pbibtex}または\texttt{uplatex}/\texttt{upbibtex}は既に使用可能であるものとします。 633 | \texttt{jIEEEtran.bst},\texttt{IEEJtran.bst}いずれも\texttt{pbibtex}と\texttt{upbibtex}に用意されている\texttt{is.kanji.str\$} 関数を使用しています。 634 | そのため,\BibTeX コンパイラとして\texttt{bibtex}ではなく必ず\texttt{pbibtex}もしくは\texttt{upbibtex}を使用してください。 635 | なお,\texttt{is.kanji.str\$} 関数による日本語の判定は,\texttt{author},\texttt{title},\texttt{journal},\texttt{publisher}の4つのフィールドに限定しています。 636 | 637 | 638 | 639 | \subsection{\texttt{jIEEEtran.bst}/\texttt{IEEJtran.bst}の置き場所} 640 | 641 | \texttt{jIEEEtran.bst}と\texttt{IEEJtran.bst}は\LaTeX のコンパイラが認識できる場所に置いてください。 642 | すなわち,コンパイル対象の\texttt{.tex}ファイルと同一のディレクトリに置いてもよいですし,パスの通った場所に置いても動作します。 643 | 例えば\texttt{ieeetr.bst}が置かれている\texttt{texmf-dist/bibtex/bst/base}に置いてもよいでしょう。 644 | この場合,ファイル一覧表の更新コマンドである\texttt{mktexlsr}を実行するのを忘れないでください。 645 | 英語と日本語の併記を実現する\texttt{mixej.py}はコンパイル対象の\texttt{.tex}ファイルから相対パスで参照できる場所であれば実行可能ですが,\texttt{.tex}ファイルと同一のディレクトリに置くことを推奨します。 646 | 647 | 648 | 649 | \subsection{\texttt{bib}ファイルの書き方} 650 | 651 | \texttt{.bib}ファイルの書き方は通常通りで構いません。 652 | 日本人著者の取り扱いは,\texttt{author = \{\{}\textgt{姓姓 名名}\texttt{\} and \{}\textgt{姓姓 名名}\texttt{\}\}}と,\texttt{\{\}}で挟んでもいいですし,\texttt{author = \{姓姓, 名名 and 姓姓, 名名\}}と,\texttt{\{\}}で挟まず半角カンマを挿入しても大丈夫です。 653 | \texttt{.bst}内部では\texttt{\{\}}は消去して処理しています。 654 | Mendeleyでは,前者はAuthorをInstitutoin/Organizationとして記載した場合,後者は通常のLastname, Firstnameとして記載した場合に相当します。 655 | 656 | タイトルの後,出版社の後,文献の最後など,適切な箇所に(in Japanese)と言語表記をする場合にはlanguageフィールドが必要です。 657 | MendeleyではPreferenceからDocument Detailsへと進めば常に表示させることが可能です。 658 | 659 | 660 | 661 | \subsection{\texttt{tex}ファイルの書き方} 662 | 663 | \texttt{jIEEEtran.bst}や\texttt{IEEJtran.bst}へのパスが通っている,もしくはコンパイルする\texttt{.tex}ファイルと同一ディレクトリにこれらの\texttt{.bst}ファイルが置かれていれば,\BibTeX スタイルファイルとして\texttt{jIEEEtran.bst}や\texttt{IEEJtran.bst}を指定するのは簡単です。 664 | 他の\texttt{bst}ファイルを指定するのと同様に,\texttt{tex}ファイル中で 665 | 666 | \noindent\makebox[\linewidth]{\rule{\linewidth}{0.4pt}}\vspace{-0.5zw} 667 | \begin{lstlisting}[style=onecol] 668 | \bibliographystyle{jIEEEtran} 669 | \end{lstlisting}\vspace{-1.8zw} 670 | \noindent\makebox[\linewidth]{\rule{\linewidth}{0.4pt}}\vspace{0.5zw}\par 671 | \noindent 672 | や 673 | 674 | \noindent\makebox[\linewidth]{\rule{\linewidth}{0.4pt}}\vspace{-0.5zw} 675 | \begin{lstlisting}[style=onecol] 676 | \bibliographystyle{IEEJtran} 677 | \end{lstlisting}\vspace{-1.8zw} 678 | \noindent\makebox[\linewidth]{\rule{\linewidth}{0.4pt}}\vspace{0.5zw}\par 679 | \noindent 680 | と書けば実行できます。 681 | 682 | 683 | 684 | \subsection{文字コードについて} 685 | 686 | UTF-8を使用しましょう。 687 | SHIFT-JISやEUC-JPは非対応です。 688 | 689 | 690 | \subsection{コンパイル手順} 691 | \label{sec:compile_procedure} 692 | 693 | 英語と日本語の併記を行わない場合,通常通りのコンパイル手順で\texttt{.pdf}を生成することができます。 694 | 例えば\texttt{uplatex}で\texttt{.dvi}を生成し,\texttt{.dvi}から\texttt{.pdf}を生成,\BibTeX コマンドには\texttt{upbibtex}を使う場合, 695 | \begin{center} 696 | \texttt{uplatex → upbibtex → uplatex → uplatex → dvipdfmx} 697 | \end{center} 698 | という手順です。 699 | 700 | 英語と日本語の併記を行う場合,通常のコンパイル手順での\texttt{upbibtex}前後に\texttt{python}による\texttt{mixej.py}の処理を一回ずつ挟みます。 701 | 前と同様に,\texttt{uplatex}で\texttt{.dvi}を生成し,\texttt{.dvi}から\texttt{.pdf}を生成,\BibTeX コマンドには\texttt{upbibtex}を使う場合, 702 | \begin{center} 703 | \texttt{uplatex → python mixej.py → upbibtex → python mixej.py\\→ uplatex → uplatex → dvipdfmx} 704 | \end{center} 705 | という手順に変更されます。 706 | 707 | 論文誌や学内資料の原稿のように\texttt{.tex}ファイル中に文献リストを1つしか出力しない場合,上の処理を1ステップずつ実行しても問題ありません。 708 | しかし,このマニュアルや学位論文,書籍などで文献リストを複数出力するために\texttt{bibunits}パッケージを使用して文献リストを複数出力する場合には,Latexmkの使用を推奨します。 709 | これは,\texttt{bu1.aux, bu1.bbl, bu5.aux, bu5.bbl}のように,\texttt{bibunits}パッケージが何個の\texttt{bu}ファイルを出力するかが不明で,1ステップずつの実行では\texttt{bu}ファイルの個数をユーザが把握する必要があり面倒だからです。 710 | Latexmkを使用していれば,各\texttt{bu}ファイルをそれぞれ必要な回数だけ処理してくれます。 711 | 712 | 713 | 714 | \subsection{コンパイラの設定の例} 715 | \label{sec:compile_config} 716 | 717 | % 英語と日本語の併記を実現するためには\texttt{pbibtex}の前後にpythonでの処理を挟む必要があります。 718 | % そのため,コンパイラではBibTeXコマンドの設定方法に注意が必要です。 719 | \ref{sec:compile_procedure}節においても触れましたが,本マニュアルのように英語と日本語の併記を実現するために\texttt{/ej/}のコマンドが含まれているものを適切に扱うためには,\texttt{python mixej.py}のコマンドを\BibTeX コマンドの前後に1回ずつ実行する必要があります。 720 | そのため,コンパイラでは\BibTeX コマンドの設定方法に注意が必要です。 721 | 722 | Latexmkを使用している場合,MacやLinuxなどのUNIX系列では\texttt{.latexmkrc}に対して次のように設定することで実現可能です。 723 | 724 | \noindent\makebox[\linewidth]{\rule{\linewidth}{0.4pt}}\vspace{-0.5zw} 725 | \begin{lstlisting}[style=onecol] 726 | #!/usr/bin/perl 727 | 728 | $latex = 'uplatex %O -synctex=1 -interaction=nonstopmode -kanji=utf8 -file-line-error %S'; 729 | $bibtex = 'python mixej.py %B; upbibtex %O %B; python mixej.py %B'; 730 | $dvipdf = 'dvipdfmx -V 7 %O -o %D %S'; 731 | $pdf_previewer = "open -ga /Applications/Skim.app"; 732 | \end{lstlisting}\vspace{-1.8zw} 733 | \noindent\makebox[\linewidth]{\rule{\linewidth}{0.4pt}}\vspace{0.5zw}\par 734 | 735 | \noindent 736 | Windowsでは,cmd, powershellともに\texttt{bibtex}の設定を次のようにすれば動きます。ただし,\texttt{\&}前後の半角スペースを忘れずに記入してください。 737 | 738 | \noindent\makebox[\linewidth]{\rule{\linewidth}{0.4pt}}\vspace{-0.5zw} 739 | \begin{lstlisting}[style=onecol] 740 | $bibtex = '@cd & python mixej.py %B & upbibtex %B & python mixej.py %B'; 741 | \end{lstlisting}\vspace{-1.8zw} 742 | \noindent\makebox[\linewidth]{\rule{\linewidth}{0.4pt}}\vspace{0.5zw}\par 743 | 744 | 745 | 最近ではVisual Studio Codeを使用している方が多いと思いますが,MacやLinuxでのVSCodeのLaTeX Workshop Extension用の設定は次のように書けます。Windowsの場合は\texttt{.latexmkrc}の場合と同様に\texttt{bibtex}コマンドを書き換えてください。 746 | 747 | \noindent\makebox[\linewidth]{\rule{\linewidth}{0.4pt}}\vspace{-0.5zw} 748 | \begin{lstlisting}[style=onecol] 749 | "latex-workshop.latex.tools": [ 750 | { 751 | "command": "latexmk", 752 | "name": "latexmk uplatex/upbibtex/mixej", 753 | "args": [ 754 | "-e", "$latex='uplatex %O -synctex=1 -interaction=nonstopmode -kanji=utf8 -file-line-error %S'", 755 | "-e", "$bibtex='python mixej.py %B; upbibtex %O %B; python mixej.py %B'", 756 | "-e", "$dvipdf='dvipdfmx -V 7 %O -o %D %S'", 757 | "-norc", "-pdfdvi", "%DOC%" 758 | ], 759 | } 760 | ], 761 | "latex-workshop.latex.recipes": [ 762 | { "name": "latexmk uplatex/upbibtex/mixej", "tools": [ "latexmk uplatex/upbibtex/mixej" ] } 763 | ], 764 | \end{lstlisting}\vspace{-1.8zw} 765 | \noindent\makebox[\linewidth]{\rule{\linewidth}{0.4pt}}\vspace{0.5zw}\par 766 | 767 | 768 | \subsection{カスタマイズの例:電気学会の省略形式} 769 | 770 | 電気学会の研究会や大会の原稿では,タイトルやVol.等の文字を表記せずに,「著者・他,電学論A,\textbf{10}(15),20--25(2020)」と省略して一行形式とすることがあります。 771 | IEEJtran.bstのオプションとして省略形での出力を可能としています。 772 | なお,現状では\texttt{article}タイプと\texttt{inproceedings}のエントリのみに対応しています。 773 | 省略形式への変更は\texttt{.bst}ファイルを変更することでも実現可能ですが,元としている\texttt{IEEEtran.bst}に習い,\texttt{IEEEtranBSTCTL}で操作できるようにしました。 774 | \texttt{IEEEtranBSTCTL}の使用方法は本マニュアルの範囲外としますが,\texttt{\textbackslash bstctlcite}を使用して\texttt{IEEEtranBSTCTL}エントリを一番はじめに引用してください。 775 | なお,本マニュアルでは\texttt{bibunit.sty}を使用しており,相性問題で\texttt{\textbackslash bstctlcite}が動きません。 776 | そのため,Warningが出てしまいますが\texttt{\textbackslash nocite\{BSTctlabbrev\}}として引用しています。 777 | なお,雑誌名を省略するには\texttt{.bib}ファイルに記載する情報を省略形としておく必要があります。 778 | \texttt{.bst}ファイルは\texttt{.bib}ファイルの\texttt{journal}フィールドの情報をそのまま出力するためです。 779 | 従って,文献管理ソフトで省略形を予め定義しておく必要があります。 780 | \texttt{.bib}ファイルと出力の例を下記に示します。 781 | 782 | \putlst{articleabbrev.bib} 783 | 784 | \begin{bibunit}[IEEJtran] 785 | \nocite{BSTctlabbrev} 786 | \nocite{jpArticle1,jpArticle2,jpArticle3,enArticle1,enArticle2,enArticle3,jpInproceedings1,jpInproceedings2,enInproceedings1,enInproceedings2} 787 | \renewcommand{\refname}{\small 参考文献(IEEJtran.bst)} 788 | {\small \putbib[./articleabbrev]} 789 | \end{bibunit} 790 | 791 | \end{document} 792 | --------------------------------------------------------------------------------