Skip to content

Commit a0ce233

Browse files
TorbjornTJelteF
authored andcommitted
Use \[ .. \] for display math instead of $$ ... $$
$$ .. $$ is not recommended for use with LaTeX, see http://tex.stackexchange.com/questions/503
1 parent 2c7c77b commit a0ce233

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

docs/source/changelog.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Changed
2828
- `.Tabular.add_row` now accepts a list of mappers
2929
- `.Tabular.add_row` now accepts cells as arguments, so they don't have to be
3030
wrapped in a `list` or `tuple` anymore.
31+
- Changed from using ``$$ ... $$`` for displaymath to using ``\[ ... \]``.
3132

3233
Added
3334
~~~~~

pylatex/math.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
class Math(Container):
1414
"""A class representing a math environment."""
1515

16+
packages = [Package('amsmath')]
17+
1618
content_separator = ' '
1719

1820
def __init__(self, *, inline=False, data=None):
@@ -39,7 +41,7 @@ def dumps(self):
3941

4042
if self.inline:
4143
return '$' + self.dumps_content() + '$'
42-
return '$$%\n' + self.dumps_content() + '%\n$$'
44+
return '\\[%\n' + self.dumps_content() + '%\n\\]'
4345

4446

4547
class VectorName(Command):

0 commit comments

Comments
 (0)