nice oval box for keycode

This commit is contained in:
Jan Benda 2015-11-15 12:37:29 +01:00
parent 87496d5f3d
commit 723339e509
2 changed files with 9 additions and 4 deletions

View File

@ -167,13 +167,18 @@
\newcommand{\reZpN}{\mathds{R^+_0}} \newcommand{\reZpN}{\mathds{R^+_0}}
\newcommand{\koZ}{\mathds{C}} \newcommand{\koZ}{\mathds{C}}
%%%%% english, german and code terms: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%% english, german, code and file terms: %%%%%%%%%%%%%%%
\newcommand{\enterm}[1]{``#1''} \newcommand{\enterm}[1]{``#1''}
\newcommand{\determ}[1]{\textit{#1}} \newcommand{\determ}[1]{\textit{#1}}
\newcommand{\codeterm}[1]{\textit{#1}} \newcommand{\codeterm}[1]{\textit{#1}}
\newcommand{\keycode}[1]{\texttt{#1}}
\newcommand{\file}[1]{\texttt{#1}} \newcommand{\file}[1]{\texttt{#1}}
%%%%% key-shortcuts %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{tikz}
\usetikzlibrary{shapes}
\tikzstyle{keybox} = [draw=blue!50!black,fill=white,thick,rectangle,rounded corners,inner sep=3pt,inner ysep=2pt]
\newcommand{\keycode}[1]{\begin{tikzpicture}[baseline=(box.base)]\node[keybox](box){\texttt{#1}};\end{tikzpicture}}
%%%%% code/matlab commands: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%% code/matlab commands: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{textcomp} \usepackage{textcomp}
\newcommand{\code}[1]{\setlength{\fboxsep}{0.5ex}\colorbox{blue!10}{\texttt{#1}}} \newcommand{\code}[1]{\setlength{\fboxsep}{0.5ex}\colorbox{blue!10}{\texttt{#1}}}

View File

@ -22,7 +22,7 @@ Guter Programmierstil greift auf unterschiedlichen Ebenen an:
\item Auslagerung von Funktionalit\"at in eigene Funktionen. \item Auslagerung von Funktionalit\"at in eigene Funktionen.
\end{enumerate} \end{enumerate}
\section{Organisation von m-Files im Dateisystem} \section{Organisation von Programmdateien im Dateisystem}
In der Einf\"uhrung zu Funktionen und Skripten wurde schon einmal ein In der Einf\"uhrung zu Funktionen und Skripten wurde schon einmal ein
typisches Programmlayout vorgestellt (\figref{programlayoutfig}). Hier typisches Programmlayout vorgestellt (\figref{programlayoutfig}). Hier
@ -242,7 +242,7 @@ end
\section{Verwendung von Kommentaren} \section{Verwendung von Kommentaren}
Kommentarzeilen werden in \matlab{} mit dem Prozentzeichen \cide{\%} Kommentarzeilen werden in \matlab{} mit dem Prozentzeichen \code{\%}
gekennzeichnet. Gezielt und sparsam eingesetzte Kommentare sind f\"ur gekennzeichnet. Gezielt und sparsam eingesetzte Kommentare sind f\"ur
das Verst\"andnis eines Programms sehr n\"utzlich. Am wichtigsten das Verst\"andnis eines Programms sehr n\"utzlich. Am wichtigsten
sind kurze Kommentare, die den Zweck und das Ziel eines Abschnitts im sind kurze Kommentare, die den Zweck und das Ziel eines Abschnitts im