1

I am using biber for my bibliography. I try to edit my in-text bibliography style to appear like this:

Blah blah[1] blah blah blah [1-3].

What I am try to change is like:

Blah blah (Koehler 1999) blah blah blah (Koehler 1999, Bailey et al.,Lam 2016).

This is simple of my latex file

\documentclass{article}
\usepackage{savesym}
\usepackage{graphicx}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{algorithm}
\usepackage[noend]{algpseudocode}
\usepackage[euler]{textgreek}
\usepackage{empheq}
\usepackage{amsmath}
\DeclareMathOperator{\rank}{rank}
\makeatletter
\newenvironment{sqcases}{%
\matrix@check\sqcases\env@sqcases
}{%
\endarray\right.%
}
\def\env@sqcases{%
\let\@ifnextchar\new@ifnextchar
\left\lbrack
\def\arraystretch{1.2}%
\array{@{}l@{\quad}l@{}}%
}
\makeatletter
\def\BState{\State\hskip-\ALG@thistlm}
\algnewcommand\algorithmicforeach{\textbf{for each}}
\algdef{S}[FOR]{ForEach}[1]{\algorithmicforeach\ #1\ \algorithmicdo}

\makeatother

\usepackage[utf8]{inputenc}
\usepackage[style=authoryear-comp, citetracker=true, maxcitenames=1, giveninits, terseinits, uniquename=init]{biblatex}
\AtEveryCitekey{\ifciteseen{}{\defcounter{maxnames}{2}}}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@article{koehler1999digital,
    title={Digital libraries and World Wide Web sites and page persistence},
    author={Koehler, Wallace},
    journal={Information research},
    volume={4},
    number={4},
    pages={4--4},
    year={1999}
}

@article{bailey2016exponent,
    title={Exponent of Cross-Sectional Dependence: Estimation and Inference},
    author={Bailey, Natalia and Kapetanios, George and Pesaran, M Hashem},
    journal={Journal of Applied Econometrics},
    volume={31},
    number={6},
    pages={929--960},
    year={2016},
    publisher={Wiley Online Library},
    doi = {10.1002/jae.2476}
}
@article{lam2016nonparametric,
    title={Nonparametric eigenvalue-regularized precision or covariance matrix estimator},
    author={Lam, Clifford},
    journal={The Annals of Statistics},
    volume={44},
    number={3},
    pages={928--953},
    year={2016},
    publisher={Institute of Mathematical Statistics},
    doi = {0.1214/15-AOS1393}
}
\end{filecontents}


\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}
\DeclareNameAlias{sortname}{family-given}
\renewcommand*{\revsdnamepunct}{}
\DeclareDelimAlias{finalnamedelim}{multinamedelim}
\DeclareDelimFormat[bib,biblist]{nametitledelim}{\addspace}
\DeclareFieldFormat*{title}{#1}
\DeclareFieldFormat*{journaltitle}{#1}
\DeclareFieldFormat*{booktitle}{#1}
\DeclareFieldFormat*{maintitle}{#1}

\renewbibmacro{in:}{%
\ifentrytype{article}{}{\printtext{\bibstring{in}\intitlepunct}}}
\renewbibmacro*{publisher+location+date}{%
\printlist{publisher}%
\setunit*{\addcomma\space}%
\printlist{location}%
\setunit*{\addcomma\space}%
\usebibmacro{date}%
\newunit}

\renewcommand*{\bibpagespunct}{\ifentrytype{article}{\addcolon {\addcomma\space}}
\DeclareFieldFormat[article,periodical]{pages}{#1}

\DeclareFieldFormat{doi}{\url{https://doi.org/#1}}

\DeclareSourcemap{
\maps[datatype=bibtex]{
    \map{
        \pertype{article}
        \step[fieldset=number, null]
    }
}
}

\renewcommand*{\finentrypunct}{}


\begin{document}

Blah blah \parencite{koehler1999digital} blah blah blah 
\parencite{koehler1999digital}, \parencite{bailey2016exponent} 
\parencite{lam2016nonparametric}.
\printbibliography
\end{document}

I try to change \parencite{koehler1999digital} to \parencite{koehler1999digital} but it does not work.

Any idea about what I am missing here ?

Mico
  • 506,678
medo0070
  • 135
  • 3
    style=numeric-comp instead of style=authoryear-comp? – moewe May 01 '18 at 12:52
  • @moewe it changes it but the bibliography list in the end on article is gone ! – medo0070 May 01 '18 at 12:59
  • 2
    Your renewcommand for \bibpagespunct is missing a } at the end. I can get what you are after using @moewe suggestion for style change, but also changing your cite line to: \parencite{koehler1999digital,bailey2016exponent,lam2016nonparametric} – Dunk the Lunk May 01 '18 at 13:01
  • 1
    The \bibpagespunct should be \renewcommand*{\bibpagespunct}{\ifentrytype{article}{\addcolon}{\addcomma\space}}. And you will indeed have to write \parencite{koehler1999digital,bailey2016exponent,lam2016nonparametric} for the citations to come out as "[1-3]". Delete your temporary files (.aux, .bbl, .bcf, ...) and recompile. If that does not work we would need to know if there are any errors or warnings in the .log or .blg file. – moewe May 01 '18 at 13:05
  • @moewe ok the bibliography is come back but the style of the bibliography is changed too. I just want to change in-text references to numeric with keeping my the bibliography style as it was without editing: Bailey N, Kapetanios G, Pesaran M H (2016) Exponent of cross-sectional dependence: estimation and inference. Journal of Applied Econometrics 31: 929-960. https://doi.org/10.1002/jae.2476 – medo0070 May 01 '18 at 13:33
  • On second thoughts, citestyle=numeric-comp, bibstyle=authoryear alone is not a great idea. You may want to have a look at https://tex.stackexchange.com/q/314014/35864 – moewe May 01 '18 at 13:37
  • Thanks for your advice but the journal asking me to do this. Thanks for your help its works fine now. – medo0070 May 01 '18 at 13:51
  • The numbers in-text is not in ascending order, its starts from 4 and 21 etc. Is there way to re-arrange them? – medo0070 May 01 '18 at 13:57
  • 1
    Does that mean the link https://tex.stackexchange.com/q/314014/35864 answers your question? If you want to sort the citations by order of appearance, add sorting=none to the biblatex options. (BTW: If you are submitting to a journal, check out if they accept biblatex submissions and read https://tex.stackexchange.com/q/12175/35864) – moewe May 01 '18 at 13:58
  • sorting=none solved the problem. I've checked my journal there is no problem with submission biblatex. Thank you so much :) – medo0070 May 01 '18 at 14:06
  • Good. I'd like to close this question as duplicate of https://tex.stackexchange.com/q/314014/35864, since that is what solved the issue at the heart of your question. Would that be OK with you? – moewe May 01 '18 at 14:12
  • No problem with that :) – medo0070 May 01 '18 at 14:13

0 Answers0