unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Julien Cubizolles <j.cubizolles@free.fr>
To: help-gnu-emacs@gnu.org
Subject: Re: Question about string-match and match-string
Date: Sat, 20 Jul 2013 17:26:49 +0200	[thread overview]
Message-ID: <874nbp8d6u.fsf@free.fr> (raw)
In-Reply-To: 87ppug469b.fsf@gmx.us

Rasmus <rasmus@gmx.us> writes:

> (with-eval-after-load 'ox
>   (defun rasmus/org-latex-ignore-heading (headline backend info)
>     "Strip headline from HEADLINE if it has tag ignoreheading for
>       certain headlines.  `info' is ignored"
>     (when (and (org-export-derived-backend-p backend 'latex 'html 'ascii 'odt)
> 	       (string-match "\\`.*ignoreheading.*\n"
> 			     (downcase headline)))
>       (replace-match "" nil nil headline)))  
>
>   (add-to-list 'org-export-filter-headline-functions
> 	       'rasmus/org-latex-ignore-heading))

It's working, thanks, but it's ignored if you use tags:nil option (which
is pretty common I guess). Consider the following 

--8<---------------cut here---------------start------------->8---
#+TITLE: Titre

* First Heading                                                         :tag:
blablabla
* Second Heading                                              :ignoreheading:
blablabla
--8<---------------cut here---------------end--------------->8---

The second heading is omitted and its text is present, just like I want
it. However, you get an (in my opinion) ugly \textsc{tag} in the first
heading (\section{First Heading\hfill{}\textsc{tag}})

If however you use

--8<---------------cut here---------------start------------->8---
#+TITLE: Titre
#+OPTIONS: tags:nil

* First Heading                                                         :tag:
blablabla
* Second Heading                                              :ignoreheading:
blablabla
--8<---------------cut here---------------end--------------->8---

Both the first and second heading are displayed (not what I want).

Finally, something weird with the title: if you don't define it with de
#+TITLE, it's set to name_of_thefile$_{\text{ignoreheading}}$...

Julien.




  reply	other threads:[~2013-07-20 15:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-17  8:17 Question about string-match and match-string Suvayu Ali
2013-07-17  8:35 ` Suvayu Ali
2013-07-17  8:44   ` Rasmus
2013-07-17  8:55     ` Suvayu Ali
2013-07-18  8:00     ` Julien Cubizolles
2013-07-18  8:33       ` Rasmus
2013-07-20 15:26         ` Julien Cubizolles [this message]
2013-07-20 22:25           ` Rasmus
2013-07-21  0:41             ` Rasmus
2013-07-21  8:15               ` Julien Cubizolles
2013-07-17  8:53 ` Nicolas Richard
2013-07-17 10:02   ` Suvayu Ali

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.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874nbp8d6u.fsf@free.fr \
    --to=j.cubizolles@free.fr \
    --cc=help-gnu-emacs@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.
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).