Hello, York Zhao <gtdplatf...@gmail.com> writes:
> As an example, I have the follow org-mode buffer: > > * Level1 > ** Level2 > *** Level3 > > If I export this to LaTeX (C-x C-e l p), it produces the following: > > > Contents > > 1 Level1 > 1.1 Level2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . > 1.1.1 Level3 . . . . . . . . . . . . . . . . . . . . . . . . . . . > > > Which is good. However, since what I need is that I don't want to produce the > "level1" heading, so I added the following code: > > (defun yz/org-export-ignore-headline (contents backend info) > "Ignore headlines with tag `ignoreheading'." > (when (and (org-export-derived-backend-p backend 'latex 'html 'ascii) > (string-match "\\`.*ignoreheading.*\n" (downcase contents))) > (replace-match "" nil nil contents))) > > (add-to-list 'org-export-filter-headline-functions > 'yz/org-export-ignore-headline) Don't do that at the filter level, which is too late for heavy structure editing. Use `org-export-before-parsing-hook' instead. See section 12.14 in manual for an example. Regards, -- Nicolas Goaziou