Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

displaymath environment using $$ #225

Closed
jgm opened this issue Jun 10, 2011 · 9 comments
Closed

displaymath environment using $$ #225

jgm opened this issue Jun 10, 2011 · 9 comments
Assignees

Comments

@jgm
Copy link
Owner

jgm commented Jun 10, 2011

Using the following notation:

$$ math $$

to insert displaymath environments in latex is desirable. This is better
when more than one line of math is required, since we would otherwise need
a hanging initial $$math.

Using \begin{displaymath}\end{displaymath} is possible, but not as convenient.

The symbols $$ are very unlikely to mean "dollar dollar" when alone at the
beginning of a line.

Google Code Info:
Issue #: 128
Author: nicolas...@gmail.com
Created On: 2009-02-17T17:01:32.000Z
Closed On: 2009-02-26T14:57:45.000Z

@ghost ghost assigned jgm Jun 10, 2011
@jgm jgm closed this as completed Jun 10, 2011
@jgm
Copy link
Owner Author

jgm commented Jun 10, 2011

An alternative might be to use a single $, but line delimited to mean displaymath,
since the usual use of $ pairs is for inline math. Maybe we should consider if:

$
math
$

is unambiguous, since arguably, this could only mean display math, and could be
replaced with:

$math$

if inline math is desired. This is quite nice, since anything between $ pairs is
rendered as math one way or another.

Google Code Info:
Author: nicolas...@gmail.com
Created On: 2009-02-17T17:05:07.000Z

@jgm
Copy link
Owner Author

jgm commented Jun 10, 2011

Your original suggestion—having Pandoc recognize math between $$s—is better, since
it's consistent with what LaTeX does. There was consensus (I think) to make Pandoc
recognize them, see: http://groups.google.com/group/pandoc-discuss/msg/81d711015d3ddd0c
but it seems to have not been implemented yet.

Google Code Info:
Author: shreevat...@gmail.com
Created On: 2009-02-21T23:35:42.000Z

@jgm
Copy link
Owner Author

jgm commented Jun 10, 2011

Actually, it is already implemented in the SVN repository -- isn't it?
What version were you (nicholas.wu) testing with?

% pandoc -w latex
$$
\pi^2
$$
^D
[
\pi^2
]

Google Code Info:
Author: fiddloso...@gmail.com
Created On: 2009-02-26T06:48:07.000Z

@jgm
Copy link
Owner Author

jgm commented Jun 10, 2011

I'm using the latest stable (1.1) version. I haven't looked at the svn version.

The output of that command in 1.1 is:

pandoc -w latex
$$
\pi^2
$$
$$ \pi^{}2 $$

it looks like the $$ are turning into $$, rather than
\begin{displaymath} \end{displaymath}.
If I do the following:

pandoc -w latex
$$\pi^2$$
[\pi^2]

then the displaymath is generated properly (using [ ] notation), but
obviously, there is no carriage return after the first $$, so this is
a different example.

Google Code Info:
Author: nicolas...@gmail.com
Created On: 2009-02-26T10:07:22.000Z

@jgm
Copy link
Owner Author

jgm commented Jun 10, 2011

OK, then, this problem is already fixed in SVN, so I'm closing this bug.
I plan to release 1.2 pretty soon.

Google Code Info:
Author: fiddloso...@gmail.com
Created On: 2009-02-26T14:57:45.000Z

ranft pushed a commit to ranft/pandoc that referenced this issue Jul 15, 2011
* Added writerChapters to WriterOptions.
* Added --chapters command-line option.
* --chapters causes top-level headers to be "chapter" instead of
  "section" in LaTeX and DocBook.
* Resolves Issue jgm#225.
@sowiso
Copy link

sowiso commented Jan 20, 2014

We're on pandoc version 1.12.3.1. using the command
pandoc -f html+tex_math_dollars+tex_math_single_backslash -t latex

and find that displaymath between double dollars is not parsed correctly; the last dollar is escaped, as
$$math$$ becomes $$math$$

Is this a bug, or do we misuse something?

jgm added a commit that referenced this issue Jan 20, 2014
@jgm
Copy link
Owner Author

jgm commented Jan 20, 2014

It is a bug in pandoc's HTML reader. Pandoc is parsing this as

[Plain [Math InlineMath "$math",Str "$"]]

instead of

[Plain [Math DisplayMath "math"]]

Commit 6c59f06 should fix this.

+++ max cohen [Jan 20 14 05:26 ]:

We're on pandoc version 1.12.3.1. using the command
pandoc -f html+tex_math_dollars+tex_math_single_backslash -t latex

and find that displaymath between double dollars is not parsed
correctly; the last dollar is escaped, as
$$math$$ becomes $$math$$

Is this a bug, or do we misuse something?


Reply to this email directly or [1]view it on GitHub.
[3044__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcwNTc1NzE5Nywi
ZGF0YSI6eyJpZCI6MjM4NjE3NjB9fQ==--baedec686b492100bb2757cbee8c75611a80a
ab3.gif]

References

  1. displaymath environment using $$ #225 (comment)

@allefeld
Copy link
Contributor

allefeld commented Dec 7, 2019

Using

$$
math
$$

for display math is not explicitly documented in the manual. It can be inferred from

It will appear verbatim surrounded by (...) (for inline math) or [...] (for display math).

in the Math section, but I think writing this explicitly would be better.

@jgm
Copy link
Owner Author

jgm commented Dec 7, 2019

I'll add something to the manual.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants