public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* How to write math equations for LatTeX *and* for HTML output?
@ 2016-03-28 20:36 news-WPTjrydoUPgeaOpM6FAJmQkbCANdLtlA
       [not found] ` <0f962214-56c6-4e73-9826-b2de0c40250d-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: news-WPTjrydoUPgeaOpM6FAJmQkbCANdLtlA @ 2016-03-28 20:36 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 1143 bytes --]

For HTML output I write equations in the markdown source as:

$$
\begin{equation}
s = \sqrt{\frac{\sum(x_i - \bar{x})^2}{n-1}} \quad \text{(variance is 
$s^2$)}
\end{equation}
$$


This renders beautiful.

However when compiling the same source to LaTeX, I get a LaTeX file 
containing:

\[
\begin{equation}
s = \sqrt{\frac{\sum(x_i - \bar{x})^2}{n-1}} \quad \text{(variance is 
$s^2$)}
\end{equation}
\]


which produces in pdflatex the LaTeX Error: *Bad math environment delimiter*

How do I write math equations which compile properly to LatTeX *and* to 
HTML output?

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/0f962214-56c6-4e73-9826-b2de0c40250d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 2431 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How to write math equations for LatTeX *and* for HTML output?
       [not found] ` <0f962214-56c6-4e73-9826-b2de0c40250d-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2016-03-29  4:22   ` John MacFarlane
  2016-03-29  5:43   ` Denis Navas Vega
  2016-03-29 11:53   ` news-WPTjrydoUPgeaOpM6FAJmQkbCANdLtlA
  2 siblings, 0 replies; 4+ messages in thread
From: John MacFarlane @ 2016-03-29  4:22 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

\begin{equation} starts a math environment and shouldn't go
inside $$..$$.

Have you tried without it in HTML?  What HTML math rendering
method are you using, mathjax?

+++ news-WPTjrydoUPgeaOpM6FAJmQkbCANdLtlA@public.gmane.org [Mar 28 16 13:36 ]:
>   For HTML output I write equations in the markdown source as:
>
>   $$
>
>   \begin{equation}
>
>   s = \sqrt{\frac{\sum(x_i - \bar{x})^2}{n-1}} \quad \text{(variance is
>   $s^2$)}
>
>   \end{equation}
>
>   $$
>
>   This renders beautiful.
>   However when compiling the same source to LaTeX, I get a LaTeX file
>   containing:
>
>   \[
>
>   \begin{equation}
>
>   s = \sqrt{\frac{\sum(x_i - \bar{x})^2}{n-1}} \quad \text{(variance is
>   $s^2$)}
>
>   \end{equation}
>
>   \]
>
>   which produces in pdflatex the LaTeX Error: Bad math environment
>   delimiter
>   How do I write math equations which compile properly to LatTeX and to
>   HTML output?
>
>   --
>   You received this message because you are subscribed to the Google
>   Groups "pandoc-discuss" group.
>   To unsubscribe from this group and stop receiving emails from it, send
>   an email to [1]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>   To post to this group, send email to
>   [2]pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>   To view this discussion on the web visit
>   [3]https://groups.google.com/d/msgid/pandoc-discuss/0f962214-56c6-4e73-
>   9826-b2de0c40250d%40googlegroups.com.
>   For more options, visit [4]https://groups.google.com/d/optout.
>
>References
>
>   1. mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>   2. mailto:pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>   3. https://groups.google.com/d/msgid/pandoc-discuss/0f962214-56c6-4e73-9826-b2de0c40250d-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org?utm_medium=email&utm_source=footer
>   4. https://groups.google.com/d/optout


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How to write math equations for LatTeX *and* for HTML output?
       [not found] ` <0f962214-56c6-4e73-9826-b2de0c40250d-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  2016-03-29  4:22   ` John MacFarlane
@ 2016-03-29  5:43   ` Denis Navas Vega
  2016-03-29 11:53   ` news-WPTjrydoUPgeaOpM6FAJmQkbCANdLtlA
  2 siblings, 0 replies; 4+ messages in thread
From: Denis Navas Vega @ 2016-03-29  5:43 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

El 2016-03-28 a las 14:36, 
news-WPTjrydoUPgeaOpM6FAJmQkbCANdLtlA@public.gmane.org escribió:
> (variance is $s^2$)

This way works:

\begin{equation}

s = \sqrt{\frac{\sum(x_i - \bar{x})^2}{n-1}} \quad \text{(variance is 
$s^2$)}

\end{equation}

Note that this expresion lacks \[ ... \] and that \text{...} requires 
usepackage{amsmath} in the document's preamble.

Stefan Kottwitz in "Beginner's Guide", shows examples with \[ \] but 
without the equation environment and when uses the equation environment, 
does not uses \[ \].





---
El software de antivirus Avast ha analizado este correo electrónico en busca de virus.
https://www.avast.com/antivirus


-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/ndd4ma%24api%241%40ger.gmane.org.
For more options, visit https://groups.google.com/d/optout.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How to write math equations for LatTeX *and* for HTML output?
       [not found] ` <0f962214-56c6-4e73-9826-b2de0c40250d-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  2016-03-29  4:22   ` John MacFarlane
  2016-03-29  5:43   ` Denis Navas Vega
@ 2016-03-29 11:53   ` news-WPTjrydoUPgeaOpM6FAJmQkbCANdLtlA
  2 siblings, 0 replies; 4+ messages in thread
From: news-WPTjrydoUPgeaOpM6FAJmQkbCANdLtlA @ 2016-03-29 11:53 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 1408 bytes --]

Thanks for the hints Just using $$ without the equation env works fine in 
both output cases. :-)

On Tuesday, March 29, 2016 at 7:36:49 AM UTC+11, 
ne...-WPTjrydoUPgeaOpM6FAJmQkbCANdLtlA@public.gmane.org wrote:
>
> For HTML output I write equations in the markdown source as:
>
> $$
> \begin{equation}
> s = \sqrt{\frac{\sum(x_i - \bar{x})^2}{n-1}} \quad \text{(variance is 
> $s^2$)}
> \end{equation}
> $$
>
>
> This renders beautiful.
>
> However when compiling the same source to LaTeX, I get a LaTeX file 
> containing:
>
> \[
> \begin{equation}
> s = \sqrt{\frac{\sum(x_i - \bar{x})^2}{n-1}} \quad \text{(variance is 
> $s^2$)}
> \end{equation}
> \]
>
>
> which produces in pdflatex the LaTeX Error: *Bad math environment 
> delimiter*
>
> How do I write math equations which compile properly to LatTeX *and* to 
> HTML output?
>

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/9d017a60-3894-4710-9ddf-a364a0b6750b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 2785 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-03-29 11:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-28 20:36 How to write math equations for LatTeX *and* for HTML output? news-WPTjrydoUPgeaOpM6FAJmQkbCANdLtlA
     [not found] ` <0f962214-56c6-4e73-9826-b2de0c40250d-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2016-03-29  4:22   ` John MacFarlane
2016-03-29  5:43   ` Denis Navas Vega
2016-03-29 11:53   ` news-WPTjrydoUPgeaOpM6FAJmQkbCANdLtlA

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).