summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/xstring
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-10-25 22:11:07 +0000
committerKarl Berry <karl@freefriends.org>2012-10-25 22:11:07 +0000
commitf7bda182fe73ce45159eb3d7263c0a2343411f59 (patch)
treeda01712cba9a9ece00c87c9114e06bf497ef906c /Master/texmf-dist/doc/generic/xstring
parentbbe35c83c2f2607cd6671d6afaf0cfe4be54f947 (diff)
xstring (25oct12)
git-svn-id: svn://tug.org/texlive/trunk@28078 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/generic/xstring')
-rw-r--r--Master/texmf-dist/doc/generic/xstring/README4
-rw-r--r--Master/texmf-dist/doc/generic/xstring/xstring_doc_en.pdfbin772855 -> 242308 bytes
-rw-r--r--Master/texmf-dist/doc/generic/xstring/xstring_doc_en.tex53
-rw-r--r--Master/texmf-dist/doc/generic/xstring/xstring_doc_fr.pdfbin791211 -> 250157 bytes
-rw-r--r--Master/texmf-dist/doc/generic/xstring/xstring_doc_fr.tex104
5 files changed, 120 insertions, 41 deletions
diff --git a/Master/texmf-dist/doc/generic/xstring/README b/Master/texmf-dist/doc/generic/xstring/README
index 7cd8ca61ad5..fbd26a12315 100644
--- a/Master/texmf-dist/doc/generic/xstring/README
+++ b/Master/texmf-dist/doc/generic/xstring/README
@@ -1,8 +1,8 @@
_________________
xstring package
- v 1.5d
- 2010/03/28
+ v 1.6
+ 2012/10/24
_________________
This package provides macros manipulating strings for programming use.
diff --git a/Master/texmf-dist/doc/generic/xstring/xstring_doc_en.pdf b/Master/texmf-dist/doc/generic/xstring/xstring_doc_en.pdf
index d48edf585cd..0be656ec48c 100644
--- a/Master/texmf-dist/doc/generic/xstring/xstring_doc_en.pdf
+++ b/Master/texmf-dist/doc/generic/xstring/xstring_doc_en.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/generic/xstring/xstring_doc_en.tex b/Master/texmf-dist/doc/generic/xstring/xstring_doc_en.tex
index 19b9c760278..e35067df703 100644
--- a/Master/texmf-dist/doc/generic/xstring/xstring_doc_en.tex
+++ b/Master/texmf-dist/doc/generic/xstring/xstring_doc_en.tex
@@ -21,7 +21,8 @@
\usepackage[a4paper,dvips,margin=1.9cm]{geometry}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{color}
-\usepackage{lmodern}
+\usepackage{fourier}
+\usepackage[scaled=.8]{luximono}
\usepackage{eurosym}
\usepackage{xspace}
\usepackage{listings}
@@ -29,7 +30,7 @@
\usepackage[bottom]{footmisc}
\usepackage[french]{babel}
\makeatletter
-\definecolor{@xs@bckgcolor}{rgb}{1,1,0.875}
+\definecolor{@xs@bckgcolor}{rgb}{1,1,0.9}
\definecolor{@xs@keywordsxstring}{rgb}{0.7,0,0}
\definecolor{@xs@keywordslatex}{rgb}{0,0,1}
\definecolor{@xs@arguments}{rgb}{0,0,0}
@@ -66,7 +67,7 @@
IfBeginWith,IfEndWith,%
IfInteger,IfDecimal,integerpart,decimalpart,%
IfStrEq,IfEq,IfStrEqCase,IfEqCase,%
- StrBefore,StrBehind,StrBetween,%
+ StrBefore,StrBehind,StrCut,StrBetween,%
StrSubstitute,StrDel,%
StrGobbleLeft,StrGobbleRight,StrRight,StrLeft,StrMid,StrChar,%
StrSplit,%
@@ -688,6 +689,50 @@ In \argu{string}, returns what is rightwards the \argu{number}\th occurrence of
|\StrBehind[3]{1b2b3}{b}|
\end{minipage}%
+\subsubsection{\ttfamily\textbackslash StrCut}
+Here is the syntax of this macro:\par\nobreak\smallskip
+\verbinline|\StrCut|\etoile\arguC{nunber}\ARGU{string}\ARGU{stringA}\ARGU{macroA}\ARGU{macroB}
+\smallskip
+
+The optional argument \argu{number} is 1 by default.\par\nobreak\smallskip
+The \argu{string} is cut in two parts at the occurrence \no\arguC{number} of \ARGU{stringA}. The left part is stored in the control sequence \argu{macroA} and the right part in \argu{macroB}.
+
+Since this macro returns \emph{two strings}, it does \emph{not} display anything. Consequently, it does not provide the optional argument in last position.\medskip
+
+\begin{Conditions}
+ \item If \argu{string} or \argu{stringA} is empty, \argu{macroA} and \argu{macroB} are empty;
+ \item If \argu{number}${}<1$, the macro behaves as if \argu{number}${}=1$;
+ \item If the occurrence is not found, \argu{macroA} receives the whole \argu{string} while \argu{macroB} is empty.
+\end{Conditions}
+\begin{minipage}[t]{0.65\linewidth}
+\begin{lstlisting}
+\StrCut{abracadabra}{a}\csA\csB |\csA|\csB|\par
+\StrCut[2]{abracadabra}{a}\csA\csB |\csA|\csB|\par
+\StrCut[3]{abracadabra}{a}\csA\csB |\csA|\csB|\par
+\StrCut[4]{abracadabra}{a}\csA\csB |\csA|\csB|\par
+\StrCut[5]{abracadabra}{a}\csA\csB |\csA|\csB|\par
+\StrCut[6]{abracadabra}{a}\csA\csB |\csA|\csB|\par
+\StrCut[-4]{abracadabra}{a}\csA\csB |\csA|\csB|\par
+\StrCut{abracadabra}{brac}\csA\csB |\csA|\csB|\par
+\StrCut{abracadabra}{foo}\csA\csB |\csA|\csB|\par
+\StrCut{abracadabra}{}\csA\csB |\csA|\csB|
+\end{lstlisting}%
+\end{minipage}\hfill
+\begin{minipage}[t]{0.35\linewidth}
+ \def\seprouge{{\color{red}|}}
+ \styleexemple
+ \StrCut{abracadabra}{a}\csA\csB |\csA\seprouge\csB|\par
+ \StrCut[2]{abracadabra}{a}\csA\csB |\csA\seprouge\csB|\par
+ \StrCut[3]{abracadabra}{a}\csA\csB |\csA\seprouge\csB|\par
+ \StrCut[4]{abracadabra}{a}\csA\csB |\csA\seprouge\csB|\par
+ \StrCut[5]{abracadabra}{a}\csA\csB |\csA\seprouge\csB|\par
+ \StrCut[6]{abracadabra}{a}\csA\csB |\csA\seprouge\csB|\par
+ \StrCut[-4]{abracadabra}{a}\csA\csB |\csA\seprouge\csB|\par
+ \StrCut{abracadabra}{brac}\csA\csB |\csA\seprouge\csB|\par
+ \StrCut{abracadabra}{foo}\csA\csB |\csA\seprouge\csB|\par
+ \StrCut{abracadabra}{}\csA\csB |\csA\seprouge\csB|
+\end{minipage}%
+
\subsubsection{\ttfamily\textbackslash StrBetween}
\verbinline|\StrBetween|\etoile\arguCC{number1}{number2}\ARGU{string}\ARGU{stringA}\ARGU{stringB}\arguC{name}
@@ -1696,7 +1741,7 @@ The macro expands each token consecutively, and does not see what follows: token
\hfil\verbinline|\StrExpand{\iftrue A\else B\fi}\resultat|\hfil{}\par\nobreak\smallskip
provokes an error because the first token "\verbinline|\iftrue|" is expanded \emph{alone} without seeing its \verbinline-\fi- which makes \TeX{} angry.
-Expansion inside groups is \emph{independant} of the exploration mode: this macro has its own command to expand or not what is inside the groups. By default, tokens inside groups are expanded, but this can be changed with \verbinline-\noexpandingroups-. The default behaviour can be recoverd with \verbinline-\expandingroups-.\bigskip
+Expansion inside groups is \emph{independant} of the exploration mode: this macro has its own command to expand or not what is inside the groups. By default, tokens inside groups are expanded, but this can be changed with the macro \verbinline-\noexpandingroups-. The default behaviour can be recoverd with \verbinline-\expandingroups-.\bigskip
The \verbinline-\scancs- macro returns the detokenized result:\par\nobreak\medskip
\verbinline|\scancs|\arguC{number}\ARGU{name}\ARGU{string}\par\nobreak\smallskip
diff --git a/Master/texmf-dist/doc/generic/xstring/xstring_doc_fr.pdf b/Master/texmf-dist/doc/generic/xstring/xstring_doc_fr.pdf
index 67b73684722..c884440c06d 100644
--- a/Master/texmf-dist/doc/generic/xstring/xstring_doc_fr.pdf
+++ b/Master/texmf-dist/doc/generic/xstring/xstring_doc_fr.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/generic/xstring/xstring_doc_fr.tex b/Master/texmf-dist/doc/generic/xstring/xstring_doc_fr.tex
index 987d90a85d3..ea701726af6 100644
--- a/Master/texmf-dist/doc/generic/xstring/xstring_doc_fr.tex
+++ b/Master/texmf-dist/doc/generic/xstring/xstring_doc_fr.tex
@@ -1,7 +1,6 @@
% Ceci est xtring_doc_fr.tex, le manuel en français de xstring
-% This is xtring_doc_fr.tex, the french manual of xstring
%
-% Christian Tellechea 2009
+% Christian Tellechea 2008-2012
%
% email : unbonpetit@gmail.com
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -22,7 +21,8 @@
\usepackage[a4paper,dvips,margin=1.9cm]{geometry}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{color}
-\usepackage{lmodern}
+\usepackage{fourier}
+\usepackage[scaled=.8]{luximono}
\usepackage{eurosym}
\usepackage{xspace}
\usepackage{listings}
@@ -30,7 +30,7 @@
\usepackage[bottom]{footmisc}
\usepackage[frenchb]{babel}
\makeatletter
-\definecolor{@xs@bckgcolor}{rgb}{1,1,0.875}
+\definecolor{@xs@bckgcolor}{rgb}{1,1,0.9}
\definecolor{@xs@keywordsxstring}{rgb}{0.7,0,0}
\definecolor{@xs@keywordslatex}{rgb}{0,0,1}
\definecolor{@xs@arguments}{rgb}{0,0,0}
@@ -67,7 +67,7 @@
IfBeginWith,IfEndWith,%
IfInteger,IfDecimal,integerpart,decimalpart,%
IfStrEq,IfEq,IfStrEqCase,IfEqCase,%
- StrBefore,StrBehind,StrBetween,%
+ StrBefore,StrBehind,StrCut,StrBetween,%
StrSubstitute,StrDel,%
StrGobbleLeft,StrGobbleRight,StrRight,StrLeft,StrMid,StrChar,%
StrSplit,%
@@ -80,18 +80,6 @@
setverbdelim},%
keywordstyle=\color{@xs@keywordsxstring},%
classoffset=0}
-% redéfinition de l'écriture des textes des footnote
-\long\def\@makefntextFB#1{%
- \ifx\thefootnote\ftnISsymbol
- \@makefntextORI{#1}%
- \else
- \rule\z@\footnotesep
- \setbox\@tempboxa\hbox{\@thefnmark}%
- \ifdim\wd\@tempboxa>\z@
- \kern2em\llap{\@thefnmark.\kern0.5em}%
- \fi
- \hangindent2em\hangafter\@ne#1
- \fi}
\makeatother
\newcommand\guill[1]{\og{}#1\fg{}}
@@ -686,6 +674,50 @@ Dans \argu{chaine}, renvoie ce qui se trouve après l'occurrence \no\argu{nombre
|\StrBehind[3]{1b2b3}{b}|
\end{minipage}%
+\subsubsection{\ttfamily\textbackslash StrCut}
+Voici la syntaxe de cette macro :\par\nobreak\smallskip
+\verbinline|\StrCut|\etoile\arguC{nombre}\ARGU{chaine}\ARGU{chaineA}\ARGU{macroA}\ARGU{macroB}
+\smallskip
+
+L'argument optionnel \argu{nombre} vaut 1 par défaut.\par\nobreak\smallskip
+La \argu{chaine} est coupée en deux chaînes à l'occurrence \no\arguC{nombre} de la \ARGU{chaineA}. Ce qui se trouve à gauche de cette occurrence est assigné à la séquence de contrôle \argu{macroA} et ce qui se trouve à droite à \argu{macroB}.
+
+Cette macro renvoie \emph{deux chaînes} et donc \textbf{n'affiche rien}. Par conséquent, elle ne dispose pas de l'argument optionnel en dernière position.\medskip
+
+\begin{Conditions}
+ \item Si \argu{chaine} ou \argu{chaineA} est vide, \argu{macroA} et\argu{macroB} seront vides ;
+ \item Si \argu{nombre}${}<1$ alors, la macro se comporte comme si \argu{nombre}${}=1$;
+ \item Si l'occurrence n'est pas trouvée, \argu{macroA} reçoit la totalité de \argu{chaine} tandis que \argu{macroB} est vide.
+\end{Conditions}
+\begin{minipage}[t]{0.65\linewidth}
+\begin{lstlisting}
+\StrCut{abracadabra}{a}\csA\csB |\csA|\csB|\par
+\StrCut[2]{abracadabra}{a}\csA\csB |\csA|\csB|\par
+\StrCut[3]{abracadabra}{a}\csA\csB |\csA|\csB|\par
+\StrCut[4]{abracadabra}{a}\csA\csB |\csA|\csB|\par
+\StrCut[5]{abracadabra}{a}\csA\csB |\csA|\csB|\par
+\StrCut[6]{abracadabra}{a}\csA\csB |\csA|\csB|\par
+\StrCut[-4]{abracadabra}{a}\csA\csB |\csA|\csB|\par
+\StrCut{abracadabra}{brac}\csA\csB |\csA|\csB|\par
+\StrCut{abracadabra}{foo}\csA\csB |\csA|\csB|\par
+\StrCut{abracadabra}{}\csA\csB |\csA|\csB|
+\end{lstlisting}%
+\end{minipage}\hfill
+\begin{minipage}[t]{0.35\linewidth}
+ \def\seprouge{{\color{red}|}}
+ \styleexemple
+ \StrCut{abracadabra}{a}\csA\csB |\csA\seprouge\csB|\par
+ \StrCut[2]{abracadabra}{a}\csA\csB |\csA\seprouge\csB|\par
+ \StrCut[3]{abracadabra}{a}\csA\csB |\csA\seprouge\csB|\par
+ \StrCut[4]{abracadabra}{a}\csA\csB |\csA\seprouge\csB|\par
+ \StrCut[5]{abracadabra}{a}\csA\csB |\csA\seprouge\csB|\par
+ \StrCut[6]{abracadabra}{a}\csA\csB |\csA\seprouge\csB|\par
+ \StrCut[-4]{abracadabra}{a}\csA\csB |\csA\seprouge\csB|\par
+ \StrCut{abracadabra}{brac}\csA\csB |\csA\seprouge\csB|\par
+ \StrCut{abracadabra}{foo}\csA\csB |\csA\seprouge\csB|\par
+ \StrCut{abracadabra}{}\csA\csB |\csA\seprouge\csB|
+\end{minipage}%
+
\subsubsection{\ttfamily\textbackslash StrBetween}
\verbinline|\StrBetween|\etoile\arguCC{nombre1}{nombre2}\ARGU{chaine}\ARGU{chaineA}\ARGU{chaineB}\arguC{nom}
\smallskip
@@ -727,6 +759,8 @@ Dans \argu{chaine}, renvoie ce qui se trouve entre\footnote{Au sens strict, c'es
\StrBetween[3,2]{abracadabra}{a}{bra}\par
\end{minipage}%
+
+
\subsubsection{\ttfamily\textbackslash StrSubstitute}
\verbinline|\StrSubstitute|\arguC{nombre}\ARGU{chaine}\ARGU{chaineA}\ARGU{chaineB}\arguC{nom}
\smallskip
@@ -1060,7 +1094,7 @@ Dans \argu{chaine}, renvoie la position de l'occurrence \no\argu{nombre} de \arg
\verbinline|\StrCompare|\etoile\ARGU{chaineA}\ARGU{chaineB}\arguC{nom}
\smallskip
-Cette macro peut fonctionner avec 2 tolérances : la tolérance \guill{normale} sélectionnée par défaut, et la tolérance \guill{stricte}.\medskip
+Cette macro peut fonctionner avec 2 tolérances, la tolérance \guill{normale} qui est sélectionnée par défaut et la tolérance \guill{stricte}.\medskip
\begin{itemize}
\item La tolérance normale, activée par la commande \verbinline|\comparenormal|.\par
@@ -1488,24 +1522,24 @@ Cette macro renvoie \emph{deux chaînes} et donc \textbf{n'affiche rien}. Par co
\begin{minipage}[c]{0.65\linewidth}
\hfill
\begin{lstlisting}
- \def\seprouge{{\color{red}|}}
- \StrSplit{abcdef}{4}{\csA}{\csB}|\csA\seprouge\csB|\par
- \StrSplit{a b c }{2}{\csA}{\csB}|\csA\seprouge\csB|\par
- \StrSplit{abcdef}{1}{\csA}{\csB}|\csA\seprouge\csB|\par
- \StrSplit{abcdef}{5}{\csA}{\csB}|\csA\seprouge\csB|\par
- \StrSplit{abcdef}{9}{\csA}{\csB}|\csA\seprouge\csB|\par
- \StrSplit{abcdef}{-3}{\csA}{\csB}|\csA\seprouge\csB|
+\def\seprouge{{\color{red}|}}
+\StrSplit{abcdef}{4}{\csA}{\csB}|\csA\seprouge\csB|\par
+\StrSplit{a b c }{2}{\csA}{\csB}|\csA\seprouge\csB|\par
+\StrSplit{abcdef}{1}{\csA}{\csB}|\csA\seprouge\csB|\par
+\StrSplit{abcdef}{5}{\csA}{\csB}|\csA\seprouge\csB|\par
+\StrSplit{abcdef}{9}{\csA}{\csB}|\csA\seprouge\csB|\par
+\StrSplit{abcdef}{-3}{\csA}{\csB}|\csA\seprouge\csB|
\end{lstlisting}%
\end{minipage}\hfill
\begin{minipage}[c]{0.35\linewidth}
- \styleexercice
- \def\seprouge{{\color{red}|}}
- \StrSplit{abcdef}{4}{\csA}{\csB}|\csA\seprouge\csB|\par
- \StrSplit{a b c }{2}{\csA}{\csB}|\csA\seprouge\csB|\par
- \StrSplit{abcdef}{1}{\csA}{\csB}|\csA\seprouge\csB|\par
- \StrSplit{abcdef}{5}{\csA}{\csB}|\csA\seprouge\csB|\par
- \StrSplit{abcdef}{9}{\csA}{\csB}|\csA\seprouge\csB|\par
- \StrSplit{abcdef}{-3}{\csA}{\csB}|\csA\seprouge\csB|
+\styleexercice
+\def\seprouge{{\color{red}|}}
+\StrSplit{abcdef}{4}{\csA}{\csB}|\csA\seprouge\csB|\par
+\StrSplit{a b c }{2}{\csA}{\csB}|\csA\seprouge\csB|\par
+\StrSplit{abcdef}{1}{\csA}{\csB}|\csA\seprouge\csB|\par
+\StrSplit{abcdef}{5}{\csA}{\csB}|\csA\seprouge\csB|\par
+\StrSplit{abcdef}{9}{\csA}{\csB}|\csA\seprouge\csB|\par
+\StrSplit{abcdef}{-3}{\csA}{\csB}|\csA\seprouge\csB|
\end{minipage}%
\setverbdelim{|}\medskip
@@ -1674,7 +1708,7 @@ D\'eveloppement de \string\csD\ au\par
\end{minipage}%
\medskip
-La macro opère séquentiellement et chaque token est développé isolément sans tenir compte de ce qui suit. On ne peut donc développer que des tokens se suffisant à eux même et n'en nécessitant aucun autre. Ainsi, \og\hbox{\verbinline|\iftrue A\else B\fi|}\fg, bien que se développant en \guill{A} ne peut être mis dans l'argument de \verbinline|\StrExpand|, et l'instruction :\par\nobreak\smallskip
+La macro agit séquentiellement et chaque token est développé isolément sans tenir compte de ce qui suit. On ne peut donc développer que des tokens qui se suffisent à eux même et dont le développement ne nécessite aucun autre token. Ainsi, \og\hbox{\verbinline|\iftrue A\else B\fi|}\fg, bien que se développant en \guill{A} ne peut être mis dans l'argument de \verbinline|\StrExpand|, et l'instruction :\par\nobreak\smallskip
\hfil\verbinline|\StrExpand{\iftrue A\else B\fi}\resultat|\hfil{}\par\nobreak\smallskip
fera échouer la compilation puisque le premier token \og\verbinline|\iftrue|\fg{} sera développé \emph{seul}, c'est-à-dire sans son \verbinline-\fi- correspondant, ce qui fâchera \TeX{} !\smallskip
@@ -1815,7 +1849,7 @@ On va appeler cette macro \verb|StringDel| et lui donner la syntaxe :\par\nobrea
\hfil\verb|\StringDel{chaine}{position}{n}{\nom_resultat}|\hfil{}
\medskip
-On peut procéder ainsi : prendre la chaîne se trouvant juste avant la position, la sauvegarder. Ensuite enlever \verb|n + position| \USs à la chaîne initiale, et concaténer ce résultat à ce qui a été sauvegardé auparavant. Cela donne le code suivant :\par\nobreak\medskip
+On peut procéder ainsi : sauvegarder la chaîne se trouvant juste avant la position. Ensuite enlever \verb|n + position| \USs à la chaîne initiale, et concaténer ce résultat à ce qui a été sauvegardé auparavant. Cela donne le code suivant :\par\nobreak\medskip
\begin{minipage}[c]{0.65\linewidth}
\begin{lstlisting}