Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Since I could not find the style that met my teacher's requirements for the bibliography I have to do, I created my own bst with latex makebst on my mac. I had chosen to make the volume bold but it does not appear in boldface on my document (I am using LyX). I was wondering if there is a way to make it appear in bold by modifying the bst file

This is what I have in the volume section

FUNCTION {format.bvolume}
{ volume empty$
    { "" }
    { bbl.volume volume tie.or.space.prefix
      "volume" bibinfo.check * *
      series "series" bibinfo.check
      duplicate$ empty$ 'pop$
        { emphasize ", " * swap$ * }
      if$
      "volume and number" number either.or.check
    }
  if$
}
FUNCTION {format.number.series}
{ volume empty$
    { number empty$
        { series field.or.null }
        { series empty$
            { number "number" bibinfo.check }
            { output.state mid.sentence =
                { bbl.number }
                { bbl.number capitalize }
              if$
              number tie.or.space.prefix "number" bibinfo.check * *
              bbl.in space.word *
              series "series" bibinfo.check *
            }
          if$
        }
      if$
    }
    { "" }
  if$
}

Can someone help me solve this problem ? I tried to add {\bf } around * swap$ * but it does not seem to be working.

share|improve this question
    
Hello and welcome :) You can use backticks ` to mark inline code fragments as I did in my edit. –  Scott H. Nov 13 '12 at 0:19
4  
Which "volume" concept do you refer to: That for a book (in a multivolume series, such as an encyclopedia), or that for a journal's volume? The BibTeX functions you display, format.bvolume and format.number.series, pertain to the former concept of "volume". If you're interested in the journal-related volume concept, you should be examining the function format.vol.num.pages. –  Mico Nov 13 '12 at 0:22
    
I want to make the Journal volume in bold –  esmitex Nov 13 '12 at 8:16
add comment

1 Answer 1

up vote 6 down vote accepted

The language of BibTeX style is based on reverse Polish notation. This means that it puts strings on a stack and the functions operates on the last element(s) in the stack. Thus to make the current element of the stack bold, one can create the following function

FUNCTION {makebold}{
  "\textbf{" swap$ * "}" * }
}

This function assumes that there is an element on the stack, then it adds the string \textbf{ to the stack, thus after this step the stack is "element" "\textbf{". The instruction swap$ inverts the order of the last two elements in the stack. * replaces the last two elements with their concatenation. Thus after the first * the last element of the stack is "\textbf{element". Then we append "}" to the stack and finally we concatenate it with the previous element. Thus we obtain "\textbf{element}".

After defining the function you can replace emphasize with makebold (or see the comment by Mico about the other relevant functions)

share|improve this answer
1  
Thank you very much. I found out there was a bolden function in the ".bst" file at the top. I wrote bolden before swap$ instead of emphasize and I wrote bolden just before volume in format.vol.num.pages. I don't know for sure which one is the right solution but it worked. –  esmitex Nov 13 '12 at 8:23
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.