

from . import Container, Command


class SectionBase(Container):
    """A class that is the base for all section type classes."""

    def __init__(self, title, numbering=True, *args, **kwargs):
        """.

        Args
        ----
        title: str
            The section title.
        numbering: bool
            Add a number before the section title.

        """

        self.title = title
        self.numbering = numbering

        super().__init__(*args, **kwargs)

    def dumps(self):
        """Represent the section as a string in LaTeX syntax.

        Returns
        -------
        str

        """

        if not self.numbering:
            num = '*'
        else:
            num = ''

        string = Command(self.latex_name + num, self.title).dumps()
        string += self.dumps_content()

        return string



from . import Container, Command


class SectionBase(Container):
    """A class that is the base for all section type classes."""

    #: A section should normally start in its own paragraph
    end_paragraph = True

    def __init__(self, title, numbering=True, *args, **kwargs):
        """.

        Args
        ----
        title: str
            The section title.
        numbering: bool
            Add a number before the section title.

        """

        self.title = title
        self.numbering = numbering

        super().__init__(*args, **kwargs)

    def dumps(self):
        """Represent the section as a string in LaTeX syntax.

        Returns
        -------
        str

        """

        if not self.numbering:
            num = '*'
        else:
            num = ''

        string = Command(self.latex_name + num, self.title).dumps()
        string += self.dumps_content()

        return string

Set end_paragraph to True by default
Section: Set end_paragraph to True by default

  
  
  from . import Container, Command
  
  
  class SectionBase(Container):
      """A class that is the base for all section type classes."""
+ 
+     #: A section should normally start in its own paragraph
+     end_paragraph = True
  
      def __init__(self, title, numbering=True, *args, **kwargs):
          """.
  
          Args
          ----
          title: str
              The section title.
          numbering: bool
              Add a number before the section title.
  
          """
  
          self.title = title
          self.numbering = numbering
  
          super().__init__(*args, **kwargs)
  
      def dumps(self):
          """Represent the section as a string in LaTeX syntax.
  
          Returns
          -------
          str
  
          """
  
          if not self.numbering:
              num = '*'
          else:
              num = ''
  
          string = Command(self.latex_name + num, self.title).dumps()
          string += self.dumps_content()
  
          return string
  
Set end_paragraph to True by default
## Code Before:


from . import Container, Command


class SectionBase(Container):
    """A class that is the base for all section type classes."""

    def __init__(self, title, numbering=True, *args, **kwargs):
        """.

        Args
        ----
        title: str
            The section title.
        numbering: bool
            Add a number before the section title.

        """

        self.title = title
        self.numbering = numbering

        super().__init__(*args, **kwargs)

    def dumps(self):
        """Represent the section as a string in LaTeX syntax.

        Returns
        -------
        str

        """

        if not self.numbering:
            num = '*'
        else:
            num = ''

        string = Command(self.latex_name + num, self.title).dumps()
        string += self.dumps_content()

        return string

## Instruction:
Set end_paragraph to True by default
## Code After:


from . import Container, Command


class SectionBase(Container):
    """A class that is the base for all section type classes."""

    #: A section should normally start in its own paragraph
    end_paragraph = True

    def __init__(self, title, numbering=True, *args, **kwargs):
        """.

        Args
        ----
        title: str
            The section title.
        numbering: bool
            Add a number before the section title.

        """

        self.title = title
        self.numbering = numbering

        super().__init__(*args, **kwargs)

    def dumps(self):
        """Represent the section as a string in LaTeX syntax.

        Returns
        -------
        str

        """

        if not self.numbering:
            num = '*'
        else:
            num = ''

        string = Command(self.latex_name + num, self.title).dumps()
        string += self.dumps_content()

        return string
