I want to cite RFCs in the format [RFCxxxx] instead of using the author's initials and the year it was published. Currently I am using the alphabetic
style that comes with biblatex
. So far, I tried using the \DeclareCiteCommand
command to use the key
field in the .bib
file, but that does not seem to work. I would really appreciate any ideas as how to solve this problem.
[Tex/LaTex] Citing RFCs with biblatex
biblatexciting
Related Solutions
Second solution
Edited again, so most multicite commands work.
Edited so \footcite
now works.
A reasonably effective solution that preserves many of biblatex
's featuers is provided by adjusting the way the year gets printed in citations. This can be done by redifining the commands associated to cite:year
and cite:extrayear
. This has the advantage of preserving the ibidem feature.
The code below includes a sample bibliography and then the main file with the redefined citation code.
\begin{filecontents}{test.bib}
@Article{Test,
author = {Author, A. N.},
title = {Article title},
year = 2005,
pages = {10-20},
journal = {Jour.},
vol = {100}
}
@Article{Test2,
author = {Author, A. N.},
title = {Second article},
year = 2005,
pages = {10-20},
journal = {Jour.},
vol = {100}
}
@Article{Test3,
author = {Author, A. B.},
title = {Third article},
year = 2005,
pages = {10-20},
journal = {Jour.},
vol = {100}
}
@Article{Test4,
author = {Author, A. N.},
title = {Fourth article},
year = 2007,
pages = {10-20},
journal = {Jour.},
vol = {100}
}
\end{filecontents}
\documentclass{article}
\usepackage[style=authoryear-icomp,autocite=plain]{biblatex}
\addbibresource{test.bib}
\renewbibmacro*{cite:labelyear+extrayear}{%
\iffieldundef{labelyear}
{}
{\iftoggle{blx@footnote}
{\printtext[bibhyperref]{%
\printfield{labelyear}%
\printfield{extrayear}}}
{\footnote{\printtext[bibhyperref]{%
\printfield{labelyear}%
\printfield{extrayear}}}}}}
\renewbibmacro*{cite:extrayear}{%
\iffieldundef{extrayear}
{}
{\iftoggle{blx@footnote}
{\printtext[bibhyperref]{\printfield{extrayear}}}%
{\footnote{\printtext[bibhyperref]{%
\printfield{labelyear}%
\printfield{extrayear}}}}}}
\renewcommand{\compcitedelim}{\space}
\begin{document}
\thispagestyle{empty}
\autocite{Test} and
\autocite[page 3]{Test}.
Some text \parencite{Test2}.
Here is a footnote citation\footcite{Test}.
\autocite{Test,Test4,Test3}.
\printbibliography
\end{document}
As the above shows this works with \autocite
, \parencite
and accepts their optional arguments. In this style \autocite
is the same as \cite
.
I haven't demonstrated \textcite
, though its ouptut may be useful sometimes; \footcite
has also been set up to work, thanks to biblatex
's blx@footnote
toggle that detects whether we are in a footnote or not.
The code also takes care of most multiple citations \cite{ref1,ref2}
. However, there is a spurious comma, if ref1
and ref2
are two publications from the same author in the same year. Fixing that requires, more substanitial rewriting of the citation style file: each of the commands \cite
, \textcite
, etc. in author-icomp.cbx
contains an explicit comma via \setunit{\addcomma}
, that needs to be deleted.
Original solution
Here is a repost of the original solution, as this apparently helps the OP best. It simply defines a newcommand \citepfy
(plain-foot-year) that calls \citeauthor
followed by a modified \footcite
command that produces only the year. It does not accept any of the optional arguments cite commands in biblatex
usually do.
\begin{filecontents}{b.bib}
@Article{Test,
author = {Author, A. N.},
title = {Article title},
year = 2005,
pages = {10-20},
journal = {Jour.},
vol = {100}
}
\end{filecontents}
\documentclass{article}
\usepackage[style=authoryear-icomp]{biblatex}
\addbibresource{b.bib}
\newcommand{\citepfy}[1]{\citeauthor{#1}\footyearcite{#1}}
\DeclareCiteCommand{\footyearcite}[\mkbibfootnote]
{\usebibmacro{cite:init}%
\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{citeyear}}
{}
{\usebibmacro{cite:postnote}}
\begin{document}
\citepfy{Test}
\printbibliography
\end{document}
I think you would benefit from using a standard style and modify that to your needs. As it stands now, your custom.bbx
does not support any entry type other than @article
and does not really benefit from all the things biblatex
can do.
Since you seems to use authoryear
, I will explain how to modify that style to get what you want, you will need to use biber (that is backend=biber
, not backend=bibtex
) to fully appreciate this solution.
First we make sure the unit separator is indeed a comma
\renewcommand*{\newunitpunct}{\addcomma\space}
To deal with name formatting, we need the package loading options firstinits=true
and terseinits=true
, the latter gets rid of spaces and punctuations for initials.
We also need
\DeclareNameAlias{sortname}{last-first}
\renewcommand*{\finalnamedelim}{\addspace\&\space}
To always have a "last first" name order and the ampersand before the last name.
To get the bare year without any parentheses, we add
\renewbibmacro*{date+extrayear}{%
\iffieldundef{\thefield{datelabelsource}year}
{}
{\iffieldsequal{year}{\thefield{datelabelsource}year}
{\printdateextralabel}%
{\printfield{labelyear}%
\printfield{extrayear}}}}%
Finally,
\newbibmacro*{in:}{%
\ifentrytype{article}
{}
{\printtext{%
\bibstring{in}\intitlepunct}}}
\DeclareFieldFormat[article,periodical]{volume}{\bibstring{volume}~#1}% volume of a journal
\DeclareFieldFormat[article,periodical]{number}{\bibstring{number}~#1}% number of a journal
\renewbibmacro*{volume+number+eid}{%
\printfield{volume}%
\setunit{\addcomma\space}%
\printfield{number}%
\setunit{\addcomma\space}%
\printfield{eid}}
Takes care of the "in" for articles (I suppose you don't like that) and the volume and number field formats.
I recommend also loading csquotes
and babel
with british
as language option, to get the right quotation marks.
MWE
\documentclass[british,a4paper]{article}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[style=authoryear, natbib=true, minnames=1, maxnames=2, maxbibnames=11, firstinits=true, terseinits=true, backend=biber]{biblatex}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@article{allwin_drilling_2009,
title = {Drilling of fibers},
volume = {18},
number = {2},
journal = {Journal of Materials},
author = {Allwin, A. K. and Maria, P. K. and Ruby, J. L.},
year = {2007},
pages = {1--7},
}
@article{suraj_solid_2007,
title = {Solid-tool machining},
volume = {10},
shorttitle = {Solid-tool machining handbook},
number = {1},
journal = {International Composite Committee},
author = {Suraj, J. K. and Chandran, M. P.},
year = {2007},
pages = {66--72},
}
@article{jayakumar_mech_2011,
title={Mechanical behaviors of polyester composite},
author={Jayakumar, S. G.},
journal={Polymers and Fibers},
volume={15},
number={11},
pages={155--164},
year={2011},
}
@article{waldron2003generalized,
title={Generalized Welch bound equality sequences are tight frames},
author={Waldron, Shayne},
journal={Information Theory, IEEE Transactions on},
volume={49},
number={9},
pages={2307--2309},
year={2003},
publisher={IEEE}
}
@article{conley1998nativity,
title={Nativity and wealth in mid-nineteenth-century cities},
author={Conley, Timothy G and Galenson, David W},
journal={Journal of Economic History},
volume={58},
pages={468--493},
year={1998},
publisher={Cambridge Univ Press}
}
@article{alishahi2009bounds,
title={Bounds on the sum capacity of synchronous binary CDMA channels},
author={Alishahi, Kasra and Marvasti, Farokh and Aref, Vahid and Pad, Pedram},
journal={Information Theory, IEEE Transactions on},
volume={55},
number={8},
pages={3577--3593},
year={2009},
publisher={IEEE}
}
\end{filecontents*}
\addbibresource{\jobname.bib}
\renewcommand*{\newunitpunct}{\addcomma\space}
\DeclareNameAlias{sortname}{last-first}
\renewcommand*{\finalnamedelim}{\addspace\&\space}
\renewbibmacro*{date+extrayear}{%
\iffieldundef{\thefield{datelabelsource}year}
{}
{\iffieldsequal{year}{\thefield{datelabelsource}year}
{\printdateextralabel}%
{\printfield{labelyear}%
\printfield{extrayear}}}}%
\newbibmacro*{in:}{%
\ifentrytype{article}
{}
{\printtext{%
\bibstring{in}\intitlepunct}}}
\DeclareFieldFormat[article,periodical]{volume}{\bibstring{volume}~#1}% volume of a journal
\DeclareFieldFormat[article,periodical]{number}{\bibstring{number}~#1}% number of a journal
\renewbibmacro*{volume+number+eid}{%
\printfield{volume}%
\setunit{\addcomma\space}%
\printfield{number}%
\setunit{\addcomma\space}%
\printfield{eid}}
\begin{document}
\nocite{*}
\printbibliography[title=REFERENCES]
\end{document}
gives
If you insist on no punctuation between names, also add
\renewcommand*{\multinamedelim}{\space}
Best Answer
According to the ietf recommendations, it's recommended to use @techreport
You can probably add
shorthand = {RFC1654}
as explain by lockstepAnother solution could be to use the natbib package
I tested this last solution with the following code:
But I got the result:
and it doesn't changed it in the list.