Skip to content

Instantly share code, notes, and snippets.

@pbelmans
Created December 14, 2012 22:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pbelmans/4289081 to your computer and use it in GitHub Desktop.
Save pbelmans/4289081 to your computer and use it in GitHub Desktop.
A TeX version of Mumford's treasure map
\documentclass[10pt,a4paper,landscape]{article}
\usepackage[T1]{fontenc}
\usepackage{amsmath, amsfonts}
\usepackage[charter]{mathdesign}
\usepackage[scaled]{beramono,berasans}
\usepackage{ifthen}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing, arrows}
\begin{document}
\thispagestyle{empty}
\begin{tikzpicture}
[line/.style = {very thick},
generic/.style = {thick, decorate, decoration = {random steps, segment length = 2.5mm, amplitude = 2mm}, rounded corners},
font = \scriptsize]
% logarithmic x-axis
\newcommand\primelog[1]{-30/(#1^.2)}
\pgfmathsetseed{1002}
% how high do we want our picture to go?
\def\height{6}
% how many primes should we depict?
\def\primes{2,3,5,7,11,13,17,19}
% the square containing our picture
\draw ({\primelog{2}-1.5},-.5)
-- ({\primelog{25}+1.5},-.5)
-- ({\primelog{25}+1.5},\height-.5)
-- ({\primelog{2}-1.5},\height-.5)
-- cycle;
% vertical lines
\foreach \p in \primes {
\draw[line] ({\primelog{\p}},-1) -- ++ (0,\height+1);
}
% we only name a few of the vertical lines end their generic points
\foreach \p in {2,3,5,7} {
\ifthenelse{\p<7}{\node at ({\primelog{\p}+0.2},\height-1.5) [right] {$[(\p)]$};}{}
\node at ({\primelog{\p}},-1) [below] {$\mathbb{V}((\p))$};
\foreach \k in {0,...,8} {
\draw[generic] ({\primelog{\p}},\height-1) -- ++ (0,-1);
}
}
\node at ({\primelog{11}},-1) [below] {\phantom{$\mathbb{V}$}$\ldots$\phantom{$\mathbb{V}$}}; % TODO ugly hack
% generic point
\node at ({\primelog{27}},\height-2.3) {$[(0)]$ generic point};
\foreach \k in {0,...,6} {
\draw[generic] ({\primelog{25}+1},\height-1) -- ++ (0,-1) -- ++ (-.3,.7) -- ++ (-.7,.3) -- ++ (1,0) -- ++ (-.4,-.4);
}
% linear (p,x)
\foreach \p in {2,3,5} {
\draw[fill] ({\primelog{\p}},0) circle (2pt) node [above right] {$[(\p,X)]$};
}
\foreach \p in {7,11,13,17,19,23} {
\draw[fill] ({\primelog{\p}},0) circle (2pt);
}
\draw[line] ({\primelog{2}-1},0) -- ({\primelog{25}+1.5},0);
\node at ({\primelog{25}+.5},0.3) {$(X)$};
\foreach \k in {0,...,5} {
\draw[generic, decoration = {amplitude = 1mm}] ({\primelog{25}},0) -- ++ (1,0);
}
% the linear points
\foreach \p/\k/\h/\pos in {2/1/2/left, 3/1/1/right, 5/1/0.8/right, 3/2/3/right, 5/2/1.6/below right, 5/3/2.4/above right, 5/4/3.2/right} {
\draw[fill] ({\primelog{\p}},\h) circle (2pt) node [\pos] {$[(\p,X+\k)]$};
}
\foreach \h in {1,2,3,5,6,7} {
\draw[fill] ({\primelog{7}},4/8*\h) circle (2pt);
}
% x^2+1
\draw[line]
({\primelog{2}},2)
.. controls ++ (0,1) and ++ (-1,0) ..
({\primelog{3}},2+1/10)
.. controls ++ (1,0) and ++ (-1,0) ..
({\primelog{5}},12/5)
.. controls ++ (.5,0) and ++ (-.5,0) ..
({\primelog{7}},16/8+1/10)
-- ++ (0.5,0);
\draw[line]
({\primelog{2}},2)
.. controls ++ (0,-1) and ++ (-1,0) ..
({\primelog{3}},2-1/10)
.. controls ++ (1,0) and ++ (-1,0) ..
({\primelog{5}},8/5)
.. controls ++ (.5,0) and ++ (-.5,0) ..
({\primelog{7}},16/8-1/10)
-- ({\primelog{25}+1.5},16/8-1/10);
\draw[densely dashed] ({\primelog{3}},2) ellipse [x radius = 4pt, y radius = 6pt];
\draw[densely dashed] ({\primelog{7}},2) ellipse [x radius = 4pt, y radius = 6pt];
\node at ({\primelog{25}+.5},2.3) {$(X^2+1)$};
\foreach \k in {0,...,10} {
\draw[generic] ({\primelog{25}},16/8-1/10) -- ++ (1,0);
}
\end{tikzpicture}
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment