TransWikia.com

BibTex: Easy way to drop article titles from references?

TeX - LaTeX Asked by scitexter on December 9, 2020

I would like to generate a bibliography for a grant application with a minimal structure. Ideally, something like science.bst i.e. omitting the article title.

A. N. Clarkson, B. S. Huang, S. E. Macisaac, I. Mody, S. T.
Carmichael, Nature 468, 305 (2010).

However, I would prefer to have the authors and year structured like apalike.bst.

Clarkson, A. N., Huang, B. S., Macisaac, S. E., Mody, I., and
Carmichael, S. T. (2010).Reducing excessive GABA-mediated tonic
inhibition promotes functional recovery after stroke. Nature,
468:305–9.

Is there a way to easily force apalike.bst to drop article titles or have science.bst reverse the author/initials and move the year?

3 Answers

You could try makebst for example. That is, type latex makebst in the command line and follow the (somewhat lengthyI dialog to create your own bst-file.

Correct answer by Dirk on December 9, 2020

Question:

Is there a way to easily force apalike.bst to drop article titles...?

(Remark: I updated this answer in after EL_DON posted a comment to note that the original answer, posted way back in August 2011, no longer works, presumably because of some update that was applied to BibTeX in the meantime.)

Short answer: Yes.

Longer answer: I suggest you proceed as follows:

  • Find the file apalike.bst in your TeX distribution. Make a copy of this file and call the copy, say, apalike-notitlefield.bst. (Do not edit an original file of the TeX distribution directly.

  • Open apalike-notitlefield.bst in a text editor. The program you use to edit your tex files will do fine.

  • Find the function format.title. (In my copy of the file, this function starts on line 264.)

  • In this function, locate the line

         { title "t" change.case$ }
    

Change this line to

        { "" }

Essentially, you're now instructing BibTeX to do nothing with the title field even if it's non-empty.

  • Save the file apalike-notitlefield.bst either to the directory that contains the main tex file (that's the file that contains bibliographystyle and bibliography directives) or to a directory that's searched by BibTeX. If you choose the second option, be sure to update the filename database of your TeX distribution suitably.

  • In the main tex file, change

     bibliographystyle{apalike} 
    

to

    bibliographystyle{apalike-notitlefield}

and perform a full recompile cycle -- LaTeX, BibTeX, and LaTeX twice more -- to fully propagate all changes.

A final remark: This answer is known to work with the apalike bibliography style. It should with many other bibliography styles as well, as long as they provide a function called format.title.


For completeness' sake, here's the original answer from late August 2011:

Yes! It requires only some minimal surgery. First, find the file apalike.bst on your system and open it in your favorite text editor; on my system, its first two lines are:

% BibTeX `apalike' bibliography style (version 0.99a, 8-Dec-10), adapted from
% the `alpha' style, version 0.99a; for BibTeX version 0.99a.

Then locate the construct ENTRY{...} (begins on line 43 on my copy of apalike.bst) and, in that construct, the line containing the single word

    title

(line 62 in my copy). Comment out this line by placing a single % comment character at the start of the line. Save this file as, say, myapalike.bst somewhere where TeX/LaTeX can find it. If you use TeXLive, for instance, you'll additionally have to run (with sudo privileges) the command mktexlsr; if you use MikTeX, you'll have to call up the Settings program and click on "Refresh FNDB".

Incidentally, this technique -- of commenting out a line in the ENTRY construct of a bst file in order to avoid it showing up in the bibliography printout -- is perfectly general. For instance, if you want to have a style file that never prints out the name of the journal in which some article is published, you could comment out the line journal and obtain the desired result.

Finally, do note that if you run LaTeX on the file makebst.tex to create your own bst file from scratch, you will still have to hand-edit the resulting bst file, as the program does not give you a choice to omit the title of a journal article entirely. Instead, it asks if you want to place the title in quotation marks and how the quotation marks are supposed to look like, e.g., single or double quotes, or single or double guillemets.

Answered by Mico on December 9, 2020

The formatting of your @article-type entries is specified in a part following

FUNCTION {article}

which starts on line 482 for apalike.bst and line 1036 for (the current version of) science.bst.

In order to remove the title field from article entries in apalike.bst (or for that matter any other *.bst-file), comment out line 488 by adding a %:

%  format.title "title" output.check

Changing the position of the year field for science.bst requires to move line 1045

 format.date "year" output.check

to the desired position, which is right after line 1038

format.authors "author" output.check
format.date "year" output.check

Note that this only changes the position of year for article entries, as specified in the question. However, it is easily extended to other entry types.

Reversing author/initials requires changes in the format.names function (line 489 of science.bst). The order is specified in line 497

      "{f.~}{vv~}{ll}{, jj}" format.name$

and the initials are the first part, which needs to be moved at the end.

      "{vv~}{ll}{, jj}{, f.}" format.name$

Note that this change acts on all author fields for all entry types.

All this is, of course, perfectly valid for any other *.bst-file.

Answered by David on December 9, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP