Maybe something along these lines with TikZ:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{matrix,shapes.multipart,shapes.geometric,fit,scopes}
\tikzset{
>= latex,
el/.style={ellipse, draw, text width=8em, align=center},
rs/.style={rectangle split, draw, rectangle split parts=#1},
ou/.style={draw, inner xsep=1em, inner ysep=1ex, fit=#1}
}
\begin{document}
\begin{tikzpicture}
\matrix[matrix of nodes, row sep=5ex, column sep=1em] (mx) {
INPUT:& |[el]| newspaper text \\
ANALYSER& |[rs=3]|
lexical tagger\nodepart{two}morphological analyser\nodepart{three}parser \\
& |[el]| {analysed newspaper text} \\
SIMPLIFIER& |[rs=2]| syntactic simplifier\nodepart{two}lexical simplifier \\
OUTPUT:& |[el]| simplified newspaper text \\
};
\node[ou=(mx-2-2)] (ana) {};
\node[ou=(mx-4-2)] (sim) {};
{[->]
\draw(mx-1-2)edge(ana) (ana)edge(mx-3-2) (mx-3-2)edge(sim) (sim)edge(mx-5-2);
}
\end{tikzpicture}
\end{document}
Or, with MetaPost (compile with lualatex
):
\documentclass{article}
\usepackage{luamplib}
\begin{document}
\begin{mplibcode}
input boxes;
nodesep := 15; % space between nodes
ellipdy := 15; % the dy of ellipses
vardef cuta(suffix a, b) = % from Peter Grogono's MetaPost reference manual
drawarrow a.c -- b.c cutbefore bpath.a cutafter bpath.b;
enddef;
beginfig(1);
% define contents
circleit.txt("newspaper text");
boxjoin(a.sw = b.nw; a.se = b.ne);
boxit.lext("lexical tagger");
boxit.mora("morphological analyser");
boxit.prsr("parser");
boxjoin();
circleit.atxt("analysed text");
boxjoin(a.sw = b.nw; a.se = b.ne);
boxit.syns("syntactic simplifier");
boxit.lexs("lexical simplifier");
boxjoin();
circleit.stxt("simplified text");
% position and tweak
txt.dy = ellipdy;
atxt.dy = ellipdy;
stxt.dy = ellipdy;
lext.ne - lext.nw = (110,0);
txt.s - lext.n = (0,nodesep);
prsr.s - atxt.n = (0,nodesep);
atxt.s - syns.n = (0,nodesep);
lexs.s - stxt.n = (0,nodesep);
% draw everything
picture pic; pic := image(drawboxed(lext, mora, prsr););
draw pic; draw bbox pic;
drawboxed(txt, atxt);
pic := image(drawboxed(syns, lexs));
draw pic; draw bbox pic;
drawboxed(stxt);
cuta(txt, lext);
cuta(prsr, atxt);
cuta(atxt, syns);
cuta(lexs, stxt);
endfig;
end;
\end{mplibcode}
\end{document}
Run with --shell-escape
and needs imagemagick
installed.
\documentclass[preview,border={10pt 0pt 10pt 10pt}]{standalone}
\usepackage{filecontents}
\begin{filecontents*}{moon.tex}
\documentclass[tikz,preview,border=15mm]{standalone}
\usetikzlibrary{calc}
\usetikzlibrary{3d,calc}
\begin{document}
\foreach \x in {5,10,...,355}{
\begin{tikzpicture}
% Earth
\path[use as bounding box] (-3,-3) rectangle (3,3);
\shade[ball color=blue!10!white,opacity=0.20] (0,0) circle (1.5);
\node[align=center](earth) at (0,0) {Earth};
% Orbitz
\draw[circle] (0,0) circle (3);
%Moon
\shade[ball color=blue!10!white,opacity=0.20] (\x:3) circle (0.5);
\node[align=center](moon) at (\x:3) {Moon};
\end{tikzpicture}
}
\end{document}
\end{filecontents*}
%
\immediate\write18{pdflatex moon}
% convert to GIF animation
%\immediate\write18{convert -delay 10 -loop 0 -density 400 -alpha remove moon.pdf moon.gif}
%
% convert to PNG
\makeatletter
\immediate\write18{convert -density 200 -alpha on moon.pdf moon-\@percentchar02d.png}
\makeatother
\usepackage{animate}
\begin{document}
\begin{preview}
%\animategraphics[controls,autoplay,loop,scale=<integer>]{<frame rate>}{<PDF filename without extension>}{<left blank>}{<left blank>}
\animategraphics[controls,autoplay,loop,scale=1]{10}{moon}{}{}
\end{preview}
\end{document}
Elliptical orbits:
\documentclass[preview,border={10pt 0pt 10pt 10pt}]{standalone}
\usepackage{filecontents}
\begin{filecontents*}{moon.tex}
\documentclass[tikz,preview,border=-2mm]{standalone}
\usetikzlibrary{calc}
\usetikzlibrary{3d,calc}
\begin{document}
\foreach \x in {5,10,...,355}{
\begin{tikzpicture}[rotate=-52]
% Earth
\clip[use as bounding box,yslant=0.5,xslant=0.5,circle] (0,0) circle (5);
%\draw[use as bounding box] (-4,-4) rectangle (4,4);
\shade[ball color=blue!10!white,opacity=0.20] (0,0) circle (1.5);
\node[align=center](earth) at (0,0) {Earth};
% Orbitz
\begin{scope}[yslant=0.5,xslant=0.5]
\draw (0,0) circle (4);
%Moon
\node (\x) at (\x:4) {};
\node[align=center](moon) at (\x:4) {Moon};
\end{scope}
\shade[ball color=blue!10!white,opacity=0.20] (\x) circle (0.5);
\end{tikzpicture}
}
\end{document}
\end{filecontents*}
%
\immediate\write18{pdflatex moon}
% convert to GIF animation
%\immediate\write18{convert -delay 10 -loop 0 -density 400 -alpha remove moon.pdf moon.gif}
%
% convert to PNG
\makeatletter
\immediate\write18{convert -density 200 -alpha on moon.pdf moon-\@percentchar02d.png}
\makeatother
\usepackage{animate}
\begin{document}
\begin{preview}
%\animategraphics[controls,autoplay,loop,scale=<integer>]{<frame rate>}{<PDF filename without extension>}{<left blank>}{<left blank>}
\animategraphics[controls,autoplay,loop,scale=1]{10}{moon}{}{}
\end{preview}
\end{document}
Best Answer
A couple of months ago, I produced a
beamer
/tikz
animation (available on texample.net) of the Earth's orbit around the Sun to illustrate the counterintuitive fact that Earth is farther from the Sun in Summer than it is in Winter. I used that example to demonstrate the power of inducing (and then resolving) cognitive dissonance in the classroom.I've modified it to also show the Moon following an elliptical orbit around the Earth. (Of course, the Moon's orbit around the Earth is really only approximately elliptical, and does not lie in the Ecliptic Plane.) You can change the positions visited by the Earth and the Moon along their respective orbits (simply change how
\Earthangle
and\Moonangle
are defined in the body of the\foreach
, and/or modify the value of\N
).Here is non-animated version in the
article
class.