Comments (6)
Note that you can always turn off the raw attribute extension:
-t markdown-raw_attribute
.
from pandoc.
I've changed the writer so it doesn't use raw_attribute
syntax unless there is no other option.
from pandoc.
However this won't render correctly.
Can you expand on this? How are you rendering this md document?
So my suggestion would be to not extend latex macros if the output format has explicitily activated the extension
latex_macros
The expansion takes place in the reader. By the time the writer gets it, it has already been expanded and there is nothing the writer can do to "unexpand" it. So, this needs to be a reader extension.
from pandoc.
However this won't render correctly.
Can you expand on this? How are you rendering this md document?
I was using
pandoc --mathjax -s -f markdown -t html5 -o test.html test.md
But this will not work correctly, because the \newcommands
will be ignored.
So my suggestion would be to not extend latex macros if the output format has explicitily activated the extension
latex_macros
The expansion takes place in the reader. By the time the writer gets it, it has already been expanded and there is nothing the writer can do to "unexpand" it. So, this needs to be a reader extension.
Ok, I understand. I was more thinking about a "readable" command line, ignoring the inner workings of pandoc. I still think it would be nice if the result in the markdown file would look like
\newcommand{\lra}[1]{ \left( #1 \right) }
\newcommand{\lrb}[1]{ \left[ #1 \right] }
\newcommand{\lrc}[1]{ \left\{ #1 \right\} }
instead of
```{=latex}
\newcommand{\lra}[1]{ \left( #1 \right) }
```
```{=latex}
\newcommand{\lrb}[1]{ \left[ #1 \right] }
```
```{=latex}
\newcommand{\lrc}[1]{ \left\{ #1 \right\} }
```
so that the latex macros won't get ignored when rendering the markdown.
from pandoc.
so that the latex macros won't get ignored when rendering the markdown.
Right. I guess that's something I hadn't considered in telling the Markdown writer to use the raw attribute syntax. We could (a) in the markdown writer, avoid using the raw attribute syntax, at least for macro definitions, or (b) in the markdown reader, process macros even when in raw blocks.
from pandoc.
From a user perspective I would choose option (a), because it leads to a simpler markdown file.
from pandoc.
Related Issues (20)
- Arm64 support in docker images HOT 1
- Optionally embed SVG as data URI instead of inlining? HOT 3
- "Defaulting to '...' as the title" warning when there is no <title> element HOT 1
- Allow empty/ default attributes in markdown codeblocks HOT 5
- Problem with html tags when converting to GFM-markdown HOT 1
- Comments with $-- do not work when output HTML HOT 2
- Reading CSV file returns incorrect line break content HOT 1
- Split table cutoff at bottom of page HOT 2
- Typst citations are unresponsive to csl style HOT 4
- RST section title including ".*" and without blank line after adornment characters wrongly renders as inline markup
- Typst: Strong emphasis function cannot take multiline variable HOT 2
- Leak in HTML parsing HOT 4
- Please tag pandoc `3.2` to `3.2.0` HOT 3
- Option to Link Images Rather Than Embed Them For ODT HOT 1
- Feature Request: Support for East Asian Language Tags in DOCX Output HOT 3
- ConTeXt backend crashes unnecessarily
- PDF to Markdown HOT 1
- Unexcepted escape seq in typst template. HOT 13
- Regression: `alerts` extension not working HOT 6
- djot writer: alignment info disappears in headerless table
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.