beamer add tag
topnush
I have this MWE:

```
\documentclass{beamer}
\usepackage{tikz}

\usepackage[many]{tcolorbox}

\usepackage{listings}
\lstdefinestyle{duckstyle}{%
    moredelim=[is][\color{red}]{|}{|},
    mathescape=true,
    escapechar=@,
    basicstyle=\ttfamily,
    columns=fullflexible
}
\lstset{style=duckstyle}

\def\HiLi{\leavevmode\rlap{\hbox to \hsize{\color{yellow!50}\leaders\hrule height .55\baselineskip depth .4ex\hfill}}}


\newcommand{\Var}[1]{\ensuremath{\textcolor{varcolor}{#1}}}
\newcommand{\Proc}[1]{\textsc{#1}}
\newcommand{\Com}[1]{\textcolor{comcolor}{#1}}
\newcommand{\Blue}[1]{\textcolor{varcolor}{#1}}
\definecolor{varcolor}{RGB}{15,122,183}
\definecolor{comcolor}{RGB}{10,161,119}



\begin{document}
\begin{frame}[fragile]
\begin{overlayarea}{\textwidth}{\textheight} 
\begin{columns}
\begin{column}{0.5\textwidth}
\begin{tcolorbox}[colback=blue!5!white, text width=4.5cm,  left=7pt, right=10pt]
\begin{lstlisting}[basicstyle=\linespread{0.9}\ttfamily, mathescape]
@\Proc{Algo}@(@\Blue{j}@)

@\HiLi \Com{initialise}@ item @\Var{\alpha}@
@\HiLi \Com{initialise}@ counter @\Var{c=0}@
Repeat for each @\Var{j}@
	if @\Var{c}@ == 0
    	@\Var{\alpha} = \Var{j}@
        @\Var{c} = 1@
	elif @\Var{j} == \Var{\alpha}@
        @\Var{c} = \Var{c} + 1@
	else
     	@\Var{c} = \Var{c} - 1@
\end{lstlisting}
\end{tcolorbox}
\end{column}
%
\begin{column}{0.5\textwidth}  %%<--- here

Some text here

\end{column}
\end{columns}
	\end{overlayarea}
\end{frame}

\end{document}
```

![Screenshot from 2024-05-21 14-25-03.png](/image?hash=8ab7b21cd01b8e31901f3c5165788447865643c37d0f4b6e9b0e3489e00f71b1)


I have three problems:

1. For some reason this no indentation showing for the lines after "Repeat for each"
2. The second highlighted line is only highlighted up to the = sign. The 0 is not highlighted.
3. I would like to move "Some text here" higher up





Top Answer
samcarter
> 1. For some reason this no indentation showing for the lines after “Repeat for each”

Don't mix tabs and spaces. Indentation is easier to control if you stick to one method.

Alternatively, choose a suitable value for `tabsize=`. From your code, I would guess you want something like `tabsize=4`.

> 2. The second highlighted line is only highlighted up to the = sign. The 0 is not highlighted.

Your line is longer than the 4.5cm you allow it to be. The highlighting will only work until the end of the line, not for all the content sticking into the margin. Either add a line break or make your line wide enough. A warning in the .log file informs you about the overfull line

(if you increase the line width, remember to also change the column width to be wide enough)

> 3. I would like to move “Some text here” higher up

You could use the `T` option to top align the columns



```
\documentclass{beamer}
\usepackage{tikz}

\usepackage[many]{tcolorbox}

\usepackage{listings}
\lstdefinestyle{duckstyle}{%
    moredelim=[is][\color{red}]{|}{|},
    mathescape=true,
    escapechar=@,
    basicstyle=\ttfamily,
    columns=fullflexible
}
\lstset{style=duckstyle}

\def\HiLi{\leavevmode\rlap{\hbox to \hsize{\color{yellow!50}\leaders\hrule height .55\baselineskip depth .4ex\hfill}}}


\newcommand{\Var}[1]{\ensuremath{\textcolor{varcolor}{#1}}}
\newcommand{\Proc}[1]{\textsc{#1}}
\newcommand{\Com}[1]{\textcolor{comcolor}{#1}}
\newcommand{\Blue}[1]{\textcolor{varcolor}{#1}}
\definecolor{varcolor}{RGB}{15,122,183}
\definecolor{comcolor}{RGB}{10,161,119}



\begin{document}
\begin{frame}[fragile]
\begin{columns}[T,onlytextwidth]
\begin{column}{0.6\textwidth}
\begin{tcolorbox}[colback=blue!5!white, text width=5cm,  left=7pt, right=10pt]
\begin{lstlisting}[basicstyle=\linespread{0.9}\ttfamily, mathescape,tabsize=4]
@\Proc{Algo}@(@\Blue{j}@)

@\HiLi \Com{initialise}@ item @\Var{\alpha}@
@\HiLi \Com{initialise}@ counter @\Var{c=0}@
Repeat for each @\Var{j}@
  if @\Var{c}@ == 0
    @\Var{\alpha} = \Var{j}@
    @\Var{c} = 1@
  elif @\Var{j} == \Var{\alpha}@
    @\Var{c} = \Var{c} + 1@
  else
    @\Var{c} = \Var{c} - 1@
\end{lstlisting}
\end{tcolorbox}
\end{column}
%
\begin{column}{0.4\textwidth}

\vskip\baselineskip
Some text here

\end{column}
\end{columns}
\end{frame}

\end{document}
```


![document-1.png](/image?hash=c74ed643d6b6809ab886d49f19e295684b96d6e9799172c6459dc6df912a847c)

Enter question or answer id or url (and optionally further answer ids/urls from the same question) from

Separate each id/url with a space. No need to list your own answers; they will be imported automatically.