abenori / jlreq

Other
125 stars 18 forks source link

biblatexで章ごとの参考文献が出力できない #117

Closed xyslope closed 1 year ago

xyslope commented 1 year ago

biblatexでrefsegment=sectionとすると、sectionごとの参考文献が出力できるのですが、jlreqを使うと、これができないようです。 articleや、ltjsarticleでは章ごとに出力できますが、jlreqでタイプセットすると、すべての参考文献や出力されてしまいます。

auxファイルを見てみると、articleでは、次のように、segmでセグメントを認識しています。

\abx@aux@cite{0}{A01} \abx@aux@segm{0}{1}{A01} \abx@aux@cite{0}{B02} \abx@aux@segm{0}{1}{B02} \abx@aux@cite{0}{A01} \abx@aux@segm{0}{2}{A01} \abx@aux@cite{0}{C02} \abx@aux@segm{0}{2}{C02} \newlabel{refsegment:01}{{1}{1}} \@writefile{toc}{\contentsline {section}{\numberline {1}section 1}{1}{}\protected@file@percent } \newlabel{refsegment:02}{{2}{1}} \@writefile{toc}{\contentsline {section}{\numberline {2}section 2}{1}{}\protected@file@percent }

jlreqでは、認識していないようです。

\abx@aux@cite{0}{A01} \abx@aux@segm{0}{0}{A01} \abx@aux@cite{0}{B02} \abx@aux@segm{0}{0}{B02} \abx@aux@cite{0}{A01} \abx@aux@segm{0}{0}{A01} \abx@aux@cite{0}{C02} \abx@aux@segm{0}{0}{C02}

なお、sectionの中身をsegment環境で囲んだばあいは、うまく動作します。 (あいにく僕はorg-modeから出力してコンパイルしているので、sectionの中身を何らかの環境で自動的に囲む設定が分かりません)

サンプルソース `\documentclass[11pt]{ltjsarticle}

\usepackage[backend=biber, refsegment=section,defernumbers=true]{biblatex} \addbibresource{mybib.bib}

\begin{document} \section{section 1} This guy said blabla \cite{A01}. And this other guy said blabla \cite{B02}. \printbibliography[segment=\therefsegment] \section{section 2} This guy said blabla \cite{A01}. And this other guy said blabla \cite{C02}. \printbibliography[segment=\therefsegment] \end{document} `

文献ファイル mybib.bib @misc{A01, keywords = {foo,bar}, author = {Author, A.}, year = {2001}, title = {Alpha}, } @misc{B02, keywords = {foo}, author = {Buthor, B.}, year = {2002}, title = {Bread}, } @misc{C02, keywords = {bar}, author = {Chirstensen, J.}, year = {2002}, title = {Cake}, }

perchapsample.pdf

abenori commented 1 year ago

ざっとみた感じでは,biblatexパッケージが特定のクラスファイルの実装に依存しているというよくある状況に見えます.biblatex\sectionコマンド(が中で利用する\@sectマクロ)を改変しているようですが,jlreqはこれを使わないのでだめ,ということみたいです.

クラスファイル側でどうにかするのはかなり非自明に思えます.というわけでとりあえず仕様ということにさせてください.

xyslope commented 1 year ago

ありがとうございます。 状況よくわかりました。 「仕様」ということでかまわないと思います。

どうしても必要になったら、biblatex側に要望を出してみます。