Skip to content

Commit

Permalink
Added aastex.Section class.
Browse files Browse the repository at this point in the history
  • Loading branch information
byrdie committed Oct 28, 2023
1 parent a8a69f6 commit 902b7a7
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
19 changes: 19 additions & 0 deletions aastex/_latex.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"Label",
"Acronym",
"Abstract",
"Section",
"Document",
]

Expand Down Expand Up @@ -122,5 +123,23 @@ def __init__(
self.escape = False


class Section(pylatex.Section):
def __init__(
self,
title: None | str = None,
numbering: None | bool = None,
*,
label: pylatex.Label | bool | str = True,
**kwargs,
):
super().__init__(
title=title,
numbering=numbering,
label=label,
**kwargs,
)
self.escape = False


class Document(pylatex.Document):
pass
10 changes: 10 additions & 0 deletions aastex/_tests/test_latex.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,16 @@ class TestAbstract:
pass


@pytest.mark.parametrize(
argnames="a",
argvalues=[
aastex.Section("Introduction"),
],
)
class TestAbstract:
pass


@pytest.mark.parametrize(
argnames="a",
argvalues=[
Expand Down

0 comments on commit 902b7a7

Please sign in to comment.