Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions pylatex/section.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,23 @@ class Section(Container):
#: subclasses will also have the new default.
numbering = True

def __init__(self, title, numbering=None, *, label=True, **kwargs):
def __init__(self, title, numbering=None, *, short=None, label=True, **kwargs):
"""
Args
----
title: str
The section title.
numbering: bool
Add a number before the section title.
short: str
The short section title.
label: Label or bool or str
Can set a label manually or use a boolean to set
preference between automatic or no label
"""

self.title = title
self.short = short

if numbering is not None:
self.numbering = numbering
Expand Down Expand Up @@ -71,7 +74,7 @@ def dumps(self):
else:
num = ""

string = Command(self.latex_name + num, self.title).dumps()
string = Command(self.latex_name + num, self.title, self.short).dumps()
if self.label is not None:
string += "%\n" + self.label.dumps()
string += "%\n" + self.dumps_content()
Expand Down