diff --git a/README.md b/README.md index ba4b8b4805eae0ebf47211eb62ac2c5bdec2af80..78bb5cb2e0fb73ace8a787370af3b585ba75f2af 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,8 @@ default configuration is as follows: replace_strings: true join_strings: true + + use_raw_bibtex_entry: false details_dir: bibliography details_layout: bibtex.html @@ -76,6 +78,10 @@ The `source` option indicates where your bibliographies are stored; `bibliography` is the name of your default bibliography. For best results, please ensure that your Bibliography is encoded as ASCII or UTF-8. +The `use_raw_bibtex_entry` option will disable parsing of Liquid tags that +are embedded in the Bibtex fields. This option provides a way to circumvent +the problem that the double braces functionality of BibTex is accidentally +parsed by Liquid, while it was intended to keep the exact capitalization style. ### Bibliographies diff --git a/lib/jekyll/scholar/defaults.rb b/lib/jekyll/scholar/defaults.rb index cdb89b159c317b14db7a4c3ef1618a7e84e91d01..eca08ea6fed6d92c823cd596ff55ede04ece9493 100644 --- a/lib/jekyll/scholar/defaults.rb +++ b/lib/jekyll/scholar/defaults.rb @@ -23,6 +23,7 @@ module Jekyll 'details_dir' => 'bibliography', 'details_layout' => 'bibtex.html', 'details_link' => 'Details', + 'use_raw_bibtex_entry' => false, 'bibliography_class' => 'bibliography', 'bibliography_template' => '{{reference}}', diff --git a/lib/jekyll/scholar/utilities.rb b/lib/jekyll/scholar/utilities.rb index f168dc6189badbbb9e4dd848c853c7170ac3bf71..ef29ca942083d0986a38aeb207866bc3aecc9642 100644 --- a/lib/jekyll/scholar/utilities.rb +++ b/lib/jekyll/scholar/utilities.rb @@ -80,13 +80,9 @@ module Jekyll opts.on('-T', '--template TEMPLATE') do |template| @bibliography_template = template end - - opts.on('-R', '--raw_bibtex') do |raw_bibtex| - @raw_bibtex = raw_bibtex - end end - argv = arguments.split(/(\B-[cCfqptTslomAR]|\B--(?:cited(_in_order)?|file|query|prefix|text|style|template|locator|offset|max|suppress_author|raw_bibtex|))/) + argv = arguments.split(/(\B-[cCfqptTslomA]|\B--(?:cited(_in_order)?|file|query|prefix|text|style|template|locator|offset|max|suppress_author|))/) parser.parse argv.map(&:strip).reject(&:empty?) end @@ -182,7 +178,7 @@ module Jekyll end def raw_bibtex? - !!@raw_bibtex + config['use_raw_bibtex_entry'] end def repository?