0

I am currently finishing a book written in LaTeX and the copy-editor asks me to use the list comma for in-text citations such as "One, Two, and Three 2019" (instead of "One, Two and Three 2019" as it is right now).

I am working with an already heavily customized .bst file based on the Chicago style. It inserts the list comma in the bibliography, but not in in-text citations.

I have tried to make changes to format.names and my.full.label functions, but so far to no avail. Same for C+P these functions from chicago.bst or other bibliography style files that use the list comma.

How can I change this without screwing up all the other customized settings? (And please don't tell me to configure my .bst file from scratch again. ;) )

Code for format.names and my.full.label below. Thank you!

FUNCTION {format.names} { 's :=   #1 'nameptr :=               % nameptr = 1;  s num.names$ 'numnames :=    % numnames = num.name$(s);   numnames 'namesleft :=
{ namesleft #0 > }
{ nameptr #1 =
    {s nameptr "{vv~}{ll}{, jj}{, ff}" format.name$ 't := }
    {s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't := }
  if$
  nameptr #1 >
     {   %begin modification: up to six authors in bibliography everybody given, >6 => FIRST, SECOND, THIRD et al. 
      nameptr #3 %given authors
      #1 + =
      numnames #6 %threshold
      > and
        { "others" 't :=
          #1 'namesleft := }
        'skip$
      if$
      namesleft #1 >   %end of modification
          { ", " * t * }
          { numnames #2 >
              { "," * }
              'skip$
            if$
            t "others" =
                { " et~al." * }
                { " and " * t * } % from Chicago Manual of Style
              if$
           }
           if$
         }
        't
    if$
    nameptr #1 + 'nameptr :=          % nameptr += 1;
    namesleft #1 - 'namesleft :=      % namesleft =- 1;
}while$}

And here is my.full.label

FUNCTION {my.full.label}
{ 
  's :=
  #1 'nameptr :=               % nameptr = 1;
  s num.names$ 'numnames :=    % numnames = num.name$(s);
  numnames 'namesleft :=
    { namesleft #0 > }

    { s nameptr "{vv~}{ll}" format.name$ 't :=  % get the next name
      nameptr #1 >
         {  %begin modification: up to THREE authors in citation---if more then FIRST et al. 
          nameptr #1 %cited authors
          #1 + =
          numnames #3 %threshold
          > and
            { "others" 't :=
              #1 'namesleft := }
            'skip$
          if$
         namesleft #1 > %end modification
              { ", " * t * }
              { numnames #2 >
                  { "" * } %if you put comma here, you get "X, et al."
                  'skip$
                if$
                t "others" =
                    { " et~al." * }
                    { " and " * t * } % from Chicago Manual of Style
                  if$
               }
               if$
             }
            't
        if$
        nameptr #1 + 'nameptr :=          % nameptr += 1;
        namesleft #1 - 'namesleft :=      % namesleft =- 1;
    }
  while$
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.