\documentclass[a4paper,12pt,oneside]{article}
\usepackage[utf8]{inputenc}
\usepackage[francais]{babel}
\usepackage[top=2cm, bottom=1.5cm, left=2.5cm, right=2.0cm]{geometry}
\geometry{a4paper}
\usepackage{tikz}
\usepackage{fancyhdr}
\usepackage{xifthen}

\lhead{Urem-ULB - \LaTeX}
\rhead{novembre 2014} \cfoot{}
\pagestyle{fancy}

\newcommand\readinglogscale[3]{
	% #1=lower bound (power of 10), #2=upper bound, #3=scale
	\begin{tikzpicture}[scale=#3]
		\def\q{#1}
		\def\p{#2}
		\def\esp{0.6}
		\pgfmathparse{int(\p+1)} \let\pp\pgfmathresult{}
		\pgfmathparse{int(\q-1)} \let\qq\pgfmathresult{}
		\draw[->,>=latex,red,thick] ({\q-0.25},0)--({\pp+0.25},0);% Log axis
		\node at ({\p+1.5},0) {$x$};

		\draw[->,>=latex,blue,thick] ({\q-0.25},\esp)--({\pp+0.25},\esp);% Linear axis
		\node at ({\q-0.5},\esp){$y$};

			\draw[->,>=latex,thick] (\p+1.5,0.1)--(\p+1.5,\esp-0.1)node[above]{$\log(x)$};
			\draw[->,>=latex,thick] (\q-0.5,\esp-0.1)--(\q-0.5,0.1)node[below]{$10^y$};

		\foreach \n in {\q,...,\pp}{% Main ticks on both axes
			\draw[very thick] (\n,\esp-0.15)--(\n,\esp+0.15) node[above]{$\n$};
			\ifthenelse{\n=0}
				{\draw[very thick] (\n,-0.15)--(\n,0.15) node[above]{$1$};}
				{\draw[very thick] (\n,-0.15)--(\n,0.15) node[above]{$10^{\n}$};}
			}

		\foreach \n in {\q,...,\p}{% Secondary ticks on log axis
			\foreach \m in {2,...,9}{
				\draw ({log10(\m)+\n},-0.1)--({log10(\m)+\n},0.1);
				}
			}

		\begin{scriptsize}
			\foreach \i in {\q,...,\p}{
				\foreach \j in {2,...,9}{
					\ifthenelse{\i > -1}
						{\pgfmathparse{int(\j*pow(10,\i))} \let\x\pgfmathresult{}}
						{ 
								\pgfkeys{/pgf/number format/.cd,fixed,precision=-\i}
								\pgfmathparse{\j/pow(10,-\i)} \let\x\pgfmathresult{}
						}
						\draw[->,>=latex,dashed] ({log10(\j)+\i},-0.2)--({log10(\j)+\i},-0.15-0.20*\j)
							node[left]{$\pgfmathprintnumber{\x}$};
					}
				}
		\end{scriptsize}

	\end{tikzpicture}

	}% end of macro

\begin{document}

	{\large Comment \emph{lire} une échelle logarithmique?}

	\vspace{1cm}
	\begin{enumerate}
	\itemsep50pt
	\item Lecture de l'échelle pour les nombres supérieurs à 1

			\bigskip
			\readinglogscale{0}{3}{2.75}

	\item Lecture des nombres positifs inférieurs à 1

			\bigskip
			\readinglogscale{-3}{0}{2.75}

	\end{enumerate}

\end{document}
