2

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

  • If you mean a specific page in the book, the relevant field is pages (§ 2.2.2 of the documentation, p. 21). – Bernard Jan 4 '15 at 15:57
  • You can use a sourcemap declaration to copy the field. – Ulrike Fischer Jan 4 '15 at 16:51
  • @Ulrike Fischer I find \DeclareDefaultSourcemap[datatype=bibtex]{ \map{\step[typesource=numpages, typetarget=pagetotal]} } but where can I put this code? – sergiokapone Jan 4 '15 at 18:06
  • Somewhere in the minimal example that you didn't provide. (and imho it should be \step[fieldsource=numpages, fieldtarget=pagetotal] – Ulrike Fischer Jan 4 '15 at 18:12
  • @ Ulrike Fischer I get an error Undefined control sequence. \DeclareDefaultSourcemap. MEW is added above. – sergiokapone Jan 4 '15 at 18:39
3

Based on your comments, I solved the problem.

\DeclareSourcemap{
  \maps[datatype=bibtex]{
    \map{
      \step[fieldsource=numpages,fieldtarget=pagetotal]
    }
  }
}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.