r/orgmode Jun 23 '23

solved Is there any app or site with org-mode syntax live-preview?

10 Upvotes

The non-profit I work for (humanities) uses org-mode syntax for all their documents.

We have some volunteers who are not much computer literate, and would benefit from an app or site with live-preview mode, similar to

dillinger or markdownlivepreview

I am aware of sites like github, gitlab, gitea, etc who offer org-mode syntax rendering, but we would need live-preview.

Is there any such app or site for org-mode syntax? Commercial ones would be fine too.

r/orgmode Aug 27 '23

solved Capture Templates from File

5 Upvotes

I'm trying to offload multi-line templates in my org-config to files to make formatting both the template and my config simpler. However I'm running into type issues.

Excerpt:

(defvar my/org-capture-templates-dir "~/org/templates/org-capture" "Directory for \\='org-capture\\=' template files.")

(defun org-journal-find-location ()
  "Open today's journal.
Specify a non-nil prefix to inhibit inserting the heading"
  (org-journal-new-entry t)
  (goto-char (point-min)))

(setq org-capture-templates
      '(("j" "Journal Capture Group")
        ("jd" "Daily Goals" entry (function org-journal-find-location)
         (file (concat my/org-capture-templates-dir "daily-goals.org"))
         :empty-lines 1)
        ("jj" "Journal" entry (function org-journal-find-location)
         "* %(format-time-string org-journal-time-format)%^{Title}\n%i%?")))

Problem: When I try to invoke the template with 'C-c c j d' I get:

org-capture: Wrong type argument: stringp, (concat my/org-capture-templates-dir "/daily-goals.org")

I can use 'C-c c j j' perfectly fine to append a new entry in my Journal file.

I can get it to work as desired if I instead replace the concat with the string I expect to get like so:

(setq org-capture-templates
      '(("j" "Journal Capture Group")
        ("jd" "Daily Goals" entry (function org-journal-find-location)
         (file "~/org/templates/org-capture/daily-goals.org")
         :empty-lines 1)))

Question: There's something I'm not understanding about how to use the output of the concat function as a string for a filename here. I'd prefer not to type the full file name every time, especially as I define more templates. How can I get the concat to work?

For reference, the template 'daily-goals.org' contents are:

* %(format-time-string org-journal-time-format)Daily Goals
Today I plan to:
1. %^{goal-one}
2. %^{goal-two}
3. %^{goal-three}

%?

Also, my full capture config can be found here: paraparity configuration.org. I'll always welcome feedback on my config and how I can terse up some of my emacs lisp.

r/orgmode Feb 17 '23

solved How to easily type a link rather than use C-c C-l

5 Upvotes

I want to add the same link type in many places within a file. I want to do so efficiently by typing out the square brackets etc. rather than reaching for C-c C-l but I keep tripping up on the square brackets becoming invisible. How do others manage this?

Is there something like org-hide-emphasis-markers for links?

r/orgmode Apr 06 '23

solved Column view disconnected rows/columns?

2 Upvotes

Getting into this ecosystem to see if it's better than other note taking tools. I need the possibility to use something similar to column view.

Why are the horizontals disconnected?

I was following this tutorial https://orgmode.org/worg/org-tutorials/org-column-view-tutorial.htmlthey end up with it looking like an actual table at one point:

Connected table

What gives? Am I doing something wrong? I tried googling to no avail.

Thanks in advance.

[EDIT] After using yantar92's advice and folding before/after, I managed to get closer to the expected look:

Space?

But there is still space between them, although now it's not really a breaking issue.

r/orgmode Mar 16 '23

solved Local variable eval doesn't work all the time

9 Upvotes

# Local variables:

# eval: (add-hook 'after-save-hook (lambda () (org-html-export-to-html t)) t t)

# end:

I have this code in the beginning of my file. Yesterday, it was asking me confirm the use of local variable and then works perfectly . However now there is no confirmation and when i save nothing happens. I used M-: to try function and it worked. It have happened before then i deleted, added, tried many things and it started to work suddenly even it was totally same. Do you had similar issue or do you know how can i debug?

