From 9caacf53d7d2a1620a603aa644617293a60183e2 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 16 Aug 2014 21:43:28 +0000 Subject: cstex (16aug14) git-svn-id: svn://tug.org/texlive/trunk@34952 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/cstex/opmac-d.tex | 61 +++++++++++++++++++------ Master/texmf-dist/doc/cstex/opmac-u-en.pdf | Bin 227290 -> 227867 bytes Master/texmf-dist/doc/cstex/opmac-u-en.tex | 69 +++++++++++++++++++---------- Master/texmf-dist/doc/cstex/opmac-u.pdf | Bin 262768 -> 262553 bytes Master/texmf-dist/doc/cstex/opmac-u.tex | 18 ++------ 5 files changed, 96 insertions(+), 52 deletions(-) (limited to 'Master/texmf-dist/doc') diff --git a/Master/texmf-dist/doc/cstex/opmac-d.tex b/Master/texmf-dist/doc/cstex/opmac-d.tex index ab78fec6146..7fd3da08a92 100644 --- a/Master/texmf-dist/doc/cstex/opmac-d.tex +++ b/Master/texmf-dist/doc/cstex/opmac-d.tex @@ -7,7 +7,8 @@ % This file is encoded in ISO-8859-2 because % UTF-8 encTeX has a conflict with DocByTeX -\def\projectversion{May 2014} +\chyph +\def\projectversion{Jul 2014} \def\headtitle{OPmac} \widowpenalty=10000 @@ -20,7 +21,6 @@ \def\csplain{\CS plain} \def\CS{CS} -\chyph \input docby.tex @@ -1027,8 +1027,17 @@ chceme nav \inext{Xindex}{\empty}{+-} -Činnost makra "\Xindex" si vysvětlíme za chvíli podrobněji. Nejprve ovšem -definujeme pomocné makro \db firstdata "\,"~"\", které expanduje na +Činnost makra "\Xindex" si vysvětlíme za chvíli podrobněji. Nyní jen +uvedeme, že "\Xindex" je jen speciální variantou obecného makra +\db Xindexg při "#1=,". Takže pracuje s kontrolními sekvencemi typu +"\,". Následující text popisuje jen tento případ. Makro "\Xindexg" +je možné použít pro pralelní vytváření dalších seznamů stránek +stejných hesel (např. seznam vyznačený kurzívou, tučně atd.). Jak to udělat +je popsáno v OPmac triku 0072. + +Údaje o stranách spojených s rejstříkovým heslem jsou ukládány do makra +"\," a jsou rozděleny do dvou částí ve tvaru "{prvni}{druhy}". +Definujeme pomocné makro \db firstdata "\,"~"\", které expanduje na "\"~"&". Je-li třeba "\,aa" definováno jako "{prvni}{druhy}", pak "\firstdata"~"\,aa"~"\cosi" expanduje na "\cosi"~"prvni&". Tím máme možnost vyzískat data z makra. Podobně makro @@ -1073,7 +1082,7 @@ if (prvn = ""; = +; = ; return; } -if ( == ) return; +if ( == || == ) return; if ( == +) { if ( == +1) { += "--"; @@ -1093,6 +1102,15 @@ else { = ; \endtt +V makru "\Xindex" pracujeme ještě se dvěma pomocnými makry +\db pgfolioA a \db pgfolioB. Pro kladné stránky se tato makra chovají +stejně, jako kdyby tam vůbec nebyla. Ovšem v plain\TeX{}u +(viz maro "\folio") se mohou stránkové číslice vyskytnout +na začátku dokumentu záporné, v takovém případě se mají tisknout +římskými číslicemi. Proto jsou uvedená makra definována poněkud chytřeji. + +\inext{pgfolioA}{\empty}{+-} + \def\begtthook{} Makro \db makeindex nejprve definuje přechodný význam rekurzivního "\act" tak, aby byly uzavřeny seznamy stránek (tj. aby seznam nekončil @@ -1776,12 +1794,15 @@ expandujeme "\tmpb" pomoc takže to pracuje jako "\def\tmbb{}\tmp\/\relax". -\inext{replacestring}{\empty}{+-} +V makru pracujeme s tokeny "!" a "?" kategorie 3, které slouží jako +separátory. Předpokládáme, že takové tokeny se ve zpracovávaném textu nikdy neobjeví. + +\inext{bgroup}{\empty}{+-} -Na konci "" je vložena sekvence "\/", která jej odděluje od přidaného -"". Kdybychom ji tam nedali, pak při "=//" a při lomítku +Na konci "" je vložen "?", který jej odděluje od přidaného +"". Kdybychom jej tam nedali, pak při "=//" a při lomítku na konci "" bychom měli "...///" a to způsobí potíže. -V závěru makra "\replacestring" je přidaná sekvence "\/" zase odstraněna. +V závěru makra "\replacestring" je přidaný otazník zase odstraněn. \subsec Outlines -- obsah v záložce PDF dokumentu @@ -2026,10 +2047,10 @@ rad Příklad: po deklaraci: "{|cr||cl|}" makro "\scantabdata" vytvoří: \begtt -tabdata: \vrule\tabiteml\hfil#\unsskip\hfil\tabitemr - &\tabiteml\hfil#\unsskip\tabitemr \vrule\kern\vvkern\vrule - &\tabiteml\hfil#\unsskip\hfil\tabitemr - &\tabiteml#\unsskip\hfil\tabitemr\vrule +tabdata: \vrule\tabiteml\hfil#\unsskip\hfil\tabitemr\tabstrutA + &\tabiteml\hfil#\unsskip\tabitemr \vrule\kern\vvkern\vrule\tabstrutA + &\tabiteml\hfil#\unsskip\hfil\tabitemr\tabstrutA + &\tabiteml#\unsskip\hfil\tabitemr\vrule\tabstrutA ddlinedata: &\dditem &\dditem\vvitem &\dditem &\dditem \endtt @@ -2270,10 +2291,22 @@ z zahájemním zpracování "\mnote". Uživatel může v prametru "\mnote" používat "{\localcolor\Green X{\localcolor\Blue Y}Z}" s~očekávaným výsledkem. Barvy neoznačené "\localcolor" končí svou platnost na konci poznámky -"\mnote". +"\mnote". \inext{mnoteC}{^^B\cbrace}{++} +Základová barva lokálního zásobníku barev je převzata jako +aktuální barva v době zpracování "\mnote", ale je pozměněna prefixem "\long", +aby explicitní nastavení barvy vždy založilo barvu. Obecně +totiž "\setcmykcolor" zakládá barvu jen tehdy, když je rozdílná od +aktuální. Zde je rozdílnost zajištěna prefixem "\long". +Tento trik zabere, pokud se uvnitř "\mnote" pomocí "A{\localcolor\Red BC}DE" +má přejít k původní barvě pro písmena "DE". Ovšem ne vždy bude barva "A" +shodná s barvou "DE", protože barva "A" odpovídá barvě na koci aktuálního +řádku odstavce, zatímco "DE" odpovídá barvě v době činnosti makra "\mnote". +Pokud toto bude uživateli vadit, musí si pomocí "\mnotehook" nastavit +explicitní barvu poznámky. + Makro \db Xmnote pracuje během čtení REF souboru a využívá toho, že makro "\Xpage" nastavuje číslo právě procesované strany do registru "\lastpge". Takže stačí použít "\sxdef" následujícím způsobem: diff --git a/Master/texmf-dist/doc/cstex/opmac-u-en.pdf b/Master/texmf-dist/doc/cstex/opmac-u-en.pdf index 731fca0656b..37f865a8ba6 100644 Binary files a/Master/texmf-dist/doc/cstex/opmac-u-en.pdf and b/Master/texmf-dist/doc/cstex/opmac-u-en.pdf differ diff --git a/Master/texmf-dist/doc/cstex/opmac-u-en.tex b/Master/texmf-dist/doc/cstex/opmac-u-en.tex index 95408df9a3e..82c65e45165 100644 --- a/Master/texmf-dist/doc/cstex/opmac-u-en.tex +++ b/Master/texmf-dist/doc/cstex/opmac-u-en.tex @@ -32,24 +32,25 @@ \nonum \sec Introduction %%%%%%%%%%%% -The OPmac package is simple additional macros to plain\TeX{}. It enables -users to take advantage of basic \LaTeX{} functionality: the font size -selection, automatic creation of table of contents and index, working with -bibliography databases, tables, references including hyperlinks option, -margins settings, etc. - -I have decided to publish my macros together with the new version of -\csplain{}. I am using these macros long time for various purposes only in -my own computer. Now, I have made them more clean and added the user and -technical documentation and released them. - -The main reason is to give a set of macros which solves the common tasks to -the plain\TeX{} users. The side effect is that the macros demonstrate -that it is possible to do \TeX{} code simple and effective. Most of -\LaTeX{} macro packages don't have this feature. All macros are in the single -documented file "opmac.tex" with only 1700 lines. On the other hand the -\LaTeX{} code which solves comparable tasks is placed in kernel and tens -of \LaTeX{} packages with many tens of thousands lines in total. +The OPmac package is a set of simple additional macros to plain\TeX{}. It +enables users to take advantage of basic \LaTeX{} functionality: font size +selection, the automatic creation of a table of contents and an index, working +with bibliography databases, tables, references with optional hyperlinks, margin +settings, etc. + +I had been using these macros personally for a long time, but now, after +cleaning up the code a bit and providing both user and technical documentation, +I'm releasing them to the general public along with the new version of +\csplain{}. + +My main motivation in publishing OPmac is to provide a set of macros with +solutions to common tasks for plain\TeX{} users. Additionally, I wanted to +demonstrate that it is possible to write \TeX{} code in a simple and effective +style, something that most \LaTeX{} macro packages lack. All of OPmac's macros +are contained within the single file "opmac.tex" in only 1,700 +lines. By comparison, the \LaTeX{} code which solves comparable tasks is placed +inside its ``kernel'' along with many \LaTeX{} packages all of which contain +tens of thousands of lines. The main principles which I followed when creating this macro package, are: @@ -95,7 +96,7 @@ Here is a text. \bye \endtt -You can use \TeX, pdf\TeX, Xe\TeX{} or lua\TeX{} with eplain or \csplain{} +You can use \TeX, pdf\TeX, Xe\TeX{} or lua\TeX{} with "etex.src" or \csplain{} preloaded. The \csplain{} is recommended but it is not explicitly requested if you don't need to use Czech/Slovak specific features\fnote {Warnings: ``falling back to ASCII sorting'' @@ -134,10 +135,26 @@ i.e. the value stays unchanged. Examples: \typoscale[\magstep2/] % fonts bigger 1,44times \endtt -The sizes declared by these macros (for example in titles) are relative to -the basic size selected for the font (this may be arbitrary size, not only +The sizes declared by these macros (for example in titles) are relative to the +basic size selected for the current font (this may be arbitrary size, not only 10pt). +There are times however, when one would like to make a font change relative to +the documents ``base'' font size instead of the current font (e.g. when +typesetting footnotes). The macro "\typobase" provides an easy way to perform +such changes. The ``base'' font size is set with the first use of either +"\typosize" or "\typoscale" and this size is restored by "\typobase". Example: + +\begtt +\typosize[12/14] % if first use of \typosize, then this sets the "base" +... +{\typoscale[16/18] % bigger size (for example title font) + ... + \typobase\typoscale[750/750] % reduced to 75% of [12/14] (i.e. [9/10.5]) + ... % this is caculated from "base", no from actual title font +} +\endtt + The size of the current font can be changed by the command "\thefontsize[]" or can be rescaled by "\thefontscale[]". These macros don't change math fonts sizes nor @@ -290,6 +307,10 @@ If there are forward referenced objects then user have to run \TeX{} twice. During each pass, the working "*.ref" file (with refereces data) is created and this file is used (if it exists) at the begin of the document. +You can create a reference to whatever else by commands +"\label[