# Shuffling the first name and surname of authors in latex

I want to have my references as first and middle name initials and, surname. Instead, I am getting the opposite. My bibtex (.bib) library is ref and .bst is model4-names provided by Elsevier. is The code in my .tex file for the Elsevier journal is as follows.

\documentclass[preprint,review,10pt]{elsarticle}
\usepackage{amssymb,amsmath}
\usepackage{algorithm}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{array}
\newcolumntype{L}{>{\centering\arraybackslash}m{3cm}}
\usepackage{algorithmicx}
\usepackage{algorithm}
\usepackage{csquotes}
\usepackage{algpseudocode}
\usepackage{lipsum}
\usepackage{algorithm,algpseudocode}
\usepackage{ifthen}
\newboolean{somevariable}
\setboolean{somevariable}{false}
\begin{document}

\begin{frontmatter}

\title{paper title}
\begin{abstract}
....
...
...
...
\bibliography{ref}
\bibliographystyle{model4-names}
\end{document}


model4-names.bst enable me to get sorted references but not in the format of the journal. The above code generates references in the following style

[1] Asghar, M.N., Ghanbari, M.. An efficient security system for cabac binstrings of h. 264/svc. Circuits and Systems for Video Technology, IEEE Transactions on 2013;23(3):425–437.

and the journal expect it in the following style

[1] M.N. Asghar, M. Ghanbari, An efficient security system for cabac binstrings of h. 264/svc. , IEEE Transactions on Circuits and Systems for Video Technology 23(3) (2013) 425–437.

Three things are missing as highlighted by bold.

1. Order of first name and surname, and

2. Parenthesis around year field for journal but not for conferences.

3. Also, there should be a comma instead of double dots (..) after the last author's name.

May I know if I am missing anything?

• Welcome to TeX.SX! Are you using model4-names because the author instructions about the submission say so? In this case, leave the choice to the bib style. – egreg Jul 25 '16 at 19:36
• I am using model4-names.bst provided by Elsevier to support alphabetical order of references. I am playing with this bst since a while and has been able to get references in the required style, however, there is a comma after the first name (initial) of each author. – user110667 Jul 25 '16 at 19:48
• Apparently Elsevier likes it. – egreg Jul 25 '16 at 20:13
• @user110667 That's the style choice of Elsevier (amongst others) – Joseph Wright Jul 26 '16 at 15:57

For this case, download and place the elsarticle-num bibliography style (.bst) files in your working directory. It is perfectly working. Moreover, for your reference, I am attaching the screenshot. Yes, you can sort the references using \biboptions{sort&compress}. You just need to add this options before the \begin{document} environment. Hope it helps. Moreover, you can also try the other available biboptions.

round  -  round parentheses are used (default)
square -  square brackets are used   [option]
curly  -  curly braces are used      {option}
angle  -  angle brackets are used    <option>
semicolon  -  multiple citations separated by semi-colon
colon  - same as semicolon, an earlier confusion
comma  -  separated by comma
numbers-  selects numerical citations
super  -  numerical citations as superscripts
sort   -  sorts multiple citations according to order in ref. list
sort&compress   -  like sort, but also compresses numerical citations
compress - compresses without sorting


\bibliographystyle{elsarticle-num}
\bibliography{bib}

• Bibliographic style elsarticle-num.bst allows to obtain the references in exactly similar style but now they are not sorted. How can i sort them alphabatically (according to authors surname) using elsearticle-num.bst file? – user110667 Jul 26 '16 at 11:24
• @user110667. The above mentioned answer is now been edited. Hope it suffice your need. – Mishra S Jul 26 '16 at 13:47