[Tex/LaTex] Editing bst file to underline title

bibtexcustom-bibline-breakingnatbibtext-decorations

I could not find an option in makebst that would make the titles of articles be underlined, however, using emphasize in an otherwise correct bst I was able to underline it. Unfortunately this makes the resulting underlined text get outside the margins. My code is

\documentclass[10pt,oneside,letterpaper,spanish]{book}
\usepackage[utf8x]{inputenc}
\usepackage[activeacute,spanish]{babel}
\addto\shorthandsspanish{\spanishdeactivate{~<>.}}
\decimalpoint %\spanishdecimal{.}

\usepackage[spanish]{babel}
\usepackage{natbib}

\begin{document}
asdasd \citep{chsh_inequality} asdasd \citep*{aspect_test_bell}
\bibliographystyle{fiuady3}
\bibliography{ejem_biblio}

\end{document}

and my bib file is

% This file was created with JabRef 2.5.
% Encoding: Cp1252

@ARTICLE{chsh_inequality,
   author = {{Clauser}, J.~F. and {Horne}, M.~A. and {Shimony}, A. and {Holt}, R.~A.
    },
    title = "{Proposed Experiment to Test Local Hidden-Variable Theories}",
  journal = {Physical Review Letters},
     year = 1969,
    month = oct,
   volume = 23,
   number = 15,
    pages = {880-884},
      doi = {10.1103/PhysRevLett.23.880},
   adsurl = {http://adsabs.harvard.edu/abs/1969PhRvL..23..880C},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@ARTICLE{aspect_test_bell,
   author = {{Aspect}, A. and {Grangier}, P. and {Roger}, G.},
    title = "{Experimental Tests of Realistic Local Theories via Bell's Theorem}",
  journal = {Physical Review Letters},
 keywords = {Fluorescence, phosphorescence},
     year = 1981,
    month = aug,
   volume = 47,
   number = 15,
    pages = {460-463},
      doi = {10.1103/PhysRevLett.47.460},
   adsurl = {http://adsabs.harvard.edu/abs/1981PhRvL..47..460A},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

The bst file I generated with makebst is http://pastebin.com/ji5d4vrx. On line 527 replacing { title with { emphasize title makes the titles become underlined, but they come outside of the margins. like thisenter image description here

How could I fix the margins? Also, how to add the missing spaces between the authors and the title and between the title and the year?

Best Answer

I suggest you to revise your .bst file. For instance, change lines 1574--1575 into

  write$ newline$
  "\expandafter\ifx\csname bbluline\endcsname\relax\let\bbluline\underline\fi"

and in your TeX file write

\usepackage{ulem}
\def\bbluline#1{\uline#1}

Also the definition of \enquote should be changed: lines 1572-1573 should be

  write$ newline$
  "\newcommand{\enquote}[1]{~`#1'\ }"

Moreover, line 197 must be changed as

    { "\bbluline{" swap$ * "}" * }

(that is, changing \uline into \bbluline).

Of course, line 527 should become

526 FUNCTION {format.title}
527 { title emphasize
528    "title" bibinfo.check

that is, removing also add.blank.

Related Question