emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@gmail.com>
To: edgar@openmail.cc
Cc: Org Mode List <emacs-orgmode@gnu.org>
Subject: Re: Ignore, skip, omit headline when exporting to LaTeX
Date: Fri, 08 Jul 2022 13:04:29 +0800	[thread overview]
Message-ID: <87r12w2o0y.fsf@localhost> (raw)
In-Reply-To: <20220707200001.Horde.GlDjC8rChDMguFW-x0ZUKIp@www.vfemail.net>

edgar@openmail.cc writes:

> Firstly, do tell me if I am breaking the nettiquete.

This is on topic and can be useful for others without knowing the
context of the mentioned discussion. So, there should be no issue with
posting this here, especially if you provide sufficient context.

> I found someone asking online how to ignore a headline when exporting  
> to LaTeX. This e-mail is to avoid creating an account on that forum  
> and to provide a solution.
>
> (require 'ox-extra)
>
>    (defun org-export-ignore-headlines-latex (data backend info)
>      "Hack of `org-export-ignore-headlines' for LaTeX: add a  
> conditional for the latex backend and replace 'ignore' with 'ignoreltx'"
>      (when (org-export-derived-backend-p backend 'latex)
>        (org-element-map data 'headline
>          (lambda (object)
>            (when (member "ignoreltx" (org-element-property :tags object))
> ...
>              (org-element-extract-element object)))
>          info nil)
>        data))

Note that this modified version of the function is derived from
org-export-ignore-headlines from ox-extra.el [1]
However, a part of the original function code is omitted.
AFAIU, this version also discards the headline contents, in addition to
the headline itself (unlike what org-export-ignore-headlines does).

Note that discarding headline + contents is also supported using
:NOEXPORT: tag.

[1] https://git.sr.ht/~bzg/org-contrib

Best,
Ihor


  reply	other threads:[~2022-07-08  5:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-07 20:00 Ignore, skip, omit headline when exporting to LaTeX edgar
2022-07-08  5:04 ` Ihor Radchenko [this message]
2022-07-08  8:51   ` edgar
2022-07-14 15:29   ` Max Nikulin

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=87r12w2o0y.fsf@localhost \
    --to=yantar92@gmail.com \
    --cc=edgar@openmail.cc \
    --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).