Skip to content

Instantly share code, notes, and snippets.

@JonasBernard
Last active February 6, 2021 12:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JonasBernard/df70b13edfc457518abfb856d572bca3 to your computer and use it in GitHub Desktop.
Save JonasBernard/df70b13edfc457518abfb856d572bca3 to your computer and use it in GitHub Desktop.
LaTeX template for screenshot-populated PDF tutorials
\documentclass[a4paper,12pt]{article}
\usepackage{graphicx}
\usepackage{adjustbox}
\usepackage[top=30mm,textwidth=160mm]{geometry}
\usepackage[most]{tcolorbox}
\usepackage{changepage}
\title{Tutorial}
\author{Author}
\newenvironment{explanation}[2][]
{\begin{adjustwidth}{-2cm}{220pt}
\begin{adjustbox}{rndcorners=3pt}
\includegraphics[width=20cm,#1]{#2}
\end{adjustbox}
\end{adjustwidth}}
\tcbset{textmarker/.style={%
enhanced,parbox=false,boxrule=0mm,boxsep=0mm,
arc=0mm,outer arc=3pt,
left=1ex,right=1ex,top=1ex,bottom=1ex,
leftrule=3mm,toprule=-0.1mm,bottomrule=-0.1mm, rightrule=-1mm}}
\newtcolorbox{noteBox}[1][]{textmarker,colframe=blue,colback=blue!15!white}
\newtcolorbox{hintBox}[1][]{textmarker,colframe=yellow,colback=yellow!20!white}
\newtcolorbox{importantBox}[1][]{textmarker,colframe=red,colback=red!15!white}
\newcommand{\note}[1]{\begin{noteBox} \textbf{Note:} #1 \end{noteBox}}
\newcommand{\warning}[1]{\begin{hintBox} \textbf{Warning:} #1 \end{hintBox}}
\newcommand{\important}[1]{\begin{importantBox} \textbf{Important:} #1 \end{importantBox}}
\begin{document}
\maketitle
\newpage
\tableofcontents
\newpage
\section{Introduction}
This tutorial explains how to use this \LaTeX{} template.
\note{The \textbf{note} command gives you space for additional information.}
\warning{The \textbf{warning} command can be used to adress warnings.}
\important{The \textbf{important} command is a box to present very important information.}
\section{Usage of screenshots}
\begin{explanation}{screenshot1.png}
This text explains screenshot 1 in detail.
\end{explanation}
\section{Simple text}
Text does not have to belong to a screenshot, but can also be written as normal.
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment