3

I have a BibTeX format base of scientific citations. Almost all of them contain the field url=''. In a destinated document class (it was specially created and designed for handling PhDs according to a national standard) these entries yield bibliography with indicated URLs where this field is present in the bibtex base. How it is possible to suppress showing URLs without affecting the class package, by a command in a preamble or as an option to \bibliography command?

  • the bibliography style in my case is \bibliographystyle{gost2008} – astrsk Sep 10 '16 at 9:29
3

Given that you're using the gost2008 bibliography style, I think you have two main options:

  1. Create a modified version of the bibliography style that doesn't process the contents of url fields.

    • Find the file gost2008.bst in your TeX distribution; make a copy of this file and name the copy, say, gost2008nourl.bst.

    • Open the file gost2008nourl.bst in a text editor (the editor you use for your tex files will do fine) and locate the function format.url. In my copy of this file, the function starts on line 1381. The function should look something like this:

      FUNCTION {format.url} 
      { url empty$
          { "" }
          {
            bbl.url ": \BibUrl{" * url * "}" *
            urldate empty$
              { "" }
              { " (" bbl.urldate * ": " * urldate * ")" * }
            if$ *
          }
        if$
      }
      
    • Replace the entire function with

      FUNCTION {format.url} 
      { url empty$
          { "" }
          { "" } 
        if$
      }
      

      I.e., replace the function with a "stub", effectively telling the bibliography style to "do nothing" whether or not the entry in question features a field called url.

    • Save the file gost2008nourl.bst either in the directory that contains your main tex file or in a directory that's searched by BibTeX. If you choose the latter option, be sure to update the filename database of your TeX distribution as well.

    • In your main tex file, change the instruction \bibliographystyle{gost2008} to \bibliographystyle{gost2008nourl}. Then rerun LaTeX, BibTeX, and LaTeX twice more to fully propagate all changes.

  2. Alternatively, open the bib file in a text editor and replace all instances of url = and url= with zzzurl=.

    BibTeX ignores fields that aren't in the database of the bibliography style you use. While gost2008 is programmed to something with fields called url, it (unsurprisingly) doesn't have instructions for what to do with fields called zzzurl.

    You will still need to re-run BibTeX and LaTeX after making the changing the field names from url to zzzurl.

Happy BibTeXing!

Your Answer

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

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