(Apologies to those who get cross-posts of this — I hope to reach as many as possible, and believe that there may be people here who have relevant experience.) Hello everyone, I'm looking for advice from people who have used LaTeX, preferably XeLaTeX but LuaLaTeX is interesting too,[1] to write a (“traditional”) reference grammar (or even better an historical reference grammar), and if so have you anything to share — code or pointers or examples? I will almost certainly mesh LaTeX and Pandoc so experiences from handling the issues mentioned below in that context are very welcome. I have tried to find something on CTAN but have come up empty handed, and googling “write [natural language] reference grammar with LaTeX” has proved useless. The first feature I will need is section numbers — “§ 42” style — which are - in the left margin against a paragraph; - possible to reference with links in the PDF; - preferably using a label since the actual numbers may be subject to change when adding/moving around parts; - with running § numbers (of first § on left page and (preferably) last § on right page) in the page headers; - independent of chapter/heading structure: a § number/label stands against a paragraph rather than a heading, and naturally a paragraph may or may not have one; - possibile to have indices — index rerum and index verborum for multiple languages — referring to § numbers rather than pages. So I think that more generally this is about - custom label/reference categories; - custom counters; - getting things into the (left) margin flush with the top of a paragraph; - getting custom things (involving counters) into page headers; - custom index formats, specifically indices referencing other numbers than page numbers.[2] I fully expect to have to set up most of this myself, and am willing to write external scripts to deal with aspects of it — preferred language Perl (which I have been using since the mid nineties) and I’m able and willing to use PerlTeX if convenient, since I’m a far better Perl than TeX programmer, although getting a grip on LaTeX solutions would be wonderful! :-) I also have Lua experience but as I'm using above-ASCII Unicode a lot Lua may be less useful. FWIW I have a good grip on how to do Unicode-aware/custom-order sorting in Perl and I have even written (slow) code to do Unicode-aware/custom-order sorting in Lua. [1] This involves needing to use system fonts and Unicode/UTF-8 encoded text using multiple scripts. Mostly Latin, IPA, Greek and some Cyrillic, but using some “exotic” Latin letters and combining marks. [2] This looks relevant: . Using memoir seems to be a good idea anyway. -- You received this message because you are subscribed to the Google Groups "pandoc-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CADAJKhBggA8DZjkoC%3Dm7GvWRK-PdG-eDByP03tE47znBY4qOiw%40mail.gmail.com.