graphics.sty
author Christian Urban <christian.urban@kcl.ac.uk>
Mon, 02 Oct 2023 23:10:56 +0100
changeset 936 0b5f06539a84
parent 798 aaf0bd0a211d
permissions -rw-r--r--
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
242
35104ee14f87 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     1
\usepackage{tikz}
35104ee14f87 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     2
\usepackage{pgf}
252
e8ef8f38ca84 added style files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 242
diff changeset
     3
\usetikzlibrary{positioning}
e8ef8f38ca84 added style files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 242
diff changeset
     4
\usetikzlibrary{calc}
264
4deef8ac5d72 uodated hws
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 253
diff changeset
     5
\usetikzlibrary{automata}
265
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 264
diff changeset
     6
\usetikzlibrary{arrows}
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 264
diff changeset
     7
\usetikzlibrary{backgrounds}
332fbe9c91ab added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 264
diff changeset
     8
\usetikzlibrary{fit}
743
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 551
diff changeset
     9
\usetikzlibrary{shadows}
372
d6af4b1239de updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 368
diff changeset
    10
\usepackage{tikz-qtree}
252
e8ef8f38ca84 added style files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 242
diff changeset
    11
\usepackage{graphicx} 
253
75c469893514 added coursework
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 252
diff changeset
    12
\usepackage{pgfplots}
252
e8ef8f38ca84 added style files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 242
diff changeset
    13
743
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 551
diff changeset
    14
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 551
diff changeset
    15
551
bd551ede2be6 updated
Christian Urban <urbanc@in.tum.de>
parents: 399
diff changeset
    16
\pgfplotsset{compat=1.15}
368
a9911966c0df updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
    17
252
e8ef8f38ca84 added style files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 242
diff changeset
    18
\newenvironment{bubble}[1][]{%
368
a9911966c0df updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
    19
\addtolength{\leftmargini}{4mm}%
a9911966c0df updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
    20
\begin{tikzpicture}[baseline=(current bounding box.north)]%
743
6acabeecdf75 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 551
diff changeset
    21
\draw (0,0) node[drop shadow,inner sep=2mm,fill=cream,ultra thick,draw=red,rounded corners=2mm]% 
252
e8ef8f38ca84 added style files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 242
diff changeset
    22
\bgroup\begin{minipage}{#1}\raggedright{}}
e8ef8f38ca84 added style files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 242
diff changeset
    23
{\end{minipage}\egroup;%
368
a9911966c0df updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 265
diff changeset
    24
\end{tikzpicture}\bigskip}
798
aaf0bd0a211d updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
    25
aaf0bd0a211d updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
    26
aaf0bd0a211d updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
    27
%%% for trees
aaf0bd0a211d updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
    28
%% http://anorien.csc.warwick.ac.uk/mirrors/CTAN/graphics/pgf/contrib/forest/forest.pdf
aaf0bd0a211d updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
    29
aaf0bd0a211d updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
    30
\newcommand\grid[1]{%
aaf0bd0a211d updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
    31
\begin{tikzpicture}[baseline=(char.base)]
aaf0bd0a211d updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
    32
  \path[use as bounding box]
aaf0bd0a211d updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
    33
    (0,0) rectangle (1em,1em);
aaf0bd0a211d updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
    34
  \draw[red!50, fill=red!20]
aaf0bd0a211d updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
    35
    (0,0) rectangle (1em,1em);
aaf0bd0a211d updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
    36
  \node[inner sep=1pt,anchor=base west]
aaf0bd0a211d updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
    37
    (char) at (0em,\gridraiseamount) {#1};
aaf0bd0a211d updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
    38
\end{tikzpicture}}
aaf0bd0a211d updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
    39
\newcommand\gridraiseamount{0.12em}
aaf0bd0a211d updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
    40
aaf0bd0a211d updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
    41
\makeatletter
aaf0bd0a211d updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
    42
\newcommand\Grid[1]{%
aaf0bd0a211d updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
    43
  \@tfor\z:=#1\do{\grid{\z}}}
aaf0bd0a211d updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
    44
\makeatother	
aaf0bd0a211d updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
    45
aaf0bd0a211d updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
    46
\newcommand\Vspace[1][.3em]{%
aaf0bd0a211d updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
    47
  \mbox{\kern.06em\vrule height.3ex}%
aaf0bd0a211d updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
    48
  \vbox{\hrule width#1}%
aaf0bd0a211d updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
    49
  \hbox{\vrule height.3ex}}
aaf0bd0a211d updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
    50
aaf0bd0a211d updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 743
diff changeset
    51
\def\VS{\Vspace[0.6em]}