Skip to content

Instantly share code, notes, and snippets.

@titospadini
Last active May 9, 2024 13:00
Show Gist options
  • Save titospadini/3355265db5868d4742333ecaa7fcb16f to your computer and use it in GitHub Desktop.
Save titospadini/3355265db5868d4742333ecaa7fcb16f to your computer and use it in GitHub Desktop.
A simple box with rounded edges, and with a title, to show command-lines
\usepackage[table, dvipsnames]{xcolor}
\usepackage{changepage}
\usepackage[skins]{tcolorbox}
\newenvironment{coloredterminal}{
\begin{adjustwidth}{10mm}{}
\begin{tcolorbox}[colback=gray!10, boxrule=1pt, title=Terminal, fonttitle=\footnotesize]
}{
\end{tcolorbox}
\end{adjustwidth}
}
\newcommand{\terminal}[1]{
\begin{coloredterminal}
\ttfamily\footnotesize
#1
\end{coloredterminal}
}
\begin{document}
% just an example with multiple command-lines.
\terminal{
sudo apt update \\
sudo apt upgrade
}
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment