Description
This code defines a LaTeX document with the article
document class and imports several packages including tikz
and xparse
. It also defines a few custom colors using the RGB color model.
The code defines a new command called \MyArrow
using xparse
. This command takes five mandatory arguments and one optional argument. The command creates an arrow between two points on the page using TikZ. The arrow style and positioning can be customized using the optional argument.
The rest of the code defines an itemized list with several items. The \tikzmark
command is used to mark certain points on the page for use in the \MyArrow
command. The \MyArrow
command is then used three times to draw arrows between different points in the list.
Keywords
latex, tikz, xparse, tikzmark, decorations, calc, overlays, remember picture, draw, arrow, pic, define color, itemize, ex, em.
Source Code
\documentclass{article}
\usepackage{tikz}
\usepackage{xparse}
\usetikzlibrary{tikzmark,decorations.pathreplacing,calc,decorations.markings}
\definecolor{colori}{RGB}{166,35,41}
\definecolor{colorii}{RGB}{248,219,162}
\NewDocumentCommand\MyArrow{O{0pt}mmmO{out=150,in=210}}
{%
\begin{tikzpicture}[overlay, remember picture]
\draw [->,thick,line width=4pt,#4]
( $ ({pic cs:#3}|-{pic cs:#2}) + (-#1,1.3ex) $ ) to[#5]
( $ (pic cs:#3) + (-#1,0) $ );
\end{tikzpicture}%
}
\begin{document}
\MyArrow[0.8em]{start1}{end1}{colorii,line width=3pt}[out=90,in=-90]
\MyArrow[1.8em]{start2}{end1}{colori}[out=120,in=250]
\MyArrow[0.4em]{start3}{end3}{colori}[out=240,in=-30]
\begin{itemize}
\item\tikzmark{end1}Processing
\item\tikzmark{start1}Embedding in paraffin blocks
\item Microtomy
\item\tikzmark{start2}Staining
\item Microscopy
\item Testing \tikzmark{start3} \hfill Math \tikzmark{end3}
\item
\end{itemize}
\end{document}