GithubHelp home page GithubHelp logo

odkr / pandoc-quotes.lua Goto Github PK

View Code? Open in Web Editor NEW
7.0 7.0 3.0 170 KB

Pandoc filter that adapts quotation marks.

License: MIT License

Makefile 0.54% Lua 47.35% HTML 35.54% CSS 2.98% Shell 13.40% Awk 0.20%
pandoc pandoc-filter quotations typography

pandoc-quotes.lua's People

Contributors

engolfarian avatar lu-p-us avatar odkr avatar rlesur avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

pandoc-quotes.lua's Issues

French quotes (guillemets) and non-breaking spaces

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.

value (global 'error')

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

Error message when running pandoc-quotes.lua

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.