% !TEX TS-program = pdflatex
% !TEX encoding = UTF-8 Unicode

\documentclass[11pt,a4paper]{article}
\usepackage[italian]{babel}
\usepackage[utf8]{inputenc}

\usepackage[margin=2.5cm]{geometry}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{tikz}
\usetikzlibrary{calc,intersections}



\title{Esempio di file \LaTeX}
\author{AA. VV.}

\begin{document}
\maketitle

Questo file ``esempio2.tex'' serve solo per verificare se l'installazione di \LaTeX\ funziona.

\section{Testo con \LaTeX}

\noindent
Stili: \\
\verb+\rm+ {\rm Normale}, 
\verb+\it+ {\it Corsivo}, 
\verb+\sl+ {\sl Inclinato},
\verb+\bf+ {\bf Grassetto},
\verb+\sf+ {\sf Sans Serif},
\verb+\tt+ {\tt Macchina da scrivere},
\verb+\sc+ {\sc Maiuscoletto}

\bigskip
\noindent
Grandezze: \\
{\tiny microscopico}, 
{\scriptsize apice o pedice}, 
{\footnotesize testo di una nota},
{\small piccolo},
{\normalsize normale},
{\large grande},
{\Large ancora più grande},
{\LARGE sempre più grande},
{\huge grandissimo},
{\Huge enorme} \\
che sono ottenuti rispettivamente con i comandi
\verb+\tiny+,
\verb+\scriptsize+,
\verb+\footnotesize+,
\verb+\small+,
\verb+\normalsize+,
\verb+\large+,
\verb+\Large+,
\verb+\LARGE+,
\verb+\huge+,
\verb+\Huge+.

\bigskip
\noindent
Lettere accentate o in altre lingue (se non presenti in tastiera): \\
\verb+\'e+ = \'e , \verb+\`e+ = \`e , \verb+\^a+ = \^a , \verb+\"u+ = \"u , \verb+\L+ = \L\ , \verb+\o+ = \o


\section{Matematica con \LaTeX}

%\subsection{Simboli in Matematica}

\noindent
Lettere greche:

\noindent
\begin{tabular}{clclclclcl}
$\alpha$ & \verb+\alpha+ & 
$\beta$  & \verb+\beta+ &
$\gamma$ & \verb+\gamma+ &
$\delta$ & \verb+\delta+ &
$\epsilon$ & \verb+\epsilon+ \\
$\varepsilon$ & \verb+\varepsilon+ &
$\zeta$ & \verb+\zeta+ &
$\eta$ & \verb+\eta+ &
$\theta$ & \verb+\theta+ &
$\vartheta$ & \verb+\vartheta+ \\
$\iota$ & \verb+\iota+ &
$\kappa$ & \verb+\kappa+ &
$\lambda$ & \verb+\lambda+ &
$\mu$ & \verb+\mu+ &
$\nu$ & \verb+\nu+ \\
$\xi$ & \verb+\xi+ &
$\pi$ & \verb+\pi+ &
$\varpi$ & \verb+\varpi+ &
$\rho$ & \verb+\rho+ &
$\varrho$ & \verb+\varrho+ \\
$\sigma$ & \verb+\sigma+ &
$\varsigma$ & \verb+\varsigma+ &
$\tau$ & \verb+\tau+ &
$\upsilon$ & \verb+\upsilon+ &
$\phi$ & \verb+\phi+ \\
$\varphi$ & \verb+\varphi+ &
$\chi$ & \verb+\chi+ &
$\psi$ & \verb+\psi+ &
$\omega$ & \verb+\omega+   &
$\Gamma$ & \verb+\Gamma+ \\
$\Delta$ & \verb+\Delta+ &
$\Theta$ & \verb+\Theta+ &
$\Lambda$ & \verb+\Lambda+ &
$\Xi$ & \verb+\Xi+ &
$\Pi$ & \verb+\Pi+ \\
$\Sigma$ & \verb+\Sigma+ &
$\Upsilon$ & \verb+\Upsilon+ &
$\Phi$ & \verb+\Phi+ &
$\Psi$ & \verb+\Psi+ &
$\Omega$ & \verb+\Omega+ \\
\end{tabular}

\bigskip
\noindent
Una selezione di simboli matematici:

%\nopagebreak[10]
\noindent
\begin{tabular}{clclclclcl}
$\perp$ & \verb+\perp+ &
$\|$ & \verb+\|+ &
$\nabla$ & \verb+\nabla+ &
$\partial$ & \verb+\partial+ &
$\infty$ & \verb+\infty+ \\

$\le$ & \verb+\le+ &
$\ll$ & \verb+\ll+ &
$\ge$ & \verb+\ge+ &
$\gg$ & \verb+\gg+ &
$\geqslant$ & \verb+\geqslant+ \\

$\pm$ & \verb+\pm+ &
$\times$ & \verb+\times+ &
$\odot$ & \verb+\odot+ &
$\oplus$ & \verb+\oplus+ &
$\otimes$ & \verb+\otimes+ \\


