0

I am trying to obtain a non-standard citation style that includes only the last name of the first author, and the year it was published. As an example at the moment I have this:

myref.bib

@article{Stupid1999,

author = {Styleiz Stupid and Don Knowhy},
title = {Using totally random citation styles to write a thesis},
year = {1999},
volume = {11},
pages = {232-254},
journal = {Journal of Stupid Citation Styles}

}

On the tex file I cite with

A stupid random citation style was also used by \cite{Stupid1999}

The output is then:

A stupid random citation style was also used by [Stupid and Knowhy, 1999]

And what I want it to be:

A stupid random citation style was also used by [Stupid,1999]

Similar outputs to this without comma would also be appreciated, I just need that it does not include any second author or et al. in the in-line citation.

Additionally, on the references part I also need the output to be like

    [Stupid,1999] Stupid, S., Knowhy, D., Using totally random citation 
                  styles to write a thesis. Journal of Stupid Citation 
                  Styles, 1999, vol. 11, p. 232-254

The important part about this output is that it needs to be in this indentation style. The order of the citation can also be (authors, year, title, rest). At the moment I'm using \bibliographystyle{apalike} cause it was the only similar option, however this will not be suitable to conclude my work.

Looking forward in advance to your suggestions.

Kind regards

Example code with package list:

\documentclass[12pt,twoside]{book}

\usepackage{graphicx}
\usepackage{color}
\usepackage[latin1]{inputenc}
\usepackage[UKenglish]{babel}
\usepackage{utilmat}
\usepackage{margen}
\usepackage{pinlabel}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{rotating}
\usepackage{titlesec}
\usepackage{enumerate}
\usepackage{nccmath}
\usepackage{bigints}
\usepackage{caption}
\usepackage[a4paper]{geometry}
\usepackage{verbatim}  % Needed for the "comment" environment to make LaTeX comments
\usepackage{vector}  % Allows "\bvec{}" and "\buvec{}" for "blackboard" style bold vectors in maths
%\usepackage{epstopdf}
\usepackage[version=3]{mhchem}
\usepackage{enumerate}
\usepackage[official]{eurosym}
\usepackage{multirow}
\usepackage[font=small, labelfont=bf, justification=centering, format=hang]{caption}
\usepackage{hyperref}
\usepackage{array}
\usepackage{subfigure}
\usepackage{multicol}
\usepackage{rotating}
\usepackage{float}
%raggedrigh
\usepackage{mhchem}
\usepackage{fancyhdr}
\usepackage{booktabs}
\usepackage{breakcites}
%\usepackage[square]{natbib}
%\usepackage{apalike}
%\bibpunct{[}{]}{;}{a}{,}{-}
\usepackage{csquotes}
%
\usepackage[%
style=verbose
,backend=bibtex      % biber or bibtex
,backref=true
,style=authoryear    % Alphabeticalsch
,style=numeric-comp  % numerical-compressed
,sorting=nyt        % no sorting
,sortcites=true      % some other example options ...
,block=none
,indexing=false 
,citereset=none
,isbn=true
,giveninits=true
,url=true
,doi=true            % prints doi
,natbib=true         % if you need natbib functions
]{biblatex} 


\addbibresource{myref.bib}

\begin{document}
    A stupid random citation style was also used by \cite{Stupid1999}

\printbibliography
\end{document}

Errors:

biblatex.sty error line 3350 Command \Rn already defined \endgroup} and multiple warnings
  • Welcome to TeX SX! Do you use biblatex? – Bernard Dec 11 '18 at 12:52
  • @Bernard I'm using bibtex at the moment, I've tried implementing biblatex, however I was not even able to print the bibliography. – José Cardoso Dec 11 '18 at 12:55
  • 1
    If I comment out all the package I don't have and substitute the .bib files I also don't have, your code compiles reasonable fine. – user36296 Dec 11 '18 at 13:28
  • 1
    Off-topic: \usepackage{hyperref} should be one of the last packages you load. – user36296 Dec 11 '18 at 13:28
  • 1
    Also don't load the same packages multiple times – user36296 Dec 11 '18 at 13:29
1

Usually I'm not very fond of abusing an alphabetic style for what is essentially an author-year style with labels in the bibliography (especially since they are better ways as for example printbibliography output for "[author year] entrydata" linked by samcarter in the comments [even if I do say so myself]). But it is always a bit tricky to suppress the "et al." information for authoryear styles in a proper manner, so we might as well go with alphabetic where it is possible by redefining \labelalphaothers.

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage[style=alphabetic, minalphanames=1, maxalphanames=1, backend=biber]{biblatex}

\renewcommand*{\labelalphaothers}{}

\DeclareLabelalphaTemplate{
  \labelelement{
    \field[final]{shorthand}
    \field{label}
    \field{labelname}
  }
  \labelelement{
    \literal{,\string\space}
  }
  \labelelement{
    \field{year}
  }
}

\addbibresource{biblatex-examples.bib}

\begin{document}
\cite{sigfridsson,worman,geer,knuth:ct:a,knuth:ct:b}
\printbibliography
\end{document}

Screenshot of the resulting PDF. The citations show up as "Sigfridsson, 1998", "Worman, 2002" etc. The bibliography shows the item each preceded by its citation label.

See also Full name in label.

  • @samcarter I tried to apply both suggestions, however the bibliography is not printed due to a displayed error: The top-level auxiliary file: maint.aux I found no \citation commands---while reading file maint.aux I found no \bibdata command---while reading file maint.aux I found no \bibstyle command---while reading file maint.aux (There were 3 error messages) – José Cardoso Dec 11 '18 at 14:13
  • @JoséCardoso You must run Biber instead of BibTeX, see tex.stackexchange.com/q/154751/35864 (and tex.stackexchange.com/q/63852/35864 for background). – moewe Dec 11 '18 at 14:14
  • That's exactly it. I forgot to switch to biber. It's working now! Thank you so much!!!!!!!! I'm going to input this into my main files. – José Cardoso Dec 11 '18 at 14:16

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.