Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm working on a document with an 8 page limit and by no means it's gonna fit a whole list of citations, and I'm looking for a way to have really short citations inline (i.e. no reference list afterwards). Something like

... this has been studied in (Smith et. al., Phys. Rev. Lett. 100, 123456 (2012)) ...

I'm quite flexible about the particular style, although something based of revtex4 would be nice. Most of my references are journal articles, and the few books I have, I can put by hand if that simplifies things.

I'm trying with package bibentry, but still not manage to find a style that fits my needs. Any ideas? For instance, I need "et al" whenever there is more than one author, no first name initials, no publication title. I need journal abbreviations (although I think this is a separate issue).

Any help will be very appreciated...

Thx

share|improve this question
    
Two comments: biblatex is probably the way to go; and you probably should give a better example of the spec you need in case the person who wants to answer doesn't know the basics of whatever (physics?) style you're loosely basing your document on. (Will, e.g., all references be to journal articles? That would make it much easier to implement....) –  jon Aug 1 '12 at 20:28
add comment

1 Answer

Here's a biblatex solution. It doesn't need Biber (though of course it will work with it). It's not intended as a polished solution such as one might put together for a full style: it assumes your requirements apply: just books and articles; no bibliography. It allows you to use \cite and \parencite.

I wasn't sure how to deal with post notes. In the end I've slotted them into the middle of the citations, before the year.

I wasn't sure how to deal with repeated citations; as it is, I've just left them as is, but not repeated the year -- on the basis that you are trying to save space! It's probably simple enough, though, that you can pretty much understand what it's doing and fiddle with the details yourself.

(Don't treat this as an endorsement of this sort of citation system! But needs must, and it's quite a nice demonstration of the flexibility of Biblatex.)

\documentclass{article}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@ARTICLE{smith,
  author = {Smith and others},
  journaltitle = {Phys. Rev. Lett.},
  volume = {100},
  pages  = {123--456},
  date   = {2012},
}
@BOOK{jones,
  author = {Jones, Arthur},
  title  = {Something about physics},
  date   = {2011},
  publisher = {Dont Print Me},
}
\end{filecontents}
\usepackage[style=authoryear, backend=bibtex, citetracker=true]{biblatex}

% For compression, we just give the *first* page of an article
\DeclareFieldFormat{pages}{%
  \mkfirstpage*{#1}}

\renewbibmacro{postnote}{%
  \ifboolexpr{ test {\iffieldundef{postnote}}
               or test {\iftoggle{postnoteprinted}}}
  {}
  {\setunit{\addcomma\space at\space}%
  \ifboolexpr{ test {\iffieldundef{pagination}}
               or test {\iffieldequalstr{pagination}{page}}}
    {\printfield[default]{postnote}}
    {\printfield{postnote}}
 \global\toggletrue{postnoteprinted}}}


\newtoggle{postnoteprinted}


\renewbibmacro*{cite}{%
  \global\togglefalse{postnoteprinted}%
  \iffieldundef{shorthand}
    {\ifboolexpr{ test {\ifentrytype{article}}
                  or test {\ifentrytype{book}} }
     {\DeclareFieldAlias{journaltitle}{default}%
      \usedriver{}{\thefield{entrytype}:abbrv}}
     {{\ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}}
        {\usebibmacro{cite:label}%
         \setunit{\addspace}}
        {\printnames{labelname}%
         \setunit{\nameyeardelim}}%
      \usebibmacro{cite:labelyear+extrayear}}}}
    {\usebibmacro{cite:shorthand}}}

\DeclareBibliographyDriver{article:abbrv}{%
  \usebibmacro{begentry}%
  \printnames{labelname}
  \setunit{\addcomma\space}%
  \usebibmacro{journal+issuetitle}%
  \setunit{\addcomma\space}%
  \usebibmacro{note+pages}%
  \usebibmacro{postnote}%
  \setunit{\addspace}%
  \usebibmacro{bracketedyear}%
  \usebibmacro{finentry}}

\DeclareBibliographyDriver{book:abbrv}{%
  \usebibmacro{begentry}%
  \printnames{labelname}%
  \setunit{\addcomma\space}%
  \usebibmacro{maintitle+title}%
  \usebibmacro{postnote}%
  \setunit{\addspace}%
  \usebibmacro{bracketedyear}%
  \usebibmacro{finentry}}

% Always uses parentheses, because that was what the
% example showed. \mkbibparens would be better IMO.
\newbibmacro{bracketedyear}{%
 \ifciteseen
    {}
    {\iffieldundef{year}
    {}
    {\printtext{(\printfield{year})}}}}

\addbibresource{\jobname.bib}
\begin{document}

Parenthetical citation: \parencite{smith}. Repeated \parencite[125]{smith}

Citation to a book: \cite[456]{jones}.

\end{document}

enter image description here

share|improve this answer
    
wow!! this is amazing! Thank you soooo very much for your help! I will implement this solution ASAP and let you know the outcome, but I thank you in advance for your time and dedication. –  Alex Monras Aug 2 '12 at 12:45
    
Ok, here's the outcome. Either the compiler asks me to rerun bibtex, and I get the tagname in boldface instead of the actual citation, or doesn't compile at all –  Alex Monras Aug 2 '12 at 13:10
    
Make sure you have changed addbibresource to point to you bib file. Just before begin document. –  Paul Stanley Aug 2 '12 at 13:15
    
I'm trying to compile the example verbatim. I also tried changing the addbibresource to point to my database, to no avail... I've also tried to remove the backslash from \begin{filecontents}{\ and from addbibresource. (I'm on OSX, in case that matters)... No success. Amazingly, when it does complain I can ignore the errors, just hit enter 2 times and... voila! I get the desired output. –  Alex Monras Aug 2 '12 at 18:39
    
In fact, not the exact desired output is produced, but an asterisk suspiciously appears in front of the volume number, precisely at the two citations that gave error (the first and second, so the error should be within the article:abbrv driver –  Alex Monras Aug 2 '12 at 19:06
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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