8
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

自分で書いたファイルをいくら見なおしてもBibTeXの文字化けが解決しないとき

Last updated at Posted at 2016-01-27

問題

卒論のBibTeXのコンパイルが出来なくて数時間はまった.

main.tex
...
なお,HPACKの仕様はRFC7541\cite{rfc7541}で定義されている.
...
\bibliographystyle{sieicej}
\bibliography{ref}
...
ref.bib
...
@misc{rfc7541,
 author               = {R. Peon},
 howpublished         = {RFC 7541},
 month                = 5,
 number               = 7540,
 organization         = {Internet Engineering Task Force},
 publisher            = {IETF},
 series               = {Request for Comments},
 title                = {{HPACK: Header Compression for HTTP/2}},
 url                  = {\\https://tools.ietf.org/html/rfc7541},
 year                 = 2015,
}
...

こんな感じで書くじゃないですか!自分で書いたファイル全部UTF-8ってことを何回も念入りに確認してるのに吐かれるbblファイルが文字化けするんですよ.

原因

スタイルファイルが原因だった.学会から配られているsieicej.bst.なんかGitHubにも上がってるんで適当にリンクしておきますw

原因はスタイルファイルに含まれる日本語コメント.まさかと思ったんですがこれがShift_JISだったんです.nkf -w でUTF-8に変換したら速攻で解決した.

%%% 更新情報
%%% 2009/12/24 v1.1
%%% ・bookとinbook,incollection,inproceedingsのaddressとpublisherの順番を変更
%%% ・bookでauthorとeditorを両方出現させるように変更
%%% ・bookのtitleを変換せずにそのまま出現させるように変更
%%%   今までは先頭の単語とコロンの後の単語のみ頭文字大文字としそれ以外は小文字としていた
%%% ・book,inbook,proceedingsのeditor表記でed.の前に,を入れるように変更

時間返して… というかみんないい加減UTF-8使おうぜ…

8
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?