2

I have a question regarding bibliography. I am not a LaTeX pro, It doesn't matter for me at the moment if I have to use embedded bibliography or bobtex. The question is, how can I accomplish the formatting I need. Here is an example of a bibliography member:

[1] Doe J.: How to format bibliography?. JohnDoe limited, Warsaw, 2015.

As you see the author name is placed as then comes dot and a colon. Title should be italic. Then after comas publisher, town and year. I would apreciate all help regarding this!

9
  • Three main choices: thebibliography environment, where you specify each item and its format, basically; BibTeX, where you put the information into a separate database and then tell LaTeX which style you want; Biblatex/Biber, where you put the information into a separate database and then tell LaTeX which style you want. Biblatex/Biber is more powerful/flexible/modern but not widely accepted by publishers. It deals with accented characters, online sources etc. more easily. Any of these methods can be used. You just have to decide which you want to use. – cfr Feb 22 '16 at 21:49
  • I understand that with thebibliography the entry is just a string of tex which I can format mysalfe. But for example, If I wanted to use BibTex, how can I tell him to format the string the way I want? – Łukasz Przeniosło Feb 22 '16 at 21:51
  • If you wish to use BibTeX, you need to select a bibliography style, which will determine the formatting of all bibliographic items. So far, you've provided only very rudimentary formatting-related information. E.g., how should journal articles, working papers, and unpublished manuscripts be formatted? How should the names of multiple authors be formatted? – Mico Feb 22 '16 at 21:54
  • I have provided the only entries that for my paper are available. This is a diploma paper and I think there are no more needed. I am not sure either for this my university uses any named formatting or is it made up by them. – Łukasz Przeniosło Feb 22 '16 at 21:57
  • There's some webpage listing all the styles so you can perhaps find the one closest to what you want. Can't remember where it is at the moment, but here is a shorter one from Reed: reed.edu/cis/help/latex/bibtexstyles.html. BibTeX is the way to go, IMO. However, if you can't find the style that suits your needs, then create your own bibliography using thebibliography as @cfr suggested but I think that might be too time-consuming for you. There are NUMEROUS styles out there - so I'm sure you'll find the one for you. Good luck! – Jimi Oke Feb 23 '16 at 1:07
2

To achieve what you wanted, you can modify the utphys.bst file as follows:

First, you must replace

FUNCTION {output.nonnull}
{ 's :=
  output.state mid.sentence =
    { ", " * write$ }
    { output.state after.quote =
    { " " * write$ }
    { output.state after.block =
        { add.period$ write$
          newline$
          "\newblock " write$
        }
        { output.state before.all =
        'write$
        { output.state after.quoted.block =
            { write$
              newline$
              "\newblock " write$
            }
            { add.period$ " " * write$ }
          if$
        }
          if$
        }
      if$
    }
      if$
      mid.sentence 'output.state :=
    }
  if$
  s
}

by (this will replace the comma after the last author by a colon):

FUNCTION {output.nonnull}
{ 's :=
  output.state mid.sentence =
    { ": " * write$ } % Modified
     { output.state after.quote =
    { " " * write$ }  % between Title and journal
    { output.state after.block =
        { add.period$ write$   
          newline$
          "\newblock " write$
        }
        { output.state before.all =
        'write$
        { output.state after.quoted.block =
            { write$
              newline$
              "\newblock " write$
            }
            { add.period$ " " * write$ }
          if$
        }
          if$
        }
      if$
    }
      if$
      mid.sentence 'output.state :=
    }
  if$
  s
}

And you should also replace the code:

