# Related field in biblatex : page

I would like to use the "related" field provided by the biblatex package.

But as I read the documentation, it implies to use only a entry key, and I would like a part of a book, not all the book.

So I would like to precise page (because I could use the book with different pages related to different entries).

What I expect to have as output will be :

Author 1, Title 1, (meta datas)... see Author 2, Title 2, (meta datas), p. xxx ; Author 3, Title 3 (meta datas) ... p. yyy etc.

(In fact, it will quite more complexe, but the idea is the same : link to precise page of other book) I was thinking to do something like this :

@book{key,
...}
@book{key2,
crossref={key},
pages={xxx}
}
@book{key3,
...}
@book{key4,
crossref={key2},
pages={yyyy}
}
@book{key5,
related={key2, key5}
...
}


But I would like to avoid "false" subentry. Do you have any idea ?

• What you probably need to do is look at the various "related:*" macros at the end of biblatex.def. You can define your own relatedtype field type, something like "pagesin" or whatever and then define a related macro to only print pages at the end. – PLK Nov 27 '13 at 21:16
• hum, I don't understand : where will I wrote the page number (assuming that it can have multiple related entry) – Maïeul Nov 27 '13 at 21:22
• Ok, I think we need a MWE with what you want the output to look like. – PLK Nov 27 '13 at 21:24
• I have changed my question. – Maïeul Nov 27 '13 at 21:33
• @Maieul This isn't a MWE. Some context would also help. Related entries may not be the way to go, particularly if these page references are not really fixed (e.g. determined by citations). – Audrey Nov 28 '13 at 15:28

Ok, I found a method, which I present it, in a simplified way (because it's a integreated in a more global project. For full details, see https://github.com/maieul/biblatex-manuscripts-philology/commit/cc76e0cd0a7d6952d407fa83229e1baeac89a27d.)

First, in the .bib file, create field "catalog", which will contain text formated as if it was arguments for cites commands:

@type{key,
catalog={[xx]{key1}[yy]{key2}}
}


In your .dbx file (see the handbook), say you want to have new field catalog:

\DeclareDatamodelFields[type=field,datatype=literal]{catalog}
\DeclareDatamodelEntryfields{catalog}


And in bbx file, say how you want to construct the final field

\DeclareStyleSourcemap{
\maps[datatype=bibtex]{
\map[overwrite]{
\step[fieldsource=catalog,final]
\step[fieldset=catalog,fieldvalue={\cites}]
\step[origfieldval,fieldset=catalog,append]
}
}
}


So the field will be automatically transformed to

\cites[xx]{key1}[yy]{key2}


So, finally, call the field in finentry macro:

\renewbibmacro{\usebibmacro{catalog}\finentry} % new finentry macro
\newbibmacro{catalog}{%
\ifbibliography{}% print the catalogs only in final bibliography
{\finentrypunct\setunit{}\par\unspace\printfield{catalog}}}%Check the punct, add a par break
{}%
}
\DeclareFieldFormat{catalog}{% Format of the field
\textbf{Cat.} % Should be more clean : with language string. See my full code
#1%
}


Advertisement : This is not a solution but a lead to a possible one. I have not enough place to explain it in a comment, so I create (improperly) an answer.

There is perhaps a solution using a biber feature. I discover this feature in a TeX.SE post (see the accepted answer) which lists advantages of biber. One of these features is :

Very flexible configuration file "sourcemap" option which can be used to change the .bib data as it is read by Biber, without changing the actual data source itself. You can use this to do all sorts of things like drop certain fields, add fields, conditionally drop/add fields, change fields using full Perl 5.14 regular expressions (see Biber manual section 3.1.1).

This last feature is particularly interesting for you as you can potentially map your pure BibTeX .bib files into the biblatex model on the fly as Biber reads them but without altering the files. It's also very useful for dropping fields like abstract which often cause trouble due to LaTeX reserved characters.

The author refereed to section 3.1.1 of biber manual but it is in fact the section 3.1.2 (entitled "The sourcemap option") which is relevant :

The datasource drivers implement a mapping from datasource entrytypes and fields into the Biblatex data model. If you want to override or augment the driver mappings you can use the sourcemap option which makes it possible to, for example, have a datasource with non-standard entrytypes or fields and to have these automatically mapped into other entrytypes/fields without modifying your datasource. Essentially, this alters the source data stream which Biber uses to build the internal Biblatex data model and is an automatic way of editing the datasource as it is read by Biber.

The 3.1.2 section contains examples and precise explanations.

To sum up, the idea is to use biber in order to change a reference (for your problem you would like to add pages mention) without actually changing the .bib file. This way you don't have to create false references to get your bibliography (with related references) right.

I have no idea how it works exactly (and not the time to try) but I believe it could be a solution to your problem.

• Hum, I don't see how I could use it: in any case it will add false entry in the .bbl file... – Maïeul Dec 6 '13 at 16:51
• Yes (I guess) but you don't have to create false entry anymore in the .bib file. You just have to specify "Biber, I want you to modify this reference in this case and add this pages field". The reference will be printed in the bibliography without pages and with pages when cited by related field. – ppr Dec 6 '13 at 16:55
• It will be problematic too because a) the problem is not to have false entry in the bib file, but in the bbl file (which implie to add filter ...) b) I can't see how I would do with a .dbx file, because my page number are depending of the book which refers to the other book. However, thanks for your help. – Maïeul Dec 6 '13 at 17:01
• I found a solution. See my answer – Maïeul Dec 23 '13 at 19:01

I checked all the options of the related field. It seems there is no way of adding informations such as pages after the related reference.

But, there is a workaround : you could set the relatedstring in such way this information will be provided. The biblatex-examples.bib file provided with the package shows such examples.

Here is a MWE:

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{filecontents}
\usepackage[style=verbose,hyperref]{biblatex}
\bibliography{biblio}
\begin{filecontents}{biblio.bib}
}
@Article{doody,
author       = {Doody, Terrence},
title        = {Hemingway's Style and Jake's Narration},
year         = 1974,
volume       = 4,
number       = 3,
pages        = {212-225},
hyphenation  = {american},
related      = {matuz:doody},
%  relatedstring= {\autocap{e}xcerpt in}, % this was the original example with no page mention.
relatedstring= {cited p.42 in :}, % but you could rephrase the field like this in this line.
journal      = {The Journal of Narrative Technique},
annotation   = {An \texttt{article} entry cited as an excerpt from a
\texttt{collection} entry. Note the format of the
\texttt{related} and \texttt{relatedstring} fields},
}

@Collection{matuz:doody,
editor       = {Matuz, Roger},
title        = {Contemporary Literary Criticism},
year         = 1990,
volume       = 61,
publisher    = {Gale},
location     = {Detroit},
pages        = {204-208},
hyphenation  = {american},
annotation   = {A \texttt{collection} entry providing the excerpt information
for the \texttt{doody} entry. Note the format of the
\texttt{pages} field},
}
\end{filecontents}
\begin{document}

\noindent\cite{matuz:doody}\\
\cite{doody}

\printbibliography
\end{document}


If you absolutely need a solution with the page after the related references, I am afraid you will have to get your hands dirty.

• yes, I could do, but it's not the style of my studies field. And it can't be use if I have more than one related entries. – Maïeul Nov 27 '13 at 21:43
• Yes I just noticed it is still the same problem (sorry for reposting a similar (but at least clearer) answer. I will not delete this attempt of answer because it could satisfy someone who has a similar question. Good luck (I am out of ideas). – ppr Nov 27 '13 at 21:47