New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
bibtool.rsc in NEMO/trunk/doc/latex/NEMO/main – NEMO

source: NEMO/trunk/doc/latex/NEMO/main/bibtool.rsc @ 11058

Last change on this file since 11058 was 11058, checked in by nicolasmartin, 5 years ago

Add a configuration file as resource for BibTool? to define standard format for our bibliographies
After the import of several new versions of references, I found some discrepancies that it was easy to address with BibTool?

  • Set a common pattern for citation key: author1[_authors2[_ea]]_journalyear
  • Suppress a good bunch of trivial fields to reduce the size of the biblio in the different exports address chapter institution isbn issn issue keywords language note number organisation pages pdf series school type volume Open to discussion but to me a DOI entry is sufficient if someone wants more information
  • Prevent the use of tab for fields indentation, better readability for the bib file on Trac browser or in the output of SVN diff
  • Apply the following order of fields for every entry author # title # booktitle # journal # publisher # editor # year # month # doi # url

To apply the rules to a BibTex? file, run

bibtool -r bibtool.rsc input_file -o output_file
File size: 1.2 KB
Line 
1fmt.name.name = "_"
2fmt.et.al     = "_ea"
3
4## Switch of tab indentation for readability under terminal, Trac, ...
5print.use.tab = off
6
7## Make brace the only delimiter
8rewrite.rule = {"^\"\([^#]*\)\"$" "{\1}"}
9
10## Remove void fields
11#rewrite.rule = { "^\" *\"$" }
12rewrite.rule = { "^{ *}$" }
13
14print { Remove unnecessary fields }
15delete.field = { address      }
16delete.field = { chapter      }
17delete.field = { institution  }
18delete.field = { isbn         }
19delete.field = { issn         }
20delete.field = { issue        }
21delete.field = { keywords     }
22delete.field = { language     }
23delete.field = { note         }
24delete.field = { number       }
25delete.field = { organisation }
26delete.field = { pages        }
27delete.field = { pdf          }
28delete.field = { series       }
29delete.field = { school       }
30delete.field = { type         }
31delete.field = { url if field = "doi" }
32delete.field = { volume       }
33
34## default order for 1st fields
35sort.order = { * = author # title # booktitle # journal # publisher # editor # year # month # doi # url }
36
37print { Generate new citation keys }
38ignored.word = "of"
39ignored.word = "and"
40ignored.word = "in"
41key.format = { %-2n(author)_%-5.1W(journal)%2d(year) }
42
43#print { Sort entries by key }
44#sort = on
Note: See TracBrowser for help on using the repository browser.