BibTeX, biblatex and biberExtract Information from BibTeX Database File

Information and discussion about BiBTeX - the bibliography tool for LaTeX documents.
Post Reply
giladrv
Posts: 1
Joined: Sun Apr 08, 2012 3:00 pm

Extract Information from BibTeX Database File

Post by giladrv »

Hello,

I want to extract, say, the 'pages' field of an '@article' from a BibTeX file, without having to write it explicitly in the TeX file.
Let me illustrate what I mean with an example- Suppose refs.bib contains:

Code: Select all

@article{Rubin1970,
	author	= "Rubin, Vera C and Ford, W Kent Jr.",
	title		= "Rotation of the Andromeda Nebula from a Spectroscopic Survey of Emission Regions",
	journal	= "The Astrophysical Journal",
	volume	= "159",
	pages		= "379-403",
	year		= "1970",
	month		= "February"
}
and my .tex file looks something like
... as demonstrated in (\cite{Rubin1970}, pages [color=#FF0000]\getpages[/color]{Rubin1970})...
where the command \getpages represent the one I'm looking for, which should produce the output:
... as demonstrated in (1, pages 379-403)...
Is it possible to do something like that?
Thanks,
Gilad.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Extract Information from BibTeX Database File

Post by localghost »

With an appropriate bibliogrpahy style the pages should be displayed in the bibliography. Hence an addition to the \cite (← Link!) command should not be necessary.

The \cite command accepts an optional argument where you could add the pages.

Code: Select all

\cite[p. 379-403]{Rubin1970}
The final output certainly depends on the chosen citation style. Due to missing information it's hard to say something specific.


Best regards and welcome to the board
Thorsten
Post Reply