From 0acad8bd2fdd1b9919a25048fe877516be6e941c Mon Sep 17 00:00:00 2001 From: minjaesong Date: Thu, 17 Dec 2020 21:51:09 +0900 Subject: [PATCH] basic: tex env for typesetting code blocks --- assets/tbas/doc/langguide.tex | 4 ++-- assets/tbas/doc/tbasman.tex | 28 ++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/assets/tbas/doc/langguide.tex b/assets/tbas/doc/langguide.tex index 495e19f..ff7546c 100644 --- a/assets/tbas/doc/langguide.tex +++ b/assets/tbas/doc/langguide.tex @@ -1,4 +1,4 @@ -\begin{verbatim} +\begin{lstlisting} 10 REM TERRAN BASIC 20 REM REFERENCE MANUAL 30 REM For Version 1.0 @@ -6,4 +6,4 @@ 100 PRINT "Hello, world!" 110 PRINT "Git gud!" 999 END -\end{verbatim} +\end{lstlisting} diff --git a/assets/tbas/doc/tbasman.tex b/assets/tbas/doc/tbasman.tex index 7cab6c7..9f6cddc 100644 --- a/assets/tbas/doc/tbasman.tex +++ b/assets/tbas/doc/tbasman.tex @@ -27,6 +27,8 @@ \usepackage{soul} \usepackage{verbatim} \usepackage{etoolbox} +\usepackage[most]{tcolorbox} +\usepackage{listings} \usepackage{lineno} % debug @@ -86,7 +88,33 @@ \end{tabular*}% }} +\newtcolorbox{lgreybox}[1][]{% + breakable, + enhanced, + colback=lgrey, + attach title to upper, + fontupper=\monofont, + #1 +} +\definecolor{sourcecomment}{HTML}{888888} + +\lstset{frame=tb, + language=[Visual]Basic, + aboveskip=3mm, + belowskip=3mm, + showstringspaces=false, + columns=flexible, + basicstyle={\small\ttfamily}, + numbers=none, + numberstyle=\textbf, + keywordstyle=, + commentstyle=\color{sourcecomment}, + stringstyle=\textbf, + breaklines=true, + breakatwhitespace=true, + tabsize=3 +} %\aliaspagestyle{part}{empty} %\aliaspagestyle{chapter}{empty}