组织模式导出为文本:使用 HTML 标签导出的引文

Org-mode export to text: citations exported with HTML tags

我正在尝试从 org 文件(最初用于乳胶>PDF 输出)生成文本文件,用于需要纯文本的提交。

组织文件:

#+TITLE: Foo

#+latex_class: article-no-defaults
#+OPTIONS: |:nil toc:nil author:nil
#+latex_class_options: [11pt,a4paper]
#+latex_header: \usepackage{fontspec}
#+latex_header: \setmainfont{Times New Roman}
#+latex_header: \usepackage{float}
#+latex_header: \usepackage{latexsym}
#+latex_header: \usepackage{graphicx}
#+latex_header: \usepackage{url}
#+latex_header: \usepackage{cleveref}

#+EXPORT_EXCLUDE_TAGS: noexport
#+DRAWERS: NOTES
\date{}
\maketitle

*Document Begins
text text

sentence 1 cite:Ohala1997. sentence 2 cite:Ohala1983, cite:Ham1998. Previous studies on sentence 3 cite:hankamer1988, cite:Ghosh2015, cite:banerjee2018.  sentence 4 cite:recasens1997. sentence 5 cite:banerjee2018.

bibliography:file.bib
bibliographystyle:plain

我尝试了“apalike”“plain”和“natbib”来检查问题是否仍然存在于不同的参考书目风格中。当我将此文件导出为 unicode 和 ASCII 文本 (c-c c-e t U/A) 时,输出如下:

       ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
           Foo
       ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━


\date{} \maketitle

sentence 1 [Ohala1997]. sentence 2 [Ohala1983], [Ham1998]. Previous studies on sentence 3 [hankamer1988], [Ghosh2015], [banerjee2018].  sentence 4 [recasens1997]. sentence 5 [banerjee2018].

Bibliography ============= [Ohala1997] John Ohala, Aerodynamics of
phonology, <i>{Proc. 4th Seoul International Conference on Linguistics
[SICOL]}</i>, <b>()</b>, 92--97 (1997). <a href="">link</a>. <a
href="http://dx.doi.org/">doi</a>.  [Ohala1983] John Ohala, PHONETIC
EXPLANATIONS FOR SOUND PATTERNS: IMPLICATIONS FOR GRAMMARS OF
COMPETENCE., <i>{Historical linguistics: Problems and perspectives}</i>,
<b>()</b>, 237--278 (1993). <a href="">link</a>. <a
href=“http://dx.doi.org/">doi</a>.

在这里,内联引用按预期呈现,但参考书目有 HTML 代码,并且“\date{} \maketitle”也按原样读取(这是我的问题有时在 Git 回购中看到过)。有没有一种方法可以生成一个文本文件(模板、包),其中的参考书目部分可以正确呈现,并且没有 at org-mode 标签?

提前致谢。

pandoc 与 pandoc-citeproc 一起使用将使您非常接近。 Pandoc 不理解 org-ref 使用的语法,所以你必须将最后两行更改为

#+bibliography: file.bib
# OPTIONAL, uncomment if you'd like a different citation style,
# see https://citationstyles.org/.
# #+csl: <your-preferred-style>

运行 pandoc 通过调用

pandoc YOURFILE.org --to=plain

在您的终端中。 Pandoc-citeproc 在这个过程中被自动调用。这将为您提供纯 ASCII 码并包括参考书目和参考文献。