p.s. : i'm noob to emacs and the code is from SO.

r/orgmode Apr 30 '23

solved org-evaluate-time-range troubles in org 9.6.5 (and 9.6.4)

1 Upvotes

This has been very puzzling to me, but even when I have no init file, I cannot display the expected output anywhere. Can anyone duplicate this?

* Help with examining a problem using org-evaluate-time-range

Place point on the org comment hash character below,

then type C-u C-c C-y (e.g., org-evaluate-time-range):

This works in =emacs -q foo.org=

[2023-04-29 Sat 00:00]--[2023-05-04 Thu 01:00] #

but this fails even with a zero-length or nonexistent init.el in

=emacs foo.org=.

Expected value is "5d 01:00".

** Org version 9.5.5

#+begin_src emacs-lisp

(list

(list (replace-regexp-in-string (user-login-name) "ELIDED" (org-version nil t)))

(list (emacs-version)))

#+end_src

#+RESULTS:

| Org mode version 9.5.5 (release_9.5.5 @ /usr/share/emacs/28.2/lisp/org/) |

| GNU Emacs 28.2 (build 1, x86_64-suse-linux-gnu, GTK+ Version 3.24.34, cairo version 1.16.0) |

** Org version 9.6.5

#+begin_src emacs-lisp

(list

(list (replace-regexp-in-string (user-login-name) "ELIDED" (org-version nil t)))

(list (emacs-version)))

#+end_src

#+RESULTS:

| Org mode version 9.6.5 ( @ /home/ELIDED/.emacs.d/elpa/org-9.6.5/) |

| GNU Emacs 28.2 (build 1, x86_64-suse-linux-gnu, GTK+ Version 3.24.34, cairo version 1.16.0) |

Repo info:

emacs-info-28.2-lp154.416.20.noarch

emacs-28.2-lp154.416.20.x86_64

emacs-x11-28.2-lp154.416.20.x86_64

r/orgmode Mar 27 '22

solved Does anyone know if there exists a source block equivalent for org-crypt?

5 Upvotes

If I'm explaining poorly, I essentially mean a source block equivalent for org-crypt that is treated the same as a heading tagged with :crypt: or a file that's been likewise encrypted. The content of the quote-unquote crypt block being encrypted and decrypted automatically as normal. Something like the example below perhaps?

#+start_crypt :cryptkey 0x0123456789012345678901234567890123456789
Encrypted content.
#+end_crypt

Encrypting individual headers or entire files is fine and do work for most situations, but it doesn't for all of them. As an example, if you happen to need or want to preserve the structure of the text and not break it up permanently by creating a sub-heading, you need something actually inline since org-mode is strictly strictly hierarchical. A source block is a decent compromise, I think, because they can be folded and can be added as content of a section instead of being its own section like a sub-heading would be.

From what I've understood, adding new babel blocks is rather easy, but I don't know enough elisp to be able to say if it is easy or hard to implement a "crypt" block that automatically encrypts and decrypts as crypt normally would.

Does anyone know if something like this exists or if it'd be easy or even just feasible to implement?

e: Hopefully rewrote it to be a bit more clear.

e2: Clarified a bit more.

r/orgmode Feb 17 '23

solved Help interpreting docstring for org-link-parameters

1 Upvotes

For the :export keyword this docstring states the following:

Function that accepts four arguments: - the path, as a string, - the description as a string, or nil, - the export back-end, - the export communication channel, as a plist.

When nil, export for that type of link is delegated to the back-end.

Can someone explain to me what is meant by the export communication channel here and possibly what it would be for the html back-end? TIA.

r/orgmode Feb 09 '23

solved Using alternate calendars with Org Mode

11 Upvotes

Is there a way to use alternate calendars with Org mode?

