1

I am using numeric-comp style. But the year for article has parentheses whereas year for 'incollection' and 'inproceedings' do not.

I am a beginner at LaTeX and would like to remove the parentheses from the article year.

Here is my current code,

\usepackage[backend=bibtex,
natbib=true,
%dashed=false,
sorting=none,
maxcitenames=3,
maxbibnames=10,
firstinits=true,
isbn=false,
doi=false,
url=false,
eprint=false,
defernumbers=true,
abbreviate=false,
style=numeric-comp]{biblatex} 

%-- formatting hell for biblatex
%-- remove "In:"
\renewbibmacro{in:}{}
% Add spaces
\setlength\bibitemsep{3.5\itemsep}
%-- no "quotes" around titles of chapters/article titles
\DeclareFieldFormat[article, inbook, incollection, inproceedings, misc, thesis, unpublished]
{title}{#1}
%-- no punctuation after volume
\DeclareFieldFormat[article]
{volume}{ {#1} } 
%-- puts number/issue between brackets
\DeclareFieldFormat[article, inbook, incollection, inproceedings, misc, thesis, unpublished]
{number}{\mkbibparens{#1}} 
%-- and then for articles directly the pages w/o any "pages" or "pp." 
\DeclareFieldFormat[article]
{pages}{#1}
%-- for some types replace "pages" by "p."
\DeclareFieldFormat[inproceedings, incollection, inbook]
{pages}{p. #1}
%-- format 16(4):224--225 for articles
\renewbibmacro*{volume+number+eid}{
    \printfield{volume}
    \printfield{number}
    \printunit{\addcolon}
}
%-- citations with square brackets (== \usepackage[square]{natbib})
\makeatletter
\newrobustcmd*{\parentexttrack}[1]{
    \begingroup
    \blx@blxinit%
    \blx@setsfcodes%
    \blx@bibopenparen#1\blx@bibcloseparen%
    \endgroup}
\AtEveryCite{
    \let\parentext=\parentexttrack%
    \let\bibopenparen=\bibopenbracket%
    \let\bibcloseparen=\bibclosebracket}
\makeatother
\addbibresource{references.bib}

and here is an example of how the types of reference are outputted

  • [8] H. Han, C. Park, J. Heo, and S. K. Kang. Muffler Sound Development Using Analysis of Acoustic Source of Engine Exhaust System. SAE 2014 World Congress & Exhibition. SAE International, 2014.

  • [9] M. Harrison. Interior noise: assessment and control. Vehicle Refinement. Edited by M. Harrison. Oxford: Butterworth-Heinemann, 2004, p. 145 –233.

  • [10] A. Singh, S. Bharadwaj, and S. Narayan. Analysis of Various NVH Sources of a Combustion Engine. Tehniˇcki glasnik 10 (1-2):(2016), 29–37.

  • [11] G. Kwon, H. Jo, and Y. J. Kang. Model of psychoacoustic sportiness for vehicle interior sound: Excluding loudness. Applied Acoustics 136:(2018), 16 –25.

  • If I'm not mistaken you won't need the block between \makeatletter...\makeatother to obtain square brackets around the citation number with the style you use. This is only necessary for authoryear and authortitle-like styles. – moewe Jul 16 '18 at 11:39
  • Okay will make those changes – H. Wills Jul 16 '18 at 11:53
  • You may also want to add a few % in \renewbibmacro*{volume+number+eid} (see tex.stackexchange.com/q/7453/35864) (if you want spaces, produce them with \setunit{\addspace} and friends instead, see §4.11.7 Using the Punctuation Tracker of the biblatex manual). A few other things could also be handled more elegantly. – moewe Jul 16 '18 at 11:56
  • Thanks @moewe like I said I am only a beginner so I didnt expect my code to be perfect – H. Wills Jul 16 '18 at 12:02
1
\renewbibmacro*{issue+date}{%
  \printfield{issue}%
  \setunit*{\addspace}%
  \usebibmacro{date}%
  \newunit}

removes the parentheses around the date (and issue) of @article and @periodical.

  • Perfect! Simple code and fast response. Thank you – H. Wills Jul 16 '18 at 11:53

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.