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