latex_cheatsheet/sample.tex
2022-02-27 10:02:58 +01:00

129 lines
3.8 KiB
TeX

\documentclass[a4paper]{article}
\usepackage[ngerman]{babel}
\usepackage{cheatsheet}
\cheatsheettitle{Cheatsheet Example}
\cheatsheetauthor{Robert Jeutter}
\begin{document}
\begin{multicols}{3}\scriptsize
\section{Section}
\subsection{Subsection}
\subsubsection{Subsubsection}
\paragraph{Paragraph}
Some random text to show minimum space required. This is only an example, everybody who reads this does it to his own harm. We can write here a lot of stuff but it really is only for demonstration.
\section{Lists}
% use * to reduce required space
Item lists
\begin{itemize*}
\item This is
\item a small list
\item to show some
\item space
\end{itemize*}
Enumeration Lists
\begin{enumerate*}
\item This is
\item a small list
\item to show some
\item space
\end{enumerate*}
Description Lists
\begin{enumerate*}
\item[This] is a
\item[Small] list to
\item[Show] some space
\end{enumerate*}
\section{Icons}
There are currently two icons you can use
\begin{enumerate*}
\item \cmark $\quad\backslash$cmark
\item \xmark $\quad\backslash$xmark
\end{enumerate*}
And it can be used in Lists too
\begin{itemize*}
\item[\cmark] Checkmark
\item[\xmark] Cross
\end{itemize*}
\columnbreak
\section{Boxes}
\note{Title}{This is a little but helpful note you can use to highlight informations}
\note{}{Not all notes need captions.}
\warning{Warning}{This is a warning box.}
\warning{}{This is a another warning.}
\important{Important}{This might be something important to remember!}
\important{}{Some important boxes don't need caption}
\headnote{Notes can have titles}{And a text below.}
\headnote{}{This note has no title}
\newtcbox{\mynewbox}[1][red]{on line,
arc=0pt,outer arc=0pt,colback=#1!10!white,colframe=#1!50!black,
boxsep=0pt,left=1pt,right=1pt,top=2pt,bottom=2pt,
boxrule=0pt,bottomrule=1pt,toprule=1pt}
\newtcbox{\xmybox}[1][red]{on line,
arc=7pt,colback=#1!10!white,colframe=#1!50!black,
before upper={\rule[-3pt]{0pt}{10pt}},boxrule=1pt,
boxsep=0pt,left=6pt,right=6pt,top=2pt,bottom=2pt}
Need to \lhigh{highlight} some \lhigh[green]{words} in your text? \rhigh{Now} possible in \rhigh[blue]{two different} styles.
\columnbreak
\section{Code}
\begin{lstlisting}
main(void){
for(int i=0; i<10; i++ ){
//do something here
x+= 2;
}
echo("The loop is finished")
}
\end{lstlisting}
\section{Tables}
\begin{tabular}{l|c|r}
Nr & Sign & Code \\\hline
1 & $\Omega$ & $\backslash$Omega \\
2 & $\Theta$ & $\backslash$Theta \\
3 & $\rho$ & $\backslash$rho
\end{tabular}
\begin{tabular}{L{0.1\linewidth}|R{0.8\linewidth}}\scriptsize
84 & \href{http://www.gutenberg.org/ebooks/84}{Frankenstein; Or, The Modern Prometheus by Mary Wollstonecraft Shelley} \\
6087 & \href{https://www.gutenberg.org/ebooks/6087}{The Vampyre; a Tale by John William Polidori} \\
696 & \href{https://www.gutenberg.org/ebooks/696}{The Castle of Otranto by Horace Walpole} \\
42 & \href{https://www.gutenberg.org/ebooks/42}{The Strange Case of Dr. Jekyll and Mr. Hyde by Robert Louis Stevenson}
\end{tabular}
\end{multicols}
\flashcard{Definition}{Your Question?}{Maybe a theme?}{This is the answer to your Question}
\flashcard{}{Minimal Example}{}{Here is very little text}
\flashcard{}{Print a List}{This could be a hint}{You can fully configure the back:
\begin{itemize}
\item Test
\item Two
\item Three
\end{itemize}
}
\end{document}