Changeset 11124


Ignore:
Timestamp:
2019-06-17T14:49:53+02:00 (17 months ago)
Author:
nicolasmartin
Message:

Editing of ametsoc.bst to generate hyperlinks for DOIs or URLs
New version of bibtool resource file:

  • Braces as entries delimiter
  • All entry types in lowercase (^@...)
  • Normalisation of pages field ([0-9]+--[0-9])
  • Deletion of url field if doi is here
  • Definition of fields order
    sort.order =
    { * =
          # title     # chapter     # pages
          # journal   # booktitle   # edition # editor # series 
          # volume    # number      
          # author    # institution # school
          # year      # month
          # publisher # issn        # isbn
          # doi       # url
    }
    
  • coding the format of citations keys
    key.format =
    { %s(bibkey) # %-2n(author)_
         {   
              %+5.1W(journal)
                 # %0s(@book         ) { bk   } # %0s(@inbook       ) { ibk  }
                 # %0s(@incollection ) { icol } # %0s(@inproceedings) { iprc }
                 # %0s(@phdthesis    ) { phd  } # %0s(@techreport   ) { rpt  }
         }
      %2d(year)                    
    }
    
Location:
NEMO/trunk/doc/latex/NEMO/main
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • NEMO/trunk/doc/latex/NEMO/main/ametsoc.bst

    r10146 r11124  
    519519  duplicate$ empty$ 'skip$ 
    520520    { 
    521       "\doi{" swap$ * "}" * 
     521      "\href{http://dx.doi.org/" swap$ * "}{DOI}" * 
    522522    } 
    523523  if$ 
     
    527527  url empty$ 
    528528    'skip$ 
    529     { "\urlprefix\url{" url * "}" * output } 
     529    { "\href{" url * "}{URL}" * output } 
    530530  if$ 
    531531 note empty$ 
     
    16371637  "\providecommand{\natexlab}[1]{#1}" 
    16381638  write$ newline$ 
    1639   "\providecommand{\url}[1]{\texttt{#1}}" 
    1640   write$ newline$ 
    1641   "\providecommand{\urlprefix}{URL }" 
    1642   write$ newline$ 
    1643   "\expandafter\ifx\csname urlstyle\endcsname\relax" 
    1644   write$ newline$ 
    1645   "  \providecommand{\doi}[1]{doi:\discretionary{}{}{}#1}\else" 
    1646   write$ newline$ 
    1647   "  \providecommand{\doi}{doi:\discretionary{}{}{}\begingroup \urlstyle{rm}\Url}\fi" 
    1648   write$ newline$ 
    1649   "\providecommand{\eprint}[2][]{\url{#2}}" 
    1650   write$ newline$ 
     1639%  "\providecommand{\url}[1]{\texttt{#1}}" 
     1640%  write$ newline$ 
     1641%  "\providecommand{\urlprefix}{URL }" 
     1642%  write$ newline$ 
     1643%  "\expandafter\ifx\csname urlstyle\endcsname\relax" 
     1644%  write$ newline$ 
     1645%  "  \providecommand{\doi}[1]{doi:\discretionary{}{}{}#1}\else" 
     1646%  write$ newline$ 
     1647%  "  \providecommand{\doi}{doi:\discretionary{}{}{}\begingroup \urlstyle{rm}\Url}\fi" 
     1648%  write$ newline$ 
     1649%  "\providecommand{\eprint}[2][]{\url{#2}}" 
     1650%  write$ newline$ 
    16511651} 
    16521652EXECUTE {begin.bib} 
  • NEMO/trunk/doc/latex/NEMO/main/bibtool.rsc

    r11060 r11124  
    1 fmt.name.name = "_" 
    2 fmt.et.al     = "_ea" 
    3  
    4 ## Switch of tab indentation for readability under terminal, Trac, ... 
     1## No tab indentation for readability 
    52print.use.tab = off 
    63 
    7 ## Make brace the only delimiter 
    8 rewrite.rule = {"^\"\([^#]*\)\"$" "{\1}"} 
     4## Braces as delimiter 
     5rewrite.rule = { "^\{\(.*\)\}$"        "\"\1\"" } 
     6rewrite.rule = { "^\([^\"].*[^\"]*\)$" "\"\1\"" } 
    97 
    10 ## Remove void fields 
    11 #rewrite.rule = { "^\" *\"$" } 
     8## Entry types in lowercase 
     9new.entry.type = "article" 
     10new.entry.type = "book" 
     11new.entry.type = "inbook" 
     12new.entry.type = "incollection" 
     13new.entry.type = "inproceedings" 
     14new.entry.type = "phdthesis" 
     15new.entry.type = "techreport" 
     16 
     17## Normalisation of 'pages' field  
     18rewrite.rule = { pages # "\([0-9]+\),\([0-9]+\)" "\1\2"   } 
     19rewrite.rule = { pages # "\([0-9]+\)–\([0-9]+\)" "\1--\2" } 
     20rewrite.rule = { pages # "\([0-9]+\)-\([0-9]+\)" "\1--\2" } 
     21 
     22## Removing void fields 
    1223rewrite.rule = { "^{ *}$" } 
    1324 
    14 #print { Remove unnecessary fields } 
    15 #delete.field = { address      } 
    16 #delete.field = { chapter      } 
    17 #delete.field = { institution  } 
    18 #delete.field = { isbn         } 
    19 #delete.field = { issn         } 
    20 #delete.field = { issue        } 
    21 #delete.field = { keywords     } 
    22 #delete.field = { language     } 
    23 #delete.field = { note         } 
    24 #delete.field = { number       } 
    25 #delete.field = { organisation } 
    26 #delete.field = { pages        } 
    27 #delete.field = { pdf          } 
    28 #delete.field = { series       } 
    29 #delete.field = { school       } 
    30 #delete.field = { type         } 
    31 #delete.field = { url if field = "doi" } 
    32 #delete.field = { volume       } 
     25## Delete 'url' field if 'doi' is present 
     26print { Removal of redundancies ('doi'='url') } 
     27rename.field = { url = dbl if doi = ".*" } 
     28delete.field = { dbl } 
    3329 
    34 ## default order for 1st fields 
    35 #sort.order = { * = author # title # booktitle # journal # publisher # editor # year # month # doi # url } 
     30## Definition of fields order 
     31sort.order = 
     32{ * = 
     33      # title     # chapter     # pages 
     34      # journal   # booktitle   # edition # editor # series  
     35      # volume    # number       
     36      # author    # institution # school 
     37      # year      # month 
     38      # publisher # issn        # isbn 
     39      # doi       # url 
     40} 
    3641 
    37 #print { Generate new citation keys } 
     42## Keys  
     43print { Generate new citation keys: 1stauthor[.2ndauthor[.ea]]_[journal|type]year } 
    3844ignored.word = "of" 
    3945ignored.word = "and" 
    4046ignored.word = "in" 
    41 ## To check duplicates, prevent the key generation by commenting the next lines 
    42 #key.format = { %-2n(author)_%-5.1W(journal)%2d(year) } 
    43 #key.format = { %-2n(author)_%2d(year) } 
     47ignored.word = "du" 
     48ignored.word = "de" 
     49key.base = lower 
     50key.format = 
     51{ %s(bibkey) # %-2n(author)_ 
     52     {    
     53          %+5.1W(journal) 
     54             # %0s(@book         ) { bk   } # %0s(@inbook       ) { ibk  } 
     55             # %0s(@incollection ) { icol } # %0s(@inproceedings) { iprc } 
     56             # %0s(@phdthesis    ) { phd  } # %0s(@techreport   ) { rpt  } 
     57     } 
     58  %2d(year)                     
     59} 
    4460 
    4561print { Sort entries by key } 
Note: See TracChangeset for help on using the changeset viewer.