Tufte-book の引用を圧縮する際にエラーが発生しました

Tufte-book の引用を圧縮する際にエラーが発生しました

私は論文を書くためにタフテブッククラスを使用しています。参考文献の記載に少し問題があります。まず、引用は[1-4]ではなく のように見えるようにしたいです[1,2,3,4]。私は を使用しています。

\setcitestyle{square,numbers,sort&compress}

そしてまた

\bibliographystyle{unsrtnat}
\bibliography{sample-handout}

しかし、私はまだ format で引用を取得しています[1;2;3;4]。さらに、オプションが赤で表示されているため、再編成されていないようですsort&compress。参考文献を引用するときに を使用していることに注意してください\citep{}


次のようなエラーも表示されます

パッケージ inputenc エラー: Unicode 文字 (U+2009)(inputenc) が LaTeX で使用するように設定されていません。C.~Monroe、W.

私が

\usepackage[utf8]{inputenc} % Ensure UTF-8 encoding is used

そして

挿入された $ がありません。...ブロック \doi{10.1364/CLEO_QELS.2016.FTh4C.1}

引用文は次のようになります

@article{White:16,
author = {Andrew G. White},
booktitle = {Conference on Lasers and Electro-Optics},
journal = {Conference on Lasers and Electro-Optics},
keywords = {Biology; Chemistry; Detectors},
pages = {FTh4C.1},
publisher = {Optica Publishing Group},
title = {Photonic Quantum Simulation},
year = {2016},
url = {https://opg.optica.org/abstract.cfm?URI=CLEO_QELS-2016-FTh4C.1},
doi = {10.1364/CLEO_QELS.2016.FTh4C.1},
abstract = {We review photonic quantum simulation, its use in biology, chemistry, computer science and physics, and its prospects for scaling given the latest advances in quantum photonics, notably in sources, detectors, and nonlinear interactions.},
}

答え1

のソースからすぐに確認することはできませんでしたがtufte-book、cite コマンドの再定義により、sort&compress有効にならないのではないかと思われます。ただし、 がnatbibロードされるときにこのオプションを設定すると (この場合は\PassOptionsToPackageクラスをロードする前に を使用)、ソートと圧縮の動作が保持されます。

は、フィールド内のMissing $ insertedエスケープされていない文字によって発生します。フィールドにはこの文字もありますが、そのフィールドはそのまま解析されますが、は通常のテキストとして解析されるため、 は下付き文字として扱われ、数式モード (つまり、) が必要になります。したがって、これを修正するには、_doiurldoi_$

doi = {10.1364/CLEO\_QELS.2016.FTh4C.1},

完全なコード:

\begin{filecontents}[overwrite]{\jobname.bib}
@article{White:16,
author = {Andrew G. White},
booktitle = {Conference on Lasers and Electro-Optics},
journal = {Conference on Lasers and Electro-Optics},
keywords = {Biology; Chemistry; Detectors},
pages = {FTh4C.1},
publisher = {Optica Publishing Group},
title = {Photonic Quantum Simulation},
year = {2016},
url = {https://opg.optica.org/abstract.cfm?URI=CLEO_QELS-2016-FTh4C.1},
doi = {10.1364/CLEO\_QELS.2016.FTh4C.1},
abstract = {We review photonic quantum simulation, its use in biology, chemistry, computer science and physics, and its prospects for scaling given the latest advances in quantum photonics, notably in sources, detectors, and nonlinear interactions.},
}
@misc{White:17,
author = {John White},
title = {Number 17},
year = {2017}
}
@misc{White:18,
author = {Mary White},
title = {Number 18},
year = {2018}
}
\end{filecontents}
\PassOptionsToPackage{square,numbers,sort&compress}{natbib}
\documentclass{tufte-book}
%\setcitestyle{square,numbers,sort&compress}
\title{Sort \& Compress}
\author{with Tufte Book}
\begin{document}
\maketitle
\chapter{Some cite commands}
\citep{White:16,White:17,White:18}
\bibliographystyle{unsrtnat}
\bibliography{\jobname}
\end{document}

結果:

ここに画像の説明を入力してください

utf8 文字については、問題のある bib エントリのソースを指定していません。ただし、一般的にこのエラーはよく知られており、pdfLaTeX がネイティブに処理できる utf8 文字の数は限られている (基本的には拡張 ASCII、つまりラテン文字と発音区別符号) という事実を示しています。他の utf8 文字がある場合は、それらを個別に設定する必要があります\DeclareUnicodeCharacter(または、CJK 用など、設定を行うパッケージを使用します)。

ただし、この特定の文字 U+2009 の場合、これは不要です。これはおそらくエントリに誤って挿入された「細いスペース」です。たとえば、視覚的な検査や 16 進エディタを使用して文字を見つけるか、エントリを再入力してください (コピーして貼り付けるのではなく、最初から再入力してください)。

関連情報