![Проблема книги Тафта с \ref](https://rvso.com/image/328473/%D0%9F%D1%80%D0%BE%D0%B1%D0%BB%D0%B5%D0%BC%D0%B0%20%D0%BA%D0%BD%D0%B8%D0%B3%D0%B8%20%D0%A2%D0%B0%D1%84%D1%82%D0%B0%20%D1%81%20%5Cref.png)
В первый раз, когда я набираю это, я получаю ??
для \ref
. Во второй раз он пустой. Я использую TeXShop. Я намеревался сделать пример, который использует biblatex
для получения списка ссылок для каждой главы и еще одного списка в конце книги. Это делает списки ссылок правильными, но не знаки \ref
. Что не так?
\documentclass[nobib]{tufte-book}
\usepackage[
style=authoryear,
autocite=footnote,
backend=biber,
natbib=true
]{biblatex}
\addbibresource{references.bib}
\begin{document}
\begin{refsection}
\chapter{First chapter}\label{ch01}
\section{Foo}\label{ch01:sec01}
Some text \citep{Duffie:96}.
\section{Bee}
Refer to \ref{ch01:sec01} of chapter \ref{ch01}.
\printbibliography[heading=subbibliography]
\end{refsection}
\begin{refsection}
\chapter{Second chapter}
\section{Bar}
Some text\autocite{Eason1999}.
Remember section \ref{ch01:sec01} of chapter \ref{ch01} down here.
\printbibliography[heading=subbibliography]
\end{refsection}
\chapter{Later}
This,\autocite{hashemian} should be a side note but not this \citep{hashemian}.
\printbibliography
\end{document}
Вот references.bib:
%% This BibTeX bibliography file was created using BibDesk.
%% http://bibdesk.sourceforge.net/
%% Created for Sam Cox at 2016-02-17 17:46:29 -0500
%% Saved with string encoding Unicode (UTF-8)
@book{Duffie:96,
Address = {Princeton, NJ 08540},
Author = {Duffie, J. Darrell},
Date-Added = {2016-02-17 22:36:09 +0000},
Date-Modified = {2016-02-17 22:36:09 +0000},
Edition = {2nd},
Publisher = {Princeton University Press},
Title = {Dynamic Asset Pricing Theory},
Year = {1996}}
@article{Eason1999,
Author = {Eason, Stephen W. and Hirst, Brian L. and Vukelic, Milan},
Date-Added = {2016-02-17 22:35:52 +0000},
Date-Modified = {2016-02-17 22:35:52 +0000},
Journal = {Record of the Society of Actuaries},
Number = {3},
Pages = {1--20},
Title = {Security Blanket for Life (and Health)},
Volume = {25},
Year = {1999}}
@book{childs_temperature,
Address = {Great Britain},
Author = {Childs, Peter R N},
Edition = {1},
Isbn = {0 7506 5080 X},
Publisher = {Butterworth - Heinemann},
Title = {Practical Temperature Measurement},
Year = {2001}}
@phdthesis{hashemian,
Author = {Hashemian, Hashem Mehrdad},
School = {{The University of Western Ontario}},
Title = {Measurements of dynamic temperatures and pressures in nuclear power plants},
Type = {PhD {T}hesis},
Year = {2011}}
решение1
Заголовки глав и разделов не пронумерованы в tufte-book
классе документа. Поскольку \ref
хочет напечатать номер главы/раздела и не может его найти, он жалуется в файле журнала:
Package hyperref Warning: Suppressing empty link on input line 18.
Если вы включите нумерацию глав и разделов (добавив ее \setcounter{secnumdepth}{1}
в преамбулу документа), это должно решить проблему.
Однако следует отметить, что заголовки в tufte-book
по умолчанию не рассчитаны на красивую печать нумерации, поэтому вам, возможно, придется немного повозиться с форматированием.
В качестве альтернативы вы можете рассмотреть возможность использования \nameref
вместо , \ref
чтобы напечатать название главы/раздела вместо номера.