def create_columns_component_l(data: GTData) -> str:
    """
    Create the columns component for LaTeX output.

    This function generates the LaTeX code for the columns component of a table which involves the
    column headings and the spanners.

    Parameters
    ----------
    data : GTData
        The GTData object that contains all the information about the table.

    Returns
    -------
    str
        The LaTeX code for the columns component of the table.
    """

    # Determine the finalized number of spanner rows
    spanner_row_count = _get_spanners_matrix_height(data=data, omit_columns_row=True)

    # Get the column headings
    headings_labels = data._boxhead._get_default_column_labels()

    # Ensure that the heading labels are processed for LaTeX
    headings_labels = [_process_text(x, context="latex") for x in headings_labels]

    table_col_headings = "".join(latex_heading_row(content=headings_labels))

    if spanner_row_count > 0:
        boxhead = data._boxhead

        table_col_spanners = []

        spanners, _ = spanners_print_matrix(
            spanners=data._spanners,
            boxhead=boxhead,
            include_hidden=False,
            ids=False,
            omit_columns_row=True,
        )

        # TODO: ensure that spanner IDs are not included in the output (spanner
        # labels should be used instead)

        # spanner_ids, spanner_col_names = spanners_print_matrix(
        #     spanners=data._spanners,
        #     boxhead=boxhead,
        #     include_hidden=False,
        #     ids=True,
        #     omit_columns_row=True,
        # )

        for i in range(len(spanners)):
            spanners_row = spanners[i]

            for k, v in spanners_row.items():
                if v is None:
                    spanners_row[k] = ""

            spanner_ids_index = spanners_row.values()
            spanners_rle = seq_groups(seq=spanner_ids_index)

            group_spans = [[x[1]] + [0] * (x[1] - 1) for x in spanners_rle]
            colspans = list(chain(*group_spans))
            level_i_spanners = []

            for colspan, span_label in zip(colspans, spanners_row.values()):
                if colspan > 0:
                    if span_label:
                        span = _process_text(span_label, context="latex")

                    else:
                        span = None

                    level_i_spanners.append(span)

            spanner_labs = []
            spanner_lines = []
            span_accumlator = 0

            for j, _ in enumerate(level_i_spanners):
                if level_i_spanners[j] is None:
                    # Get the number of columns to span nothing
                    span = group_spans[j][0]
                    spanner_labs.append("" * span)

                elif level_i_spanners[j] is not None:
                    # Get the number of columns to span the spanner
                    span = group_spans[j][0]

                    # TODO: Get alignment for spanner, for now it's center (`c`)

                    # Get multicolumn statement for spanner
                    multicolumn_stmt = f"\\multicolumn{{{span}}}{{c}}{{{level_i_spanners[j]}}}"

                    spanner_labs.append(multicolumn_stmt)

                    # Get cmidrule statement for spanner, it uses 1-based indexing
                    # and the span is the number of columns to span; we use the `span_accumlator`
                    # across iterations to adjust the starting index (j) to adjust for previous
                    # multicolumn spanning values

                    begin = j + span_accumlator + 1
                    end = j + span_accumlator + span

                    cmidrule = f"\\cmidrule(lr){{{begin}-{end}}}"

                    span_accumlator += span - 1

                    spanner_lines.append(cmidrule)

            spanner_labs_row = " & ".join(spanner_labs) + " \\\\ \n"
            spanner_lines_row = " ".join(spanner_lines) + "\n"

            col_spanners_i = spanner_labs_row + spanner_lines_row

            table_col_spanners.append(col_spanners_i)

        table_col_spanners = "".join(table_col_spanners)

    else:
        table_col_spanners = ""

    columns_component = "\\toprule\n" + table_col_spanners + table_col_headings

    return columns_component

    Create the columns component for LaTeX output.

    This function generates the LaTeX code for the columns component of a table which involves the
    column headings and the spanners.

    Parameters
    ----------
    data : GTData
        The GTData object that contains all the information about the table.

    Returns
    -------
    str
        The LaTeX code for the columns component of the table.
    
great_tables/_utils_render_latex.py