odkr / pandoc-quotes.lua Goto Github PK
View Code? Open in Web Editor NEWPandoc filter that adapts quotation marks.
License: MIT License
Pandoc filter that adapts quotation marks.
License: MIT License
While trying to figure out my question in #4, I realised that the links to the manual page lead to a 404 error.
I’ve posted this issue simply to let you know that I know. I’ll fix it soon-ish, promise.
In French, guillemets usually have a non-breaking space « inside them ». That is, the line:
fr = {'«', '»', '‹', '›' },
produces a change of quotes to «inside them» (no spaces). Non-breaking is important so you don't get a line wrap with a single guillemet as a word.
So, the line could probably be:
fr = {'« ',' »', '‹', '›' },
(the line actually has non-breaking spaces). This is how Microsoft Word works, as well as LaTeX's babel (and csquotes) if I'm not mistaken.
The change works great in a copy of the filter I installed, and I wonder if it should be changed here (I've begun using git submodules for the pandoc filters so it's easier to update them in my projects). Interestingly, I didn't see in csquotes that it's handled for any other languages: https://github.com/josephwright/csquotes/blob/bfd47ca66d07dc939d3ce37c3aefe1348996470c/csquotes.def#L594-L625
I also realize I could just override it with the YAML option, but haven't tried it.
In Romanian, the single quotes equivalent is << ... >>. The filter has the wrong order for them, resulting in >> ... <<.
See here:
pandoc-quotes.lua/pandoc-quotes.lua
Line 278 in d1c6aa2
The fix would be very simple -- just change their order.
Cheers,
Florin
Hello!
I installed a new version of pandoc 3.1.6.2 [windows-x86_64.msi] and the filter stopped working, it gives this error. What should I do?
Transcript started, output file is build.log
Executing Pandoc...
Error running filter C:\Users...\pandoc-quotes.lua:
...ers...\pandoc-quotes.lua:465: attempt to call a nil value (global 'error')
stack traceback:
Write-Error: Pandoc execution has failed
The correct line for Russian quotation marks should be:
ru = {'«', '»', '„', '“'},
I've been using an older version of pandoc-quotes for a while successfully, but am now looking towards updating to a new system, but I'm running into an error when running it. (I'll be working in a Linux\Ubuntu environment and am checking things out in a virtual machine -- Xubuntu 18.04 -- first).
john@john-VB-Xubuntu:~/Documents/Markdown_test_dir$ pandoc -s -o new_test.docx --filter pandoc-citeproc --lua-filter=pandoc-quotes.lua new_test.md
Error running filter /home/john/.pandoc/filters/pandoc-quotes.lua:
/home/john/.pandoc/filters/pandoc-quotes.lua:192: attempt to call a nil value (global 'sub')
stack traceback:
/home/john/.pandoc/filters/pandoc-quotes.lua:192: in main chunk
pandoc version: 2.7.3
pandoc-lua version: 0.1.9
In my document's YAML block, lang is set to "de-DE".
Pandoc without using pandoc-quotes works fine when converting to pdf and docx (just without -- in the later case -- converting the quotation marks to the German style that I need).
I would appreciate any help on this. Happy to provide any further information.
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.