From: Nicolas Goaziou <n.goaziou@gmail.com>
To: Samuel Wales <samologist@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: footnotes export verbatim
Date: Wed, 27 Feb 2013 00:24:42 +0100 [thread overview]
Message-ID: <87621emzet.fsf@gmail.com> (raw)
In-Reply-To: <CAJcAo8sQ8axJcWLkXF_Y=dYidxZtiOcoYHA_ADWqwPTngXDJyQ@mail.gmail.com> (Samuel Wales's message of "Tue, 26 Feb 2013 15:35:38 -0700")
Hello,
Samuel Wales <samologist@gmail.com> writes:
> That doesn't seem to work for me. After a great deal of
> effort I came up with this:
>
> (add-hook 'org-export-before-parsing-hook
> 'alpha-org-export-fix-inline-footnotes)
> (defun alpha-org-export-fix-inline-footnotes (_back-end)
> "Try to get paragraphs to work in inline footnotes
> again."
> ;; this is both slow and buggy
> ;;
> ;; replace every set of blank lines in the buffer with
> ;; \par. what i really want is to do so only in
> ;; footnotes and to not squeeze multiple blank lines.
> ;;
> ;; this merely does on whole buffer:
> ;; (while (re-search-forward from nil t)
> ;; (replace-match to t))
> (alpha-replace-re-in-buffer "\\(\n[[:blank:]]*\\)*\n" "\n\\\\par\n")
> (org-footnote-normalize)
> (alpha-replace-re-in-buffer "\\\\par" "\n"))
Try the following:
#+begin_src emacs-lisp
(defun my-par-in-inline-fn (backend)
(unless (org-export-derived-backend-p backend 'latex)
(let ((org-footnote-section "My section"))
(org-footnote-normalize)
(while (re-search-forward "\\par\\s-*" nil t)
(replace-match "\n\n")))))
(add-hook 'org-export-before-parsing-hook 'my-par-in-inline-fn)
#+end_src
Regards,
--
Nicolas Goaziou
next prev parent reply other threads:[~2013-02-26 23:24 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-19 20:47 footnotes export verbatim Samuel Wales
2013-02-20 15:18 ` Nicolas Goaziou
2013-02-20 17:21 ` Samuel Wales
2013-02-20 17:32 ` Nicolas Goaziou
2013-02-20 20:13 ` Samuel Wales
2013-02-20 20:43 ` Nicolas Goaziou
2013-02-20 20:59 ` Samuel Wales
2013-02-21 14:27 ` Eric S Fraga
2013-02-23 3:08 ` Samuel Wales
2013-02-24 13:50 ` Nicolas Goaziou
2013-02-24 20:12 ` Samuel Wales
2013-02-25 8:09 ` Nicolas Goaziou
2013-02-26 22:35 ` Samuel Wales
2013-02-26 23:24 ` Nicolas Goaziou [this message]
2013-02-26 23:28 ` Nicolas Goaziou
2013-02-26 23:40 ` Samuel Wales
2013-03-19 4:13 ` Samuel Wales
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=87621emzet.fsf@gmail.com \
--to=n.goaziou@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=samologist@gmail.com \
/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).