citation-style-language / styles

Official repository for Citation Style Language (CSL) citation styles.
https://citationstyles.org/
3.34k stars 3.78k forks source link

Styles for the journals of the Royal Society of Chemistry -RSC #199

Closed cparnot closed 12 years ago

cparnot commented 12 years ago

07-13-2012

Generating CSL files for all RSC journals

It appears all the journals for the 'Royal Society of Chemistry' follow the same guidelines for reference formatting.

The RSC web site has a list of journals in html form, and with some googling, I found a partial list of journals with ISSNs.

Using the list of journals available also on their web site, I created manually a list of journals with ISSNs and URLs.

Files

These are the files used to generate the styles

Title   ISSN    eISSN   Years   URL
Analyst 0003-2654   1364-5528   1997-2012   http://xlink.rsc.org/?genre=journal&issn=1364-5528
Analytical Abstracts    0003-2689   1471-7107   1997-2012   http://www.rsc.org/aa
Analytical Communications   x   x   1996-1999   http://pubs.rsc.org/en/journals/journalissues/ac
Analytical Methods  1759-9660   1759-9679   2009-2012   http://xlink.rsc.org/?genre=journal&issn=1759-9679
Analytical Proceedings  x   x   1980-1993   http://pubs.rsc.org/en/journals/journalissues/ap
Analytical Proceedings including Analytical Communications  x   x   1994-1995   http://pubs.rsc.org/en/journals/journalissues/ai
Annual Reports on Analytical Atomic Spectroscopy    x   x   1971-1984   http://pubs.rsc.org/en/journals/journalissues/aa
Annual Reports on the Progress of Chemistry x   x   1904-1966   http://pubs.rsc.org/en/journals/journalissues/ar
Annual Reports Section A - Inorganic Chemistry  0260-1818   1460-4760   1997-2012   http://xlink.rsc.org/?genre=journal&issn=1460-4760
Annual Reports Section B - Organic Chemistry    0069-3030   1460-4779   1997-2012   http://xlink.rsc.org/?genre=journal&issn=1460-4779
Annual Reports Section C - Physical Chemistry   0260-1826   1460-4787   1997-2012   http://xlink.rsc.org/?genre=journal&issn=1460-4787
Biomaterials Science    x   x   2012    http://pubs.rsc.org/en/journals/journalissues/bm
Catalysis Science & Technology  2044-4753   2044-4761   2011-2012   http://xlink.rsc.org/?genre=journal&issn=2044-4761
Catalysts & Catalysed Reactions 1474-9173   1474-9181   2002-2012   http://www.rsc.org/catalysts
Chemical Communications 1359-7345   1364-548X   1997-2012   http://xlink.rsc.org/?genre=journal&issn=1364-548X
Chemical Communications (London)    x   x   1965-1968   http://pubs.rsc.org/en/journals/journalissues/c1
Chemical Hazards in Industry    0265-5721   1476-3907   1997-2012   http://www.rsc.org/chi
Chemical Science    2041-6520   2041-6539   2010-2012   http://xlink.rsc.org/?genre=journal&issn=2041-6539
Chemical Society Reviews    0306-0012   1460-4744   1998-2012   http://xlink.rsc.org/?genre=journal&issn=1460-4744
Chemistry Education: Research and Practice  1109-4028   x   2000-2012   http://pubs.rsc.org/en/journals/journalissues/rp
Chemistry World 1473-7604   1749-5318   2005-2012   http://xlink.rsc.org/?genre=journal&issn=1749-5318
Contemporary Organic Synthesis  x   x   1994-1997   http://pubs.rsc.org/en/journals/journalissues/co
CrystEngComm    x   1466-8033   1999-2012   http://xlink.rsc.org/?genre=journal&issn=1466-8033
Dalton Transactions 1477-9226   1477-9234   1997-2012   http://xlink.rsc.org/?genre=journal&issn=1477-9234
Discussions of the Faraday Society  x   x   1947-1971   http://pubs.rsc.org/en/journals/journalissues/df
Education in Chemistry  0013-1350   1479-5326   2004-2012   http://xlink.rsc.org/?genre=journal&issn=1749-5326
Energy & Environmetnal Science  1754-5692   1754-5706   2008-2012   http://xlink.rsc.org/?genre=journal&issn=1754-5706
Faraday Discussions 1359-6640   1364-5498   1997-2012   http://xlink.rsc.org/?genre=journal&issn=1359-6640
Faraday Discussions of the Chemical Society x   x   1972-1991   http://pubs.rsc.org/en/journals/journalissues/df
Faraday Special Discussions of the Chemical Society x   x   1972-1972   http://pubs.rsc.org/en/journals/journalissues/s1
Faraday Symposia of the Chemical Society    x   x   1972-1984   http://pubs.rsc.org/en/journals/journalissues/fs
Food & Function 2042-6496   2042-650X   2010-2012   http://xlink.rsc.org/?genre=journal&issn=2042-650X
Geochemical Transactions    x   x   2000-2003   http://pubs.rsc.org/en/journals/journalissues/gt
Green Chemistry 1463-9262   1463-9270   1999-2012   http://xlink.rsc.org/?genre=journal&issn=1463-9270
Integrative Biology 1757-9694   1757-9708   2009-2012   http://xlink.rsc.org/?genre=journal&issn=1757-9708
Issues in Environmental Science & Technology    1350-7583   1465-1874   -   http://ebook.rsc.org/?DOI=10.1039/1350-7583
Journal and Proceedings of the Institute of Chemistry of Great Britain and Ireland  x   x   1920-1943   http://pubs.rsc.org/en/journals/journalissues/jg
Journal and Proceedings of the Royal Institute of Chemistry x   x   1949-1949   http://pubs.rsc.org/en/journals/journalissues/jp
Journal and Proceedings of the Royal Institute of Chemistry of Great Britain and Ireland    x   x   1944-1948   http://pubs.rsc.org/en/journals/journalissues/rg
Journal of Analytical Atomic Spectrometry   0267-9477   1364-5544   1997-2012   http://xlink.rsc.org/?genre=journal&issn=1364-5544
Journal of Environmental Monitoring 1464-0325   1464-0333   1999-2012   http://xlink.rsc.org/?genre=journal&issn=1464-0333
Journal of Materials Chemistry  0959-9428   1364-5501   1997-2012   http://xlink.rsc.org/?genre=journal&issn=1364-5501
Journal of the Chemical Society x   x   1862-1877   http://pubs.rsc.org/en/journals/journalissues/js
Journal of the Royal Institute of Chemistry x   x   1950-1964   http://pubs.rsc.org/en/journals/journalissues/ji
Jubilee of the Chemical Society x   x   1891-1891   http://pubs.rsc.org/en/journals/journalissues/m1
Lab on a Chip   1473-0197   1473-0189   2001-2012   http://xlink.rsc.org/?genre=journal&issn=1473-0189
Laboratory Hazards Bulletin 0261-2917   1476-3915   1997-2012   http://www.rsc.org/lhb
MedChemComm 2040-2503   2040-2511   2010-2012   http://xlink.rsc.org/?genre=journal&issn=2040-2511
Memoirs and Proceedings of the Chemical Society x   x   1843-1848   http://pubs.rsc.org/en/journals/journalissues/mp
Mendeleev Communications    x   x   1997-2004   http://pubs.rsc.org/en/journals/journalissues/mc
Metallomics 1759-5901   1756-591X   2009-2012   http://xlink.rsc.org/?genre=journal&issn=1756-591X
Methods in Organic Synthesis    0265-4245   1478-1565   2000-2012   http://www.rsc.org/mos
Molecular BioSystems    1742-206X   1742-2051   2005-2012   http://xlink.rsc.org/?genre=journal&issn=1742-2051
Nanoscale   2040-3364   2040-3372   2009-2012   http://xlink.rsc.org/?genre=journal&issn=2040-3372
Natural Product Reports 0265-0568   1460-4752   1998-2012   http://xlink.rsc.org/?genre=journal&issn=1460-4752
Natural Product Updates 0950-1711   1478-1557   2000-2012   http://www.rsc.org/npu
New Journal of Chemistry    1144-0546   1369-9261   1998-2012   http://xlink.rsc.org/?genre=journal&issn=1369-9261
Organic & Biomolecular Chemistry    1477-0520   1477-0539   2003-2012   http://xlink.rsc.org/?genre=journal&issn=1477-0539
Pesticide Outlook   x   x   1989-2003   http://pubs.rsc.org/en/journals/journalissues/po
Photochemical & Photobiological Sciences    1474-905X   1474-9092   2002-2012   http://xlink.rsc.org/?genre=journal&issn=1474-9092
PhysChemComm    x   x   1998-2003   http://pubs.rsc.org/en/journals/journalissues/qu
Physical Chemistry Chemical Physics 1463-9076   1463-9084   1998-2012   http://xlink.rsc.org/?genre=journal&issn=1463-9084
Polymer Chemistry   1759-9954   1759-9962   2010-2012   http://xlink.rsc.org/?genre=journal&issn=1759-9954
Proceedings of the Analytical Division of the Chemical Society  x   x   1975-1979   http://pubs.rsc.org/en/journals/journalissues/ad
Proceedings of the Chemical Society x   x   1957-1964   http://pubs.rsc.org/en/journals/journalissues/ps
Proceedings of the Chemical Society, London x   x   1885-1914   http://pubs.rsc.org/en/journals/journalissues/pl
Proceedings of the Institute of Chemistry of Great Britain and Ireland  x   x   1877-1919   http://pubs.rsc.org/en/journals/journalissues/pg
Proceedings of the Society for Analytical Chemistry x   x   1964-1974   http://pubs.rsc.org/en/journals/journalissues/sa
Quarterly Journal of the Chemical Society of London x   x   1849-1862   http://pubs.rsc.org/en/journals/journalissues/qj
Quarterly Reviews, Chemical Society x   x   1947-1971   http://pubs.rsc.org/en/journals/journalissues/qr
Royal Institute of Chemistry, Reviews   x   x   1968-1971   http://pubs.rsc.org/en/journals/journalissues/rr
RSC Advances    -   2046-2069   2011-2012   http://xlink.rsc.org/?genre=journal&issn=2046-2069
Russian Chemical Reviews    x   x   1998-2004   http://pubs.rsc.org/en/journals/journalissues/rc
Selected Annual Reviews of the Analytical Sciences  x   x   1971-1974   http://pubs.rsc.org/en/journals/journalissues/as
Soft Matter 1744-863X   1477-6848   2005-2012   http://xlink.rsc.org/?genre=journal&issn=1744-6848
Special Discussions of the Faraday Society  x   x   1970-1970   http://pubs.rsc.org/en/journals/journalissues/sd
Symposia of the Faraday Society x   x   1967-1971   http://pubs.rsc.org/en/journals/journalissues/sf
Toxicology Research x   x   2012    http://pubs.rsc.org/en/journals/journalissues/tx
Transactions of the Faraday Society x   x   1905-1971   http://pubs.rsc.org/en/journals/journalissues/tf

