Acronyms at first use but no acronyms list/heading #13

Closed
opened 2023-02-25 11:22:15 +00:00 by jdm204 · 3 comments
jdm204 commented 2023-02-25 11:22:15 +00:00 (Migrated from github.com)

I couldn't find a way in the documentation to process acronyms (produce the expanded form at first use on export) but not export and link the actual definition list of acronyms in the exported document (on a per-document basis).

I've tried

* Acronyms :noexport:

(with that tag in org-export-exclude-tags) but no luck.

Something very close is

#+print_glossary: :type nil

but then the acronyms hyperlink to where the printed acronym list would have been in the document, i.e where the #+print_glossary statement is put, which makes it seem to the reader they are linking to random unrelated text.

What would be great is if we could have the first-use expansion but no links, just by using an excluded tag like :noexport:!

I couldn't find a way in the documentation to process acronyms (produce the expanded form at first use on export) but not export and link the actual definition list of acronyms in the exported document (on a per-document basis). I've tried ``` * Acronyms :noexport: ``` (with that tag in `org-export-exclude-tags`) but no luck. Something very close is ``` #+print_glossary: :type nil ``` but then the acronyms hyperlink to where the printed acronym list *would have been in the document*, i.e where the `#+print_glossary` statement is put, which makes it seem to the reader they are linking to random unrelated text. What would be great is if we could have the first-use expansion but no links, just by using an excluded tag like `:noexport:`!
tecosaur commented 2023-02-26 17:02:11 +00:00 (Migrated from github.com)

Hmm, you could create a new acronym-like category which just doesn't produce a glossary section.

(add-to-list 'org-glossary-headings '("Acronyms sans link" . acronym-nolink))
(add-to-list 'org-glossary--heading-names "Acronyms sans link")

(org-glossary-set-export-spec t 'acronym-nolink
  :heading ""
  :use "%v"
  :first-use "%v (%u)"
  :definition-structure "")

This is untested, but it should be a decent starting point.

Hmm, you could create a new acronym-like category which just doesn't produce a glossary section. ```emacs-lisp (add-to-list 'org-glossary-headings '("Acronyms sans link" . acronym-nolink)) (add-to-list 'org-glossary--heading-names "Acronyms sans link") (org-glossary-set-export-spec t 'acronym-nolink :heading "" :use "%v" :first-use "%v (%u)" :definition-structure "") ``` This is untested, but it should be a decent starting point.
tecosaur commented 2023-02-27 16:50:09 +00:00 (Migrated from github.com)

Let me know if there are any issues with the above.

Let me know if there are any issues with the above.
jdm204 commented 2023-02-28 09:06:08 +00:00 (Migrated from github.com)

I found that the previous gave me the definition twice at first use, and the definition afterwards---the following seems to work, thanks!

(add-to-list 'org-glossary-headings '("Acronyms sans link" . acronym-nolink))
  (add-to-list 'org-glossary--heading-names "Acronyms sans link")
  (org-glossary-set-export-spec t 'acronym-nolink
    :heading ""
    :use "%t"
    :first-use "%v (%t)"
    :definition-structure "")
I found that the previous gave me the definition twice at first use, and the definition afterwards---the following seems to work, thanks! ``` (add-to-list 'org-glossary-headings '("Acronyms sans link" . acronym-nolink)) (add-to-list 'org-glossary--heading-names "Acronyms sans link") (org-glossary-set-export-spec t 'acronym-nolink :heading "" :use "%t" :first-use "%v (%t)" :definition-structure "") ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: tec/org-glossary#13
No description provided.