浏览代码

update aastex63 to use current acknowledgments element

George C. Privon 6 年之前
父节点
当前提交
96e5bca9d6
共有 2 个文件被更改,包括 9 次插入3 次删除
  1. 3 1
      aastex63/demo.md
  2. 6 2
      aastex63/filters/acknowledgments.lua

+ 3 - 1
aastex63/demo.md

@@ -279,7 +279,7 @@ Use of such a filter would make it easier to convert the Markdown source to othe
 Simple filters are straightforward to construct and I demonstrate one here.
 With output formats besides \aastex\ in mind, the acknowledgments portion of the document has been delineated in the Markdown file as a macro: `{{acknowledgments}}`.
 However it is desirable to automatically convert this to the \TeX\ source appropriate for the journal's template.
-For \aastex\, this is the `\acknowledgments` macro.
+For \aastex\, this is the `\acknowledgments{}` macro.
 The following filter, written in lua, performs this translation when included as part of the `pandoc` invocation:
 
 ```{#ackfilter .numberLines caption="lua filter code for acknowledgements replacement"}
@@ -338,4 +338,6 @@ Comments, bug reports, and enhancements are welcome.
 
 I thank Kelly Hondula for comments on this manuscript and acknowledge support from the University of Florida.
 
+{{end_acknowledgments}}
+
 # References

+ 6 - 2
aastex63/filters/acknowledgments.lua

@@ -1,7 +1,7 @@
 --[[
 Simple pandoc filter to handle the {{acknowledgments}} macro.
 
-Copyright (C) 2018 George C. Privon
+Copyright (C) 2018-2019 George C. Privon
 
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -22,12 +22,16 @@ return {
     Str = function (elem)
         if elem.text == "{{acknowledgments}}" then
             if string.find(FORMAT, "latex") then
-                return pandoc.RawInline("tex", "\\acknowledgements")
+                return pandoc.RawInline("tex", "\\acknowledgments{")
             elseif string.find(FORMAT, "html") then
                 return pandoc.RawInline("html", "<h1>Acknowledgements</h1>")
             else
                 return elem
             end
+        elseif elem.text == "{{end_acknowledgments}}" then
+            if string.find(FORMAT, "latex") then
+                return pandoc.RawInline("tex", "}")
+            end
         end
     end,
   }