[Tex/LaTex] How to customize a .bst bibliographic style created with custom-bib for dealing with entries with no year and/or no author

bibliographiesbibtexcustom-bibnatbib

I am using natbib with author-year-like cites style and with a custom references style (a .bst file) that I created with custom-bib. That style file for references is also author-year oriented, of course.

I am not an expert on .bst files and so on. The style I created with custom-bib is perfect for me, but there are two cases in which it could (and should) be improved:

  1. entries without year and
  2. entries without author, and also a not so important improvement:
  3. entries that have an URL (for the records) but are not online websites.

I copy here my MWE (maybe not so minimal), and a link to my .bst file:

\begin{filecontents}{mybib.bib}
@book{GAMSCPLEX,
publisher = {GAMS Development Corporation},
title = {{GAMS/CPLEX} 10 Solver Manual},
url = {http://www.gams.com/dd/docs/solvers/cplex.pdf}
},
@book{GAMSSBB02,
address = {Washington, DC},
publisher = {GAMS Development Corporation},
title = {{GAMS/SBB} Solver Manual},
url = {http://www.gams.com/dd/docs/solvers/sbb.pdf},
year = {2002}
},
@book{GAMSCONOPT,
address = {Bagsvaerd},
author = {Drud, A},
publisher = {{ARKI} Consulting and Development},
title = {{GAMS/CONOPT} Solver Manual},
url = {http://www.gams.com/dd/docs/solvers/conopt.pdf}
},
@article{Chou2006,
author = {Chou, C. Y. and Chen, C. H.},
journal = {Expert Systems with Applications},
number = {2},
pages = {233--242},
title = {Economic design of variable sampling intervals {$T^2$} control charts using genetic algorithms},
volume = {30},
year = {2006}
},
@article{DRUZOVEC98,
address = {Ljubljana (Slovenija-Slovenia)},
author = {Dru\v{z}ovec, M and \v{S}ostar, A and Godina, A},
journal = {Strojni{\v{s}}ki Vestnik-Journal of Mechanical Engineering},
number = {1-2},
pages = {29--34},
title = {{MPC} process control procedure},
volume = {44},
year = {1998}
}
\end{filecontents}

\documentclass[11pt]{book}
\usepackage[a4paper,showframe]{geometry}

\RequirePackage[latin1]{inputenc}

%\usepackage{amsmath}

\usepackage[spanish]{babel}

\usepackage[autostyle=true]{csquotes}

\usepackage[round,semicolon,authoryear,longnamesfirst]{natbib}


\usepackage[%implicit=false,
                pdftex,hyperfootnotes=false,
             pdfpagelabels]{hyperref}  % backref linktocpage pagebackref
\pdfcompresslevel=9
\pdfadjustspacing=1 

\hypersetup{hyperfootnotes=false,
            colorlinks=true, linkcolor=blue, citecolor=green,%
                             filecolor=red, urlcolor=red,
            pdfpagemode=UseOutlines, pdfpagelayout=SinglePage,%
            pdfhighlight=/N, pageanchor=true,%
            pdftoolbar=true, pdfmenubar=true, pdfstartview=FitH}

\begin{document}

Referencias:

\begin{itemize}
    \item \cite{Chou2006}.
    \item \cite{DRUZOVEC98}.
    \item \cite{GAMSCPLEX}.
    \item \cite{GAMSSBB02}.
    \item \cite{GAMSCONOPT}.
\end{itemize}

\bibliographystyle{mycustom}
\bibliography{mybib}

\end{document}

This is the link for mycustom.bst: https://dl.dropbox.com/u/155485/mycustom.bst

These are the results I get for the reference list:

The reference list I get using mycustom.bst


OK, so my questions are obviously the following:

  1. How can I tweak my .bst file (or the preceding .dbj file) in order to hide those ugly empty round brackets in the case there is no year for the item??

  2. How should my .bst file deal with items without author? Should it take the publisher info? I suppose the right order could be: authors, if not then editors, if not then publisher or institution. How can I get that done in my custom style?*

  3. I don't know what exactly to do with URL information. In the cases I am showing in my example, they are in fact online documents, so I think it's not wrong to show the links to them. But in other cases you have an URL address in your .bib file just for your information… Anyway, my question in this case is easier: How can I get rid of that ugly "URL" label before the URL address?


EDIT: Although this is not the goal of this question, I would also like to ask you the following:

Do you know any (natbib or just bibtex) existing style that is the same or nearly the same as my custom bib style?? I was no able to locate such a style, but maybe I missed something.

Best Answer

  1. To start, there are several things wrong with your bib file. Following the BibTeX manual, the book entry requires year, and author or editor. So I suggest to turn the first three entries into manual, which just requires title.
  2. For those manuals, in particular when the author is missing, one should provide a key entry that BibTeX can use to sort the entries, and that is sometimes shown instead of the author (depends on the style).
  3. I would also change the publisher fields of the manuals into organization fields, as those are optional fields of manual, while publisher is not.

The resulting database would then look like:

@manual{GAMSCPLEX,
key = {GAMS/CPLEX},
organization = {GAMS Development Corporation},
title = {{GAMS/CPLEX} 10 Solver Manual},
url = {http://www.gams.com/dd/docs/solvers/cplex.pdf}
},
@manual{GAMSSBB02,
key = {GAMS/SBB},
address = {Washington, DC},
organization = {GAMS Development Corporation},
title = {{GAMS/SBB} Solver Manual},
url = {http://www.gams.com/dd/docs/solvers/sbb.pdf},
year = {2002}
},
@manual{GAMSCONOPT,
key = {GAMS/CONOPT},
address = {Bagsvaerd},
author = {Drud, A.},
organization = {{ARKI} Consulting and Development},
title = {{GAMS/CONOPT} Solver Manual},
url = {http://www.gams.com/dd/docs/solvers/conopt.pdf}
},
@article{Chou2006,
author = {Chou, C. Y. and Chen, C. H.},
journal = {Expert Systems with Applications},
number = {2},
pages = {233--242},
title = {Economic design of variable sampling intervals {$T^2$} control charts using genetic algorithms},
volume = {30},
year = {2006}
},
@article{DRUZOVEC98,
address = {Ljubljana (Slovenija-Slovenia)},
author = {Dru\v{z}ovec, M. and \v{S}ostar, A. and Godina, A.},
journal = {Strojni{\v{s}}ki Vestnik-Journal of Mechanical Engineering},
number = {1-2},
pages = {29--34},
title = {{MPC} process control procedure},
volume = {44},
year = {1998}
}

Regarding the empty parentheses for non-existing years I have three suggestions:

  1. Remove the yr-par option from your dbj file to remove all parentheses around years. (maybe not an option for you)
  2. Just provide a year! If you use a specific version of, say, GAMS/CPLEX, look up its release date, and use that. It is reasonable to assume that the manual was released alongside the software release. (maybe not an option for you)
  3. bst hackery: Although year is an optional field of manual, your style file does not check properly if the year is present. This is a bug in custom-bib. To circumvent it, add the indicated five lines to your style file, in function format.date:

    FUNCTION {format.date}
    { year "year" bibinfo.check duplicate$ empty$
        {
        }
        'skip$
      if$
      extra.label *
      before.all 'output.state :=
      duplicate$ empty$     %% added
      { pop$ "{}" }         %% added
      {                     %% added
      " (" swap$ * ")" *
      }                     %% added
      if$                   %% added
    }
    

    In principle, this could be added to merlin.mbs, to fix all derived styles. With this hack, and the proposed changes to your database, I get: example bibliography