emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Lele Gaifax <lele@metapensiero.it>
To: emacs-orgmode@gnu.org
Subject: Re: latex-export + columnview: misinterpretation of section prefixes as emphasis
Date: Wed, 22 Jun 2016 20:45:22 +0200	[thread overview]
Message-ID: <87y45xgj0d.fsf@metapensiero.it> (raw)
In-Reply-To: 20100531033853.GD27574@soloJazz.com

Hi all,

I know this is an ancient thread, but it seems the problem is still there, in
Emacs 25.

FWIW, this is my quick and dirty fix, that at least produce a readable output,
in Emacs as well as in the PDF output.

    (require 'org-colview)

    ;; Quick&dirty workaround to http://article.gmane.org/gmane.emacs.orgmode/25821: replace
    ;; asterisks with some other character in the table automatically built by org-colview, because
    ;; when the table is exported to LaTeX they are misinterpreted as emphasis markup, resulting in
    ;; an unreadable hierarchy.

    (defun esk/org-replace-section-prefix (s)
      "Replace asterisks in  Org heading with em-dashes."
      (when (string-match org-outline-regexp-bol s)
        (setq s (replace-match
                 (concat (make-string (- (match-end 0) (match-beginning 0) 1) ?—)
                         " ")
                 t t s)))
      s)

    (defun org-listtable-to-string (tbl)
      "Convert a listtable TBL to a string that contains the Org-mode table.
    The table still need to be aligned.  The resulting string has no leading
    and trailing newline characters."
      (mapconcat
       (lambda (x)
         (cond
          ((listp x)
           (concat "|" (esk/org-replace-section-prefix (mapconcat 'identity x "|")) "|"))
          ((eq x 'hline) "|-|")
          (t (error "Garbage in listtable: %s" x))))
       tbl "\n"))

Of course I'll be happy to hear about any better way to do it!

ciao, lele.
-- 
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
lele@metapensiero.it  |                 -- Fortunato Depero, 1929.

  parent reply	other threads:[~2016-06-22 18:45 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-31  3:38 latex-export + columnview: misinterpretation of section prefixes as emphasis Juan Pechiar
     [not found] ` <D96E521D-17DE-4725-AD9A-363522C9B1E9@tsdye.com>
     [not found]   ` <20100531130409.GE27574@soloJazz.com>
2010-05-31 16:57     ` Thomas S. Dye
2010-06-01  7:32 ` Carsten Dominik
2010-06-01 10:51   ` Tim Burt
2010-06-01 13:34     ` Carsten Dominik
2010-06-01 14:52       ` tcburt
2016-06-22 18:45 ` Lele Gaifax [this message]
2016-06-22 19:56   ` Nicolas Goaziou
2016-06-22 20:16     ` Lele Gaifax
2016-06-22 20:46       ` Nicolas Goaziou
2016-06-23  6:36         ` Lele Gaifax
2016-06-24  9:38           ` Nicolas Goaziou
2016-06-24 12:08             ` Lele Gaifax
2016-06-24 12:26               ` [PATCH] org-colview.el: Fix typo in function name Lele Gaifax
2016-06-24 12:49                 ` Nicolas Goaziou
2016-06-24 13:06                   ` Lele Gaifax
2016-06-24 14:01                     ` Nicolas Goaziou
2016-06-24 12:47               ` latex-export + columnview: misinterpretation of section prefixes as emphasis Nicolas Goaziou
2016-06-24 13:03                 ` Lele Gaifax

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=87y45xgj0d.fsf@metapensiero.it \
    --to=lele@metapensiero.it \
    --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).