In org-mode how to break current section and escape to upper level - emacs

In org-mode, normal hierarchy goes like :
* Section 1
Content of section 1
** Section 1-1
Content of section 1-1
** Section 1-2
Content of section 1-2
As I understand it, everything after a header belongs to that section until it meets another (higher or lower) header.
But is it possible to break the current section without using another header, and to continue the content of the previous section? Something like :
* Section 1
Content of section 1
** Section 1-1
Content of section 1-1
** Section 1-1 end
Content of section 1 continues ...
** Section 1-2
Content of section 1-2
** Section 1-2 ends
Content of section 1 continues ...

There has been a long discussion in org-mode mailing list on this same issue.
Several proposals, but at the end, the need for simplicity and compatibility with LaTeX, DocBook and traditional book/article structures seem more important than allowing for content continuation after subheadings.
Also, content continuation after subheading sections end is in general not obvious to the reader.
One of the workarounds proposed is using lists as the sub-content. This is quite clear in the markup, and also for the reader.

Related

Emacs Org-Mode: Reset Line Indention Within org-indent-mode

I love Emacs and Org-Mode. But I can only stand to use Org Mode in the clean view (or whatever it's called - with org-indent-mode on).
My problem is that I often want to use headers that don't have a bullet in front of them. I want one asterisk to be the start of the list, not the header.
Example:
List 1
List 2
Header 1
List 3
List 4
But when I try to do this, Header 1 gets indented to the level of List 2.
I know just turning off org-indent-mode and getting used to that is one solution. But is there a way to reset the indentation for Header 1?
The things you are talking about changing are pretty fundamental to org-mode; basically you are trying to change the org-mode syntax. The reason why Header 1 in your example is not being dedented, is that org-mode does not see it as a headline, because headlines by definition start with leading stars. Also, while it is technically supported to use * to identify a plain list item, this is not recommended, and can cause some unexpected behavior (see footnote 1 here).
That being said, you can have some control over the appearance of headlines. For example, you can use the org-bullets package. You can then define the bullets to use in place of * like this:
(setq org-bullets-bullet-list
'("◉" "◎" "⚫" "○" "►" "◇"))
which will define the bullets used for the first six levels of headlines. You can replace the bullets in that list with other utf-8 symbols, and you can even use " " as one of the symbols, so that your Headlines will be preceded by a single space. However, note that this only affects the way headlines are displayed; they will still be preceded by * in the actual file.
I know it is not very helpful, but my overall suggestion would be to stick with the org-mode syntax if you want to use org-mode, i.e., use a structure like this:
- List one
- List two
* Header 1
- List three
- List four
with * starting a headline, and - starting a plain list. Since org-mode files are just plain text, the magic of that mode depends heavily on those files having a set structure. In my own experience, if you try to change that structure (another example is changing timestamp formats), it will cause more headaches than it relieves, and cause a lot of the functionality that makes org-mode so great to break.
Just as a side note: I prefer a cleaner view as well, and one option I like to enable in addition to org-indent-mode is (setq org-hide-leading-stars t), which will display only a single star/bullet per headline (although the leading stars will still be present in the actual text file).

Can I "fix" heading levels in rST on GitHub?

On GitHub, in a .md file I'm able to specify heading levels that are respected in they way they are displayed on there, but my .rst files are not: the "highest" level heading is treated as a level 1 heading,
For example,
## Heading
Stuff
## Sub-heading
More stuff
in a .md will treat the first as a second-level heading and the second as a third-level heading, while its equivalent (e.g as generated by pandoc),
Heading
-------
Stuff
Sub-heading
~~~~~~~~~~~
More stuff
is treated as a first-level and second-level headings.
Is there a way to overcome this? Can I "fix" the heading level in rST, at as GitHub interprets it?
No, this is not possible.
Docutils does not allow header levels to be skipped. In fact, it will crash hard on inconsistently nested levels. Additionally, here is no hard rule for which characters in the ReST syntax represent which level. It is simply assumed that they appear in the order they are found (the inconsistency comes when you step back up, then down again -- it is assumed that you use the same pattern going back down). Therefore, the first header is always a level 1 header (<h1>) regardless of which character you use. However, in Markdown the levels are explicit in the syntax. If a user starts with ### Header, then that first header in the document must be level 3 (<h3>). Under the hood, Docutils has no mechanism for retaining that info. It only knows whether a header is the "next higher" or "lower" level in consecutive order.

How to create a multi-level ordered (numbered) plain list in org-mode?

In org-mode, if I have an ordered list such as
first item
second item
third item
fourth item
and I demote an item, the demoted item is automatically renumbered restarting from 1:
first item
second item
third item
fourth item
Is there a way to make org-mode (or emacs in general) to automatically renumber demoted items like when using legal numbering?
I mean this:
first item
second item
2.1. third item
2.1.1. fourth item
Org-mode doesn't currently provide this functionality, and nor, to my knowledge, does any existing minor mode. The only emacs package I'm aware of which does is hyperbole, whose koutline module (here is an example-document, exported to html) provides an impressive suite of outline-editing tools, and supports hierarchical legal numbering.
(koutline also supports "klinks" between numbered paragraphs which refer to an invariant ID assigned to each paragraph on creation, so that the links remain valid even if one moves a paragraph from its original position in the document hierarchy.)
Unfortunately koutline is incompatible with org-mode. It does have a rudimentary HTML-export, but this is unlikely, in its present form, to satisfy anyone used to the wide range of export options provided by org-export. Nevertheless, depending on your use-case, koutline might be an adequate tool.
Org-mode's built-in list styles include
unordered lists, using -, + or *,
ordered lists, using 1. or 1), and
definition lists, using :: to separate terms from definitions.
You can cycle a given list between these styles using S-left and S-right.
There are a number of forum posts and mailing list entries asking for legal numbering, but unfortunately I don't think it's supported.
I can create a multi-level lists with:
1. Step 1
1. Substep 1
1. Substep 2
1. Step 2
1. Step 3
When rendered in Gitea, it will use different number systems for the two levels, e.g. "1,2,3" or "i,ii,iii".

How to maintain notes organized with org-mode?

I have a bunch of papers to read and taking notes. The problem is I don't have much time to spend looking for a way to organize my note taking system. For me emacs org-mode seems to be a quite powerfull solution, and pretty straightforward.
I encounter another problem, how can I keep my notes organized with a single file, in a way that I can rapidly access all the notes?
Since you're short time, you might do well to start with a simple system in which you can capture the notes you need to take, and worry later about organization. Consider the following:
* Title of a paper
** First section name
- A note
- Another note
** Second section name
- Yet another note
- A fourth note
- A fifth note
* Title of another paper
** First section name
- Yet more notes
** Second section name
- &c., &c.
Using paper titles as top-level section headings makes it easy to navigate among papers with isearch; C-s Title of a paper RET brings you to the section containing all your notes on that paper. From there, you can search for a section title, or just use TAB on headings to fold and unfold until you're looking at what you want.
Unless I've misunderstood your requirement, that should give you a pretty quick and straightforward way to dive in and start taking your notes, without losing navigability. That'll also give you an opportunity for some initial, shallow exploration of the problem domain; then, once you've gotten past the current glut of work and have time to think about how you want your note-taking system to work, you can explore the problem more deeply, using org-mode's quick outline rearrangement tools at need to turn the scheme you've got into the scheme you need.

Replace empty lines with a Heading style with Normal style

I'm in the process of updating a heap of manuals which for whatever reason have Heading Formats applied to them. The empty lines sometimes appear in the table of contents which is annoying the end recipients somewhat.
The documents have a mix of styles I need to replace, ie the Paragraphs in the boxes below, but I can't work out a way to find an empty line with a specific style that may or may not differ from the previous line.
I'm getting the impression it's not doable but thought I'd ask here before doing it manually. The main effect is on navigation but occasionally TOC, usually when compatibility is maintained.