8

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?

6
  • 3
    Underlining is a sure sign of bad typography; please, don't do it.
    – egreg
    Commented Jan 5, 2013 at 11:41
  • But I absolutely have to.
    – Oscar Lazo
    Commented Jan 5, 2013 at 11:44
  • 1
    In this case look at what the soul package provides.
    – egreg
    Commented Jan 5, 2013 at 11:46
  • But that is meant for use in the body of the document, how can I make it work through a bst?
    – Oscar Lazo
    Commented Jan 5, 2013 at 12:12
  • If I make the change you propose, I get that the author list is underlined.
    – egreg
    Commented Jan 5, 2013 at 13:28

2 Answers 2

6

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.

8
  • That will produce a similar result, the underlined text goes on until it reaches the margins.
    – Oscar Lazo
    Commented Jan 5, 2013 at 15:35
  • @OscarLazo Not in my experiment. Actually the plain \uline from ulem would work if you didn't enclose the full title in the additional pair of braces.
    – egreg
    Commented Jan 5, 2013 at 15:36
  • Could you post your code? I'm pretty sure I did just what you suggested.
    – Oscar Lazo
    Commented Jan 5, 2013 at 15:58
  • @OscarLazo Sorry, I forgot the change on line 197, where \uline should become \bbluline
    – egreg
    Commented Jan 5, 2013 at 16:10
  • I tried with just \usepackage{ulem} \def\bbluline#1{\uline#1} in the tex file and "\enquote{ \uline" swap$ * in line 531
    – Oscar Lazo
    Commented Jan 5, 2013 at 16:14
4

write into the preamble of your document

\usepackage{soul}

and change the title function in your bst file to

FUNCTION {format.title}
{ title add.blank
   "title" bibinfo.check
  duplicate$ empty$ 'skip$
    {
      "\enquote{\ul{" swap$ *
      non.stop
        { "}} " * }
        { "}} " * }
      if$
    }
  if$
}

then it should work.

1
  • what is a typo? If I do what you suggest I get an error after pdflatex bibtex pdflatex: Package soul Error: Reconstruction failed
    – Oscar Lazo
    Commented Jan 5, 2013 at 16:01

You must log in to answer this question.

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