emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Using the file as 1st level headline
@ 2015-09-16 16:49 Sven Bretfeld
  2015-09-17  9:42 ` Eric S Fraga
  0 siblings, 1 reply; 8+ messages in thread
From: Sven Bretfeld @ 2015-09-16 16:49 UTC (permalink / raw)
  To: emacs-orgmode

Hi all

Is it possible to have a file header which is counted as a first level
headline? 

If that sounds weird, this is what I like to do: I'm using Bernt
Hansen's setup of orgmode for GTD (http://doc.norang.ca/org-mode.html).
In this setup a project is defined as each headline which has a TODO
keyword AND has sublevel tasks also containing a TODO keyword:

* TODO Project
** NEXT step 1
** TODO step 2
** TODO step 3

Now, I'm using org to write scientific books and articles. Therefore,
I want to use 1st level headlines as section titles for LaTeX export.
Of course, not every section is an individual project---the article in
total is the project and its doable steps are defined by inline tasks.
So, what I want to do is something like this:

,---- xy.org
| 
| #+TITLE: XY
| #+AUTHOR: Sven Bretfeld
| #+HEADLINE: TODO Write article on XY
| #+CATEGORY: XY article
| #+EXCLUDE_TAGS: noexport
| 
| * Introduction and Methodology
| Some text. Some text. Some text. Some text. Some text. Some text. Some
| text. Some text.  
| ***************************** NEXT Write summary of Smith's thesis   @office:noexport:
| ***************************** END
| Some text. Some text. Some text. Some text. Some text. Some text. Some
| text. Some text.  
| ***************************** TODO Look up other theories            @library:noexport:
| ***************************** END
|
`----

The purpose is making org-export print the pure article (no TODOs, all
headlines are sections, subsections etc.) while making org-agenda say:

,----Org Agenda
| 
| Projects
| TODO Write article on XY
| Project Next Tasks
| XY article: NEXT Write summary of Smith's thesis   @office:noexport:
| Project Subtasks
| XY article: TODO Look up other theories            @library:noexport:
| 
`----

Is that possible?

Thank you very much for any help.

Sven

-- 
Sven Bretfeld
Department of Philosophy and Religious Studies
NTNU Trondheim

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

* Re: Using the file as 1st level headline
  2015-09-16 16:49 Using the file as 1st level headline Sven Bretfeld
@ 2015-09-17  9:42 ` Eric S Fraga
  2015-09-17 17:55   ` Sven Bretfeld
  0 siblings, 1 reply; 8+ messages in thread
From: Eric S Fraga @ 2015-09-17  9:42 UTC (permalink / raw)
  To: Sven Bretfeld; +Cc: emacs-orgmode

On Wednesday, 16 Sep 2015 at 18:49, Sven Bretfeld wrote:
> Hi all
>
> Is it possible to have a file header which is counted as a first level
> headline? 

I am not sure how this relates to the rest of your email.  Can you
please expand on this?

[...]

> Now, I'm using org to write scientific books and articles. Therefore,
> I want to use 1st level headlines as section titles for LaTeX export.
> Of course, not every section is an individual project---the article in
> total is the project and its doable steps are defined by inline tasks.
> So, what I want to do is something like this:

Have you actually tried what you wrote?  What happens?

This approach is basically what I use: inline tasks for the TODO
elements but the rest of the structure is the paper with top level
headings as sections etc.  However, I note that my approach is different
in that I don't hide the inline tasks when generating the article.  I
actually export my inline tasks using the following:

#+begin_src emacs-lisp
  (defun org-latex-format-inlinetask (todo type priority name tags contents info)
    "Format an inline task element for LaTeX export."
    (let ((theinlinetask (concat todo " " name ": " contents)))
      (format "\\footnote{%s}\\marginpar{\\fbox{\\tiny\\thefootnote. %s}}" theinlinetask todo)))
  (setq org-latex-format-inlinetask-function 'org-latex-format-inlinetask)
#+end_src

Is the issue, in your case, that the noexport tag on the inlinetasks is
ignored?  If so, you could simply define the org-latex-format-inlinetask
function I have above to do nothing?

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.50.2, Org release_8.3.1-234-g8c85c9

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

* Re: Using the file as 1st level headline
  2015-09-17  9:42 ` Eric S Fraga
