It it difficult to create a question for this. I want to tex source code like here. Is this with listings? Which package do they use? How do I get the separate procedures in one line? And how do I get the borderline?

Source code

Sorry, if the question is bad. The source is this paper.

  • This looks like a table with four columns, or maybe four minipages side by side. The code itself I'm not sure, but it might have been entered manually, with a combination of \textbf, \textsf (sans serif), \texttt (teletype) and math mode.
    – Marijn
    Commented Aug 24, 2018 at 13:53
  • I'm not an expert but this looks like pseudocode. Have a look at this introduction to algorithms.
    – Max
    Commented Aug 24, 2018 at 13:53

1 Answer 1


Here is a start:

enter image description here


\usepackage[margin = 1in]{geometry}% Just for this example

  \texttt{IF} #1,
  \begin{itemize}[nosep, leftmargin = 1em]
  \begin{itemize}[nosep, leftmargin = 1em]
  \texttt{ELSE} #1
\newcommand{\OUTPUT}[1]{\texttt{OUTPUT} #1}
\newcommand{\RETURN}[1]{\texttt{RETURN} #1}


  \textbf{proc.}\ \textsf{#2} \par
\setlength{\procedurewidth}{.5\linewidth}% Default procedure width



      $(\sigma, I, \gamma, z) \assign \mathcal{D}(\sigma)$ \\
      $S \assign \var{refresh}(S, I)$ \\
      $c \assign c + \gamma$
      \IF{$c \geq \gamma^*$}
        $\var{corrupt} \assign \FALSE$
      $(\mathcal{S}, R_0) \assign \var{next}(S)$ \\
      $R_1 \assign \{0, 1\}^{\ell}$
      \IF{$\var{corrupt} = \TRUE$}
        $c \assign 0$ \\
      \LELSE \OUTPUT{$R_b$}
      $(\mathcal{S}, R) \assign \var{next}(\mathcal{S})$
      \IF{$\var{corrupt} = \TRUE$}
        $c \assign 0$
      $c \assign 0$, $\var{corrupt} \assign \TRUE$ \\
  \caption{Procedures in games $\RES{\gamma^*}$, $\FWD{\gamma^*}$, $\BWD{\gamma^*}$, $\ROB{\gamma^*}$
    for $\mathcal{G} = (\var{setup}, \var{refresh}, \var{next})$}


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .