Skip to content

Commit

Permalink
leading plus signs + are now stripped for siunitx notation within Mar…
Browse files Browse the repository at this point in the history
…kdown
  • Loading branch information
gpoore committed Aug 31, 2022
1 parent e332d71 commit af78fb9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

## v0.6.0 (dev)

* Leading plus signs `+` are now stripped for siunitx notation within
Markdown.

* Added `amsmath`, `amssymb`, and `siunitx` to template for LaTeX solutions
export.

Expand Down
1 change: 1 addition & 0 deletions text2qti/markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ def siunitx_num_to_plain_latex(self, number: str, in_math: bool=False) -> str:
number = number.lower()
if 'e' in number:
significand, magnitude = number.split('e', 1)
magnitude = magnitude.lstrip('+')
latex_number = f'{significand}\\times 10^{{{magnitude}}}'
else:
latex_number = number
Expand Down
2 changes: 1 addition & 1 deletion text2qti/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-

from .fmtversion import get_version_plus_info
__version__, __version_info__ = get_version_plus_info(0, 6, 0, 'dev', 7)
__version__, __version_info__ = get_version_plus_info(0, 6, 0, 'dev', 8)

0 comments on commit af78fb9

Please sign in to comment.