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.

I am trying to modify a certain .bst file. At the moment I am able to hack the file to get the following reference output for an inbook entry:

Jones, W.P. 1994. Turbulence modelling and numerical solution methods for variable density and combustion flows, Turbulent Reacting Flows. In, Libby, P.A. and Williams, F.A., (Eds.). Academic Press, London, UK. pp. 309-374.

The only problem I have is that if you look above, there is a comma after the word 'In'. I know that this is because I tried to included the word 'In' in the .bst file. Does anyone know how to do this properly? Here is the bit of code where I modified to get 'In'.

FUNCTION {format.editors}
{ editor empty$
     { "" }
     {
       add.period$ " In" * editor format.names
       editor num.names$ #1 >
         { ", " * bbl.editors * }
         { ", " * bbl.editor * }
       if$
     }
   if$
}

And this is the code for the inbook entry

FUNCTION {inbook}
{ output.bibitem
  format.authors output.nonnull
  new.block
  format.date "year" output.check
  new.sentence
  format.chapter.pages "chapter and pages" output.check
  format.btitle "title" output.check
  crossref missing$
    { format.editors output
      new.block
      format.publisher
      new.sentence
    }
    { format.chapter.pages "chapter and pages" output.check
      new.block
      format.book.crossref output.nonnull
    }
  if$
  format.edition output
  new.sentence
  format.pages output
  new.block
  note output
  fin.entry
}
share|improve this question
    
Welcome to TeX.sx! Usually, we don't put a greeting or a "thank you" in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Upvoting is the preferred way here to say "thank you" to users who helped you. –  Guido Jan 7 '13 at 18:12

1 Answer 1

up vote 3 down vote accepted

If I've understood right you want to remove comma between "In" and "Libby":

Jones, W.P. 1994. Turbulence modelling and numerical solution methods for variable density and combustion flows, Turbulent Reacting Flows. In Libby, P.A. and Williams, F.A., (Eds.). Academic Press, London, UK. pp. 309-374.

If so, here is correct using of operator *

FUNCTION {format.editors}
{ editor empty$
     { "" }
     {
       add.period$ " In " editor format.names *
       editor num.names$ #1 >
         { ", " * bbl.editors * }
         { ", " * bbl.editor * }
       if$
     }
   if$
}

Also, space is added after string " In".

The explanation of stack: in expression

" In" * editor format.names

operator * concatenates editor and " In" and then resulting string is parsed by format.names, which puts extra comma. In expression

" In " editor format.names *

operator * concatenates result of command editor format.names and " In ".

share|improve this answer
1  
Welcome to TeX.sx! –  lockstep Jan 8 '13 at 7:20
    
Thanks @artscan! Yes, that's what I was looking for and thanks for the explanation of using * –  lost.identity Jan 8 '13 at 8:24

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.