rsc_journals_to_skip.txt

rsc_style_template.csl

<?xml version="1.0" encoding="utf-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0">
  <!-- This style was generated automatically from a script created by Charles Parnot. This was done based on the assumption that all Royal Society of Chemistry journals follow the same reference style. This style should not be modified and made independent: any adjustment would likely have be made to the parent style instead, "royal-society-of-chemistry". See also: https://github.com/citation-style-language/styles/issues/199 -->
  <info>
    <title>#TITLE#</title>
    <id>http://www.zotero.org/styles/#IDENTIFIER#</id>
    <link href="http://www.zotero.org/styles/royal-society-of-chemistry" rel="independent-parent"/>
    <category citation-format="numeric"/>
    <category field="chemistry"/>
    <issn>#ISSN#</issn>   <!-- Print -->
    <issn>#EISSN#</issn>  <!-- Electronic -->
    <updated>2012-07-13T12:00:00+00:00</updated>
    <rights>This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/</rights>
  </info>
</style>

generate_rsc_styles.rb

#! /usr/bin/ruby

# for File.makedirs
require 'ftools'

# where are we?
This_script_path = File.dirname(File.expand_path(__FILE__))
puts "running script #{This_script_path}"

# hashes of hashes that will contain all the styles to generate
styles = { }

