tecosaur / org-glossary

Mirror of https://git.tecosaur.net/tec/org-glossary
GNU General Public License v3.0
97 stars 4 forks source link

Support LaTeX glossaries export #11

Closed authsec closed 1 year ago

authsec commented 1 year ago

Can you show me an export-spec that works with the glossaries latex package? I tried with the following to start

(org-glossary-set-export-spec 'latex t
  :first-use "\\gls{gls-%K}"
  :use "\\gls{gls-%K}"
  :backref ""
  :backref-seperator ""
  :definition-structure "%d"
  :heading ""
  :definition "\\newacronym{gls-%K}{%t}{%v}")

Which seems to work at least somewhat. It however creates the Acronyms and Glossary chapters too and obviously now everything is an acronym. Is it possible to switch the definition depending on if it's an acronym or glossary type?

The MWE is:

#+title: Glossary Demo
#+latex_header: \usepackage[toc,acronyms,numberedsection]{glossaries}
#+glossary_sources: glossary-it-general acronyms-it-general

* One

Use a reference and a glossary entry to the PC or a blog in the EmRE.

* Two
No refs aside from the PC glossary entry.

#+begin_src emacs-lisp :exports none
(org-glossary-set-export-spec 'latex t
  :first-use "\\gls{gls-%K}"
  :use "\\gls{gls-%K}"
  :backref ""
  :backref-seperator ""
  :definition-structure "%d"
  :heading ""
  :definition "\\newacronym{gls-%K}{%t}{%v}")
#+end_src

#+latex: \printglossaries

with the two files from https://github.com/tecosaur/org-glossary/issues/9#issuecomment-1344504097

tecosaur commented 1 year ago

Have you read this section of the manual: https://github.com/tecosaur/org-glossary/blob/master/org-glossary.org#export-configuration ?

It's very much possible to do what you want, it will just take a little more work.

All that said, I'd hoped the default generated LaTeX would be good enough, how does it fall short for you?

tecosaur commented 1 year ago

Closing as it is supported with more work.