-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added a filter to turn pandoc native divs into latex environments #40
Conversation
I also added a filter to turn any divs with latex="true" into a latex environment by the first class. Description:
|
Sorry, wrong click! |
You can also have a look to https://github.com/chdemko/pandoc-latex-environment |
Looks great! I hope either one of these can make into the official pandoc language. If there's no hope of making any of these into the official pandoc language, I probably would folk yours and apply it in the amsthm environments I made at ickc/pandoc-amsthm: provide amsthm environments in pandoc with valid output in LaTeX and HTML which also uses YAML front matter to define some environments. |
I've also implemented a kind of automatic numbering filter similar to theorem-like environment https://pypi.python.org/pypi/pandoc-numbering/ |
Wow. Very interesting. Yours is very sophiticated and ganranteed to work in all output formats. The only downside is that it isn't using LaTeX's amsthm in LaTeX output (but it's like an amsthm package for pandoc). By the way, have you tested how different the LaTeX output will be from using amsthm to do it, in terms of both numbering and visually (typographically)? His syntaxes and the way it works has a pandoc feel. May be it should make into the offcial pandoc syntax? (or an official pandoc filter that is recommended by the documentation?) I noticed that there are other filters here and there related to numberings (e.g. equation numbering) and references by the numbering. It would be great if they can be integrated together under a big packages/documentclass (the filters in pandoc are like the packages in latex, but may be we need something like a memoir or amsart "documentclass" (just a bigger filter) that ties all these filters together in a harmonize way. As I was brain-storming, may be pandoc need something like a CTAN and TeX Live so that those filters can be centralized (in a sense this repository could be that thing, but obviously it isn't centralized enough). e.g. if there's a way to install "official" pandoc filters in this repository from the command line |
There is a wiki page for all third-party filters: https://github.com/jgm/pandoc/wiki/Pandoc-Filters |
I knew that but it is not exhaustive, lacking the ecosystem for an incentive to put it there (e.g. should I push to this repo or edit the wiki over there?), and it's description is not good for filter discovery (e.g. as you mention it, I bet yours is also there, but a quick glimpse cannot find it. I once opened all links there and hasn't "discovered" your excellent filter. Probably it isn't obvious about what the fitlers are doing). And not to mention if there's a centralized thing like TeX Live or brew, all installed filters can be updated at once. But as I said I was brainstorming and probably dreaming because it certainly takes a lot of effort and resources to do something like that. And in the TeX world it isn't exactly easy to discover and pick packages either. |
I just clean up the wikis over there. There's a lot of room to improve though. All those numbering filters are confusing and probably a table needed to be created. |
@chdemko I do exactly like I said and forked your filter to incorporate it with my ickc/pandoc-amsthm: provide a syntax to use amsthm environments in pandoc, with output in LaTeX and HTML. Thanks for pointing me to your filter. |
new plugin: plantuml
@jgm Will this example be considered to add? If not, please close it. Thanks! |
This all looks fine to me, and will be useful to some people. |
By the way, I have an idea that we can use brew as a package manager for pandoc-filters. Since pandoc filters are not written solely in a certain language, many package managers are out of questions. But brew is very generic. And there's also a linux port of it. So it could serves the Mac/Linux at the same time. The same concept could apply to pandoc templates too. But that might be more problematic by the nature of it: templates usually are too specific. I am asking in jgm/pandoc#3138 about using template in header-includes. If the idea works (there's already work-around mentioned), we can make custom templates modular. And modular templates will be much more useful if managed by a package manager. |
@ickc , I would also love some sort of package manager, although Windows support would be quite valuable. BTW, Pandoc 1.17.3 now "checks |
May be this should be discussed in pandoc-discuss further and see if others are also interested in the idea? Regarding Windows support, recently there's WSL (Windows Subsystem for Linux) that gives us Bash on Ubuntu on Windows. Windows 10 Anniversary update only (optional beta feature that requires user activation). I didn't have time to play with it in details. But I think probably it can turn a Windows machine to be "Unix-like" in many situations. If pandoc and linuxbrew works on it, using brew would means support on Mac/Linux/Windows 10 Anniversary. The brew I think that is more suitable probably is brew cask, it install binaries rather than from source code. cask-fonts can install fonts to the font directory instead. i.e. we can install filters in No experience on pacman though. Do you think it would be easier to setup, and support more platform? |
No description provided.