emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Rob Stewart <robstewart57@gmail.com>
To: Rob Stewart <robstewart57@gmail.com>, emacs-orgmode@gnu.org
Subject: Re: Fwd: Don't treat [n] as a footnote, and export "[n]"
Date: Thu, 23 Apr 2015 20:49:08 +0100	[thread overview]
Message-ID: <CA+ZOas+VpBLOg7qgwCz-npoB-1O8r9_Ay2Bs2F63JLfgQ1GmoA@mail.gmail.com> (raw)
In-Reply-To: <87lhhi1vm0.fsf@nicolasgoaziou.fr>

Hi Nicolas,

For the last line:

(add-to-list org-export-filter-parse-tree-functions #'my-ignore-false-footnotes)

I'm getting

Debugger entered--Lisp error: (wrong-type-argument symbolp
(org-bibtex-merge-contiguous-citations org-bibtex-process-bib-files))
  add-to-list((org-bibtex-merge-contiguous-citations
org-bibtex-process-bib-files) my-ignore-false-footnotes)
  eval((add-to-list org-export-filter-parse-tree-functions (function
my-ignore-false-footnotes)) nil)
  eval-last-sexp-1(nil)
  eval-last-sexp(nil)
  call-interactively(eval-last-sexp nil nil)
  command-execute(eval-last-sexp)

? Thanks,

--
Rob


On 23 April 2015 at 20:40, Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:
> Hello,
>
> Rob Stewart <robstewart57@gmail.com> writes:
>
>> And just as soon as I send this email, I find the answer:
>
> [num] syntax for footnotes is indeed a pain.
>
> However, the solution below is really a kludge because some parts of Org
> (or external libraries) could hard-code it anyway.
>
>> (setq org-footnote-re
>>       (concat "\\[\\(?:"
>>           ;; Match inline footnotes.
>>           (org-re "fn:\\([-_[:word:]]+\\)?:\\|")
>>           ;; Match other footnotes.
>>           ;; "\\(?:\\([0-9]+\\)\\]\\)\\|"
>>           (org-re "\\(fn:[-_[:word:]]+\\)")
>>           "\\)"))
>>
>> (setq org-footnote-definition-re
>>       (org-re "^\\[\\(fn:[-_[:word:]]+\\)\\]"))
>>
>> From http://stackoverflow.com/a/25342297/1526266 .
>
> From an export perspective, you can turn these footnotes back into
> regular text at the parse tree level:
>
> --8<---------------cut here---------------start------------->8---
> (defun my-ignore-false-footnotes (ast backend info)
>   (org-element-map ast 'footnote-reference
>     (lambda (f)
>       (let ((label (org-element-property :label f)))
>         (when (org-string-match-p "\\`[0-9]+\\'" label)
>           (org-element-set-element
>            f
>            (concat "[" label "]"
>                    (make-string (org-element-property :post-blank f) ?\s)))))))
>   ast)
>
> (add-to-list org-export-filter-parse-tree-functions #'my-ignore-false-footnotes)
> --8<---------------cut here---------------end--------------->8---
>
>
> Regards,
>
> --
> Nicolas Goaziou

  reply	other threads:[~2015-04-23 19:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-23 19:10 Don't treat [n] as a footnote, and export "[n]" Rob Stewart
2015-04-23 19:27 ` Fwd: " Rob Stewart
2015-04-23 19:40   ` Nicolas Goaziou
2015-04-23 19:49     ` Rob Stewart [this message]
2015-04-23 19:53       ` Nicolas Goaziou
2015-04-23 20:03         ` Rob Stewart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CA+ZOas+VpBLOg7qgwCz-npoB-1O8r9_Ay2Bs2F63JLfgQ1GmoA@mail.gmail.com \
    --to=robstewart57@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).