@ 2015-09-17 17:55   ` Sven Bretfeld
  2015-09-18  7:54     ` Eric S Fraga
  2015-09-19 10:25     ` Suvayu Ali
  0 siblings, 2 replies; 8+ messages in thread
From: Sven Bretfeld @ 2015-09-17 17:55 UTC (permalink / raw)
  To: Eric S Fraga; +Cc: emacs-orgmode

Hi Eric

Eric S Fraga writes:

> On Wednesday, 16 Sep 2015 at 18:49, Sven Bretfeld wrote:

>> Is it possible to have a file header which is counted as a first level
>> headline? 
>
> I am not sure how this relates to the rest of your email.  Can you
> please expand on this?

I should have been more clear. The problem is the project definition. It
will become clear below.

>> Now, I'm using org to write scientific books and articles. Therefore,
>> I want to use 1st level headlines as section titles for LaTeX export.
>> Of course, not every section is an individual project---the article in
>> total is the project and its doable steps are defined by inline tasks.
>> So, what I want to do is something like this:
>
> Have you actually tried what you wrote?  What happens?

If I do it that way, each inline-task is treated as a standalone task,
not as subtask of a larger project. One of the strengths of Bernt
Hansen's setup is the possibility to narrow down the agenda to a
specific project and have only its next steps and other subtasks
displayed. A project is defined as a headline with TODO keyword which
has at least one sublevel headline also containing a TODO keyword. An
inline-task inside a standard article structure has no higher level task
which would count as the project subsuming the inline-tasks as subtasks.

At the moment I'm using this solution:

* TODO Introduction
  Text.
********************* NEXT Something 1
********************* END

* TODO Chapter 1
  Text.
******************** TODO Something 2
******************** END

But this makes "Introduction" and "Chapter 1" individual projects and
assigns a single subtask to each named "Something 1" and "Something 2".
For a book this can easily sum up to 20 different "projects" (i.e.
chapters) which mess up the agenda-view and the work-flow. What would
work is:

* TODO Write book on XY
** Introduction
   Text.
********************* NEXT Something 1
********************* END

** Chapter 1
   Text.
******************** TODO Something 2
******************** END
   
But this collides with the export, as it turns the chapters into
subchapters. So "Introduction" would be 1.1 instead of 1. Furthermore,
this is confusing while working on the file. Therefore I was asking if
it's possible to assign a TODO keyword to the file itself via a header
which would, then, play the role of the project definition subsuming the
inline-tasks as subtasks.

The only other way would be a redefinition of what a project is. But my
lisp knowledge is by far overstrained with this. Basically I'm happy
with the TODO-subTODO approach. So it must be a complimentary definition
saying basically: "All TODO lines in file xy.org are treated as subtasks
to the project `Write book on XY'".

> Is the issue, in your case, that the noexport tag on the inlinetasks is
> ignored?  If so, you could simply define the org-latex-format-inlinetask
> function I have above to do nothing?

No, that's not the problem. I, too, include them in the export when I
need them printed. Sorry, I should have been more clear in the first
mail.

Thanks for help,

Sven

-- 
Sven Bretfeld
Department of Philosophy and Religious Studies
NTNU Trondheim

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

* Re: Using the file as 1st level headline
  2015-09-17 17:55   ` Sven Bretfeld
@ 2015-09-18  7:54     ` Eric S Fraga
  2015-09-19  9:05       ` Sven Bretfeld
  2015-09-19 10:25     ` Suvayu Ali
  1 sibling, 1 reply; 8+ messages in thread
From: Eric S Fraga @ 2015-09-18  7:54 UTC (permalink / raw)
  To: Sven Bretfeld; +Cc: emacs-orgmode

On Thursday, 17 Sep 2015 at 19:55, Sven Bretfeld wrote:

[...]

> I should have been more clear. The problem is the project definition. It
> will become clear below.

Thanks for the clarification.  I understand what you are trying to
achieve.  I may not be able to help much, unfortunately.  Except:

[...]

> What would work is:
>
> * TODO Write book on XY
> ** Introduction
>    Text.
> ********************* NEXT Something 1
> ********************* END

Have you looked at exporting the sub-tree?  If you define the
appropriate EXPORT_xxx properties in the sub-tree, it should be
equivalent to having that sub-tree as a file alone.  Check the export
options at the top of the help window when you type "C-c C-e ?"

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.5.1, Org release_8.3.1-203-g4ca3d3

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

* Re: Using the file as 1st level headline
  2015-09-18  7:54     ` Eric S Fraga
@ 2015-09-19  9:05       ` Sven Bretfeld
  0 siblings, 0 replies; 8+ messages in thread
From: Sven Bretfeld @ 2015-09-19  9:05 UTC (permalink / raw)
  To: Eric S Fraga; +Cc: emacs-orgmode

Eric S Fraga writes:

> On Thursday, 17 Sep 2015 at 19:55, Sven Bretfeld wrote:
>
> [...]
>
> Have you looked at exporting the sub-tree?  If you define the
> appropriate EXPORT_xxx properties in the sub-tree, it should be
> equivalent to having that sub-tree as a file alone.  Check the export
> options at the top of the help window when you type "C-c C-e ?"

Hmm. Not sure how this is actually working. (By the way C-c C-e ? does
not work for me [orgmode 8.3.1 on Emacs 24.5.1, ArchLinux]). What I have
tried now:

