emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] filter paragraph function not running


From: Samuel Wales
Subject: [O] filter paragraph function not running
Date: Thu, 1 Jun 2017 20:18:46 -0700

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 via email to

[Prev in Thread] Current Thread [Next in Thread]