Autonumber in org-mode - emacs

In all the docs I'm reading about org mode it seems that numbered lists will auto number when moving to next list item but it seems that I can't trigger it. So, I'm not understanding how [#50] (to start at 50 instead of 1) works.
Am I just missing some thing about numbered lists?

Assuming that org mode is in fact enabled (either with editing a file with the .org extension, or by manually triggering it with org-mode), you can auto-increment a numbered list by hitting M-<RET> after a list item.
1. First entry (M-<RET>)
2.
Edit: Looking back, seems I may have misunderstood your question. This is how to trigger the autoincrementing of the list items, but are you instead asking how to start at number other than 1?
(Keeping this as an answer because it does provide a solution, at least to the assumed question.)

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

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.

Combine org mode capture and drill modules to learn vocabulary

I want to use the capture module of org-mode to create a data base of new words that I want to learn, and then use the drill module to learn them (flash cards style).
In my org-capture-templates I added the following:
("v" "Vocabulary" entry
(file+headline (concat org-directory "/vocab.org")
"Vocabulary")
"* Word :drill:\n%^ \n** Answer \n%^")
This is a rather naive template which I borrowed from here. It works fine but it is too limited. Unfortunately I'm rather new to elisp and I don't know how to improve it.
I think the above template has to be improved in the following there aspects:
Headline Currently the first input string is the (new) word and the headline is fixed. How can the headline be the same (input) word? I think that the following result is desirable:
* Vocabulary
** Foo :drill:
Foo
*** Answer
What is foo
Actually an even better way would be to have 3 input strings.
The new word (for example foo) which will be the headline.
If the second is empty, then it gets the same string as (1). Otherwise, concatenates the string to the one from (1). E.g. having as second input bar would yield foo bar. This will be the content of the entry.
The word's definition which should come in the answer sub-headline.
Duplications (see again this) If at some later point I try to capture foo again, I would like to know it, and be directed to edit the already existing entry - skipping all the inputs.
Sorting After capturing I think it would be nice to sort the list of words. This should not be too hard given that the headline of each entry is the word itself. In this case one can probably use the org-sort-entries function.
I know this is a rather big questions but I also think that if it can be solved here it will be of great use to many users.
Edits:
Using #juan_g suggestions, I improved my template and now it is:
("v" "Vocabulary" entry
(file+headline (concat org-directory "/vocab.org")
"Vocabulary")
"* %^{The word} :drill:\n %t\n %^{Extended word (may be empty)} \n** Answer \n%^{The definition}")
I didn't manage to set the default value of the second input to be the 1st one. I tried something like %^{Extended word (may be empty)|%\1} but it returns ^A which is not helpful.
In any case, this improved version seems to be already usable.
About the input question, in Org Mode Manual: 9.1.3.2 Template expansion, there is the %\1 special escape code:
%\n Insert the text entered at the nth %^{prompt}, where n a number, starting from 1.
The duplications question probably would need some Emacs Lisp coding.
For sorting, see C-c ^ (org-sort).
BTW, org-drill seems indeed a really interesting package, based on SuperMemo's spaced repetition algorithms.
You need an extra "\", therefore %\\1 works as expected.

Banish unmatched top-level trees when performing tag search in Emacs Org Mode

For the past year and a half, I've maintained a monolithic buffer in Org Mode for my engineering notes with my current employer. Despite containing mostly pointers to other documents, this file has become quite large by human standards (48,290 lines of text), while remaining trivially searchable and editable through programmatic means (read: grep and Org Mode tag search).
One thing bothers me, though. When I perform a tag search using Org Mode 6.33x, Org's sparse tree view retains the folded representation of unmatched trees within the buffer (that is, content preceded by a single asterisk, *). This is generally useful for smaller buffers or those better organized into a single tree with multiple branches. However, this doesn't work especially well for documentation where each new tree is generated chronologically, one for each day, as I've been doing.
.
Before I continue, I'll note that my workaround is inherent in what I've just asked, as are the obvious alterations in my documentation habits with this buffer. However, the following questions remain:
1) Why does Org Mode organize trees in this manner when performing sparse tag searching? The technical details are self-evident, the UX decisions less so.
2) If I wished to correct this issue with a script written in Emacs Lisp, what hooks and commands should I explore in more detail to restructure the document view? Writing overrides for the standard commands (for example, org-match-sparse-tree) is already self-evident.
.
Thank you in advance.
As you already noticed the problem only affects the top level headings. The good thing is that in org-mode you can demote easily all headings with simple keystrokes. This way you can avoid the problem. Also cleaning up afterwards are just some simple keystrokes.
Step-by-step instructions:
Mark the full buffer
Call M-right (for outline-demote)
Input * root\n at the beginning of the file
Now, build up your subtree and do what you want with it.
When done you can remove * root\n at the beginning of the file and promote the headings again with M-left
I have got the impression that you can even leave the overall-heading where it is for your application.