From 229d2a84824108e60025d12c971370b90ee01578 Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Tue, 3 May 2016 21:31:44 +0000
Subject: cstex (3may16)

git-svn-id: svn://tug.org/texlive/trunk@40871 c570f23f-e606-0410-a88d-b1316a301751
---
 Master/texmf-dist/doc/cstex/opmac-d.tex | 46 +++++++++++++++++++--------------
 1 file changed, 27 insertions(+), 19 deletions(-)

(limited to 'Master/texmf-dist/doc/cstex/opmac-d.tex')

diff --git a/Master/texmf-dist/doc/cstex/opmac-d.tex b/Master/texmf-dist/doc/cstex/opmac-d.tex
index 85482f28976..2b85b79ba80 100644
--- a/Master/texmf-dist/doc/cstex/opmac-d.tex
+++ b/Master/texmf-dist/doc/cstex/opmac-d.tex
@@ -8,7 +8,7 @@
 % UTF-8 encTeX has a conflict with DocByTeX
 
 \chyph
-\def\projectversion{Apr. 2016}
+\def\projectversion{May 2016}
 \def\headtitle{OPmac}
 
 \widowpenalty=10000 
@@ -259,11 +259,10 @@ souboru nar
 
 Makro \db replacestrings "{<string1>}{<string2>}" vym�n� v makru "\tmpb"
 ve�ker� v�skyty "<string1>" za "<string2>". Pro tento ��el definuje pracovn�
-makro \db replacestringsA se separ�torem "<string1>". Jak to pracuje je
-uk�z�no na p��kladu n��e.
+makra \db replacestringsA a \db replacestringsB se separ�torem "<string1>". 
+Jak to pracuje je uk�z�no na p��kladu n��e.
 P�ed spu�t�n�m "\replacestringsA" je t�eba nejprve vyvrhnout obsah "\tmpb"
-do vstupn� fronty, pot� prov�st "\def\tmpb{}" a nakonec prov�st
-"\replacestringsA". To je ud�l�no pomoc� triku s "\edef\tmpb" a se dv�ma "\expandafter". 
+do vstupn� fronty pomoc� "\expandafter". 
 V makru pracujeme s tokeny "!" a "?" kategorie 3, kter� slou�� jako
 separ�tory. P�edpokl�d�me, �e takov� nestandardn� tokeny se ve zpracov�van�m 
 textu nikdy neobjev�, proto�e vyk�i�n�k a otazn�k maj� norm�ln� kategorii
@@ -272,26 +271,29 @@ textu nikdy neobjev
 \inext{bgroup}{\empty}{+-}
 
 Jak to pracuje si uk�eme na p��kladu "\replacestrings{XX}{YY}", pokud m�me
-v "\tmpb" ulo�en t�eba text "ahaXXuffXXkonec". Makro "\replacestringsA" je v
-takov�m p��pad� definov�no jako:
+v "\tmpb" ulo�en t�eba text "ahaXXuffXXkonec". Makra "\replacestringsA" a 
+"\replacestringsB" jsou v takov�m p��pad� definov�na jako:
 
 \begtt
-\def\replacestringsA #1XX#2!{%
-   \ifx!#2!\addto\tmpb{#1}\else\addto\tmpb{#1YY}\replacestringsA#2!\fi}%
+\def\replacestringsA #1XX{\def\tmpb{#1}\replacestringsB}
+\def\replacestringsB #1XX{\ifx!#1\relax\else
+   \addto\tmpb{YY#1}\expandafter\replacestringsB\fi}%
 \endtt
 %
 a jednotliv� kroky zpracov�n� prob�haj� takto:
 
 \begtt
-\replacestringsA ahaXXuffXXkonec?XX!
-#1 = "aha" #2 = "uffXXkonec?XX!"
-\addto\tmpb{ahaYY}
-\replacestringsA uffXXkonec?XX!
-#1 = "uff" #2 = "konec?XX!"
-\addto\tmpb{uffYY}, tj. \tmpb obsahuje "ahaYYuffYY".
-\replacestringsA konec?XX!
-#1 = "konec?" #2 = "" (pr�zdn� parametr)
-\addto\tmpb{konec?}, tj. \tmpb obsahuje "ahaYYuffYYkonec?" a rekurze kon��.
+\replacestringsA ahaXXuffXXkonec?XX!XX
+#1 = "aha" zbytek fronty = "uffXXkonec?XX!"
+\def\tmpb{aha}
+\replacestringsB uffXXkonec?XX!XX
+#1 = "uff" zbytek fronty = "konec?XX!"
+\addto\tmpb{YYuff}, tj. \tmpb obsahuje "ahaYYuff".
+\replacestringsB konec?XX!XX
+#1 = "konec?" zbytek fronty = "!XX"
+\addto\tmpb{YYkonec?}, tj. \tmpb obsahuje "ahaYYuffYYkonec?"
+\replacestringsB !XX
+#1 = ! zbytek fronty pr�zdn�, rekurze kon��
 \endtt
 %
 D�le se p�edefinuje "\def\replacestrin""gsA#1?{\def\tmpb{#1}}" a provede se
@@ -306,6 +308,11 @@ tedy t
 d�vali? Kdyby tam nebyl, tak by nespr�vn� fungovalo
 "\replacestrings{XX}{YY}" p�i "\tmpb" ve tvaru "ahaX".
 
+Makro "\replacestrings" je kompromisem mezi jednoduchost� a p�ijateln�mi
+mo�nostmi. Nefunguje nad textem s nesp�rovan�mi "\if...\fi" a tak�
+p�i "\def\tmpb{{aha}XX}\replacestrings{XX}{YY}" se bohu�el odstran� ku�erav�
+z�vorky kolem "aha". M��ete t�eba p�idat p�ed ka�dou dvojici takov�ch
+z�vorek "\empty", abyste m�li jistotu, �e z�vorky nezmiz�.
 
 \subsec Glob�ln� parametry
 %%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -825,7 +832,8 @@ Fonty pro titul, kapitoly a sekce \db titfont,
 jsou definov�ny jako odpov�daj�c� zv�t�en� a nastaven� tu�n�ho duktu.
 Ten je nastaven pomoc� \db bfshape jako "\bf" a nav�c je ztoto�n�n
 "\tenit" s "\tenbi", tak�e kdy� nyn� u�ivatel nap��e "\it", dostane tu�nou
-kurz�vu. 
+kurz�vu. Tu�n� varianty matematick�ch font� se zavedou a� p�i pou�it�
+matematick�ho m�du v nadpise (viz "\everymath").
  
 \inext{titfont}{\empty}{+-}
 
-- 
cgit v1.2.3