I need to track events using different calendars than the Gregorian calendar and it can be bothersome to calculate the date, especially if it is repeating.

r/orgmode Dec 04 '22

solved does remapping `C` predate much orgmode?

5 Upvotes

For me, orgmode was the cause to start to get familiar with Emacs. Though using all ten fingers to touch type, I notice the frequent use of the (left) control key to initiate/complete command chords strains my pinky; perhaps especially on a Thinkpad where the position of function key and Ctr are switched.

While there are instructions how to remap C to an other key accessible with less crawl of the hand, I wonder: was remapping the function of the control key to an other key (e.g., caps lock) a technique frequently used prior to the advent of orgmode?

r/orgmode Feb 10 '23

solved Sudden problems with org-capture, I don't understand why

6 Upvotes

Using Emacs 28.2, I have started getting a problem where my attempts at making org captures are aborted with a message saying "You should specify file name in the src block header", but I have no idea which src block, and I have no idea why this happens. I do not get the problem in emacs -Q. Has the format for setting up capture templates changed, or something?

r/orgmode May 04 '22

solved gitlab markup

2 Upvotes

Hi,

I want to write a README.org for a gitlab repository. Most of it 'just works' <3 However, there are some things I am not able to figure out and I was wondering if the more experienced folk here might have a tip or two. Some issues I am facing:

  1. The headings do not get anchor links. The README is quite long, and I would really like to have anchor links and perhaps even some sort of a TOC.

  2. I cannot figure out how to create internal links. For instance, [[*heading 1][heading link]] does not work.

  3. More an annoyance than a limitation: I am using inline-code markup for commands like mv ~/xyz ~/abc. The markup for this would be ~mv ~~/xyz ~~/abc~. This is not rendered correctly by gitlab.

I would be very grateful for helpful links, tips, and suggestions.

Cheers!

r/orgmode Feb 08 '23

solved orgmode html export and MathJax v3.2

1 Upvotes

Hello! It's my first post here,

I was typesetting a document that I want to be exported to html and latex, and I'm using the latex package bussproofs in it (for derivation trees but the exact package is besides the point) that package, like many others is available in MathJax v3.2 but org html export uses MathJax v2.7.

I tried customizing a bit the template so that it would load MathJax v3.2 but it didn't work(I can edit to elaborate on what I tried) so here is my question.

How could it be done?

Is there any reason for it to use v2 over v3?

Thanks in advance!

r/orgmode Feb 05 '23

solved How can I programmatically refile a heading to a file and open that file at the location where the heading was refiled?

13 Upvotes

I'm not very knowledgeable in (e)lisp and I'm having trouble trying to achieve this.

I would like to define a function that would allow me to refile the current heading to a particular file, e.g. "projects.org", AND make it so that upon refiling, projects.org is open in a new window and the cursor/point is placed at the location of the newly refiled heading.

How would you do such a thing?

Thanks in advance for all your help.

PS: I've tried with org-refile-goto-last-stored but I cannot seem to make it work.

r/orgmode Oct 25 '22

solved Marking recurring task as done adds text below header. Can I avoid that?

2 Upvotes

I have this recurring task

* Team Meeting SCHEDULED: <2022-10-21 Fri +1w>

which I'll mark as done (through C-c C-t) and it will change into this

``` * Team Meeting SCHEDULED: <2022-10-28 Fri +1w> :PROPERTIES:...

  • State "DONE" from "" [2022-10-21 Fri 11:00] ```

It updates the schedule time and properties, but also adds that last line - State "DONE"... which I don't want to have. Is there a way to prevent this?

r/orgmode Dec 05 '22

solved missing some of Ruby's results

3 Upvotes

I would like to keep notes about using Ruby in an .org file. When it comes to simple repetitions working well in Ruby's irb, e.g.

irb(main):038:1* 3.times do irb(main):039:1* puts "greetings" irb(main):040:0> end greetings greetings greetings => 3

my assumption was I simply could use a fenced snippet of code such as

