2

I want to cite some websites (some organisation ones like the NOAA etc.) but I do not want to show any year against them. This is what I am doing:

MWE:

enter image description here

%\RequirePackage{filecontents}
\begin{filecontents}{ref.bib}
@misc{pngea,    
  author = "{PANGAEA}",    
  title = "{PANGAEA}. {Data} Publisher for {Earth \& Environmental Science}",    
  year = "2019",   
  url = "https://www.pangaea.de",    
  note = "[Online; last accessed January 2019]"  
} 
@misc{ncdcpc,    
  author = "{NOAA NCDC Paleoclimate}", 
  title = "Paleoclimatology Data, {National} Climatic Data Center,
     {National Oceanic and Atmospheric Administration}",    
  year = "2019",   
  url = "https://www.ncdc.noaa.gov/data-access/paleoclimatology-data",  
  note = "[Online; last accessed January 2019]"  
}
\end{filecontents}

\documentclass[12pt,twoside,a4paper,fleqn]{article} 
%\documentclass[natbib,fleqn,smallextended]{svjour3} %
%%\usepackage{filecontents} 
% %Author list
\usepackage[noblocks,auth-lg]{authblk} % %
\usepackage[version=3]{mhchem} % for upright CO2 
\usepackage{graphicx}
\usepackage{floatrow} %\usepackage{tabularx}%modifiable tabular
%\usepackage[usestackEOL]{stackengine} 
\usepackage{longtable}
\usepackage{graphbox}%change float alignments 
% %setting spacing
\usepackage{setspace} 
\doublespacing %\singlespacing %\onehalfspacing
%For other sizes use the \setstretch command like this:
%\setstretch{1.8} 
\usepackage[square,authoryear]{natbib}
\usepackage{color} 
\usepackage[vmargin=1in, hmargin=0.8in]{geometry} 
%line Numbers 
\usepackage{lineno}
\linenumbers*[1] %to set numbering format 

\usepackage{enumerate}
%Maths 
\usepackage{amsmath} 
\usepackage{amssymb} %for deg
\usepackage{gensymb} %for permil 
\usepackage{wasysym} % Headers and Footers 
\usepackage{fancyhdr} % for rotating floats
\usepackage{lscape} %for subfigures and tables
\usepackage[font=small,labelfont=bf]{caption}
\usepackage[font=footnotesize]{subfig} %automatic referencing

\usepackage[spaces,hyphens]{url}
\usepackage[hidelinks]{hyperref} 
\usepackage[capitalise]{cleveref}

\begin{document}
\citep[e.g.,][]{ncdcpc,pngea} 
\bibliographystyle{unsrtnat}
\bibliography{ref}
\end{document}
  • 2
    Maybe you can remove the unwanted portions of your code to make it more readable and re-usable, and keep at least one \documentclass{...} uncommented (both seem to be commented at the moment). – Partha D. Jan 22 '19 at 13:04
2

Since you're employing the natbib citation management package, you could set up "citation aliases". E.g.,

\defcitealias{pngea}{PANGAEA}

Then, if you type \citepalias{pngea}, you'll get "PANGAEA".

A modified MWE:

enter image description here

\RequirePackage{filecontents}
\begin{filecontents}{mybib.bib}
@misc{pngea,    
  author = "{PANGAEA}",    
  title  = "{PANGAEA}. {Data} Publisher for {Earth~\& Environmental Science}",    
  year   = "2019",   
  url    = "https://www.pangaea.de",    
  note   = "[Online; last accessed 22 January 2019]"  
} 
@misc{ncdcpc,    
  author = "{NOAA NCDC Paleoclimate}", 
  title  = "Paleoclimatology Data, {National Climatic Data Center},
            {National Oceanic and Atmospheric Administration}",    
  year   = "2019",   
  url    = "https://www.ncdc.noaa.gov/data-access/paleoclimatology-data",  
  note   = "[Online; last accessed 22 January 2019]"  
}
\end{filecontents}

\documentclass[12pt,twoside,a4paper,fleqn]{article} 
%\documentclass[natbib,fleqn,smallextended]{svjour3} % 
%%Author list
\usepackage[noblocks,auth-lg]{authblk} % %
\usepackage[version=3]{mhchem} % for upright CO2 
\usepackage{graphicx}
\usepackage{floatrow} 
%\usepackage{tabularx}%modifiable tabular
%\usepackage[usestackEOL]{stackengine} 
\usepackage{longtable}
\usepackage{graphbox}%change float alignments 
%% set spacing
\usepackage{setspace} 
%\doublespacing %
\singlespacing %\onehalfspacing
% For other sizes use the \setstretch command like this:
% \setstretch{1.8} 

\usepackage[square,authoryear]{natbib}
%% Citation aliases without years
\defcitealias{pngea}{PANGAEA}
\defcitealias{ncdcpc}{NOAA}

\usepackage{xcolor} 
\usepackage[vmargin=1in, hmargin=0.8in]{geometry} 
%Show Line Numbers 
\usepackage{lineno}
\linenumbers*[1] %to set numbering format 

\usepackage{enumerate}
%Maths 
\usepackage{amsmath} 
\usepackage{amssymb} %for deg
\usepackage{gensymb} %for permil 
\usepackage{wasysym} 
% Headers and Footers 
\usepackage{fancyhdr} 
% for rotating floats
\usepackage{lscape} 
%for subfigures and tables
\usepackage[font=small,labelfont=bf]{caption}
\usepackage[font=footnotesize]{subfig} 

%cross-referencing
\usepackage[spaces,hyphens]{url}
\usepackage[hidelinks]{hyperref} 
\usepackage[capitalise]{cleveref}

\begin{document}
\verb+\citep+: \citep{ncdcpc,pngea} 

\verb+\citepalias+: \citepalias{ncdcpc,pngea}

\bibliographystyle{unsrtnat}
\bibliography{mybib}
\end{document}
|improve this answer|||||

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.