Pandoc markdown conversion with == highlighting - pandoc

I am using Typora Markdown text editor wherein highlighting text is done with ==[...]== operation. This is also the case for many other Markdown editors such as Obsidian, Quilt, iA Writer, etc.
What is a way for pandoc to convert the == highlighting when converting to a pdf file ?
Sample.md
==Testing==
Then performing
pandoc Sample.md -o test.pdf
produces a pdf with "==Testing=="

The short answer is: there isn't one, highlighting syntax is currently not supported by pandoc. For more details, refer to the related discussion on the pandoc mailing list.
The long answer is that you could write a Lua filter or even a custom Markdown parser to add support for various features, but that's non-trivial in this case.

Related

Converting page range from docx to pdf using pandoc

I'm trying to convert certain pages of a docx to pdf using pandoc but I can't find any sources hinting at where should I start. After taking a look into the pandoc documentation I still couldn't figure it out, so I just assumed that pandoc doesn't support this.
This might just act as a confirmation for future readers, Does pandoc support page range converting?
Pandoc has no concept of pages.
Putting text on pages happens during rendering with Word and LaTeX, but pandoc does not render the text before converting. Therefore it cannot know on which page a specific letter will be placed.

Pandoc - convert docx to .md with docx having word shapes

I'm playing around with pandoc to see if it is able to convert all aspect of word doc to .md reliably. Looks like it handles lot of stuff pretty well such as table of contents, images, etc.. However, I am looking to see if it can also understand a diagram in word doc that has been made using combining multiple shapes of word. for, e.g. diagram like below in your word doc:
when I do "pandoc --extract-media=. my.docx -o my.md" to convert to .md, mark down doc does not have any thing related to word shapes. Looks like it does not understand it. Is there any way to make pandoc smart enough to undestand word shapes ?
No, pandoc cannot handle these. There are two issues for this on the pandoc issue tracker, #4735, and #2792.

Pandoc: Different outputs to docx and LaTeX formats

In LaTeX one could for example have a nice inline equation like $x^2=4$, which in docx format I would be glad to have as italic text.
Is there a way to tell Pandoc to use one of these solutions depending on the output format?
When searching for a possible solution, I realized pandoc has filters and templates. I would not really understand, which direction to follow.
But I would really like to arrive with a more general solution, that would also work for analogous tasks like, for example, smaller spaces between a number and units: In LaTeX straightforward $\;$, but including this in my Markdown document would not give me a satisfactory result in DOCX or ODT output.
This is what I found from the pandoc manual
For docx output, styles will be defined in the output file as inheriting from normal
text, if the styles are not yet in your reference.docx. If they are already defined,
pandoc will not alter the definition.
and please read the --reference-doc=FILE part of the maunal
--reference-doc=FILE
Use the specified file as a style reference in producing a docx or ODT file.
...
how to use the reference-doc in pandoc???
create a empty docx file and rename it (eg. refer.docx)
define the styles you want to display
add "--reference-doc=(refer.docx path)" into your pandoc command line .

Is there any MathML support in Sphinx (by mathjax extension)?

Is there anyway to render MathML in the rst file with Sphinx?
I enabled mathjax extension in conf.py. It works very well with latex using like
However, if I replace it with math ML, it does render it but instead display all the xml code. For example,
produces
In Sphinx math is rendered by a mathjax extension. On https://www.mathjax.org/ mathjax claims they support MathML.
It's difficult to answer without knowing your desired output, but from the doc
The "math" directive inserts blocks with mathematical content (display
formulas, equations) into the document. The input format is LaTeX math
syntax with support for Unicode symbols
So, no way to use MMl with ..math::
If you output in HTML, you can try raw or literal directives instead to let the block as is. The block will be displayed correctly in a MML browser compliant. If you include mathjax libraries with a correct configuration it will also process.

text highlight in markdown

Within a Markdown editor I want to support text highlight, not in the sense of code highlighting, but the type of highlighting people do on books.
In code oriented sites people can use backquotes for a grey background, normally inline code within a paragraph. However on books there is the marker pen for normal text within a paragraph. That is the classical black text on yellow background.
Is there any syntax within Markdown (or its variants) to specify that the user want that type of highlight? I want to preserve the backquotes syntax for code related marking, but also want a way to enable highlighted user text
My first thought is just using double backquotes, since triple backquotes are reserved for code blocks. I am just wondering if other implementations have already decided a syntax for it... I would also appreciate if someone could justify if this is a very bad idea.
As the markdown documentation states, it is fine to use HTML if you need a feature that is not part of Markdown.
HTML5 supports
<mark>Marked text</mark>
Else you can use span as suggested by Rad Lexus
<span style="background-color: #FFFF00">Marked text</span>
I'm late to the party but it seems like a couple of markdown platforms (Quilt & iA Writer) are using a double equal to show highlighting.
==highlight==
Typora is also using double equal for highlighting. It would be nice it that becomes a CommonMark standard, as mentioned by DirtyF. It would be nice for those who use it frequently, since it is only 4 repeated chars: ==highlight==
If you want the option to use multiple editors, it may be best to stick with <mark>highlight</mark> for now, as answered by Matthias.
Here is the latest spec from CommonMark, "which attempts to specify Markdown syntax unambiguously". Currently "highlighting" is not included.
Editors using ==highlight== from comments mentioned previously:
Typora
Obsidian
Quilt
IA Writer
Feel free to add to this list.
You can use the Grave accent (backtick) ` to highlight text in markdown
Highlighted text
Also works with VS Code extension markdownlint
Grey-colored Higlighting Solution
A possible solution is to use the <code> element:
This solution works really well on git/github, because git/github doesn't allow css styling.
OBS!:
Using the code-element for highlighting is not semantic.
However, it is a possible solution for adding grey-colored highlighting to text in markdown.
Markdown/HTML
<code> <i>This text will be italic</i> <b>this text will be bold</b> </code>
Output
This text will be italic this text will be bold
Roam markdown uses double-caret: ^^highlight^^. Andrew Shell's answer mentions double-equals.
The accepted and clearly correct answer is <mark> from Matthias above, but I thought I had seen carets in some other flavor of markdown. Maybe not. I want to transform my ^^highlights^^ to <mark>highlights</mark> in pandoc conversion to html, and somehow ended up here...
Probably best bet is just use html e.g
<pre><b>Hello</b> is higlighted</pre>
Hello is higlighted
Remember nearly all html is valid in markdown too.

Resources