emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: Weird interaction between ox-extra and include :minlevel
@ 2018-04-12  9:26 Daniel P. Gomez
  2018-04-12 13:28 ` Nicolas Goaziou
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel P. Gomez @ 2018-04-12  9:26 UTC (permalink / raw)
  To: emacs-orgmode

Hi all,


TLDR: Using ox-extras :IGNORE: tags break #+INCLUDE :minlevel. 
Ideally ox-extras functionality could make it into ox.


I'm using Org Mode to structure my thesis, and one of the Org 
features that I rely on the most are the #+INCLUDE derivatives.

My setup is such that I have a main thesis.org file with the 
(simplified) following contents:

-- 
#+latexclass: thesis
#+setupfile: thesis.setup
#+exclude_tags: manuscript noexport

* Chapter 1
#+INCLUDE: chap1/chapter1.org :lines "3-"

etc..
--

And I have chapter files where, e.g., the Methods section is 
formatted differently whether it is included in the main body of 
the thesis or in a manuscript:
--
#+latexclass: manuscript
#+setupfile: manuscript.setup
#+exclude_tags: thesis noexport

etc..

# For thesis, include methods directly
* Methods :thesis:
#+INCLUDE: methods.org :lines "3-"


# For paper, wrap methods into a specific control sequence and 
  adjust headline levels.
* Methods :ignore:manuscript:

#+LATEX: \matmethods{
#+INCLUDE: methods.org :lines "3-" :minlevel 2
#+LATEX: }


* Insert Methods :ignore:manuscript:
#+LATEX: \showmatmethods{}
--

I don't know if this is the cleanest setup, but it works well for 
me because I get to reuse my files.
The one issue I have with this setup, is that besides relying on 
IGNORE tags, I also rely on :minlevel to adjust the headlines. 
However, because ox-extra promotes all subtrees, it breaks 
minlevel's functionality.

Would anyone have an idea on how to fix this? Is there any 
intention of bringing ox-extra functionality into main Org? 
Something like #+ignore_tags would be a powerful addition for fine 
grained export control, in my opinion.


Thank you

-- 
Daniel P. Gomez

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Bug: Weird interaction between ox-extra and include :minlevel
  2018-04-12  9:26 Bug: Weird interaction between ox-extra and include :minlevel Daniel P. Gomez
@ 2018-04-12 13:28 ` Nicolas Goaziou
  2018-04-12 14:38   ` Daniel P Gomez
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Goaziou @ 2018-04-12 13:28 UTC (permalink / raw)
  To: Daniel P. Gomez; +Cc: emacs-orgmode

Hello,

"Daniel P. Gomez" <gomez.danp@gmail.com> writes:

> Is there any intention of bringing ox-extra functionality into main
> Org? Something like #+ignore_tags would be a powerful addition for
> fine grained export control, in my opinion.

IIRC, "ox-extra" was written because we could not agree on a definition
and an implementation of the ignore headline feature. 

I don't know what you do mean by "something like #+ignore_tags", but you
could discuss it on this ML.

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Bug: Weird interaction between ox-extra and include :minlevel
  2018-04-12 13:28 ` Nicolas Goaziou
@ 2018-04-12 14:38   ` Daniel P Gomez
  2018-04-15  7:44     ` Nicolas Goaziou
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel P Gomez @ 2018-04-12 14:38 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

I was thinking of #+ignore_tags. as an analog of #+exclude_tags. While
#+exclude_tags removes a complete subtree from export, #+ignore_tags
would only ignore headlines and insert the contents.
When used in combination, subtree would be excluded no matter what.

#+IGNORE_TAGS: ignore bar
#+EXLUDE_TAGS: noexport foo

The idea of ignore_tags, for me, would to allow grouping content
within the Org file in a manner that differs from the grouping of
content upon export - without having to resort to filter-hooks. Not
that hooks are bad, but they are harder to construct without proper
elisp skills and require knowledge about the Org API. Furthermore,
tags are excellent because they're easy to manipulate and search for.

On Thu, Apr 12, 2018 at 3:28 PM, Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:
> Hello,
>
> "Daniel P. Gomez" <gomez.danp@gmail.com> writes:
>
>> Is there any intention of bringing ox-extra functionality into main
>> Org? Something like #+ignore_tags would be a powerful addition for
>> fine grained export control, in my opinion.
>
> IIRC, "ox-extra" was written because we could not agree on a definition
> and an implementation of the ignore headline feature.
>
> I don't know what you do mean by "something like #+ignore_tags", but you
> could discuss it on this ML.
>
> Regards,
>
> --
> Nicolas Goaziou

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Bug: Weird interaction between ox-extra and include :minlevel
  2018-04-12 14:38   ` Daniel P Gomez
@ 2018-04-15  7:44     ` Nicolas Goaziou
  0 siblings, 0 replies; 4+ messages in thread
From: Nicolas Goaziou @ 2018-04-15  7:44 UTC (permalink / raw)
  To: Daniel P Gomez; +Cc: emacs-orgmode

Hello,

Daniel P Gomez <gomez.danp@gmail.com> writes:

> I was thinking of #+ignore_tags. as an analog of #+exclude_tags. While
> #+exclude_tags removes a complete subtree from export, #+ignore_tags
> would only ignore headlines and insert the contents.

You may want to read the discussions about this feature on the ML.

I think "only" is not accurate. To make it clear, what would become the
following documents:

--8<---------------cut here---------------start------------->8---
* H

Text

** H2 :ignore:

Text 2

*** H3
--8<---------------cut here---------------end--------------->8---

and

--8<---------------cut here---------------start------------->8---
Text 0

* H :ignore:

Text

** H2

Text 2
--8<---------------cut here---------------end--------------->8---

but also

--8<---------------cut here---------------start------------->8---
- item
* H :ignore:
- new list?
--8<---------------cut here---------------end--------------->8---

and the following convoluted one

--8<---------------cut here---------------start------------->8---
#+begin_example

Something

* H :ignore:

Somethin else
#+end_example
--8<---------------cut here---------------end--------------->8---

> When used in combination, subtree would be excluded no matter what.
>
> #+IGNORE_TAGS: ignore bar
> #+EXLUDE_TAGS: noexport foo

I'm not sure to understand this.

> The idea of ignore_tags, for me, would to allow grouping content
> within the Org file in a manner that differs from the grouping of
> content upon export - without having to resort to filter-hooks. Not
> that hooks are bad, but they are harder to construct without proper
> elisp skills and require knowledge about the Org API.

The manual gives one example of one such hook, see (info "(org) Advanced
configuration"). There, the filter /only/ removes headlines.

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-04-15  7:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-12  9:26 Bug: Weird interaction between ox-extra and include :minlevel Daniel P. Gomez
2018-04-12 13:28 ` Nicolas Goaziou
2018-04-12 14:38   ` Daniel P Gomez
2018-04-15  7:44     ` Nicolas Goaziou

Code repositories for project(s) associated with this 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).