emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* filter paragraph function not running
@ 2017-06-02  3:18 Samuel Wales
  0 siblings, 0 replies; only message in thread
From: Samuel Wales @ 2017-06-02  3:18 UTC (permalink / raw)
  To: emacs-orgmode

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>.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-06-02  3:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-02  3:18 filter paragraph function not running Samuel Wales

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).