def to_ltx(a, fmt='{:6.4f}', latexarraytype='array', imstring='i', is_row_vector=True, mathform=True, brackets='()', mark_elements=[], mark_color='pink', separate_columns=[], separate_rows=[]):
    '\n    Return a LaTeX array given a numpy array.\n\n    Parameters\n    ----------\n    a : numpy.ndarray\n    fmt : str, default = \'{:6.2f}\'\n        python 3 formatter, optional-\n        https://mkaz.tech/python-string-format.html\n    latexarraytype : str, default = \'array\'\n        Any of\n\n        .. code:: python\n\n            "array"\n            "pmatrix"\n            "bmatrix"\n            "vmatrix"\n            "Vmatrix"\n            "Bmatrix"\n\n        if "array", you can specifiy the brackets\n        with the keyword ``brackets``.\n    imstring : str, default = \'i\'\n        Character to use to represent the imaginary unit.\n        Usually ``\'i\'`` or ``\'j\'``\n    is_row_vector : bool, default = True\n        If the array is 1D, should the output be\n        a row (True) or column (False) vector?\n    mathform : bool, default = True\n        wether to convert strings like ``1e+05``\n        to ``1\\times10^{5}``.\n    brackets : iterable, default = \'()\'\n        which brackets to use to wrap the matrix\n        (must be two elements long).\n        Use ``brackets = None`` if you don\'t want\n        any brackets around the array.\n    mark_elements : list, default = []\n        list of tuples containing element indices that\n        should be marked with a colorbox.\n    mark_color : str, default = \'pink\'\n        The color with which to mark matrix elements.\n    separate_columns : list, default = []\n        list of column indices before which a vertical\n        line should be drawn\n    separate_rows : list, default = []\n        list of row indices before which a horizontal\n        line should be drawn\n\n    Returns\n    -------\n    out: str\n        Formatted LaTeX string\n\n    Examples\n    --------\n    >>> from numpyarray_to_latex import to_ltx\n    >>> tex = to_ltx([[2.,2.],[2.,2.]])\n    >>> print(tex)\n    \\left(\n    \\begin{array}{}\n        2.00 &    2.00\\\\\n        2.00 &    2.00\n    \\end{array}\n    \\right)\n\n    '
    a = np.array(a)
    if (len(a.shape) > 2):
        raise NotImplementedError('Arrays having more than two dimensions cannot be converted.')
    if (mark_elements is None):
        mark_elements = []
    if ((a.ndim == 2) and (len(mark_elements) > 0) and (not all([hasattr(mark, '__len__') for mark in mark_elements]))):
        raise ValueError("If the array is 2D, ``mark_elements`` should be 2D as well, but isn't")
    if (len(a.shape) == 1):
        if ((len(mark_elements) > 0) and hasattr(mark_elements[0], '__len__')):
            raise ValueError("If the array is 1D, ``mark_elements`` should be 1D as well, but isn't.")
        a = np.array([a])
        if (is_row_vector is False):
            a = a.T
            mark_elements = [(mark, 0) for mark in mark_elements]
        else:
            mark_elements = [(0, mark) for mark in mark_elements]
    if isinstance(mark_elements, np.ndarray):
        mark_elements = mark_elements.tolist()
        mark_elements = [tuple(row) for row in mark_elements]
    (nrow, ncol) = a.shape
    out = ''
    if ((brackets is not None) and (latexarraytype not in ['bmatrix', 'pmatrix', 'vmatrix', 'Bmatrix', 'Vmatrix'])):
        out = (('\\left' + brackets[0]) + '\n')
    if (len(separate_columns) > 0):
        if (latexarraytype != 'array'):
            raise ValueError('column separators can only be used for `latexarraytype = "array"`')
        colstr = '{'
        for i in range(ncol):
            if ((i in separate_columns) and (i > 0)):
                colstr += '|'
            colstr += 'c'
        colstr += '}'
    else:
        colstr = '{}'
    out += (((('\\begin{' + latexarraytype) + '}') + colstr) + '\n')
    for i in np.arange(nrow):
        if ((i in separate_rows) and (i > 0)):
            out += '  \\hline\n'
        out = (out + ' ')
        for j in np.arange(ncol):
            this_element = ''
            if (np.real(a[(i, j)]) < 0):
                leadstr = ''
            else:
                leadstr = ' '
            if ('.' not in fmt.format(a[(i, j)])):
                dot_space = ' '
            else:
                dot_space = ''
            if np.iscomplexobj(a[(i, j)]):
                real = math_form(fmt.format(np.real(a[(i, j)])), mathform=mathform)
                real = real.lstrip(' ')
                imag = math_form(fmt.format(np.imag(a[(i, j)])), is_imaginary=True, mathform=mathform)
                imag = imag.lstrip(' ')
                if (not (imag.startswith('-') or imag.startswith('+'))):
                    number = ((real + '+') + imag)
                else:
                    number = (real + imag)
                this_element = ((((this_element + leadstr) + number) + imstring) + dot_space)
            else:
                this_element = (((this_element + leadstr) + math_form(fmt.format(np.real(a[(i, j)])), mathform=mathform)) + dot_space)
            if ((i, j) in mark_elements):
                this_element = (((('\\colorbox{' + mark_color) + '}{$') + this_element) + '$}  ')
            if (j < (ncol - 1)):
                this_element += ' & '
            out += this_element
        if (i < (nrow - 1)):
            out = (out + '\\\\\n')
    out = ((((out + '\n') + '\\end{') + latexarraytype) + '}')
    if ((brackets is not None) and (latexarraytype not in ['bmatrix', 'pmatrix', 'vmatrix', 'Bmatrix', 'Vmatrix'])):
        out += ('\n\\right' + brackets[1])
    return out
