0

Question: How to change the place of reference number? In this document I want to shift refrence [1] in superscript position of Casson.

Please help me.

MWE:

\documentclass[12pt]{article}
\usepackage[a4paper,top=0.6 in,bottom=0.6 in,left=0.6 in,right=0.6 in]{geometry}
%%%%%%%%%==============watermark
%\usepackage[printwatermark]{xwatermark}
%\newwatermark[allpages,color=red!50,angle=45,scale=3,xpos=0,ypos=0]{DRAFT}
%%%%%%%==================
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[misc]{ifsym}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{mathtools}
\usepackage{multirow}
\usepackage[numbers,sort&compress]{natbib}%%% to arrange citation in sequence
\usepackage{setspace}
\usepackage{multicol}
%%===========color reference===========
%%===========color reference===========
\usepackage{graphicx}
\usepackage{delarray}
\usepackage[dvipsnames]{xcolor}
\usepackage{tikz}
\usetikzlibrary{calc,shapes}
\usepackage{parskip}
\usepackage{fancyhdr}
\pagestyle{fancy}
%%% remove these two draw line
\fancyhf{} % sets both header and footer to nothing
\renewcommand{\headrulewidth}{0pt}
% your new footer definitions here
%%%% above
\usepackage{lastpage}
\lhead{}
\rhead{}
\chead{}
%\cfoot{Page \thepage \hspace{1pt} of \pageref{LastPage}}
\lfoot{}
\rfoot{}
%\renewcommand{\headrulewidth}{0.4pt}
%\renewcommand{\footrulewidth}{0.4pt}
\newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node (#1) {};}
\newcommand{\DrawBox}[2]{%
    \begin{tikzpicture}[overlay,remember picture]
    \draw[->,shorten >=5pt,shorten <=5pt,out=70,in=130,distance=0.5cm,#1] (MarkA.north) to (MarkC.north);
    \draw[->,shorten >=5pt,shorten <=5pt,out=50,in=140,distance=0.3cm,#2] (MarkA.north) to (MarkB.north);
    \end{tikzpicture}
}
\usepackage{cellspace}
\setlength\cellspacetoplimit{4pt}
\setlength\cellspacebottomlimit{4pt}
\usepackage{nomencl}
\makenomenclature
%++++++++++++++++++++++++++++++++++++++++++
%\usepackage{makecell, multirow}
%\usepackage{siunitx}
%\usepackage{etoolbox}
%\newrobustcmd\B{\DeclareFontSeriesDefault[rm]{bf}{b}\bfseries}                          
%\usepackage[skip=4ex, font=small, labelfont=bf]{caption}
%++++++++++++++++++++++++++++++++++++++++++
%%%%%%%%%%%% Table insert %%%%%%%%%%%%%%%%%%%
\usepackage{siunitx,booktabs,caption}
%%%%%%%%%%%% Table insert %%%%%%%%%%%%%%%%%%%
%\linespread{1.25}
\setstretch{1.5}
\begin{document}
\section{Introduction}
Casson \textcolor{blue}{\cite{casson1959flow}} originally proposed the Casson fluid. The Casson fluid model has been demonstrated by Blair\textcolor{blue}{\cite{blair1959equation}}. 
\bibliographystyle{unsrtnat}
\clearpage
\bibliography{Bibliography.bib}
\end{document}

Bibliography.bib items are as under.

@article{casson1959flow,
  title={A flow equation for pigment-oil suspensions of the printing ink type},
  author={Casson, N},
  journal={Rheology of disperse systems},
  year={1959},
  publisher={Pargamon Press}
}


@article{blair1959equation,
  title={An equation for the flow of blood, plasma and serum through glass capillaries},
  author={Blair, GW Scott},
  journal={Nature},
  volume={183},
  number={4661},
  pages={613--614},
  year={1959},
  publisher={Nature Publishing Group}
} 
1
  • @egreg please help me sir.
    – SandyM
    Commented Sep 25, 2022 at 3:24

1 Answer 1

0

Since you're loading natbib, you can use its \bibpunct command to set the style of the cituation. It has six arguments so here I say what each does in the comments. See the natbib documentation, page 13.

E.g., at the end of the preamble, put:

\bibpunct%
    {[}% punctuation before citation number
    {]}% punctuation after citation number
    {;}% punctuation between citations when more than one
    {s}% style: here "s" means "numerical superscript"
    {}% punctuation between author and year in author-year cituations
    {}% punctuation between years in author-year citations

The "s" style will make them superscripted (as opposed to the "n" style which is the regular number style).

If you wanted them all to be blue, as in your sample document, you could add that to the declaration in the start puncutation:

\bibpunct%
    {\color{blue}[}% punctuation before citation number
    {]}% punctuation after citation number
    {;}% punctuation between citations when more than one
    {s}% style: here "s" means "numerical superscript"
    {}% punctuation between author and year in author-year cituations
    {}% punctuation between years in author-year citations

Then you could simply do Casson\cite{casson1959flow} in the body.

myoutput

Here's the full modified code:

\documentclass[12pt]{article}
\usepackage[a4paper,top=0.6 in,bottom=0.6 in,left=0.6 in,right=0.6 in]{geometry}
%%%%%%%%%==============watermark
%\usepackage[printwatermark]{xwatermark}
%\newwatermark[allpages,color=red!50,angle=45,scale=3,xpos=0,ypos=0]{DRAFT}
%%%%%%%==================
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[misc]{ifsym}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{mathtools}
\usepackage{multirow}
\usepackage[numbers,sort&compress]{natbib}%%% to arrange citation in sequence
\usepackage{setspace}
\usepackage{multicol}
%%===========color reference===========
%%===========color reference===========
\usepackage{graphicx}
\usepackage{delarray}
\usepackage[dvipsnames]{xcolor}
\usepackage{tikz}
\usetikzlibrary{calc,shapes}
\usepackage{parskip}
\usepackage{fancyhdr}
\pagestyle{fancy}
%%% remove these two draw line
\fancyhf{} % sets both header and footer to nothing
\renewcommand{\headrulewidth}{0pt}
% your new footer definitions here
%%%% above
\usepackage{lastpage}
\lhead{}
\rhead{}
\chead{}
%\cfoot{Page \thepage \hspace{1pt} of \pageref{LastPage}}
\lfoot{}
\rfoot{}
%\renewcommand{\headrulewidth}{0.4pt}
%\renewcommand{\footrulewidth}{0.4pt}
\newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node (#1) {};}
\newcommand{\DrawBox}[2]{%
    \begin{tikzpicture}[overlay,remember picture]
    \draw[->,shorten >=5pt,shorten <=5pt,out=70,in=130,distance=0.5cm,#1] (MarkA.north) to (MarkC.north);
    \draw[->,shorten >=5pt,shorten <=5pt,out=50,in=140,distance=0.3cm,#2] (MarkA.north) to (MarkB.north);
    \end{tikzpicture}
}
\usepackage{cellspace}
\setlength\cellspacetoplimit{4pt}
\setlength\cellspacebottomlimit{4pt}
\usepackage{nomencl}
\makenomenclature
%++++++++++++++++++++++++++++++++++++++++++
%\usepackage{makecell, multirow}
%\usepackage{siunitx}
%\usepackage{etoolbox}
%\newrobustcmd\B{\DeclareFontSeriesDefault[rm]{bf}{b}\bfseries}                          
%\usepackage[skip=4ex, font=small, labelfont=bf]{caption}
%++++++++++++++++++++++++++++++++++++++++++
%%%%%%%%%%%% Table insert %%%%%%%%%%%%%%%%%%%
\usepackage{siunitx,booktabs,caption}
%%%%%%%%%%%% Table insert %%%%%%%%%%%%%%%%%%%
%\linespread{1.25}
\setstretch{1.5}

%%%%%%%%% NEW LINES to change citation style
\bibpunct%
    {\color{blue}[}% punctuation before citation number
    {]}% punctuation after citation number
    {;}% punctuation between citations when more than one
    {s}% style: here "s" means "numerical superscript"
    {}% punctuation between author and year in author-year cituations
    {}% punctuation between years in author-year citations

\begin{document}
\section{Introduction}
Casson\cite{casson1959flow} originally proposed the Casson fluid. The Casson fluid model has been demonstrated by Blair\cite{blair1959equation}. 
\bibliographystyle{unsrtnat}
\clearpage
\bibliography{Bibliography.bib}
\end{document}

(Alternatively, or additionally, you could load the hyperref package with the options \usepackage[citecolor=blue]{hyperref} to get them to be both colored and hyperlinked, which may be better.)

6
  • It's not working.
    – SandyM
    Commented Sep 25, 2022 at 3:24
  • It works for me with your code. I added an image to my answer showing what I get when I add the code. What exactly did you do, and what result do you get? What errors if any? If a result like mine is not what you get, edit your question with your new code and post a link to your .log file.
    – frabjous
    Commented Sep 25, 2022 at 3:30
  • You are right. This is what I want. Can you share the full code, from which you produce the above pic? I think full code will solve my problem.
    – SandyM
    Commented Sep 25, 2022 at 3:37
  • I am confused where to use \bibpunct.
    – SandyM
    Commented Sep 25, 2022 at 3:59
  • Put it at the end of the preamble. I'll add my full code.
    – frabjous
    Commented Sep 25, 2022 at 4:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .