From 247399917fff513bacf0e465d5709edae32d0a48 Mon Sep 17 00:00:00 2001 From: Malin Freeborn <malinfreeborn@posteo.net> Date: Mon, 30 Jan 2023 08:49:13 +0100 Subject: [PATCH] allow mapPic to adjust size --- docs.tex | 8 +++++++- layout.sty | 12 ++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/docs.tex b/docs.tex index 9a1e9c93..3ee056a5 100644 --- a/docs.tex +++ b/docs.tex @@ -182,7 +182,7 @@ Wider pictures should be placed with \verb"\widePic{s1}", and they will appear o The map function works like \verb"\widePic", but for maps. You can add a list of coordinates, and the names or number-labels to place on those coordinates. -\mapPic{../config/images/l1}{0.8/0.8/Toptown, 0.2/0.75/Leftown,0.8/0.6/2} +\mapPic[\large]{../config/images/l1}{0.8/0.8/\Huge Toptown, 0.2/0.75/Leftown,0.8/0.6/2} Imagine the shield image is a map to be labelled. We can start by putting `Toptown' at the top. @@ -200,6 +200,12 @@ We can even add commands, such as \verb"\ref{basement}" to get some number assoc \mapPic{../config/images/l1}{0.8/0.8/Toptown, 0.2/0.75/Leftown,0.8/0.6/2} \end{verbatim} +An optional argument allows default size changes for the words, and as usual words can change their sizes individually. + +\begin{verbatim} + \mapPic[\small]{../config/images/l1}{0.8/0.8/\large Toptown, 0.2/0.75/Leftown,0.8/0.6/\ref{basement}} +\end{verbatim} + \subsection{Symbols} \begin{tabularx}{\linewidth}{Xcc} diff --git a/layout.sty b/layout.sty index e36e5cdb..bf9a2119 100644 --- a/layout.sty +++ b/layout.sty @@ -260,24 +260,24 @@ bookmarks=true]% \end{figure*} } -\newcommand\mapLegend[3]{ - \node [black, font=\bfseries] at (#1,#2) {\huge #3}; +\newcommand\mapLegend[4]{ + \node [black, font=\bfseries] at (#1,#2) {#4 #3}; } -\newcommand\mapPic[2]{ +\newcommand\mapPic[3][\Huge]{ \begin{figure*}[t!] \begin{tikzpicture}[every shadow/.style={ shadow blur invert, shadow xshift=-1pt, shadow yshift=-3pt }] - \node[anchor=south west,inner sep=0] (image) at (0,0) {\includesvg[width=\textwidth]{images/#1}}; + \node[anchor=south west,inner sep=0] (image) at (0,0) {\includesvg[width=\textwidth]{images/#2}}; \begin{scope}[ x={(image.south east)}, y={(image.north west)} ] - \foreach \mX/\mY/\mNum in {#2}{ - \mapLegend{\mX}{\mY}{\mNum} + \foreach \mX/\mY/\mNum in {#3}{ + \mapLegend{\mX}{\mY}{\mNum}{#1} } \end{scope} \end{tikzpicture} -- GitLab