Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

index de nombres

9 views
Skip to first unread message

Olve

unread,
May 17, 2013, 10:36:07 AM5/17/13
to
Bonjour,

Voici un ecm plus bas.
Dans l'index au final, j'obtiens
Exercice
no 10, 1
no 11, 1
no 1, 1
no 2, 1
...
Le probl�me semble venir de l'�valuation : le fichier
ECM.idx contient des lignes du type

\indexentry{Exercice!no \numprint {1}@no 1}{1}

et non

\indexentry{Exercice!no 001@no 1}{1}

comme je m'y attendais.
Help appreciated:)
Merci, A.O.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[10pt, a4paper, twoside]{book}
\usepackage{makeidx}
\usepackage{numprint}
\newcounter{noexercice}
\setcounter{noexercice}{0}
\nplpadding{3}
\newenvironment{exercice}%
{\refstepcounter{noexercice}Exercice \thenoexercice\par%
\index{Exercice!no \numprint{\thenoexercice}@no \thenoexercice}}{\goodbreak}
\makeindex

\begin{document}

\begin{exercice}
jjjj
\end{exercice}
\begin{exercice}
jjjj
\end{exercice}
\begin{exercice}
jjjj
\end{exercice}
\begin{exercice}
jjjj
\end{exercice}
\begin{exercice}
jjjj
\end{exercice}
\begin{exercice}
jjjj
\end{exercice}
\begin{exercice}
jjjj
\end{exercice}
\begin{exercice}
jjjj
\end{exercice}
\begin{exercice}
jjjj
\end{exercice}
\begin{exercice}
jjjj
\end{exercice}
\begin{exercice}
jjjj
\end{exercice}

\printindex

\end{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

GL

unread,
May 17, 2013, 1:40:10 PM5/17/13
to
Le 17/05/2013 16:36, Olve a �crit :
> Bonjour,
>
> Voici un ecm plus bas.
> Dans l'index au final, j'obtiens
> Exercice
> no 10, 1
> no 11, 1
> no 1, 1
> no 2, 1
> ...
> Le probl�me semble venir de l'�valuation : le fichier
> ECM.idx contient des lignes du type
>
> \indexentry{Exercice!no \numprint {1}@no 1}{1}
>
> et non
>
> \indexentry{Exercice!no 001@no 1}{1}
>
> comme je m'y attendais.
> Help appreciated:)
> Merci, A.O.

Ben : faites plus simple :


\def\@padwithzeros #1{\ifnum #1<10 0\fi \ifnum #1<100 0\fi \number #1}

\@padwithzeros {50}
\@padwithzeros {150}
\@padwithzeros {3}

\@padwithzeros {\value{noexercice}}

Olve

unread,
May 17, 2013, 10:20:16 PM5/17/13
to
Excellent, merci beaucoup ! A.O.
0 new messages