Org-mode export to text: citations exported with HTML tags
Clash Royale CLAN TAG#URR8PPP
Org-mode export to text: citations exported with HTML tags
I am trying to generate text files from org files(originally intended for latex>PDF outputs), for submissions that require plain text.
org-file:
#+TITLE: Foo
#+latex_class: article-no-defaults
#+OPTIONS: |:nil toc:nil author:nil
#+latex_class_options: [11pt,a4paper]
#+latex_header: usepackagefontspec
#+latex_header: setmainfontTimes New Roman
#+latex_header: usepackagefloat
#+latex_header: usepackagelatexsym
#+latex_header: usepackagegraphicx
#+latex_header: usepackageurl
#+latex_header: usepackagecleveref
#+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
I tried ‘apalike’ ‘plain’ and ‘natbib’ to check if the problem persisted with different bibliography styles. When I exported this file to text(c-c c-e t U/A) in unicode and ASCII, this was the output:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
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>.
Here, the in-line references are rendered as intended, but the bibliography has HTML codes, and “date maketitle” are also being read as is(this is a problem I’ve seen in Git repos sometimes). Is there a way to generate a text file(templates, packages) with the bibliography section rendered correctly, and without at org-mode tags?
Thanks in advance.
1 Answer
1
Using pandoc together with pandoc-citeproc will get you pretty close. Pandoc doesn't understand the syntax used by org-ref, so you'd have to change the last two lines to
#+bibliography: file.bib
# OPTIONAL, uncomment if you'd like a different citation style,
# see https://citationstyles.org/.
# #+csl: <your-preferred-style>
Run pandoc by calling
pandoc YOURFILE.org --to=plain
in your terminal. Pandoc-citeproc is called automatically in the process. This will give you plain ASCII and will include a bibliography and references.
I like using ox-pandoc for this, but plain export isn't listed in the export menu by default. One can add it by configuring the
org-pandoc-menu-entry
variable.– tarleb
Aug 28 at 13:01
org-pandoc-menu-entry
And yes, pandoc-mode's dropdown offers all one needs for this.
– tarleb
Aug 28 at 13:08
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
If one has emac’s pandoc-mode, can one use the dropdown menu for this?
– rebelioustomboy
Aug 28 at 12:04