pylatexenc/latex2text.py
def _nodelistcontents_to_text(self, nodelist):
        """
        Turn the node list to text representations of each node.  Basically apply
        `node_to_text()` to each node.  (But not quite actually, since we take
        some care as to where we add whitespace.)
        """
        s = ''
        prev_node = None
        for node in nodelist:
            if self._is_bare_macro_node(prev_node) and node.isNodeType(latexwalker.LatexCharsNode):
                if not self.strict_latex_spaces['between-macro-and-chars']:
                    # after a macro with absolutely no arguments, include post_space
                    # in output by default if there are other chars that follow.
                    # This is for more breathing space (especially in equations(?)),
                    # and for compatibility with earlier versions of pylatexenc (<=
                    # 1.3).  This is NOT LaTeX' default behavior (see issue #11), so
                    # only do this if `strict_latex_spaces=False`.
                    s += prev_node.macro_post_space
            s += self.node_to_text(node)
            prev_node = node
        return s
def _nodelistcontents_to_text(self, nodelist):
        """
        Turn the node list to text representations of each node.  Basically apply
        `node_to_text()` to each node.  (But not quite actually, since we take
        some care as to where we add whitespace.)
        """
        s = ''
        prev_node = None
        for node in nodelist:
            if self._is_bare_macro_node(prev_node) and node.isNodeType(latexwalker.LatexCharsNode):
                if not self.strict_latex_spaces['between-macro-and-chars']:
                    # after a macro with absolutely no arguments, include post_space
                    # in output by default if there are other chars that follow.
                    # This is for more breathing space (especially in equations(?)),
                    # and for compatibility with earlier versions of pylatexenc (<=
                    # 1.3).  This is NOT LaTeX' default behavior (see issue #11), so
                    # only do this if `strict_latex_spaces=False`.
                    s += prev_node.macro_post_space
            s += self.node_to_text(node)
            prev_node = node
        return s
Turn the node list to text representations of each node.  Basically apply
        `node_to_text()` to each node.  (But not quite actually, since we take
        some care as to where we add whitespace.)