$\angle$ & \verb+\angle+ &
$\triangle$ & \verb+\triangle+ &
$\Box$ & \verb+\Box+ &
$\circ$ & \verb+\circ+ &
$\bigcirc$ & \verb+\bigcirc+ \\

$\Re$ & \verb+\Re+ &
$\Im$ & \verb+\Im+ &
$\mho$ & \verb+\mho+ & 
$\leadsto$ & \verb+\leadsto+ & 
$\approx$ & \verb+\approx+ \\

$\sum$ & \verb+\sum+ &
$\int$ & \verb+\int+ &
$\oint$ & \verb+\oint+ &
$\prod$ & \verb+\prod+ &  & \\
\end{tabular}

\bigskip
\noindent
Una selezione di frecce:

\noindent
\begin{tabular}{clclclcl}
$\rightarrow$ & \verb+\rightarrow+ &
$\longrightarrow$ & \verb+\longrightarrow+ &
$\Rightarrow$ & \verb+\Rightarrow+ \\
$\Longrightarrow$ & \verb+\Longrightarrow+ &
$\leftarrow$ & \verb+\leftarrow+ & 
$\leftrightarrow$ & \verb+\leftrightarrow+
\end{tabular}

\bigskip
\noindent
Accenti in matematica:

\noindent
\begin{tabular}{clclclclcl}
$\hat{a}$ & \verb+\hat{a}+ &
$\breve{a}$ & \verb+\breve{a}+ &
$\grave{a}$ & \verb+\grave{a}+ &
$\bar{a}$ & \verb+\bar{a}+ &
$\dot{a}$ & \verb+\dot{a}+ \\
$\vec{a}$ & \verb+\vec{a}+ &
$\check{a}$ & \verb+\check{a}+ &
$\acute{a}$ & \verb+\acute{a}+ &
$\tilde{a}$ & \verb+\tilde{a}+ &
$\ddot{a}$ & \verb+\ddot{a}+ 
\end{tabular}

%\bigskip
%\noindent
%Nomi di funzioni che sono da scrivere in testo normale: \\
%\verb+\cos+ dà $\cos$ e
%in modo simile si scrivono arccos, arcsin, arctan, arg, cos, cosh, cot, coth, deg, det,
%exp, lim, ln, log, max, min, sec, sin, sinh, tan, tanh.

\section{Figure con TikZ}

\[
\begin{tikzpicture}[scale=2]
  \coordinate (O1) at (0,0); % centro stella
  \coordinate (O2) at (2.5,0); % centro pianeta
  \draw[name path=S,thick] (O1) circle (2); % disco stella (r=2)
  \draw[name path=P,thick] (O2) circle (1); % disco pianeta (r=1)

  % individuo punti di intersezione fra dischi di pianeta e stella
  \path[name intersections={of=S and P,by={A,B}}];
  \draw[dashed] (O1) -- (A) -- (O2) -- node[below,sloped] {$r_2$} (B) --
                node[above,sloped] {$r_1$}  (O1);
  \draw (A) -- (B);
  \draw[->] ($(B) - (0,0.5)$) node[left,fill=white,inner sep=0.4] {$S_1$} to
            [out=45,in=-80] (1.9,-0.1);
  \draw[->] ($(A) + (0,0.5)$) node[right] {$S_2$}
            to[out=180] (1.7,0.1);
  \draw[red,thick] let \n1 = {acos((1-4+2.5*2.5)/(2*1*2.5))} in
            ($(O2) - cos(\n1)*(0.2,0) + sin(\n1)*(0,0.2)$) arc
            (180-\n1:180+\n1:0.2);
  \draw[->] ($(O2) + (-0.2,0.5)$) node[red,right] {$\theta_2$}
            to[out=180,in=180] (2.3,0);
  \draw[blue,thick] let \n2 = {acos((4-1+2.5*2.5)/(2*2*2.5))} in
            ($(O1) + cos(\n2)*(0.3,0) - sin(\n2)*(0,0.3)$) arc (-\n2:\n2:0.3);
  \draw[->] ($(O1) + (0.5,-0.5)$) node[blue,below] {$\theta_1$} to[in=0] (0.3,0);
\end{tikzpicture}
\]

\[
\begin{tikzpicture}[scale=0.9]
     \draw [ultra thick] (-8,0) -- (8,0);
     \draw [ultra thick] (0,0) circle (8);
     \foreach \i in {0,1,2,3} 
         \draw [ultra thick, red] (90*\i:8) arc (270+90*\i:180+90*\i:8);

     \foreach \i in {0,1,...,7}
         \draw [very thick, green] (45*\i:8) arc (270+45*\i:135+45*\i:3.3);
            
     \foreach \i in {0,1,...,15}
         \draw [thick, blue] (22.5*\i:8) arc (270+22.5*\i:112.5+22.5*\i:1.6);

     \foreach \i in {0,1,...,31}
         \draw [thin, red] (11.25*\i:8) arc (270+11.25*\i:101.25+11.25*\i:0.8);

     \foreach \i in {0,1,...,63}
         \draw [ultra thin, blue] (5.625*\i:8) arc (270+5.625*\i:95.625+5.625*\i:0.4);
  \end{tikzpicture}
\]


\end{document}
