MENU

溶けかけてるうさぎ HP GALLERY BLOG TOP RECENT ARTICLES POPULAR ARTICLES ABOUT THIS BLOG

CATEGORY

大学 (140) 仕事 (17) 航空宇宙 (104) 写真 (77) 旅行 (32) 飯・酒 (17) コンピュータ (118) その他 (44)

TAG

ARCHIVE

RECENT

【カメラ】X100 シリーズが好きすぎる(主にリーフシャッタ) 【カメラ】X100V から X100VI に買い替えました 【自宅サーバー】Google Domains から Cloudflare にドメインを移管 【カメラ】FUJIFILM XF レンズのサイズ比較ができるようにしてみた 【写真】自作写真閲覧ページにてフィルムシミュレーションで写真をフィルタできるようにした

【LaTeX】BibTeX導入 まとめ

事象発生日:2017-05-15

記事公開日:-

アクセス数:7873

BibTeXを導入しようと思ったら,少しつまずいたので備忘録.

1.実行環境

Microsoft Windows 10 Home (64bit)

W32TeX

Sublime Text Build 3126 (portable version)

2.用意するファイル

以下のファイルを用意する.

\documentclass[10pt,a4paper,uplatex]{jsarticle}
\begin{document}
  \section{見出し}
  本文
  ~\cite{0264-9381-19-7-371}
  ~\cite{Bandyopadhyay2016}
  ~\cite{Foust2015}
  ~\cite{keyence}
  本文.
  \bibliographystyle{jplain}
  \bibliography{bibdata}
\end{document}
source.tex
@article{0264-9381-19-7-371,
  author={William J Weber and Antonella Cavalleri and Rita Dolesi and Giorgio Fontana and Mauro Hueller and Stefano Vitale},
  title={Position sensors for LISA drag-free control},
  journal={Classical and Quantum Gravity},
  volume={19},
  number={7},
  pages={1751},
  url={http://stacks.iop.org/0264-9381/19/i=7/a=371},
  year={2002},
  abstract={The extreme level of isolation from stray forces required for LISA makes the development of 'drag-free control' technologies essential to the mission. We report here on the progress in the development of a capacitive, six degree-of-freedom, position sensor designed to meet the required low levels of position read-out noise (1 nm Hz ?1/2 ) and stray force noise (3 × 10 ?15 N Hz ?1/2 ) across the LISA bandwidth of 0.1 mHz to 0.1 Hz. In this paper we briefly discuss sensor design and expected performance before presenting preliminary noise measurements made with a prototype sensor.}
}
@article{Bandyopadhyay2016,
  author = {Bandyopadhyay, Saptarshi and Foust, Rebecca and Subramanian, Giri P. and Chung, Soon-Jo and Hadaegh, Fred Y.},
  doi = {10.2514/1.A33291},
  file = {:C$\backslash$:/Users/${username}/Documents/Mendeley Desktop/Review of Formation Flying and Constellation Missions Using Nanosatellites.pdf:pdf},
  issn = {0022-4650},
  journal = {Journal of Spacecraft and Rockets},
  number = {3},
  pages = {1--12},
  title = {{Review of Formation Flying and Constellation Missions Using Nanosatellites}},
  volume = {53},
  year = {2016}
}
@article{Foust2015,
  author = {Foust, Rebecca and Chen, Derek and Chan, Stanley and Rogers, Dayne and Kokkat, Jobin and Bandyopadhyay, Saptarshi and Morgan, Daniel},
  doi = {10.2514/6.2015-2043},
  file = {:C$\backslash$:/Users/${username}/Documents/Mendeley Desktop/Information-Driven Systems Engineering Study of a Formation Flying Demonstration Mission using Six CubeSats.pdf:pdf},
  isbn = {9781624103438},
  number = {January},
  pages = {1--30},
  title = {{Information-Driven Systems Engineering Study of a Formation Flying Demonstration Mission using Six CubeSats}},
  year = {2015}
}
@Misc{keyence,
  author = {KEYENCE},
  title = {{「レーザ変位センサ」カタログ}},
}
bibdata.bib

3.ビルド

uplatex -interaction=nonstopmode -synctex=1 source.tex
jbibtex source
uplatex -interaction=nonstopmode -synctex=1 source.tex
uplatex -interaction=nonstopmode -synctex=1 source.tex
dvipdfmx source
コマンド

上のようにビルドすると,次のようなpdfが生成される.

ビルド結果

4.文字コードまわりの問題

そもそもうまくいかなかった場合

bibtexを使用すると,なんだかおかしな結果になった.

uplatex -interaction=nonstopmode -synctex=1 source.tex
bibtex source
uplatex -interaction=nonstopmode -synctex=1 source.tex
uplatex -interaction=nonstopmode -synctex=1 source.tex
dvipdfmx source
コマンド
ビルド結果

.bibがutf-8の場合

upbibtexとpbibtexで可能だった.「」のの2行目を,

upbibtex source
pbibtex -kanji=utf8 source

のいずれかに書き換えれば良い.

.bibがCP932 (Shift-JIS) の場合

jbibtexとpbibtexで可能だった.「」のの2行目を,

jbibtex source
pbibtex source

のいずれかに書き換えれば良い.

5.Sublime Textとの連携

」の「」の環境で快適にビルドできるようにする.

${sublime_text_root}\Packages\User に次のようなファイルを作成する.

{
    "cmd": ["upbibtex", "$file_base_name"],
    "selector": "text.tex.latex",
    "working_dir": "$file_path",

    "variants":
    [

        {
            "name": "BibTeX",
            "shell": true,
            "windows":
            {
                "cmd": ["start", "cmd", "/c", "echo === & echo $file_base_name & echo. & upbibtex $file_base_name & echo. & pause"],
            }
        }
    ]
}
MyTex.sublime-build

Ctrl + b で .texのビルド → .bibのビルド → .texのビルド とすれば,目的のpdfが生成される.

関連記事

コメントを投稿

名前

Email (※公開されることはありません)

コメント