• 검색 결과가 없습니다.

Controlling the bibliography

문서에서 The Not So Short Introduction to LATEX (페이지 147-152)

4.2 biblatex with biber

4.2.3 Controlling the bibliography

The default sorting order is Name (author/editor), Title, Y ear or nty in short. This order can be changed by passing sorting=〈order〉 as a package option. For example if you want to sort entries in chronological order simply pass the ynt option. Other options allow sorting by citation

\documentclass{article}

\usepackage{biblatex}

\addbibresource{example.bib}

\begin{document}

\ldots{} Recently I was learning to use Bib\LaTeX{}

from~\cite{lshort}. It seems very useful. \ldots

\ldots{} which was already shown by Mrs.~Curie in~\cite{curie}. \ldots

\ldots{} this can be easily explained by the fact that Einstein was a time

traveller~\cite{dream}. \ldots

\printbibliography

\end{document}

… Recently I was learning to use BibLATEX from [3]. It seems very useful. …

… which was already shown by Mrs. Curie in [1]. …

… this can be easily explained by the fact that Einstein was a time traveller [2]. …

References

[1] Marie Curie. “Les nouvelles substances radioactives”. In:

Revue scientifique. 4th ser. 14.3 (1900).

[2] Jane Diviner. Yesterday’s dream. The vision came to me while I was sleeping. It was very vivid. July 19, 3012.

[3] Tobias Oetiker et al. The Not So Short Introduction to LATEX2ε. Mar. 9, 2021. url: https://www.ctan.org/

pkg/lshort-english.

Listing 4.2: An example of using biblatex to manage references in an1 article

4.2 biblatex with biber 131

order (none) and by the number of citations (count).

% In preamble

\usepackage[

sorting=ynt ]{biblatex}

% ...

[1] Marie Curie. “Les nouvelles sub-stances radioactives”. In: Revue scientifique. 4th ser. 14.3 (1900).

[2] Tobias Oetiker et al. The Not So Short Introduction to LATEX2ε.

Mar. 9, 2021. url: https://www.

ctan.org/pkg/lshort-english.

[3] Jane Diviner. Yesterday’s dream.

The vision came to me while I was sleeping. It was very vivid.

July 19, 3012.

While the default citation style is numeric, this can be easily changed1 by setting the preferred style via the 〈style〉 option. Choose from alphabetic, authoryear, authortitle or verbose. Some styles come in several variations.

% In preamble

\usepackage[

style=alphabetic ]{biblatex}

% ...

The validity of~\cite{dream}

as a scientific source was recently called into question though it correctly claims that polonium was first described in~\cite{curie}.

The validity of [Div12] as a scientific source was recently called into question though it correctly claims that polo-nium was first described in [Cur00].

References

[Cur00] Marie Curie. “Les nouvelles substances radioactives”. In:

Revue scientifique. 4th ser.

14.3 (1900).

[Div12] Jane Diviner. Yesterday’s dream. The vision came to me while I was sleeping. It was very vivid. July 19, 3012.

In contrast to the thebibliography environment, the biblatex’s1

\printbibliographycommand only prints entries that were referenced in the document. If you want to print entries not mentioned in the document, you may use the\nocite{〈marker〉}command. It will insert invisible citations, thus instructing biblatex to put them in the bibliog-raphy. The special value * can be passed as a 〈marker〉 if you want to

print all entries in the database.

I've only

cited~\cite{lshort}.

\nocite{*}

\printbibliography

I’ve only cited [3].

References

[1] Marie Curie. “Les nouvelles sub-stances radioactives”. In: Revue sci-entifique. 4th ser. 14.3 (1900).

[2] Jane Diviner. Yesterday’s dream. The vision came to me while I was sleep-ing. It was very vivid. July 19, 3012.

[3] Tobias Oetiker et al. The Not So Short Introduction to LATEX2ε.

Mar. 9, 2021. url: https : / / www . ctan.org/pkg/lshort-english.

If your bibliography gets really large it may make sense to split1 it into several parts. This can be done by passing filter options to the \printbibliography command. Available filters include type, category, keyword. It may be useful to also change the titles of different categories using title option.

\printbibliography[

type=book,

title=Books I've referenced ]

\printbibliography[

keyword=unreliable, title=Don't trust those ]

Books I’ve referenced

[3] Tobias Oetiker et al. The Not So Short Introduction to LATEX2ε.

Mar. 9, 2021. url: https://www.

ctan.org/pkg/lshort-english.

Don’t trust those

[2] Jane Diviner. Yesterday’s dream.

The vision came to me while I was sleeping. It was very vivid.

July 19, 3012.

By default, the bibliography does not appear in the table of con-1 tents. This is because it is using starred version of\chapter/\section (depending on the class) to generate its heading. In order to change the default we may pass the option heading to \printbibliography.

Available options include

4.2 biblatex with biber 133

bibliography the default, starred version of heading

bibintoc starred version of heading, will appear in table of contents subbibliography will drop the bibliography one level in hierarchy

(\section* instead of\chapter* and so on)

bibnumbered will use non starred version for heading, thus numbering it and appearing in table of contents

subbibintoc will drop the bibliography one level and put it in table of contents

subbibnumbered will drop the bibliography one level and use non starred version of heading

none will not print the heading

\tableofcontents

\section{Important section}

% ...

\section{Other}

\printbibliography[

heading=subbibnumbered, title=Bibliography, ]

% ...

Contents

1 Important section 1

2 Other 1

2.1 Bibliography . . . . 1

1 Important section 2 Other

2.1 Bibliography

[1] Marie Curie. “Les nouvelles sub-stances radioactives”. In: Revue sci-entifique. 4th ser. 14.3 (1900).

1

As you may have noticed, when entries have many authors, then not all of them will be printed; instead “et al.” shows up at the end of the author list. This behaviour may be controlled via maxnames (default 3) and minnames (default 1) options. If the number of names is greater than 〈maxnames〉 then it will be shortened to 〈minnames〉 and “et al.”

will be added.

\usepackage[

maxnames=4, ]{biblatex}

[1] Tobias Oetiker, Hubert Partl, Irene Hyna, and Elisabeth Schlegl. The Not So Short Introduction to LATEX2ε.

Mar. 9, 2021. url: https : / / www . ctan.org/pkg/lshort-english.

1

\usepackage[

minnames=2, ]{biblatex}

[1] Tobias Oetiker, Hubert Partl, et al.

The Not So Short Introduction to LATEX2ε. Mar. 9, 2021. url: https:

/ / www . ctan . org / pkg / lshort -english.

문서에서 The Not So Short Introduction to LATEX (페이지 147-152)