Comments (14)
Hmm, that turns out to be a little more complicated than I initially thought. I am working on it and hope to have some results by the weekend.
from pandoc-unicode-math.
Yup. Under the hood, it boils down to "abstract syntax" and "concrete syntax". Pandoc filters modify the so-called abstract syntax tree (AST) of a document and don't care about a specific format's concrete syntax like whether to use $
or \(
or even something completely different to denote the beginning of a math environment.
from pandoc-unicode-math.
I updated the README file with installation/usage and build instructions and added a little example file. Hope that helps? I also published a binary that's compatible with Pandoc 1.17 which I happen to use because it comes with Debian 9. Let me know if you need something else!
from pandoc-unicode-math.
Great, thanks!
Hmm I do need it to work with pandoc 2.x.x, I'll let you know if it works.
Btw, does it replace e.g. "∧" with "\land" or "$\land$"?
from pandoc-unicode-math.
You're welcome, I will be glad to hear about Pandoc 2.x.x!
It replaces symbols like "∧" with "\land" (no added dollar signs), but only inside math environments: "The formula
I have been thinking about replacing symbols outside math environments as well so that the second example would become "The formula A
from pandoc-unicode-math.
Hi @gandalfsaxe, I added binaries for Pandoc 2 on Linux and Windows to the release section. Have fun ;-)
from pandoc-unicode-math.
Hi again,
Actually having thought about it, my only use for this filter is if it replace a selection of math symbols [X] in the text for
Could you make a version / options / switch that will add the dollar signs around the symbols? As for the possible issue with greek letters, I'm thinking that since you Haskell script is pretty understandable, the user could simply modify it and build from source if needed? The best option may be two separate versions of the filter, one adding dollars signs around symbols and the other not, or even better perhaps an option flag to the filter?
Sorry if I'm asking a lot, but it would be very useful 😄
from pandoc-unicode-math.
I built it from source using your instructions, but for some reason it can't find the executable:
Even though it's in my path:
Any suggestions?
from pandoc-unicode-math.
Is the /Users/gandalf/.local/bin/pandoc-unicode-math
file executable? I get a simliar error when it is not.
from pandoc-unicode-math.
Huh it runs now. It looked like it was executable before (did a ls -la
), but I did a chmod 755 pandoc-unicode-math
, and it works now.
In trying to do what I mentioned before, I tried changing:
sym '¬' = "\\neg"
to
sym '¬' = "$\\neg$"
However it only works within math environment, which is obviously not what I want. What else do I need to change so that the substitution are done outside of math blocks?
from pandoc-unicode-math.
OK, I started a new branch where symbols outside math blocks are replaced as well. It still needs a little polish but it should already do what you want. Feedback is very welcome!
Of course this is primarily useful for single characters. Formulas that you want displayed as one coherent math expression still need an explicit math environment because otherwise there is no way to tell where the formula starts and ends. Examples:
- "The variable α holds" now becomes "The variable
$\alpha$ holds". - "The formula A ∧ B" now becomes "The formula A
$\land$ B", but not "The formula$A \land B$ ".
from pandoc-unicode-math.
Hi,
I tried converting a .md file with this line into .tex with pandoc:
Testing this is A ∧ B testing.
and this was the result:
Testing this is A \(\land\) B testing.
Shouldn't it be Testing this is A $\land\$ B testing.
? But converting to PDF didn't give an error and gave the correct output as far as I can tell. It may be working as intended, I'm just not sure what \(\land\)
means in TeX? 😅
Anyway I think that using Typora and it's live inline math preview + math block preview box actually solves most of this issue for me after all. So an alternative to this filter would just be to suck it up and use inline
from pandoc-unicode-math.
OK, then I will close this issue since it is solved one way or the other ;-)
The \(...\)
vs. $...$
syntax is a Latex vs. Tex thing, see https://en.wikibooks.org/wiki/LaTeX/Mathematics#Mathematics_environments. For practical purposes it seems to be equivalent and since you're writing Markdown not Latex you can certainly keep using $...$
but \(...\)
being "correct" Latex syntax I think Pandoc normalizes this for math environments.
from pandoc-unicode-math.
Ah ok. So is it that your filter just tells pandoc to convert X into X in a math environment, and then it's pandoc that decides whether that means \(...\)
or $...$
?
Anyway thanks for your time, it's good to know that both versions of this filter exists and have in the toolbelt. This issue can be closed now yes :-)
from pandoc-unicode-math.
Related Issues (10)
- Expand symbols.hs by this list HOT 1
- Confusing documentation: '$$' sequence needed to make this work HOT 1
- posix_spawnp: does not exist using the plugin with pandoc on nixos HOT 3
- Add ≈ sign
- Increase readability of existing markdown documents with latex maths HOT 4
- MacOS binaries? HOT 17
- Enhancement: add whitespace HOT 2
- Expanded UnicodeMath support HOT 4
- Confusion around Ω and Ω HOT 14
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pandoc-unicode-math.