复制精美的海报:TikZ 节点的相对位置

复制精美的海报:TikZ 节点的相对位置

我正在研究复制(或接近)国际文凭组织制作的以下海报/备忘单:

在此处输入图片描述

在将节点/框相对于彼此定位时,我发现我必须node distance=根据具体情况进行调整:有没有办法设置,使得垂直和水平距离相同,而不管框的大小如何?

如果有人知道如何设置更接近原始字体的字体,我将不胜感激任何建议。我还没有研究过如何复制人物的风格,那留到以后再说吧!

以下是我定位盒子的尝试:

% !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}

在此处输入图片描述

我正在编写XeLaTeX并计划编写此文的法语版本,因此对重音进行了实验。

编辑如果我全局设置节点距离,那么\tikzset{node distance = 2cm and 2cm}我会得到某些盒子的正确距离,但不会得到其他盒子的正确距离,例如:

在此处输入图片描述

答案1

\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}

三个带有云形边框的黄色盒子

答案2

对于字体部分:

字体看起来像“与吉普赛人进行易货贸易”。whatfontis.com

使用xelatex我可以编译以下内容:

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

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

首先必须下载并安装字体(双击 ttf 文件并按安装)。

编辑:据说存在一种从文件夹加载字体的方法,但我无法使其工作。

看:加载 ./fonts 目录中的字体

相关内容