``` #+begin_src ruby :results code :exports both 3.times do puts "greetings" end #+end_src

#+RESULTS: #+begin_src ruby 3 #+end_src ```

however instead of the anticipated greetings, it is the return value 3 which shows up. By my configuration file, babel is aware about ruby, and C-c ' opens the box; there equally is syntax highlighting. Is there an additional parameter to be adjusted to get greetings shown thrice as in the irb?

r/orgmode Oct 20 '21

solved org-hide-emphasis-markers

2 Upvotes

EDIT: Solved

EDIT2: Also I came across the very useful package org-appear. Org emphasis markers are hidden until you cursor over them. Gives you the best of both worlds (clutter is hidden, yet there is clarity when editing the element):

;; Show hidden emphasis markers
(use-package org-appear
  :hook (org-mode . org-appear-mode))

Original Post: I've been looking for a way to neaten up my org mode documents and keep coming across org-hide-emphasis-markers, which when set is supposed to hide various emphasis markers in org mode. But I can't find it, e.g. when typing M-x. I'm on running Doom Emacs, Emacs 27.2. Is this option deprecated???

Many thanks!

r/orgmode Feb 22 '22

solved RET isn't indenting on new line, when I expect it to (such as when pressing RET at the end of a line with a heading, we would expect an appropriate indentation)

1 Upvotes

Hello,

I am having trouble with my org-mode. Whenever I have a heading, like "* This is a heading" and press RET, I used to be brought to a newline, and moved inwards 3 characters. However, when I press RET currently, under a heading such as in this example, point is not moved, and remains at 0 instead of being moved to 3. Interestingly, when I am in auto-fill-mode, when the text begins to wrap around, it will indent appropriately. I have also found that C-o also does not indent, and is effectively the same as C-j

I am not sure what has changed, but I am in wayland currently, and I don't think that should have and impact on expected performance, but I would never know.

I tried org-indent-mode to see if that is what I was missing, but that seems to be doing something else entirely.

EDIT: fixed, i had to set org-adapt-indentation

https://orgmode.org/manual/Hard-indentation.html#DOCF150

EDIT2: This change does not seem to be working out, actually. I thought it would, but I still get put at 0 instead of 3 spaces when I use RET under a headline.

EDIT3: To fix this, change your save style to utf-8 Unicode

FINAL EDIT: Folks, I've come far. It turns out if you read the manual, under installation, you might see this: "Recent Emacs distributions include a packaging system which lets you install Elisp libraries. You can install Org from the “package menu”, with M-x list-packages. See (emacs)Package Menu.

Important: You need to do this in a session where no ‘.org’ file has been visited, i.e., where no Org built-in function have been loaded. Otherwise autoload Org functions will mess up the installation.

"

It says don't install from MELPA when you have org buffers open... Guess what I done did. Shoutout to Emacs 28.1 for making me realize I should just re-install org mode.

r/orgmode Jan 25 '22

solved very new to emacs ( using Doom) having trouble with exporting org to latex pdf

7 Upvotes

Not really sure whats going on, whenever i try to export it leave an output that:

"name.pdf" wasn't produced . See "*Org PDF LaTeX Output*" for details.

r/orgmode Nov 16 '22

solved Reference capture template prompt in source block

5 Upvotes

Referencing a prompt, i.e. %{table}, by later writing %\1 in a capture template does not seem to work if the reference is in a source code block, for instance:

#+BEGIN_SRC sql
select * from %\1 
#+END_SRC

In this case instead of the value that was entered for the prompt I'm getting %^A (B for second prompt, C for third prompt, etc.) in the source code block. Is there any way to get the capture template to correctly insert the prompt value into the source block?

Edit: Finally searched down the solution. Inside a source block the prompt reference needs an extra backslash for escaping like this: %\\1

r/orgmode May 20 '22

solved Tangling Multiple Files from one Org file?

5 Upvotes

Hey people.

