tomncooper / pandoc-gls Goto Github PK
View Code? Open in Web Editor NEWA pandoc filter allowing easier syntax for the Latex glossaries package with Markdown documents
A pandoc filter allowing easier syntax for the Latex glossaries package with Markdown documents
E.g.,
front text---(+term)--followed by text
Renders out as:
front \gls{term} by text
It's not at all clear what's going on here. It works when (+term)
is preceded or followed by a hyphen, but not a double or triple hyphen. front
and back
match terms are both greedy--i.e., (%g*)
--so it seems to me should work.
Pandoc automatically inserts non-breaking spaces after abbreviations such as "e.g." and "i.e.".
As a consequence, the words processed by the Str function of this filter may actually contain whitespace characters.
However, the filter merely matches printable characters (not including spaces) via %g*
to identify the text before/after the acronym.
As a result, text before a non-breaking space will be discarded.
This problem is reproducible by the following example:
Some text (e.g. (+FOOBAR))).
Which will produce the following LaTeX output:
Some text \gls{FOOBAR}.
I'd suggest to use a .*
instead of a %g*
to match the front and back part.
Hi,
Not sure if this is supposed to work, but when I generate an html file with pandoc none of this appears to work. In otherwords the term doesn't appear in the text (eg if I put (+foo)) nothing appears, and the glossary section doesn't appear.
Before delving further, is it supposed to work for html output?
Cheers
Matt
Just wondering (and sorry if I missed something; I only briefly looked) as I'm thinking about glossaries in org-mode, why not use YAML, since it's used elsewhere in the pandoc universe?
title: my animal glossary
entries:
horse:
name: horse
description: a four-legged animal
Hi Tom,
I tested your filter with converting a Markdown file to Word docx. format, instead of PDF, but it didn't work. Is it generally possible using your filter for the purpose or not?
Maybe I did something wrong.
Thanks
Andreas
Hi Tom,
with pandoc 2.16.2 the lua-filter prevents the print of the lot, toc, lof and the list of acronyms and glossary entries.
If I use \gls{} for the acronyms and glossary entries in the text, everything works fine.
There must be a change in the actual Pandoc version. A few weeks ago the lua-filter worked normal.
Regards
Andreas
Hi Tom,
This package is great. So, now I would like to be able to write my glossaries in markdown as well as using markdown-ish syntax to use them. So, how about it?
(I would have sent an email but didn't see your email on your site. Mine is not even slightly disguised (I need to fix that) on my website: sigfried.org)
Thanks!
Sigfried
E.g., (+K8S)
will not be substituted with \gls{K8S}
even though the label is legal.
Hi Tom,
Wonderful solution which makes writing much easier. Thank you very much for sharing.
Only one question: Plurals with (+^x) isn't working for me. Do you have an example of an entry in "glossary.tex" with a working plural?
Thanks
Andreas
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.