2

I'm looking into replicating (or approaching) the following poster/cheatsheet produced by the International Baccalaureate Organization:

enter image description here

In positioning the nodes/boxes relative to each other, I have found that I had to tweak node distance= on a case by case basis: Is there a way to set so that the vertical and horizontal distances are the same irrespective of the size of the boxes?

If anyone knows how to set up a font that more closely resembles the original, I'd greatly appreciate any suggestions. I haven't looked into replicating the style of the figures yet, that's for another day!

Here's my attempt at positioning boxes:

% !TEX TS-program = xelatex
% !TeX spellcheck = fr
% !TEX encoding = UTF-8 Unicode
\documentclass[landscape,letterpaper]{article}
\usepackage[svgnames]{xcolor}
\usepackage{graphicx}

% font stuff \usepackage[math-style=upright]{unicode-math} \defaultfontfeatures{Scale=MatchLowercase} \setmainfont{Bradley Hand} \setmathfont{GFS Neohellenic Math}

% tikz libraries \usepackage{tikz} \usetikzlibrary{calc,positioning} \usetikzlibrary{shapes,arrows} \usetikzlibrary{decorations.pathmorphing}

% Define box styles % Define box styles \tikzset{boxstyle/.style={draw=Gold, minimum height=1ex, minimum width=5em}, fluffybox/.style={boxstyle, fill=white, very thick, decorate, decoration={random steps,segment length=3pt,amplitude=1pt}}, doublebox/.style = {boxstyle, fill=Lavender!50, thick, double}, line/.style = {very thick, draw=Gold}, pointer/.style = {very thick, draw=Gold, -latex'} }
\begin{document}

\begin{tikzpicture} % title \node [doublebox] (A) {Interesting Title}; % node A \node [fluffybox, below of=A] (B) {% $ \lim_{t \to \infty} \frac{\partial}{\partial t} \int_0^{2 \muppi} \frac{t^2}{2} \mathop{\symup{d}t} \leq \sum_{i=1}^N \frac{\muppi i}{\sqrt 2} \approx \increment \symbfup{v}t $ }; % node B \node [fluffybox, node distance=5cm, right of=B] (C) {% $ \frac{\sin \theta}{\Theta} = \frac{\sin \varphi}{\Phi} = \frac{\sin \gamma}{\Gamma} $ }; % edge \path [line] (B) -- (C); % node C \node [fluffybox, node distance=2cm, below of=B] (D) {% $ x^n+y^n = z^n $ }; % pointer \path [pointer] (B) -- (D); % title \node [doublebox, below of=C] (E) {Lettres Intéressantes: ç, ï, ê, œ}; % image \node [fluffybox, node distance=2cm, below of=E] (F) {% \includegraphics[width=0.3\linewidth,height=0.3\textheight,keepaspectratio]% {example-image-a.jpg} };

\end{tikzpicture}

\end{document}

enter image description here

I'm compiling with XeLaTeX and plan to write a French version of this, hence the experiment with accents.

EDIT If I set the node distances globally, say \tikzset{node distance = 2cm and 2cm}, I get the correct distance for some boxes but not for others, e.g.:

enter image description here

PatrickT
  • 2,923
  • does this help - https://tex.stackexchange.com/a/332796/197451.-- also what about using a table to place the figures at equidistant in rows and columns or a matrix – js bibra Jan 23 '24 at 04:07
  • 1
    Also, it is better to use tilzset instead of tikzstyle which is deprecated.

    \tikzset{inicio/.style = {rectangle, rounded corners, minimum width=3cm, minimum height=1cm,text centered, draw=black, fill=yellow}, nodo/.style = {rectangle, rounded corners, minimum width=3cm, minimum height=1cm,text centered, draw=black}, }

    – js bibra Jan 23 '24 at 04:09
  • Thanks @jsbibra, I'll update to \tikset. So I don't want a table with fixed widths and heights, but instead randomly sized and positioned boxes that have a fixed distance between them. Thanks! – PatrickT Jan 23 '24 at 04:16
  • for fixed distance use the link - https://tex.stackexchange.com/a/332796/197451 – js bibra Jan 23 '24 at 04:17
  • Thanks, but this doesn't produce the expected result. I'm updating the question to explain. – PatrickT Jan 23 '24 at 04:21
  • The font looks like "Barter with Gypsy". https://www.whatfontis.com/FF_Barter-with-a-Gypsy-Bold.font? – anis Jan 23 '24 at 08:33
  • @anis, Oh! great. Would you know how to set it up? I tried \setmainfont{BarterwithaGypsy} without success. (what a font name that is) – PatrickT Jan 23 '24 at 08:57
  • Let me make an answer. – anis Jan 23 '24 at 10:10
  • For the drawing part, I still don't understand what you want to achieve vs what you have. – anis Jan 23 '24 at 10:13
  • For the box positioning, I would like to set the distance between one box's edge and the next box's edge to be a fixed distance, say 2cm, and not have to tweak on a case by case basis based on the size of the box, as I am doing in the code above. – PatrickT Jan 24 '24 at 09:16
  • Use this syntax: [fluffybox, right = of B.east]. you can even go for [fluffybox, right = of B.east, anchor=west]. it basically indicates that exact distance between the east anchor of the node B is node distance from the west anchor of the current node. – anis Jan 24 '24 at 12:30
  • @PatrickT Great summary. Would you mind posting the final result ? Much interested :) – JeT Jan 25 '24 at 12:54

2 Answers2

2
\documentclass[tikz, border=1cm]{standalone}
\usetikzlibrary{decorations.pathmorphing, positioning}
\tikzset{
cloudframed/.style={path picture={
\draw[orange!30!yellow, ultra thick, fill=white]
decorate[decoration={bent, amplitude=3pt}]{
decorate[decoration={random steps, segment length=12pt, amplitude=1pt}]{
([shift={(5pt,5pt)}]path picture bounding box.south west) rectangle ([shift={(-5pt,-5pt)}]path picture bounding box.north east)
}};}},
boxstyle/.style={cloudframed, align=left, inner sep=10pt, font=\sc\bf},
conn/.style={orange!30!yellow, ultra thick},
node distance=0.5cm and 0.5cm,
}
\pgfdeclarelayer{foreground}
\pgfdeclarelayer{background}
\pgfsetlayers{background, main, foreground}
\begin{document}
\begin{tikzpicture}
\node[boxstyle] (A) {$Z\sim N(0,1)$};
\node[boxstyle, right=of A] (B) {Z is the number of\\standard deviations\\away from mean};
\node[boxstyle, below=of B, minimum size=4cm] (C) {};
\begin{pgfonlayer}{background}
\draw[conn] (A.center) -- (B.center);
\draw[conn] (B.center) -- (C.center);
\end{pgfonlayer}
\end{tikzpicture}
\end{document}

Three yellow boxes with a cloud shaped border

  • does the trick thank you so much! I'll have to investigate the font issues separately (sounds like no small feat from what anis said in a comment!) – PatrickT Jan 25 '24 at 18:15
  • 1
    Yes - it is alway better to ask several questions (and add links to old ones, if it is needed for context) with smaller self contained questions/tasks. – hpekristiansen Jan 26 '24 at 13:44
1

For the font part:

The font looks like "Barter with a Gypsy". whatfontis.com

Using xelatexI can compile the following:

\documentclass[12pt,a4paper]{article}
\usepackage{lipsum}
\usepackage{fontspec}
\setmainfont[]{Barter with a Gypsy}

\begin{document} \lipsum[1] \end{document}

The font has to be downloaded and installed first (double click the ttf file and press install).

Edit: there supposedly exists a way to load fonts from a folder but I could not make it work.

See: Load fonts that are in a ./fonts directory

anis
  • 1,510
  • 5
  • 13
  • Thanks @anis! So this prints basic text, but not the accents and math above. Any thoughts? – PatrickT Jan 24 '24 at 09:14
  • 1
    Bater with a Gypsy doesn't define accented characters. https://www.dafont.com/barter-with-a-gypsy.font?text=%E9crire. To my knowledge, there are two ways: define a new font that does or manually create a macro that adds an image of the size of a character. https://tex.stackexchange.com/questions/13594/how-to-add-a-custom-symbol-to-latex . Both are terrible. You may want to open a new question for this specific case. – anis Jan 24 '24 at 10:58
  • Thanks @anis for the tip! – PatrickT Jan 25 '24 at 17:59