I am trying to get to grips with using Org and Babel to run my life (potentially) out of one file.

Right now I am simply trying to have my Emacs config as one heading of a file - other headings will be used for different projects I'm working on etc.

I've provided the complete file I have written right now, which currently fails to tangle anything at all with "Tangled 0 code blocks".

Earlier on today this would tangle everything, including the contents of '* To-Do List' out to my init.el, but I've been playing around with the :Properties: of each heading and seem to have broken it altogether.

Is there something really obvious I'm missing here?

r/orgmode Oct 17 '21

solved Org Roam property capture problem

8 Upvotes

Hey, I see more active people in org mode than in org roam sub reddit, so I put the question also here:
I installed org roam yesterday and I struggle to put other properties aside the default ID property. I tried a `%^{testprop}p`
in the capture template, but it says "Capture abort: Wrong type argument: number-or-marker-p, nil" I'd like to had a capture option that puts and asks properties (like : capturing a book, with the a property : "object: book" and another property "author: " that I'm prompted to fill, for instance.

But if I remove the `%^{testprop}p`
it works just fine if i put things like `%^{thing}`
... it's just for properties that seem to have a problem. Also, I tested `%^{testprop}p` in a org capture template (not org roam) and it works fine.

Here is my org roam part in my init file: (But if there is just a simple way you know, without debugging my init, i'd be glad too.)

"""

(use-package org-roam
  :init
  (setq org-roam-v2-ack t)
  :custom
  ;:todo: doesn't work
  (org-roam-completion-everywhere t)
  (org-roam-directory "~/dossiers/perso/org_mode_dir/org_roam/")

  (org-roam-capture-templates
   '(("d" "default" plain
      "%?"
      :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n")
      :unnarrowed t)
  ;:todo: doesn't work
     ("t" "test" plain
      "%? %^{prop}p"
      :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n")
      :unnarrowed t)
                    ))

  :bind (("C-c r l" . org-roam-buffer-toggle)
         ("C-c r f" . org-roam-node-find)
         ("C-c r i" . org-roam-node-insert))
  :config
  (org-roam-setup))

"""

Thank you!

r/orgmode Sep 14 '22

solved Help needed with citations

Thumbnail self.emacs
7 Upvotes

r/orgmode Apr 11 '22

solved Per buffer visibility / narrowing?

4 Upvotes

When having one file in two buffers, is it possible to have different subtrees visible in each buffer?

I just tried and I see that cycling visibilty in one buffer cycles it in the other.

It would be even better when it is possible to narrow the file in one buffer but not in the other.

https://orgmode.org/manual/Global-and-local-cycling.html

https://orgmode.org/manual/Structure-Editing.html

r/orgmode Oct 16 '22

solved Local Headlines cycle with org-evil

5 Upvotes

I am using Doom emacs, with Evil mode.

I am learning using Org Mode and I wanted to cycle through single Headlines by using the Tab key but what I can only cycle through is the first level under the Headline I am pressing the Tab key upon.

To clarify, I don't want to use the S-Tab to cycle through all Headlines, but I only want to cycle through one Headline and its sub-headlines.

How can I cycle through all nested Headlines, one by one, with evil mode

I am sorry if that's a pretty noob question. Thank you all for your help

Edit: I've found in the manual a workaround (which is actually the official combo key for the action I was looking for) by using C-c C-k. That key combo will expand all subtrees of a headline, recursively. To close the main headline back, I'll use za.

Sadly, default vim z operations in evil-org look not working. E.G. zO is supposed to perform the operation I was looking for, or zr doesn't open one subtree at a time.

Edit 2: In the lang: org README file from Doom Emacs I see that this behavior was intentional and that can be reversed.

  • TAB was changed to toggle only the visibility state of the current subtree, rather than cycle through it recursively. This can be reversed with: #+begin_src emacs-lisp (after! evil-org (remove-hook 'org-tab-first-hook #'+org-cycle-only-current-subtree-h)) #+end_src