4

I use Zotero to get references from the web, and then export them into LaTeX using biblatex format using this workflow. I am fine with the style of bibliography and its output as shown below , but I want now to switch to short journal names using the same style, as they are provided in the exported database from Zotero, I made sure that all references do have a short journal name in Zotero database, but it would be nice if the code will fall back to long names otherwise (not elegant, though, to have both in the bibliography list, but as a last resort and this can be fixed from within Zotero later on). I checked this post, but couldn't achieve my goal.

I would be very grateful also, if someone can suggest a better way than writing all this code to achieve the same style or a similar one. There are no specific regulations for the PhD bibliography in my university.

So my questions are:
1. How to show short journal names when available?
2. How to achieve the same output (see below), but with short journal names writing less code?
3. I couldn't find the explanation of the chem-acs style in biblatex manual, what does this style entail?

MWE Code

\documentclass{scrartcl} 
\usepackage[backend=biber,style=chem-acs,terseinits=true,sorting=none,isbn=false,doi=false,backref=true]{biblatex}  \renewcommand*{\bibfont}{\small} % smaller font for bibliography list
\ExecuteBibliographyOptions{%
  citetracker=true,
  sorting=none,
  alldates=long,
  articletitle=true,
  maxcitenames=1
}
% remove brackets around the number of each bibliography entry
\DeclareFieldFormat{labelnumberwidth}{#1\addperiod}
% Suppress article title, doi, url, etc. in citations
\AtEveryCitekey{%
  \ifentrytype{article}
    {\clearfield{title}}
    {}%
  \clearfield{doi}%
  \clearfield{url}%
  \clearlist{publisher}%
  \clearlist{location}%
  \clearfield{note}%
}

% Print year instead of date, when available; make use of urldate
\DeclareFieldFormat{urldate}{\bibstring{urlseen}\space#1}
\renewbibmacro*{date}{% Based on date bib macro from chem-acs.bbx
  \iffieldundef{year}
    {\ifentrytype{online}
       {\printtext[urldate]{\printurldate}}
       {\printtext[date]{\printdate}}}
    {\printfield[date]{year}}}

% Remove period from titles
\DeclareFieldFormat*{title}{#1}
\DeclareFieldFormat[book]{date}{\textbf{#1}} % 
\DeclareFieldFormat[report]{date}{\textbf{#1}} % 
\DeclareFieldFormat[software]{date}{\textbf{#1}} % 
\DeclareFieldFormat[inproceedings]{date}{\textbf{#1}} % 

% Embed doi and url in titles, when available
\renewbibmacro*{title}{% Based on title bib macro from biblatex.def
  \ifboolexpr{ test {\iffieldundef{title}}
               and test {\iffieldundef{subtitle}} }
    {}
    {\ifboolexpr{ test {\ifhyperref}
                  and not test {\iffieldundef{doi}} }
       {\href{http://dx.doi.org/\thefield{doi}}
          {\printtext[title]{%
             \printfield[titlecase]{title}%
             \setunit{\subtitlepunct}%
             \printfield[titlecase]{subtitle}}}}
       {\ifboolexpr{ test {\ifhyperref}
                     and not test {\iffieldundef{url}} }
         {\href{\thefield{url}}
            {\printtext[title]{%
               \printfield[titlecase]{title}%
               \setunit{\subtitlepunct}%
               \printfield[titlecase]{subtitle}}}}
         {\printtext[title]{%
            \printfield[titlecase]{title}%
            \setunit{\subtitlepunct}%
            \printfield[titlecase]{subtitle}}}}%
     \newunit}%
  \printfield{titleaddon}%
  \clearfield{doi}%
  \clearfield{url}%
  \clearlist{language}%
  \clearfield{note}%
  \ifentrytype{article}% Delimit article and journal titles with a period
    {\adddot}
    {}}
\renewbibmacro*{name:andothers}{% Based on name:andothers from biblatex.def
  \ifboolexpr{
    test {\ifnumequal{\value{listcount}}{\value{liststop}}}
    and
    test \ifmorenames
  }
    {\ifnumgreater{\value{liststop}}{1}
       {\finalandcomma}
       {}%
     \andothersdelim\bibstring[\emph]{andothers}}
    {}}



\usepackage{filecontents}
\begin{filecontents}{jobname.bib}
@article{rand_objective_1971,
    title = {Objective criteria for the evaluation of clustering methods},
    volume = {66},
    issn = {01621459},
    url = {http://www.jstor.org/discover/10.2307/2284239?uid=3737864&uid=2&uid=4&sid=21103234673533},
    doi = {10.2307/2284239},
    pages = {846},
    number = {336},
    journaltitle = {Journal of the American Statistical Association},
    shortjournal = {J Amer Statist Assoc},
    author = {Rand, William M.},
    urldate = {2013-12-18},
    date = {1971-12},
    keywords = {Comparing partitions, Rand, statistics}
}

@article{hubert_comparing_1985,
    title = {Comparing partitions},
    volume = {2},
    issn = {0176-4268, 1432-1343},
    url = {http://link.springer.com/article/10.1007/BF01908075},
    doi = {10.1007/BF01908075},
    pages = {193-218},
    number = {1},
    journaltitle = {Journal of Classification},
    shortjournal = {J Classif},
    author = {Hubert, Lawrence and Arabie, Phipps},
    urldate = {2013-12-18},
    date = {1985-12-01},
    langid = {english},
    keywords = {{ARI}, Comparing partitions, Consensus indices, Measures of agreement, Measures of association, statistics, Statistics, general}
}   
\end{filecontents}
\addbibresource{jobname.bib}
\usepackage{xcolor}
\usepackage{hyperref} 
\hypersetup{ % 
    colorlinks, linkcolor={magenta},
    citecolor={black}, urlcolor={blue}
}

\begin{document}
This is the main text citing~\parencite{hubert_comparing_1985} and~\parencite{rand_objective_1971}
\printbibliography[title={References}] 
\end{document}

MWE Output
enter image description here

  • The chem-acs style is not in the biblatex manual as it's not a 'generic' style: you'll find the documentation in the biblatex-chem bundle (texdoc -l biblatex-chem at the Command Line/Terminal). The style follows the requirements of the American Chemical Society: it's entirely focussed on reproducing the requirements of that journal. – Joseph Wright May 13 '14 at 11:44
5

You can transfer data from one field to another using the Biber source map feature:

\DeclareSourcemap{
  \maps[datatype=bibtex]{
    \map[overwrite]{ % Notice the overwrite: replace one field with another
      \step[fieldsource=shortjournal,fieldtarget=journaltitle]
    }
  }  
}

See for example \DeclareSourcemap in biblatex for more on this feature. Mappings only apply if the source is available, so this is 'safe' for cases where there is no short title.

  • is it possible that this solution isn't working any more with biblatex v3.4? (It worked some time ago which I think was v3.3. If I am wrong I'll happily delete my comment.) – Stefan Pinnow Mar 31 '16 at 12:11

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.