How to create sub-headers in org-mode (emacs)? - emacs

Hello I was wondering how to create sub-headers in an org document. I have tried this:
* header
* sub-header
Some text
The * works for the header part but will create bullets instead of sub-headers.

for these kind of questions the org-manual is the best place to check: https://orgmode.org/org.html#Headlines
Headlines define the structure of an outline tree. The headlines in Org start with one or more stars, on the left margin3. For example:
* Top level headline
** Second level
*** Third level
some text
*** Third level
more text
* Another top level headline
Hope, this helps!

As a supplement to the answer by #sanenr9, you can also enable a "clean view" that hides all but the last star in a heading if you prefer (see A Cleaner Outline View): the asterisks are still there in the buffer but they are hidden using an overlay.
Another useful hint is to examine the "Org" entry in the menu: there are many useful commands there (generally with a keyboard shortcut as well). E.g. you can add a new heading at the same level as the previous heading by clicking on the "New Heading" entry in the "Org" menu and you can then make it into a subheading by clicking on
"Org/Edit Structure/Demote heading" menu item (or you can use the indicated keyboard shortcut M-<right> which is done by holding down the Meta key and pressing the right arrow key.)

Related

MSWORD2016: How do I force Table of Contents to identify a custom style as a heading?

I started with the minimalist table of contents title style, in other words based on the ToC Heading template. The important aspect is this template creates a vertical bar to the left of the title (picture below).
I would like to reproduce this for all of my headings throughout my document. My conundrum is the following:
As the base style is ToC Heading and not Heading 1, the table of contents will not reference it.
When I modify the base style from ToC Heading to Heading 1, the table of contents will naturally reference it; however, the vertical bar to the left of the title name is lost, as Heading 1 does not include this bar.
In other words, I want to keep the vertical bar, but it seems that only a ToC Heading base includes this aesthetic.
Picture (vertical bar can be seen in the document; style is based on ToC Heading)
How can I either force the table of contents to recognize my custom style as a heading to reference, or how can I retain the same aesthetic in my custom style after switching to a Heading 1 base?
Thank you!
Found it.
Highlight existing table of contents (highlighting the ToC title will create a menu above and to the left. Clicking on the ":" will highlight everything).
Click reference tab, look at the icon to add a table of contents, and click the arrow for a drop down menu.
Select custom table of contents from here.
Go to format. My custom style appeared there. I selected 1 as its heading level. It is now treated the same as Heading 1.
Add this table of contents and check the option to replace the current table.
Hope that helps someone else!

How do I move text back to just under the parent level

* Parent
Some text under this level
** Headline below parent
** Another Headline at the same level
I don't want this text to be a headline but be indented same as the text under the parent level without being a headline. Cannot do this.
I just cannot re-indent this text just below the parent level here
* Another top-level headline
Is there any way in org-mode to re-indent plain text back to the same indent level as the plain text just under the parent level but below several headlines under the parent?
I am trying to do something like this:
* A Section
Introductory text.....
** Subsection 1
** Subsection 2
Further Reading
Now, that "Further Reading" is not a headline, I don't want it to be one. However, I cannot "get out of" Subsection 2: Anything I type below it is a part of it. Perhaps I need to structure this some other way such as using lists instead of headlines.
There is no way to do this in org, currently - there is no syntax that ends a subheader to return you to the previous level. But you could add a subsection at the same level - e.g. in your example,
* A Section
Introductory text.....
** Subsection 1
Subsection 1 text
** Subsection 2
Subsection 2 text
** Further Reading
Some further reading
It might be nice if org had some syntax, like **-, that would end a subsection, but I'm not sure how involved a change that would be - probably pretty extensive.

Emacs org-mode: how to hide the enumerated list items descriptions by default

Suppose we have this org file:
1. first item
description of the first item
2. second item
description of the second item
3. third item
description of the third item
If I move the cursor to all the top items, and click <tab>, it will hide the descrption. And the file will look like this:
1. first item...
2. second item...
3. third item...
But when I open the file all items are open, which is uncomfortable for me. How can I hide them by default, leaving just dots?
That's strange, for me this is the default behavior to hide everything except the top level.
You can either modify it globally via the customize menu : Group org startup -> option org-startup-folded
or for each file like this http://orgmode.org/manual/Initial-visibility.html#Initial-visibility

Collapsing the current outline in Emacs org-mode

Say I am in org-mode in a document with the following structure:
* First headline
* Second headline
** Section A
Here is one line
Here is another line
blah, blah
** Section B
Say the cursor is on the line that reads Here is another line. I would like to collapse ** Section A from this location with a keyboard shortcut.
If I press <TAB> it does not collapse ** Section A, as I would need the cursor to be on the stars for this to work.
If I press <Shift-TAB> it collapses all outlines, and not the current one.
Is there any way to cycle through the collapsing of the outline in scope (i.e. the "current outline")?
You can customize the behaviour of the org-cycle command (which is bound to <TAB>) by changing the value of org-cycle-emulate-tab.
To get it to collapse ** Section A when your cursor is on Here is another line add the following line to your .emacs file:
(setq org-cycle-emulate-tab 'white)
The white will allow you to still use <TAB> to indent in empty lines. From org-mode Github:
org-cycle-emulate-tab's value is t
Documentation:
Where should `org-cycle' emulate TAB.
nil Never
white Only in completely white lines
whitestart Only at the beginning of lines, before the first non-white char
t Everywhere except in headlines
exc-hl-bol Everywhere except at the start of a headline
If you don't mind doing this in two steps:
C-c C-p: move the cursor to the previous heading (** Section A in your example)
TAB: fold the section
This method doesn't require any configuration, as long as you get used to it.

emacs org-indent-mode: how to go back a tab

When I enable org-indent-mode in emacs and have a document outline like the following:
* headline
** secondary headline
text
(after pressing enter key on previous line cursor is set here)
(i want my cursor to be here)
I want to have my cursor go back to the 'headline' part, and not automatically to the 'secondary headline' part. How can I make this happen?
Use M-Enter (probably Alt-Enter) instead of just enter.
This is not possible. It's not an org-indent limitation. It's an org-mode, and a general outliner limitation.
You cannot add content to a headline after creating a sub-headline.