Multimarkdown and Glossary Function

jo
joe.rice
Posts: 4
Joined: Wed Dec 06, 2017 3:09 pm
Platform: Mac

Fri Nov 15, 2019 8:43 am Post

I am exploring the use of the glossary markdown from scrivener to Latex. If I use:

Code: Select all

[?(Glossary) The glossary collects information
about important terms used in your documemnt]

I get this in Latex:

Code: Select all

\newglossaryentry{Glossary}{name=Glossary, description={The glossary collects information
about important terms used in your documemnt}}\gls{Glossary}

This is perfect!
But if I want to refer to that glossary item a second time, and of course don't need to re-enter the description again, I expect this to work:

Code: Select all

[?Glossary] is a glossary term.

That gives me this in the Latex document:

Code: Select all

{[?Glossary]} is a glossary term.

But I am expecting:

Code: Select all

\gls{Glossary} is a glossary term.


Can you help me understand the markdown syntax for glossary items, and what to expect when compiled to Latex.

User avatar
rdale
Posts: 1757
Joined: Tue Jul 14, 2015 1:07 pm
Platform: Mac, Win + iOS
Location: St. Louis, MO
Contact:

Fri Nov 15, 2019 3:47 pm Post

I don't think I'm familiar with glossary references in text. Isn't a glossary just a list of terms and definitions/explanations? Are you trying to make an index of where the glossary terms fall within your document?

I looked at the MMD syntax guide, and I'm only finding syntax on how to create an entry, not how to refer back to it again… https://fletcher.github.io/MultiMarkdow ... index.html
FKA: robertdguthrie
AKA: R Dale Guthrie, Robert, Mr. Obscure, and "Oh, it's you again".

ks
kseggleton
Posts: 5
Joined: Mon Sep 17, 2018 5:41 am
Platform: Mac

Mon Nov 18, 2019 1:41 pm Post

I do a REGEX search in Scriveners compile settings to search for all instances of words contained in square brackets with a leading question mark and replace that \gls(word). This creates the glossary references in the resulting Latex document.

jo
joe.rice
Posts: 4
Joined: Wed Dec 06, 2017 3:09 pm
Platform: Mac

Tue Nov 26, 2019 2:38 am Post

What regex search expression are you using?

ks
kseggleton
Posts: 5
Joined: Mon Sep 17, 2018 5:41 am
Platform: Mac

Fri Nov 29, 2019 4:33 am Post

joe.rice wrote:What regex search expression are you using?


The 'Replacement' REGEX expression is:

Code: Select all

\[\?(\w*?)\](\W)


And the 'With' code is:

Code: Select all

\\gls\{$1\}$2


In the Latex template I have the following commands:

Code: Select all

\usepackage[nonumberlist, nogroupskip, nopostdot]{glossaries} % Enables glossaries package. Removes numbers from glossary, groupings and final full stop
\glstoctrue % Adds glossary to TOC
\makenoidxglossaries % Gets Tex to sort glossaries


And in the Scrivener document I place the following where I want the glossary to appear:

Code: Select all

\printnoidxglossary[type=main]