Pandoc: How can I get numbered LaTeX equations to show up in both PDF and HTML output
To make a numbered equation in Pandoc, I defer to using pure LaTeX:
begin{equation}
a^2 + b^2 = c^2
end{equation}
In PDF form, it gives a nice numbered equation, however, this equation doesn't show up at all in the HTML output because the equation is within the begin
environment and is ignored. I would like to keep the numbering in the PDF, but would like the equation to show up in the HTML, with or without the numbering.
pandoc
add a comment |
To make a numbered equation in Pandoc, I defer to using pure LaTeX:
begin{equation}
a^2 + b^2 = c^2
end{equation}
In PDF form, it gives a nice numbered equation, however, this equation doesn't show up at all in the HTML output because the equation is within the begin
environment and is ignored. I would like to keep the numbering in the PDF, but would like the equation to show up in the HTML, with or without the numbering.
pandoc
add a comment |
To make a numbered equation in Pandoc, I defer to using pure LaTeX:
begin{equation}
a^2 + b^2 = c^2
end{equation}
In PDF form, it gives a nice numbered equation, however, this equation doesn't show up at all in the HTML output because the equation is within the begin
environment and is ignored. I would like to keep the numbering in the PDF, but would like the equation to show up in the HTML, with or without the numbering.
pandoc
To make a numbered equation in Pandoc, I defer to using pure LaTeX:
begin{equation}
a^2 + b^2 = c^2
end{equation}
In PDF form, it gives a nice numbered equation, however, this equation doesn't show up at all in the HTML output because the equation is within the begin
environment and is ignored. I would like to keep the numbering in the PDF, but would like the equation to show up in the HTML, with or without the numbering.
pandoc
pandoc
edited May 2 '13 at 10:17
user13907
asked May 2 '13 at 6:13
user1027169user1027169
186114
186114
add a comment |
add a comment |
5 Answers
5
active
oldest
votes
An extension exists on github: pandoc-crossref
install it with
cabal update
cabal install pandoc-crossref
or in archlinux using ArchHaskell
pacman -Sy pandoc-crossref
you can use it by doing
$$ math $$ {#eq:label}
[@eq:label]
and compiling with
pandoc file.md --filter pandoc-crossref -o file.pdf
for more information see the documentation
Alternatively, as described in https://github.com/jgm/pandoc/issues/1938#issuecomment-74011358 you can use --mathjax
for HTML rendering
if your equations are in math.txt
$$ a^2 + b^2 = c^2 $$
create a file header
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ TeX: { equationNumbers: {autoNumber: "all"} } });
</script>
and compile with
pandoc math.txt -t html -s -o test.html --mathjax=https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML -H header
Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format.
– Symbol 1
Apr 1 '15 at 9:27
add a comment |
In pandoc you can do:
(@foo) $a^2 + b^2 = c^2$
As (@foo) says, ...
(@bar) $e = x + y$
This will give you running equation numbers in both PDF and HTML. However, the equations will not be centered or display-formatted. (You can use $$
for display math, but then the numbers probably won't be lined up right -- though maybe this can be fixed with CSS.)
Doing it this way, the equation ends up being placed on the left and slightly above the equation itself. Is there a way to have the equation number on the right just like in the regular latex format?
– user1027169
May 3 '13 at 20:11
No, there's no way to get the number on the right. You could probably fix alignment issues with display math using CSS.
– John MacFarlane
May 4 '13 at 2:06
I meant in the PDF output, the equation number gets moved to the left. As you mentioned, the HTML shouldn't be an issue with some CSS.
– user1027169
May 4 '13 at 16:25
@JohnMacFarlane just wondering if this (displaymath, right-aligned eqs) is something that might be addressed in later pandoc releases, or if explicit LaTeX environment remains the way to go for pdf output?
– cboettig
Jun 23 '14 at 18:20
Mathjax supportsref
andeqref
in plain HTML: cdn.mathjax.org/mathjax/latest/test/sample-eqrefs.html --- can Pandoc users get access to this functionality? (I'm converting multimarkdown to html.)
– Ahmed Fasih
Jun 29 '14 at 4:26
add a comment |
Another option for equation numbers and references is the pandoc-eqnos filter.
Install pandoc-eqnos as root using the bash command
pip install pandoc-eqnos
To tag an equation with the label eq:description
, use
$$ y = mx + b $$ {#eq:description}
The prefix #eq:
is required whereas description
can be replaced with any combination of letters, numbers, dashes, slashes and underscores.
To reference the equation, use
@eq:description
To apply the filter, use the following option with pandoc:
--filter pandoc-eqnos
Full details and demos are given on the pandoc-eqnos Web page at github.
add a comment |
If you use css styling you can add the following in your css file:
/*create an equation counter variable */
body {
counter-reset: EQU_COUNT 0 ;
}
and:
.MathJax_Display:after {
content: " (" counter(EQU_COUNT) ")";
counter-increment: EQU_COUNT;
}
This will automatically add a an incremented counter value after each equation.
add a comment |
If ConTeXt is used as the engine to produce the PDF output,
then one can simply precede the LaTeX display formula with a placeformula
ConTeXt command in the Pandoc Markdown input:
placeformula
$$ a^2 + b^2 = c^2 $$
When multiple output formats are desired, it is better to use a GNU makefile
containing a sed
command:
SHELL := /usr/bin/env bash
NAME := $(basename $(wildcard *.md))
all: $(NAME).pdf $(NAME).docx
$(NAME).pdf: $(NAME).md
pandoc
<(sed 's/^$$$$.*/\placeformulan&/' $<)
--smart --output=$(NAME).tex --to=context
context $(NAME).tex
$(NAME).docx: $(NAME).md
pandoc $< --smart --output=$(NAME).docx
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f111868%2fpandoc-how-can-i-get-numbered-latex-equations-to-show-up-in-both-pdf-and-html-o%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
5 Answers
5
active
oldest
votes
5 Answers
5
active
oldest
votes
active
oldest
votes
active
oldest
votes
An extension exists on github: pandoc-crossref
install it with
cabal update
cabal install pandoc-crossref
or in archlinux using ArchHaskell
pacman -Sy pandoc-crossref
you can use it by doing
$$ math $$ {#eq:label}
[@eq:label]
and compiling with
pandoc file.md --filter pandoc-crossref -o file.pdf
for more information see the documentation
Alternatively, as described in https://github.com/jgm/pandoc/issues/1938#issuecomment-74011358 you can use --mathjax
for HTML rendering
if your equations are in math.txt
$$ a^2 + b^2 = c^2 $$
create a file header
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ TeX: { equationNumbers: {autoNumber: "all"} } });
</script>
and compile with
pandoc math.txt -t html -s -o test.html --mathjax=https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML -H header
Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format.
– Symbol 1
Apr 1 '15 at 9:27
add a comment |
An extension exists on github: pandoc-crossref
install it with
cabal update
cabal install pandoc-crossref
or in archlinux using ArchHaskell
pacman -Sy pandoc-crossref
you can use it by doing
$$ math $$ {#eq:label}
[@eq:label]
and compiling with
pandoc file.md --filter pandoc-crossref -o file.pdf
for more information see the documentation
Alternatively, as described in https://github.com/jgm/pandoc/issues/1938#issuecomment-74011358 you can use --mathjax
for HTML rendering
if your equations are in math.txt
$$ a^2 + b^2 = c^2 $$
create a file header
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ TeX: { equationNumbers: {autoNumber: "all"} } });
</script>
and compile with
pandoc math.txt -t html -s -o test.html --mathjax=https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML -H header
Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format.
– Symbol 1
Apr 1 '15 at 9:27
add a comment |
An extension exists on github: pandoc-crossref
install it with
cabal update
cabal install pandoc-crossref
or in archlinux using ArchHaskell
pacman -Sy pandoc-crossref
you can use it by doing
$$ math $$ {#eq:label}
[@eq:label]
and compiling with
pandoc file.md --filter pandoc-crossref -o file.pdf
for more information see the documentation
Alternatively, as described in https://github.com/jgm/pandoc/issues/1938#issuecomment-74011358 you can use --mathjax
for HTML rendering
if your equations are in math.txt
$$ a^2 + b^2 = c^2 $$
create a file header
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ TeX: { equationNumbers: {autoNumber: "all"} } });
</script>
and compile with
pandoc math.txt -t html -s -o test.html --mathjax=https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML -H header
An extension exists on github: pandoc-crossref
install it with
cabal update
cabal install pandoc-crossref
or in archlinux using ArchHaskell
pacman -Sy pandoc-crossref
you can use it by doing
$$ math $$ {#eq:label}
[@eq:label]
and compiling with
pandoc file.md --filter pandoc-crossref -o file.pdf
for more information see the documentation
Alternatively, as described in https://github.com/jgm/pandoc/issues/1938#issuecomment-74011358 you can use --mathjax
for HTML rendering
if your equations are in math.txt
$$ a^2 + b^2 = c^2 $$
create a file header
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ TeX: { equationNumbers: {autoNumber: "all"} } });
</script>
and compile with
pandoc math.txt -t html -s -o test.html --mathjax=https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML -H header
edited 5 mins ago
JouleV
2,499628
2,499628
answered Apr 1 '15 at 9:18
PietroPietro
21124
21124
Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format.
– Symbol 1
Apr 1 '15 at 9:27
add a comment |
Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format.
– Symbol 1
Apr 1 '15 at 9:27
Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format.
– Symbol 1
Apr 1 '15 at 9:27
Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format.
– Symbol 1
Apr 1 '15 at 9:27
add a comment |
In pandoc you can do:
(@foo) $a^2 + b^2 = c^2$
As (@foo) says, ...
(@bar) $e = x + y$
This will give you running equation numbers in both PDF and HTML. However, the equations will not be centered or display-formatted. (You can use $$
for display math, but then the numbers probably won't be lined up right -- though maybe this can be fixed with CSS.)
Doing it this way, the equation ends up being placed on the left and slightly above the equation itself. Is there a way to have the equation number on the right just like in the regular latex format?
– user1027169
May 3 '13 at 20:11
No, there's no way to get the number on the right. You could probably fix alignment issues with display math using CSS.
– John MacFarlane
May 4 '13 at 2:06
I meant in the PDF output, the equation number gets moved to the left. As you mentioned, the HTML shouldn't be an issue with some CSS.
– user1027169
May 4 '13 at 16:25
@JohnMacFarlane just wondering if this (displaymath, right-aligned eqs) is something that might be addressed in later pandoc releases, or if explicit LaTeX environment remains the way to go for pdf output?
– cboettig
Jun 23 '14 at 18:20
Mathjax supportsref
andeqref
in plain HTML: cdn.mathjax.org/mathjax/latest/test/sample-eqrefs.html --- can Pandoc users get access to this functionality? (I'm converting multimarkdown to html.)
– Ahmed Fasih
Jun 29 '14 at 4:26
add a comment |
In pandoc you can do:
(@foo) $a^2 + b^2 = c^2$
As (@foo) says, ...
(@bar) $e = x + y$
This will give you running equation numbers in both PDF and HTML. However, the equations will not be centered or display-formatted. (You can use $$
for display math, but then the numbers probably won't be lined up right -- though maybe this can be fixed with CSS.)
Doing it this way, the equation ends up being placed on the left and slightly above the equation itself. Is there a way to have the equation number on the right just like in the regular latex format?
– user1027169
May 3 '13 at 20:11
No, there's no way to get the number on the right. You could probably fix alignment issues with display math using CSS.
– John MacFarlane
May 4 '13 at 2:06
I meant in the PDF output, the equation number gets moved to the left. As you mentioned, the HTML shouldn't be an issue with some CSS.
– user1027169
May 4 '13 at 16:25
@JohnMacFarlane just wondering if this (displaymath, right-aligned eqs) is something that might be addressed in later pandoc releases, or if explicit LaTeX environment remains the way to go for pdf output?
– cboettig
Jun 23 '14 at 18:20
Mathjax supportsref
andeqref
in plain HTML: cdn.mathjax.org/mathjax/latest/test/sample-eqrefs.html --- can Pandoc users get access to this functionality? (I'm converting multimarkdown to html.)
– Ahmed Fasih
Jun 29 '14 at 4:26
add a comment |
In pandoc you can do:
(@foo) $a^2 + b^2 = c^2$
As (@foo) says, ...
(@bar) $e = x + y$
This will give you running equation numbers in both PDF and HTML. However, the equations will not be centered or display-formatted. (You can use $$
for display math, but then the numbers probably won't be lined up right -- though maybe this can be fixed with CSS.)
In pandoc you can do:
(@foo) $a^2 + b^2 = c^2$
As (@foo) says, ...
(@bar) $e = x + y$
This will give you running equation numbers in both PDF and HTML. However, the equations will not be centered or display-formatted. (You can use $$
for display math, but then the numbers probably won't be lined up right -- though maybe this can be fixed with CSS.)
answered May 3 '13 at 3:22
John MacFarlaneJohn MacFarlane
42825
42825
Doing it this way, the equation ends up being placed on the left and slightly above the equation itself. Is there a way to have the equation number on the right just like in the regular latex format?
– user1027169
May 3 '13 at 20:11
No, there's no way to get the number on the right. You could probably fix alignment issues with display math using CSS.
– John MacFarlane
May 4 '13 at 2:06
I meant in the PDF output, the equation number gets moved to the left. As you mentioned, the HTML shouldn't be an issue with some CSS.
– user1027169
May 4 '13 at 16:25
@JohnMacFarlane just wondering if this (displaymath, right-aligned eqs) is something that might be addressed in later pandoc releases, or if explicit LaTeX environment remains the way to go for pdf output?
– cboettig
Jun 23 '14 at 18:20
Mathjax supportsref
andeqref
in plain HTML: cdn.mathjax.org/mathjax/latest/test/sample-eqrefs.html --- can Pandoc users get access to this functionality? (I'm converting multimarkdown to html.)
– Ahmed Fasih
Jun 29 '14 at 4:26
add a comment |
Doing it this way, the equation ends up being placed on the left and slightly above the equation itself. Is there a way to have the equation number on the right just like in the regular latex format?
– user1027169
May 3 '13 at 20:11
No, there's no way to get the number on the right. You could probably fix alignment issues with display math using CSS.
– John MacFarlane
May 4 '13 at 2:06
I meant in the PDF output, the equation number gets moved to the left. As you mentioned, the HTML shouldn't be an issue with some CSS.
– user1027169
May 4 '13 at 16:25
@JohnMacFarlane just wondering if this (displaymath, right-aligned eqs) is something that might be addressed in later pandoc releases, or if explicit LaTeX environment remains the way to go for pdf output?
– cboettig
Jun 23 '14 at 18:20
Mathjax supportsref
andeqref
in plain HTML: cdn.mathjax.org/mathjax/latest/test/sample-eqrefs.html --- can Pandoc users get access to this functionality? (I'm converting multimarkdown to html.)
– Ahmed Fasih
Jun 29 '14 at 4:26
Doing it this way, the equation ends up being placed on the left and slightly above the equation itself. Is there a way to have the equation number on the right just like in the regular latex format?
– user1027169
May 3 '13 at 20:11
Doing it this way, the equation ends up being placed on the left and slightly above the equation itself. Is there a way to have the equation number on the right just like in the regular latex format?
– user1027169
May 3 '13 at 20:11
No, there's no way to get the number on the right. You could probably fix alignment issues with display math using CSS.
– John MacFarlane
May 4 '13 at 2:06
No, there's no way to get the number on the right. You could probably fix alignment issues with display math using CSS.
– John MacFarlane
May 4 '13 at 2:06
I meant in the PDF output, the equation number gets moved to the left. As you mentioned, the HTML shouldn't be an issue with some CSS.
– user1027169
May 4 '13 at 16:25
I meant in the PDF output, the equation number gets moved to the left. As you mentioned, the HTML shouldn't be an issue with some CSS.
– user1027169
May 4 '13 at 16:25
@JohnMacFarlane just wondering if this (displaymath, right-aligned eqs) is something that might be addressed in later pandoc releases, or if explicit LaTeX environment remains the way to go for pdf output?
– cboettig
Jun 23 '14 at 18:20
@JohnMacFarlane just wondering if this (displaymath, right-aligned eqs) is something that might be addressed in later pandoc releases, or if explicit LaTeX environment remains the way to go for pdf output?
– cboettig
Jun 23 '14 at 18:20
Mathjax supports
ref
and eqref
in plain HTML: cdn.mathjax.org/mathjax/latest/test/sample-eqrefs.html --- can Pandoc users get access to this functionality? (I'm converting multimarkdown to html.)– Ahmed Fasih
Jun 29 '14 at 4:26
Mathjax supports
ref
and eqref
in plain HTML: cdn.mathjax.org/mathjax/latest/test/sample-eqrefs.html --- can Pandoc users get access to this functionality? (I'm converting multimarkdown to html.)– Ahmed Fasih
Jun 29 '14 at 4:26
add a comment |
Another option for equation numbers and references is the pandoc-eqnos filter.
Install pandoc-eqnos as root using the bash command
pip install pandoc-eqnos
To tag an equation with the label eq:description
, use
$$ y = mx + b $$ {#eq:description}
The prefix #eq:
is required whereas description
can be replaced with any combination of letters, numbers, dashes, slashes and underscores.
To reference the equation, use
@eq:description
To apply the filter, use the following option with pandoc:
--filter pandoc-eqnos
Full details and demos are given on the pandoc-eqnos Web page at github.
add a comment |
Another option for equation numbers and references is the pandoc-eqnos filter.
Install pandoc-eqnos as root using the bash command
pip install pandoc-eqnos
To tag an equation with the label eq:description
, use
$$ y = mx + b $$ {#eq:description}
The prefix #eq:
is required whereas description
can be replaced with any combination of letters, numbers, dashes, slashes and underscores.
To reference the equation, use
@eq:description
To apply the filter, use the following option with pandoc:
--filter pandoc-eqnos
Full details and demos are given on the pandoc-eqnos Web page at github.
add a comment |
Another option for equation numbers and references is the pandoc-eqnos filter.
Install pandoc-eqnos as root using the bash command
pip install pandoc-eqnos
To tag an equation with the label eq:description
, use
$$ y = mx + b $$ {#eq:description}
The prefix #eq:
is required whereas description
can be replaced with any combination of letters, numbers, dashes, slashes and underscores.
To reference the equation, use
@eq:description
To apply the filter, use the following option with pandoc:
--filter pandoc-eqnos
Full details and demos are given on the pandoc-eqnos Web page at github.
Another option for equation numbers and references is the pandoc-eqnos filter.
Install pandoc-eqnos as root using the bash command
pip install pandoc-eqnos
To tag an equation with the label eq:description
, use
$$ y = mx + b $$ {#eq:description}
The prefix #eq:
is required whereas description
can be replaced with any combination of letters, numbers, dashes, slashes and underscores.
To reference the equation, use
@eq:description
To apply the filter, use the following option with pandoc:
--filter pandoc-eqnos
Full details and demos are given on the pandoc-eqnos Web page at github.
answered Jun 3 '15 at 19:50
tjdtjd
12621
12621
add a comment |
add a comment |
If you use css styling you can add the following in your css file:
/*create an equation counter variable */
body {
counter-reset: EQU_COUNT 0 ;
}
and:
.MathJax_Display:after {
content: " (" counter(EQU_COUNT) ")";
counter-increment: EQU_COUNT;
}
This will automatically add a an incremented counter value after each equation.
add a comment |
If you use css styling you can add the following in your css file:
/*create an equation counter variable */
body {
counter-reset: EQU_COUNT 0 ;
}
and:
.MathJax_Display:after {
content: " (" counter(EQU_COUNT) ")";
counter-increment: EQU_COUNT;
}
This will automatically add a an incremented counter value after each equation.
add a comment |
If you use css styling you can add the following in your css file:
/*create an equation counter variable */
body {
counter-reset: EQU_COUNT 0 ;
}
and:
.MathJax_Display:after {
content: " (" counter(EQU_COUNT) ")";
counter-increment: EQU_COUNT;
}
This will automatically add a an incremented counter value after each equation.
If you use css styling you can add the following in your css file:
/*create an equation counter variable */
body {
counter-reset: EQU_COUNT 0 ;
}
and:
.MathJax_Display:after {
content: " (" counter(EQU_COUNT) ")";
counter-increment: EQU_COUNT;
}
This will automatically add a an incremented counter value after each equation.
edited Sep 1 '16 at 14:45
samcarter
88.9k799285
88.9k799285
answered Sep 1 '16 at 14:10
jean-marc vollejean-marc volle
311
311
add a comment |
add a comment |
If ConTeXt is used as the engine to produce the PDF output,
then one can simply precede the LaTeX display formula with a placeformula
ConTeXt command in the Pandoc Markdown input:
placeformula
$$ a^2 + b^2 = c^2 $$
When multiple output formats are desired, it is better to use a GNU makefile
containing a sed
command:
SHELL := /usr/bin/env bash
NAME := $(basename $(wildcard *.md))
all: $(NAME).pdf $(NAME).docx
$(NAME).pdf: $(NAME).md
pandoc
<(sed 's/^$$$$.*/\placeformulan&/' $<)
--smart --output=$(NAME).tex --to=context
context $(NAME).tex
$(NAME).docx: $(NAME).md
pandoc $< --smart --output=$(NAME).docx
add a comment |
If ConTeXt is used as the engine to produce the PDF output,
then one can simply precede the LaTeX display formula with a placeformula
ConTeXt command in the Pandoc Markdown input:
placeformula
$$ a^2 + b^2 = c^2 $$
When multiple output formats are desired, it is better to use a GNU makefile
containing a sed
command:
SHELL := /usr/bin/env bash
NAME := $(basename $(wildcard *.md))
all: $(NAME).pdf $(NAME).docx
$(NAME).pdf: $(NAME).md
pandoc
<(sed 's/^$$$$.*/\placeformulan&/' $<)
--smart --output=$(NAME).tex --to=context
context $(NAME).tex
$(NAME).docx: $(NAME).md
pandoc $< --smart --output=$(NAME).docx
add a comment |
If ConTeXt is used as the engine to produce the PDF output,
then one can simply precede the LaTeX display formula with a placeformula
ConTeXt command in the Pandoc Markdown input:
placeformula
$$ a^2 + b^2 = c^2 $$
When multiple output formats are desired, it is better to use a GNU makefile
containing a sed
command:
SHELL := /usr/bin/env bash
NAME := $(basename $(wildcard *.md))
all: $(NAME).pdf $(NAME).docx
$(NAME).pdf: $(NAME).md
pandoc
<(sed 's/^$$$$.*/\placeformulan&/' $<)
--smart --output=$(NAME).tex --to=context
context $(NAME).tex
$(NAME).docx: $(NAME).md
pandoc $< --smart --output=$(NAME).docx
If ConTeXt is used as the engine to produce the PDF output,
then one can simply precede the LaTeX display formula with a placeformula
ConTeXt command in the Pandoc Markdown input:
placeformula
$$ a^2 + b^2 = c^2 $$
When multiple output formats are desired, it is better to use a GNU makefile
containing a sed
command:
SHELL := /usr/bin/env bash
NAME := $(basename $(wildcard *.md))
all: $(NAME).pdf $(NAME).docx
$(NAME).pdf: $(NAME).md
pandoc
<(sed 's/^$$$$.*/\placeformulan&/' $<)
--smart --output=$(NAME).tex --to=context
context $(NAME).tex
$(NAME).docx: $(NAME).md
pandoc $< --smart --output=$(NAME).docx
edited Jun 19 '17 at 15:15
answered Jun 19 '17 at 9:47
Serge StroobandtSerge Stroobandt
2,63311937
2,63311937
add a comment |
add a comment |
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f111868%2fpandoc-how-can-i-get-numbered-latex-equations-to-show-up-in-both-pdf-and-html-o%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown