I'm writing a document where I want ISBN
s to be shown for books so I have turned on the isbn
option. This causes the ISSN
for journals to be shown when I reference an article. Is there a way to enable ISBN
s but dissable ISSN
s? They seem to be controlled by the same option in when referring to the biblatex
manual. I'm also using the biblatex-chem
styles as well if that helps.
1 Answer
You can clear the contents of the issn
field. This post gives you two options:
- Invoke
\clearfield{issn}
in\AtEveryBibitem
(and maybe\AtEveryCitekey
). - Set the
issn
field to null withbiber
's source mapping feature.
Here's an example for the first approach.
\documentclass{article}
\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage[backend=bibtex,style=chem-rsc,isbn=true]{biblatex}
\AtEveryBibitem{\clearfield{issn}}
\AtEveryCitekey{\clearfield{issn}}
\begin{filecontents}{\jobname.bib}
@Periodical{jcg,
title = {Computers and Graphics},
issuetitle = {Semantic {3D} Media and Content},
volume = {35},
number = {4},
year = {2011},
issn = {0097-8493}}
@Article{sarfraz,
author = {M. Sarfraz and M. F. A. Razzak},
title = {Technical section: {An} algorithm for automatic capturing of the font outlines},
journal = {Computers and Graphics},
volume = {26},
number = {5},
pages = {795--804},
year = {2002},
issn = {0097-8493}}
@Manual{cms,
label = {CMS},
title = {The Chicago Manual of Style},
subtitle = {The Essential Guide for Writers, Editors, and Publishers},
edition = {15},
publisher = {University of Chicago Press},
location = {Chicago, Ill.},
date = {2003},
isbn = {0-226-10403-6}}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\fullcite{jcg,sarfraz,cms}
\printbibliography
\end{document}
You could suppress the issn
field more selectively. For example
\AtEveryBibitem{\ifentrytype{article}{\clearfield{issn}}{}}
would print issn
for @periodical
entries in the bibliography.
In the second approach, source mapping can be done two ways:
\DeclareSourcemap
in the document preamble. This feature was introduced inbiblatex 2.0
/biber 1.0
.- The
sourcemap
option in thebiber.conf
file. The configuration file overrides any source mapping done in the preamble.
To demonstrate \DeclareSourcemap
we use the same document, but with the preamble:
\documentclass{article}
\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage[backend=biber,style=chem-rsc,isbn=true]{biblatex}
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map{
\pertype{article}
\step[fieldset=issn, null]
}
}
}
\begin{filecontents}{\jobname.bib}
...
This source mapping will suppress issn
only in @article
entries. To omit issn
in all entry types, remove \pertype{article}
.
The following biber
configuration file will carry out the same source mapping:
<?xml version="1.0" encoding="UTF-8"?>
<config>
<sourcemap>
<maps datatype="bibtex" map_overwrite="1">
<map>
<per_type>ARTICLE</per_type>
<map_step map_field_set="ISSN" map_null="1"/>
</map>
</maps>
</sourcemap>
</config>
Here we can remove <per_type>ARTICLE</per_type>
to suppress issn
in all entry types. Save this file as biber.conf
in the same folder as the document.
In either source mapping method, suppose the document is saved as test.tex
. At the command line you would invoke:
latex test
biber test
latex test
Further details on source mapping can be found in biber
's manual. For additional \DeclareSourcemap
examples, refer to the biblatex
manual.
-
Thanks Audrey. I've tried the \AtEveryBibitem{\ifentrytype{article}{\clearfield{issn}}{}} method so far and it works nicely. With regards the command line bit of the second suggestion would latexmk do that automatically?– DarlingJan 5, 2012 at 22:14
-
-
Yes, the
latexmk
tool will do this automaically, since it involves no special command line switches o biber. Then again, neither solution des.– PLKJul 18, 2012 at 14:48