Return a LaTeX array given a numpy array.

Parameters
----------
a : numpy.ndarray
fmt : str, default = '{:6.2f}'
    python 3 formatter, optional-
    https://mkaz.tech/python-string-format.html
latexarraytype : str, default = 'array'
    Any of

    .. code:: python

        "array"
        "pmatrix"
        "bmatrix"
        "vmatrix"
        "Vmatrix"
        "Bmatrix"

    if "array", you can specifiy the brackets
    with the keyword ``brackets``.
imstring : str, default = 'i'
    Character to use to represent the imaginary unit.
    Usually ``'i'`` or ``'j'``
is_row_vector : bool, default = True
    If the array is 1D, should the output be
    a row (True) or column (False) vector?
mathform : bool, default = True
    wether to convert strings like ``1e+05``
    to ``1\times10^{5}``.
brackets : iterable, default = '()'
    which brackets to use to wrap the matrix
    (must be two elements long).
    Use ``brackets = None`` if you don't want
    any brackets around the array.
mark_elements : list, default = []
    list of tuples containing element indices that
    should be marked with a colorbox.
mark_color : str, default = 'pink'
    The color with which to mark matrix elements.
separate_columns : list, default = []
    list of column indices before which a vertical
    line should be drawn
separate_rows : list, default = []
    list of row indices before which a horizontal
    line should be drawn

Returns
-------
out: str
    Formatted LaTeX string