# template used by all the styles
template_path = "#{This_script_path}/rsc_style_template.csl"
template = File.read(template_path)

# styles to skip
skip_list_path = "#{This_script_path}/rsc_journals_to_skip.txt"
skipped_journals = File.read(skip_list_path).split(/\n/)

# start with new empty style directory
style_dir_path = "#{This_script_path}/generated_styles"
puts "creating directory at path #{style_dir_path}"
`rm -R '#{style_dir_path}'`
File.makedirs style_dir_path

# load all the info from the tab-delimited info file
journal_info = "#{This_script_path}/rsc_journals.tab"
File.read(journal_info).split(/\n/).each do |journal_line|

  # each line has the following fields
  # Publisher   Journal name    Abbreviation    ISSN    URL Start Date
  fields = journal_line.split(/\t/)
  if (fields.length != 5)
    puts "invalid journal line: #{journal_line}"
    next
  end
  title  = fields[0]
  issn   = fields[1]
  eissn  = fields[2]
  years  = fields[3]
  url    = fields[4]

  # identifier is created from the title
  identifier = title.downcase
  identifier.gsub!(',', ' ')
  identifier.gsub!(':', ' ')
  identifier.gsub!("\'", '')
  identifier.gsub!('  ', ' ')
  identifier.gsub!('  ', ' ')
  identifier.gsub!(/^ +/, '')
  identifier.gsub!(/ +$/, '')
  identifier.gsub!(' ', '-')
  identifier.gsub!('--', '-')
  identifier.gsub!('--', '-')
  identifier.gsub!('&', 'and')

  # excluded journal?
  if (skipped_journals.include?(title) or skipped_journals.include?(identifier))
    $stderr.puts "skipping journal: #{title} because it's in the exclusion list"
    next
  end

  # skip archived journals
  if not (years =~ /2012$/)
    $stderr.puts "skipping journal: #{title} because years = #{years}"
    next
  end

  # create style xml
  puts "creating style: #{identifier}"
  style_content = template.gsub('#TITLE#', title.gsub('&', '&amp;'))
  style_content.gsub!('#IDENTIFIER#', identifier)
  style_content.gsub!('#URL#', url.gsub('&', '&amp;'))

  # optional ISSN
  if (issn.length == 9)
    style_content.gsub!('#ISSN#', issn)
  else
    style_content.gsub!(/^.*#ISSN#.*$\n/, '')
  end

  # optional eISSN
  if (eissn.length == 9)
    style_content.gsub!('#EISSN#', eissn)
  else
    style_content.gsub!(/^.*#EISSN#.*$\n/, '')
  end

  # save file
  style_path = "#{style_dir_path}/#{identifier}.csl"
  File.open(style_path, 'w') { |fileio| fileio.write style_content }

end
rmzelle commented 12 years ago

Some of the journals have closed up shop, so they shouldn't get a style. E.g. "Analytical Communications", of which the last issue was in 1999 (see your tab-delimited file).

cparnot commented 12 years ago

The script skips journals no longer published, so "Analytical Communications" is not included in the commit. Only 43 of the journals are left after taking the years into account.

Sent with my thumbs

On Jul 13, 2012, at 1:13 PM, "Rintze M. Zelle"reply@reply.github.com wrote:

Some of the journals have closed up shop, so they shouldn't get a style. E.g. "Analytical Communications", of which the last issue was in 1999 (see your tab-delimited file).


Reply to this email directly or view it on GitHub: https://github.com/citation-style-language/styles/issues/199#issuecomment-6974024

rmzelle commented 12 years ago

Sorry for the noise, then. I was just looking at the list of journals above.