,----test.org
| 
| * TODO Write Article on Test
| ** Title of the Article
| *** First Chapter
| **** First Section of First Chapter
|      Some Text. Some Text. Some Text. Some Text. Some Text. Some Text. Some
|      Text. Some Text. Some Text. Some Text.  Some Text. Some Text. Some
|      Text.  
| *************** NEXT Find books on tests             :@library:
| *************** END
| 
`----

This works if I export the subtree with the mark somewhere in the 2nd
line. Otherwise the export would be reduced to the subtree I'm in. The
2nd line must necessarily contain the article title. This makes the
#+TITLE header superfluous.

I could live with such a structure. Even if it means that the first
level of sectioning corresponds to the third org level. What annoys me
more, is the necessity to jump to the 2nd line of the file before doing
an export. Is there a way around this? Maybe by configuring which
subtree to export, no matter where the mark currently is? Is that what
you meant with the EXPORT property definition?

Anyway, thanks for your help. You brought me a good step further. The
rest is a matter of making the solution more convenient.

Sven

-- 
Sven Bretfeld
Department of Philosophy and Religious Studies
NTNU Trondheim

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

* Re: Using the file as 1st level headline
  2015-09-17 17:55   ` Sven Bretfeld
  2015-09-18  7:54     ` Eric S Fraga
@ 2015-09-19 10:25     ` Suvayu Ali
  2015-09-19 10:59       ` Sven Bretfeld
  2015-09-21  8:25       ` Eric S Fraga
  1 sibling, 2 replies; 8+ messages in thread
From: Suvayu Ali @ 2015-09-19 10:25 UTC (permalink / raw)
  To: emacs-orgmode

On Thu, Sep 17, 2015 at 07:55:07PM +0200, Sven Bretfeld wrote:
> 
> * TODO Write book on XY
> ** Introduction
>    Text.
> ********************* NEXT Something 1
> ********************* END
> 
> ** Chapter 1
>    Text.
> ******************** TODO Something 2
> ******************** END

If you are using latex export, you should be able to get the above
structure to work with a custom latex-class.  Here is an example:

(add-to-list 'org-latex-classes
	     '("withtodos" "\\documentclass[11pt]{scrreprt}"
	       ("%%%% %s" . "%%%% %s")
	       ("\\chapter{%s}" . "\\chapter*{%s}")
	       ("\\section{%s}" . "\\section*{%s}")
	       ("\\subsection{%s}" . "\\subsection*{%s}")
	       ("\\subsubsection{%s}" . "\\subsubsection*{%s}")))

This will insert the top level headline as a comment.

-- 
Suvayu

Open source is the future. It sets us free.

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

* Re: Using the file as 1st level headline
  2015-09-19 10:25     ` Suvayu Ali
@ 2015-09-19 10:59       ` Sven Bretfeld
  2015-09-21  8:25       ` Eric S Fraga
  1 sibling, 0 replies; 8+ messages in thread
From: Sven Bretfeld @ 2015-09-19 10:59 UTC (permalink / raw)
  To: Suvayu Ali; +Cc: emacs-orgmode


Suvayu Ali writes:

> On Thu, Sep 17, 2015 at 07:55:07PM +0200, Sven Bretfeld wrote:
>> 
>> * TODO Write book on XY
>> ** Introduction
>>    Text.
>> ********************* NEXT Something 1
>> ********************* END
>> 
>> ** Chapter 1
>>    Text.
>> ******************** TODO Something 2
>> ******************** END
>
> If you are using latex export, you should be able to get the above
> structure to work with a custom latex-class.  Here is an example:
>
> (add-to-list 'org-latex-classes
> 	     '("withtodos" "\\documentclass[11pt]{scrreprt}"
> 	       ("%%%% %s" . "%%%% %s")
> 	       ("\\chapter{%s}" . "\\chapter*{%s}")
> 	       ("\\section{%s}" . "\\section*{%s}")
> 	       ("\\subsection{%s}" . "\\subsection*{%s}")
> 	       ("\\subsubsection{%s}" . "\\subsubsection*{%s}")))
>
> This will insert the top level headline as a comment.

This is great! I'd have never thought about this. Works perfectly.

Thank you very much

Sven

-- 
Sven Bretfeld
Department of Philosophy and Religious Studies
NTNU Trondheim

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

* Re: Using the file as 1st level headline
  2015-09-19 10:25     ` Suvayu Ali
  2015-09-19 10:59       ` Sven Bretfeld
@ 2015-09-21  8:25       ` Eric S Fraga
  1 sibling, 0 replies; 8+ messages in thread
From: Eric S Fraga @ 2015-09-21  8:25 UTC (permalink / raw)
  To: emacs-orgmode

On Saturday, 19 Sep 2015 at 12:25, Suvayu Ali wrote:

[...]

> If you are using latex export, you should be able to get the above
> structure to work with a custom latex-class.  Here is an example:
>
> (add-to-list 'org-latex-classes
> 	     '("withtodos" "\\documentclass[11pt]{scrreprt}"
> 	       ("%%%% %s" . "%%%% %s")

cute!  Love it.  Definitely out of the box thinking.
-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.50.2, Org release_8.3.1-234-g8c85c9

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

end of thread, other threads:[~2015-09-21  8:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-16 16:49 Using the file as 1st level headline Sven Bretfeld
2015-09-17  9:42 ` Eric S Fraga
2015-09-17 17:55   ` Sven Bretfeld
2015-09-18  7:54     ` Eric S Fraga
2015-09-19  9:05       ` Sven Bretfeld
2015-09-19 10:25     ` Suvayu Ali
2015-09-19 10:59       ` Sven Bretfeld
2015-09-21  8:25       ` Eric S Fraga

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).