Skip to content

Commit

Permalink
fix(latex-renderer): thematic break on new line
Browse files Browse the repository at this point in the history
Preceed `\hrulefill` by an empty line, so the thematic break is rendered
as a separate horizontal line between blocks of text. Otherwise, the
last line of the preceeding paragraph is filled with a horizontal rule.
(Tested with pdflatex, version pdfTeX 3.141592653-2.6-1.40.25 (TeX Live
2023/Debian))
  • Loading branch information
choeppler authored and pbodnar committed Sep 29, 2024
1 parent 0b7cdf7 commit a40cd2f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mistletoe/latex_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def render_table_cell(self, token):

@staticmethod
def render_thematic_break(token):
return '\\hrulefill\n'
return '\n\\hrulefill\n'

@staticmethod
def render_line_break(token):
Expand Down
2 changes: 1 addition & 1 deletion test/test_latex_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def test_table_cell(self):
self._test_token('TableCell', 'inner')

def test_thematic_break(self):
self._test_token('ThematicBreak', '\\hrulefill\n')
self._test_token('ThematicBreak', '\n\\hrulefill\n')

def test_line_break(self):
self._test_token('LineBreak', '\\newline\n', soft=False)
Expand Down

0 comments on commit a40cd2f

Please sign in to comment.