Examples
--------
>>> from numpyarray_to_latex import to_ltx
>>> tex = to_ltx([[2.,2.],[2.,2.]])
>>> print(tex)
\left(
\begin{array}{}
    2.00 &    2.00\\
    2.00 &    2.00
\end{array}
\right)
def to_ltx(a, fmt='{:6.4f}', latexarraytype='array', imstring='i', is_row_vector=True, mathform=True, brackets='()', mark_elements=[], mark_color='pink', separate_columns=[], separate_rows=[]):
    '\n    Return a LaTeX array given a numpy array.\n\n    Parameters\n    ----------\n    a : numpy.ndarray\n    fmt : str, default = \'{:6.2f}\'\n        python 3 formatter, optional-\n        https://mkaz.tech/python-string-format.html\n    latexarraytype : str, default = \'array\'\n        Any of\n\n        .. code:: python\n\n            "array"\n            "pmatrix"\n            "bmatrix"\n            "vmatrix"\n            "Vmatrix"\n            "Bmatrix"\n\n        if "array", you can specifiy the brackets\n        with the keyword ``brackets``.\n    imstring : str, default = \'i\'\n        Character to use to represent the imaginary unit.\n        Usually ``\'i\'`` or ``\'j\'``\n    is_row_vector : bool, default = True\n        If the array is 1D, should the output be\n        a row (True) or column (False) vector?\n    mathform : bool, default = True\n        wether to convert strings like ``1e+05``\n        to ``1\\times10^{5}``.\n    brackets : iterable, default = \'()\'\n        which brackets to use to wrap the matrix\n        (must be two elements long).\n        Use ``brackets = None`` if you don\'t want\n        any brackets around the array.\n    mark_elements : list, default = []\n        list of tuples containing element indices that\n        should be marked with a colorbox.\n    mark_color : str, default = \'pink\'\n        The color with which to mark matrix elements.\n    separate_columns : list, default = []\n        list of column indices before which a vertical\n        line should be drawn\n    separate_rows : list, default = []\n        list of row indices before which a horizontal\n        line should be drawn\n\n    Returns\n    -------\n    out: str\n        Formatted LaTeX string\n\n    Examples\n    --------\n    >>> from numpyarray_to_latex import to_ltx\n    >>> tex = to_ltx([[2.,2.],[2.,2.]])\n    >>> print(tex)\n    \\left(\n    \\begin{array}{}\n        2.00 &    2.00\\\\\n        2.00 &    2.00\n    \\end{array}\n    \\right)\n\n    '
    a = np.array(a)
    if (len(a.shape) > 2):
        raise NotImplementedError('Arrays having more than two dimensions cannot be converted.')
    if (mark_elements is None):
        mark_elements = []
    if ((a.ndim == 2) and (len(mark_elements) > 0) and (not all([hasattr(mark, '__len__') for mark in mark_elements]))):
        raise ValueError("If the array is 2D, ``mark_elements`` should be 2D as well, but isn't")
    if (len(a.shape) == 1):
        if ((len(mark_elements) > 0) and hasattr(mark_elements[0], '__len__')):
            raise ValueError("If the array is 1D, ``mark_elements`` should be 1D as well, but isn't.")
        a = np.array([a])
        if (is_row_vector is False):
            a = a.T
            mark_elements = [(mark, 0) for mark in mark_elements]
        else:
            mark_elements = [(0, mark) for mark in mark_elements]
    if isinstance(mark_elements, np.ndarray):
        mark_elements = mark_elements.tolist()
        mark_elements = [tuple(row) for row in mark_elements]
    (nrow, ncol) = a.shape
    out = 
    if ((brackets is not None) and (latexarraytype not in ['bmatrix', 'pmatrix', 'vmatrix', 'Bmatrix', 'Vmatrix'])):
        out = (('\\left' + brackets[0]) + '\n')
    if (len(separate_columns) > 0):
        if (latexarraytype != 'array'):
            raise ValueError('column separators can only be used for `latexarraytype = "array"`')
        colstr = '{'
        for i in range(ncol):
            if ((i in separate_columns) and (i > 0)):
                colstr += '|'
            colstr += 'c'
        colstr += '}'
    else:
        colstr = '{}'
    out += (((('\\begin{' + latexarraytype) + '}') + colstr) + '\n')
    for i in np.arange(nrow):
        if ((i in separate_rows) and (i > 0)):
            out += '  \\hline\n'
        out = (out + ' ')
        for j in np.arange(ncol):
            this_element = 
            if (np.real(a[(i, j)]) < 0):
                leadstr = 
            else:
                leadstr = ' '
            if ('.' not in fmt.format(a[(i, j)])):
                dot_space = ' '
            else:
                dot_space = 
            if np.iscomplexobj(a[(i, j)]):
                real = math_form(fmt.format(np.real(a[(i, j)])), mathform=mathform)
                real = real.lstrip(' ')
                imag = math_form(fmt.format(np.imag(a[(i, j)])), is_imaginary=True, mathform=mathform)
                imag = imag.lstrip(' ')
                if (not (imag.startswith('-') or imag.startswith('+'))):
                    number = ((real + '+') + imag)
                else:
                    number = (real + imag)
                this_element = ((((this_element + leadstr) + number) + imstring) + dot_space)
            else:
                this_element = (((this_element + leadstr) + math_form(fmt.format(np.real(a[(i, j)])), mathform=mathform)) + dot_space)
            if ((i, j) in mark_elements):
                this_element = (((('\\colorbox{' + mark_color) + '}{$') + this_element) + '$}  ')
            if (j < (ncol - 1)):
                this_element += ' & '
            out += this_element
        if (i < (nrow - 1)):
            out = (out + '\\\\\n')
    out = ((((out + '\n') + '\\end{') + latexarraytype) + '}')
    if ((brackets is not None) and (latexarraytype not in ['bmatrix', 'pmatrix', 'vmatrix', 'Bmatrix', 'Vmatrix'])):
        out += ('\n\\right' + brackets[1])
    return out