JelteF / PyLaTeX

A Python library for creating LaTeX files
https://jeltef.github.io/PyLaTeX/
MIT License
2.24k stars 287 forks source link

Proposal for `add_item` #381

Open dg-pb opened 6 months ago

dg-pb commented 6 months ago

It sometimes takes a lot of command calls to construct 1 item. Wouldn't it be convenient if the method looked more like:

def add_item(self, label, *s):
        self.append(Command("item", options=label))
        self.extend(s)

I could issue a PR if this makes sense. Doesn't break backwards compatibility.