emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Samuel Wales <samologist@gmail.com>
To: emacs-orgmode@gnu.org
Subject: filter paragraph function not running
Date: Thu, 1 Jun 2017 20:18:46 -0700	[thread overview]
Message-ID: <CAJcAo8t58LJowaedDMAtdn+Nx2CAbn9SVXryFRqmQ7r6vyTixA@mail.gmail.com> (raw)

this is probably user error.

in md output i don't think this is being run and i am not sure why.
in odt, it doesn't work but i am not sure why.

finally, does anybody know a quick way to get paragraphs to look like
i do them instead of indenting the first line and not putting a blank
line, for pdf output?

thanks.

  (add-to-list 'org-export-filter-paragraph-functions
'alpha-org-export-===-rule--par)
  (defun alpha-org-export-===-rule--par (paragraph backend _info)
    "Reverse the new exporter emphasis to get my === back as a
horizontal rule that separates paragraphs with blanks above and below."
    ;; runs after === is converted.  (from the code-font
    ;; interpretation to the backend.)
    (with-no-warnings
      (cond
        ((and (org-export-derived-backend-p backend 'html)
              (or
               (string-match "<p
class=\"footpara\">\n<code>=</code>\n</p>\n*" paragraph)
               (string-match "<p>\n<code>=</code>\n</p>\n*" paragraph)))
         "\n\n<hr width=\"10%\"
style=\"width:10%;color:#000;background-color:#000;height:1px;border:none\"/>\n\n")
        ;; fixme notwork
        ((org-export-derived-backend-p backend 'md)
         (replace-string "`=`" "==="))
        ((org-export-derived-backend-p backend 'odt)
         ;; untested
         (replace-string "<text:span text:style-name=\"OrgCode\">=</text:span>"
                         "<text:span
text:style-name=\"OrgCode\">===</text:span>"))
        ((org-export-derived-backend-p backend 'latex)
         ;; =fact re string needs \\\\, but string needs \\
         ;; (replace-regexp-in-string "\\\\hi" "there" "\\hi" t t)
         ;; (replace-regexp-in-string "\\\\hi{=}" "there" "\\hi{=}" t t)
         ;; seems to work
         (replace-regexp-in-string "\\\\texttt{=}"

"\\\\hspace{\\\\stretch{1}}\\\\rule{0.15\\\\textwidth}{0.1pt}\\\\hspace{\\\\stretch{1}}"
                                   ;; "\\\\centerline{\\\\rule
{0.15\\\\linewidth}{.2pt}}"
                                   paragraph))
        ((and (org-export-derived-backend-p backend 'ascii)
              (string-match "^`='$" paragraph))
         "===\n\n")
        (t paragraph))))

-- 
The Kafka Pandemic: <http://thekafkapandemic.blogspot.com>

The disease DOES progress. MANY people have died from it. And ANYBODY
can get it at any time.

"You’ve really gotta quit this and get moving, because this is murder
by neglect." ---
<http://www.meaction.net/2017/02/03/pwme-people-with-me-are-being-murdered-by-neglect>.

                 reply	other threads:[~2017-06-02  3:18 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=CAJcAo8t58LJowaedDMAtdn+Nx2CAbn9SVXryFRqmQ7r6vyTixA@mail.gmail.com \
    --to=samologist@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).