FUNCTION {format.names}
{ 's :=
  #1 'nameptr :=
  s num.names$ 'numnames :=
  numnames 'namesleft :=
    { namesleft #0 > }
    { s nameptr "{f.~}{vv~}{ll}{, jj}" format.name$ 't := % Modified
      nameptr #1 >
    { namesleft #1 >
        { ", " * t * }
        { numnames #2 >
        { "," * }
        'skip$
          if$
          t "others" =
        { " {\em et~al.}" * }
        { string.and * t * }
          if$
        }
      if$
    }
    't
      if$
      nameptr #1 + 'nameptr :=
      namesleft #1 - 'namesleft :=
    }
  while$
}

by (This will change the name format to {jj.~}{vv~}{ll}{ f}, where: jj stands for the suffix e.g. Sr, vv for von part, ll for last name, and f for the first letter of the first name):

FUNCTION {format.names}
{ 's :=
  #1 'nameptr :=
  s num.names$ 'numnames :=
  numnames 'namesleft :=
    { namesleft #0 > }
    { s nameptr "{jj.~}{vv~}{ll}{ f}" format.name$ 't :=
      nameptr #1 >
    { namesleft #1 >
        { ", " * t * }
        { numnames #2 >
        { "," * } % { "," * }
        'skip$
          if$
          t "others" =
        { " {\em et~al.}" * }
        { string.and * t * } 
          if$

        }
      if$
    }
    't
      if$
      nameptr #1 + 'nameptr :=
      namesleft #1 - 'namesleft :=
    }
  while$
} 

To make the title of an article italic and remove the quotation marks which surrounded it you have to replace the code:

FUNCTION {format.title}
{ title empty$
    { "" }
    { "``" title "t" change.case$ * ",''" * }
  if$
}

FUNCTION {format.title.p}
{ title empty$
    { "" }
    { "``" title "t" change.case$ * ".''" * }
  if$
}

by the code:

FUNCTION {format.title}
{ title empty$
    { "" }
    { "" title emphasize "t" change.case$ * "." * } % Modified
  if$
}

FUNCTION {format.title.p}
{ title empty$
    { "" }
    { "``" title "t" change.case$ * " ''." * } 
  if$
}

To prevent the "journal name" from being italic you have to replace

FUNCTION {format.journal}
{ journal missing$   
    { "" }
    {journal emphasize " " *
     format.volume *
     format.number *
     format.date.paren *
     format.pages.nopp *
      }
    if$
}

by

FUNCTION {format.journal}
{ journal missing$   
    { "" }
     {journal " " *  % Modified
     format.volume *
     format.number *
     format.date.paren *
     format.pages.nopp *
      }
    if$
    }

A MWE:

  \documentclass{article}
   \begin{filecontents*}{test.bib}
     @book{Albuquerque2015,
       address = {Cham},
       author = {Albuquerque, Ulysses Paulino},
       doi = {10.1007/978-3-319-06517-5},
       isbn = {978-3-319-06516-8},
       pages = {67},
       publisher = {Springer International Publishing},
       title = {{Speaking in Public About Science}},
       year = {2015}
       }
     @article{B,
      author = {AuthorA, A. and AuthorB, B. and AuthorC, C.},
      journal = {Journal of Physics},
      pages = {1233},
      title = {{Title of the paper}},
      volume = {567},
      year = {2016}
        }
  \end{filecontents*}
  \begin{document}

   ~\nocite{*}

 %Bibleography

 \bibliographystyle{utphys}
 \bibliography{test}
 \end{document}

It gives:

enter image description here

Update: In order to have a dot after the abbreviated names and to delete and before the last name you the FUNCTION {format.names} must be instead replaced by:

 FUNCTION {format.names}
    { 's :=
      #1 'nameptr :=
      s num.names$ 'numnames :=
      numnames 'namesleft :=
        { namesleft #0 > }
        { s nameptr "{jj.~}{vv~}{ll}{ f.}" format.name$ 't :=
          nameptr #1 >
        { namesleft #1 >
            { ", " * t * }
            { numnames #2 >
            { ", " * } % { "," * }
            'skip$
              if$
              t "others" =
            { " {\em et~al.}" * }
            { t * } 
              if$

            }
          if$
        }
        't
          if$
          nameptr #1 + 'nameptr :=
          namesleft #1 - 'namesleft :=
        }
      while$
    }

This gives for my above MWE: enter image description here

2
  • Thank you for answer. This is almost right. After each authors letter name there should be a dot before the coma. Also, before the last author, there should also be a dot before the colon. There should be no and before last author, just a coma. – Łukasz Przeniosło Mar 5 '16 at 7:56
  • @ŁukaszPrzeniosło, just replace FUNCTION {format.names} by the one that I added now. – Mohamed Vall Mar 5 '16 at 13:01

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.