Advertisement
Thomas131

useful LaTeX-Functions

Feb 20th, 2018
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Latex 1.33 KB | None | 0 0
  1. % @author Thomas <mail@t131.us.to>
  2. % @license Public Domain
  3. % Verwendung z.B. \imagewdesc[width=250px]{code2flow_process.png}{Blockdiagramm der process-Funktion} (das zwischen den eckigen Klammern ist das styling und kann man weglassen, dann ist es 300px breit)
  4. % Referenzieren auf die Abbildung kann man dann damit: \ref{code2flow_process.png}
  5. \newcommand{\imagewdesc}[3][width=300px]{
  6.     \begin{figure}[h!]
  7.         \centering
  8.         \includegraphics[#1]{#2}
  9.         \caption{#3}
  10.         \label{#2}
  11.     \end{figure}
  12. }
  13.  
  14. % @author Thomas <mail@t131.us.to>
  15. % @license Public Domain
  16. % Verwendung wie \imagewdesc, nur ist das Bild gedreht ...
  17. \newcommand{\imagewdesc_sideway}[3][width=300px]{
  18.     \begin{sidewaysfigure}[!htbp]
  19.         \centering
  20.         \includegraphics[#1]{#2}
  21.         \caption{#3}
  22.         \label{#2}
  23.     \end{sidewaysfigure}
  24. }
  25.  
  26. % FΓΌr das gscheite Formatieren von Quellcode
  27. % @source: https://tex.stackexchange.com/questions/68091/how-do-i-add-syntax-coloring-to-my-c-source-code-in-beamer
  28. % \begin{lstlisting}
  29. % Quellcode
  30. % \end{lstlisting}
  31. \usepackage{listings}
  32. \lstset{language=C++,
  33.                basicstyle=\ttfamily,
  34.                keywordstyle=\color{blue}\ttfamily,
  35.                stringstyle=\color{red}\ttfamily,
  36.                commentstyle=\color{green}\ttfamily,
  37.                morecomment=[l][\color{magenta}]{\#},
  38.                breaklines=true
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement