I have a file in bibtex format with records like:
@BOOK{11980,
author = "French, A. P.",
title = "Vibrations and Waves",
publisher = " ",
year = 1971,
numpages = 327,
language = "english",
edition = " ",
}
I wan to use it with biblatex biber also, but biblatex understand pagetotal entry instead of numpages. How can I redefine numpages->pagetotal without changing .bib-file
My MuWE:
\documentclass[11pt, a4paper]{article}
\usepackage{fontspec}
\defaultfontfeatures{Mapping=tex-text}
\usepackage{xunicode}
\usepackage{xltxtra}
\usepackage{csquotes}
\usepackage{selinput}
\SelectInputEncodingList{utf8,cp1251}
\inputencoding{utf8}
\usepackage[russian]{babel}
\usepackage[mis]{xecyr}
\setmainfont{Times New Roman}
\newfontfamily\cyrillicfont{Times New Roman}
\DeclareRobustCommand{\No}{\ifmmode{\nfss@text{\textnumero}}\else\textnumero\fi}
\usepackage[%
backend=biber,
bibstyle=gost-numeric,
language=auto,
babel=other,
sorting=none,
doi=false,
eprint=true,
isbn=false,
dashed=false,
]{biblatex}
\addbibresource{e:/projects/LaTeX/MyPackage/MyBaseXe.bib}
\DeclareDefaultSourcemap[datatype=bibtex]{%
\map{
\step[fieldsource=numpages, fieldtarget=pagetotal]
}
}
\begin{document}
Some text \cite{LL1,LL2,SivP5, Siv1}.
\printbibliography
\end{document}
I get an error Undefined control sequence. \DeclareDefaultSourcemap
pages(§ 2.2.2 of the documentation, p. 21). – Bernard Jan 04 '15 at 15:57\step[fieldsource=numpages, fieldtarget=pagetotal]– Ulrike Fischer Jan 04 '15 at 18:12Undefined control sequence. \DeclareDefaultSourcemap. MEW is added above. – sergiokapone Jan 04 '15 at 18:39\DeclareDriverSourcemap. And I think the structure is normally\DeclareDriverSourcemap{\maps[datatype=bibtex]{\map{\step[fieldsource=numpages, typetarget=pagetotal]}}}. (Untested.) – jon Jan 04 '15 at 19:23biblatex, there is noDeclareDefaultSourcemap. I'd go with\DeclareSourcemap{\maps[datatype=bibtex]{\map{\step[fieldsource=numpages]\step[fieldset=pagetotal, origfieldval]}}}. See §4.5.2 Dynamic Modification of Data of thebiblatexdocumentation, especially the second example on pp. 151/152. – moewe Jan 04 '15 at 21:12\DeclareDriverSourcemap? (I have never used that command in any of my documents; but it seems the default data mapping uses it, so there seems to be a difference.) I thinktypetargetin your code above should readfieldtarget. – moewe Jan 04 '15 at 21:19\DeclareSourcemapone. And you're surely right about the second correction. That's (for me) the problem of suggesting things without testing them first! – jon Jan 05 '15 at 02:04\DeclareDriverSourcemapseems to have a slightly different syntax compared to\DeclareSourcemap, because it always applies only to one data format driver; but other than that the documentation only states it is conceptually different from mappings done via user sourcemapping. I was curious about that because I had never seen this command being used, but maybe it's just that. – moewe Jan 05 '15 at 07:46