diff options
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r-- | Master/texmf-dist/doc/cstex/README-opmac | 5 | ||||
-rw-r--r-- | Master/texmf-dist/doc/cstex/opmac-d.pdf | bin | 734297 -> 0 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/cstex/opmac-d.tex | 244 | ||||
-rw-r--r-- | Master/texmf-dist/doc/cstex/opmac-u-en.pdf | bin | 0 -> 227290 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/cstex/opmac-u-en.tex | 1251 | ||||
-rw-r--r-- | Master/texmf-dist/doc/cstex/opmac-u.pdf | bin | 257522 -> 262768 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/cstex/opmac-u.tex | 129 |
7 files changed, 1531 insertions, 98 deletions
diff --git a/Master/texmf-dist/doc/cstex/README-opmac b/Master/texmf-dist/doc/cstex/README-opmac index 53632ef9a14..b3a34b07dc5 100644 --- a/Master/texmf-dist/doc/cstex/README-opmac +++ b/Master/texmf-dist/doc/cstex/README-opmac @@ -1,7 +1,8 @@ The documentation of the OPmac is: -opmac-u.tex,pdf ... user documentation (in Czech) -opamc-d.tex,pdf ... technical documentation (in Czech) +opmac-u.tex,pdf ... user documentation (in Czech) +opmac-u-en.tex,pdf ... user documentation (in English) +opamc-d.tex ... technical documentation (in Czech) See http://petr.olsak.net/opmac.html for more information. diff --git a/Master/texmf-dist/doc/cstex/opmac-d.pdf b/Master/texmf-dist/doc/cstex/opmac-d.pdf Binary files differdeleted file mode 100644 index 3bba0387253..00000000000 --- a/Master/texmf-dist/doc/cstex/opmac-d.pdf +++ /dev/null diff --git a/Master/texmf-dist/doc/cstex/opmac-d.tex b/Master/texmf-dist/doc/cstex/opmac-d.tex index 32fef6bf372..735087fd6a8 100644 --- a/Master/texmf-dist/doc/cstex/opmac-d.tex +++ b/Master/texmf-dist/doc/cstex/opmac-d.tex @@ -7,7 +7,7 @@ % This file is encoded in ISO-8859-2 because % UTF-8 encTeX has a conflict with DocByTeX -\def\projectversion{Nov. 2013} +\def\projectversion{May 2014} \def\headtitle{OPmac} \widowpenalty=10000 @@ -253,6 +253,7 @@ uživatelské dokumentaci. \dgn \nb cnvhook \dgn \nb pghook \dgn \nb toclinehook +\dgn \nb fnotehook \dgn \nb mnotehook \dgn \nb captionhook @@ -1658,7 +1659,7 @@ charakterizuje obvyklou možnost chování PDF prohlížeče při odskoku na cíl. Podrobněji viz manuál k~pdf\TeX{}u. PDF prohlížeče většinou lícují horní hranu okna přesně s~místem cíle, je tedy potřeba cíl umístit poněkud výše, abychom viděli i odkazovaný text. -K~tomu právě slouží registr \db destheight. +K~tomu právě slouží obsah makra \db destheight. \inext{dest}{\empty}{+-} @@ -1730,15 +1731,13 @@ Makro \db url "{<text>}" se používá k tisku URL. Vytiskne "<text>" fontem mezeru s dodatečnou mírnou roztažitelností \db urlskip. Mezera vpravo od těchto znaků je navíc zlomitelná s penaltou definovanou v makru \db urlbskip. Dvojité lomítko \db urlslashslash má zlomitelnou mezeru jen na -konci. +konci. Makro "\|" je lokálně definováno jako prázdné, ale při "\urlfont" +nabývá hodnoty \db urlspecchar. Takže ve skutečném odkaze se neprojeví, ale +při tisku ano. Uživatel si může "\urlspecchar" definovat dle svých představ +(například jako "\hfil\break"). \inext{url}{\empty}{+-} -Je třeba vysvětlit, proč je v makru "\urlskip" použito "\null", neboli -"\hbox{}". Tento box se přilepí na předchozí slovo a tím zakážeme toto slovo -dělit podle vzorů dělení slov. Spojovník při rozděleném slovu je totiž pro -čtenáře matoucí: nemůže vědět, zda je nebo není součástí URL. - Makro "\url{<text>}" pracuje tak, že uloží "<text>" do "\tmpb" a nechá vyměnit příslušné znaky uvnitř "\tmpb" pomocí "\replacestrings". Nakonec vytiskne "<text>" prostřednictvím "\ulink". @@ -1748,8 +1747,9 @@ některé další znaky, ale ne všechny: procento, backlash. U těchto znaků bychom nejprve museli vyměnit jejich kategorie. Pak by ale makro "\url" nefungovalo uvnitř parametrů jiných maker. V zájmu jednoduchosti makra "\url" to neděláme. Takže pokud uživatel -má v URL znak procento, nahradí ho sekvencí "\percent" manuálně a pokud tam má -další speciální znak, vyřeší to podobným makrem jako "\percent". +má v URL znak procento, musí psát "\%" +nebo si změní kategorie sám. Podobná poznámka platí pro znaky "{", "}", "\", +"#" a "$". Makro \db replacestrings "{<string1>}{<string2>}" vymění v makru "\tmpb" veškeré výskyty "<string1>" za "<string2>". Pro tento účel definuje pracovní @@ -2238,6 +2238,27 @@ Při kladení vlevo musíme použít "fill", abychom přeprali natahovací mezeru z \inext{mnoteA}{^^B\cbrace}{++} +Text uvnitř "\mnote" přebírá barvu kvůli "\vadjust" \uv{se zpožděním}, podle +barvy, která je na konci řádku, vedle kterého je "\mnote" umístěna. Makra +tedy při zpracování parametru "\mnote" nemohou dopředu vědět, jaká to bude +barva, a nelze tedy použít zásobník barev řízený makry. Uživateli přitom +musíme dát možnost barvu "\mnote" nastavit, například: + +\begtt +\def\mnotehook{\noindent\Black} +\endtt +zajistí, že budou všechny poznámky na okraji černé bez ohledu na to, jakou +barvu mají řádky, vedle kterých ty poznámky stojí. K tomu účelu je nastavení +případných barev uživatelem jednak v makru "\mnoteA" obklopeno do dvojice +"\pdfsave"--"\pdfrestore" a dále je nastartován pomocí \db mnoteC lokální +zásobník barev, který je pomocí \db mnoteD vrácen do stavu, v jakém byl před +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". + +\inext{mnoteC}{^^B\cbrace}{++} + 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: @@ -2255,31 +2276,32 @@ pak na definovanost "\mnotesfixed" ptá a pokud je definované, nepoužije \subsec Bibliografické reference %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -Nejprve uvedeme deklarace deskriptoru \db auxfile a čítačů +Nejprve uvedeme deklarace deskriptoru \db auxfile, stringu \db bibmark a čítačů \db bibnum a \db lastcitenum. \inext{auxfile}{\empty}{+-} -Makro \db cite "[<lejblík1>,<lejblík2>,...]" si prostřednictvím \db citeA -zavolá "\rcite{<lejblík>}" pro každou jednotlivou položku oddělenou čárkou ve -svém parametru. Makro "\citeA" v sobě skrývá fintu: parametr nemá jediný, -ale dva "#1#2". Protože první z nich je neseparovaný, ignorují se případné -mezery za čárkou a "#1" obsahuje první písmeno "<lejblíku>". Uvnitř makra -měníme \db citesep, což je čárka a mezera, která se má mezi údaji -vytisknout. Makro \db nocite "[<lejblík1>,<lejblík2>,...]" je definováno -stejně, jen připraví jiný význam makra "\docite", krz které budeme tisknout -v "\rcite" potřebný údaj. Veškerá -činnost maker "\cite" a "\nocite" probíhá uvnitř skupiny. +Makro \db cite "[<lejblík1>,<lejblík2>,...]" si opakovaně zavolá +"\citeA<lejblík-i>", kde se připraví čísla citovaných publikací do +lokálně tvořeného seznamu "\savedcites". Poté zavolá "\printsavedcites", +které lokálně tvořený seznam čísel vytiskne. Kromě toho makro "\citeA" udělá +plno dalších potřebných věcí, jak uvidíme za chvíli. +Makro \db nocite se chová jako "\cite" až na to, že se nic netiskne. +Makro \db rcite vytiskne čísla publikací, ale bez hranatých závorek kolem. +Makro \db savedcites je globálně prázdné a zaplní se vždy znovu uvnitř +skupiny vymezené makrem "\cite" nebo "\nocite" nebo "\rcite". \inext{cite}{\empty}{+-} -Makro \db rcite "{<lejblík>}" řeší zhruba řečeno následující věci: - +Makro \db citeA "<lejblík>," řeší zhruba řečeno následující věci: \begitems \item * Zjistí, zda je definován "\csname bib:<lejblík>\endcsname". Pokud ano, - vytiskne jeho hodnotu, pokud ne, vytiskne do textu otazníky a na terminál - varování. Tato kontrolní sekvence začne být známá po použití + přidá obsah tohoto makra (což je číslo citovaného záznamu) + do "\savedcites". Pokud ne, přidá do + "\savedcites" otazník a na terminál vypíše varování. + Kontrolní sekvence "\csname bib:<lejblík>\endcsname" bude obsahovat + "<číslo citace>" po použití "\bib[<lejblík>]" nebo "\bibitem{<lejblík>}". Tato makra uloží odpovídající informaci do REF souboru, odkud ji při opakovaném \TeX{}ování vyzvedneme. Je to klasická činnost, kterou provozujeme i u ostatních @@ -2288,41 +2310,45 @@ Makro \db rcite "{<lejblík>}" řeší zhruba řečeno následující věci: v makrech "\usebibtex" nebo "\usebbl". \enditems -Makro "\rcite" je naprogramováno zhruba takto +Makro "\citeA" je naprogramováno zhruba takto \def\begtthook{\langleactive} \begtt -function rcite(<lejblík>) { +function citeA(<lejblík>) { if (<lejblík> == '*') { <zapiš do> \citelist '*'; return; } if (\bib:<lejblík> == nedef) { - <zapiš do> \citelist <lejblík>; + <přidej do> \citelist <lejblík>; <na terminál:> "Warning, cite [label] unknown"; - <do tiskového výstupu:> "??"; + <přidej do> \savedcites "?,"; + <lokálně vypni třídění a zkracování seznamu> \savedcites; \bib:<lejblík> = empty; return; if (\bib:<lejblík> == empty) { - <do tiskového výstupu:> "??"; + <přidej do> \savedcites "?,"; + <lokálně vypni třídění a zkracování seznamu> \savedcites; return; } if (\bib:<lejblík> končí znakem '&') { - <zapiš do> \citelist <lejblík>; + <přidej do> \citelist <lejblík>; <odstraň znak & z obsahu makra> \bib:<lejblík>; } - <tiskni obsah makra> \bib:<lejblík>; + <přidej do> \savedcites <expandovaný> "\bib:<lejblík>,"; } \endtt -\def\begtthook{\langleactive} Výklad kódu: Protože chceme šetřit pamětí bufferu "\citelist", zapisujeme tam každý "<lejblík>" jen jednou. Zda se nedeklarovaný "<lejblík>" vyskytl -poprvé poznáme podle nedefinované hodnoty "\bib:<lejblík>". Zda se vyskytl -později znovu poznáme podle toho, že má hodnotu "empty". Zda se deklarovaný -"<lejblík>" vyskytl poprvé poznáme podle znaku "&" v jeho obsahu. +poprvé, poznáme podle nedefinované hodnoty "\bib:<lejblík>". Zda se vyskytl +nedeklarovaný "<lejblík>" později znovu poznáme podle toho, že má makro +"\bib:<lejblík>" hodnotu "empty". Zda se deklarovaný +"<lejblík>" vyskytl poprvé poznáme podle znaku "&" v~jeho obsahu. Návrh kódu v C-like notaci nyní převedeme do maker v \TeX{}u: -\inext{rcite}{^^B\cbrace}{++} +\inext{citeA}{^^B\cbrace}{++} +Makro snímá svůj parametr jako "#1#2," aby mohly být "<lejblíky>" odděleny +před čárkou mezerou, která je neseparovaným parametrem "#1" ignorována. Asi nejzajímavější vychytávka v tomto makru se týká testu na znak "&". Implicitně při čtení REF souboru se do makra "bib:<lejblík>" uloží "\bibnn{<hodnota>}&". Příkaz "\if" za sebou totálně expanduje vše @@ -2334,48 +2360,130 @@ Odstranění tohoto znaku probíhá znovu totální expanzí, tentokrát "\bibnn" první parametr "<hodnota>" zopakuje a druhý parametr se znakem "&" zahodí. -Než se pustíme do výkladu makra "\docite", připravíme si makra \db printcite -"<položka>" a \db printdashcite "<položka>". První z nich tiskne jednu -položku oddělenou od případné -další čárkou, druhé tiskne položku, před kterou předchází pomlčka -vyznačující interval položek. Pointa makra "\printcite" je v tom, že si samo -po prvním zavolání připraví separátor "\citesep" (který je na začátku -činnosti "\cite" prázdný), takže při opakovaném volání "\printcite" se -vytiskne i požadovaný separátor. Pomlčka v "\printdashcite" je schována do -"\hbox", aby nedocházelo těsně za ní ke zlomu řádku. - -\inext{printcite}{\empty}{+-} - -Makro \db docite "<položka>" vytiskne otazníky při prázdném parametru a jinak +Makro \db printsavedcites případně setřídí seznam "\savedcites" +podle velikosti zavoláním "\sortcitesA" +a dále opakovaně na jednotlivé prvky seznamu zavolá makro +"\citeB", které prvky seznamu vytiskne a případně je zkrátí pomocí intervalů +(místo "3,4,5" píše "3--5"). Pomocnou proměnnou "\tmpb" využije makro +"\citeB", jak uvidíme později při výkladu tohoto makra. + +\inext{printsavedcites}{^^B\cbrace}{++} + +Makro \db sortcitesA seřadí seznam "\savedcites" podle velikosti. Takže třeba +"4,7,3,5," se promění na "3,4,5,7,". Implicitně je definováno jako prázdné +makro, takže řazení se neprovede. Nicméně uživatel ho použitím makra +\db sortcitations v~hlavičce svého dokumentu probudí k životu. + +Oživené "\sortcitesA" nejprve vyvrhne do čtecí fronty obsah "\savedcites" +ukončený další čárkou (máme zde dvě čárky vedle sebe) a následně spustí \db +sortcitesB, které postupně odebírá jednotlivé prvky ze čtecí fronty, předává +je do nově tvořeného setříděného seznamu, kam je vkládá na správné místo. +Výchozí hodnota nově tvořeného seznamu obsahuje číslo "300000", které bude +vždy na konci seznamu, protože se předpokládá větší než jakýkoli tříděný +prvek. Zajímavý trik s "\edef\savedcites{...\expandafter}" způsobí, že se +"\savedcites" nejprve vyvrhne (po aplikaci dvou "\expandafter") do čtecí +fronty a teprve poté dostane novou hodnotu pomocí "\edef". Na konci makra +"\sortcitesA" ze seznamu odebereme koncové číslo "300000". + +\inext{sortcitesA}{\count=2 ^^B\cbrace}{++} + +Vložení prvku do zatříděného seznamu probíhá pomocí \db sortcitesC, což je +makro, které nově tvořený seznam, který je nyní také vyvržen ve čtecí +frontě, projde zleva doprava, dokud nenarazí na číslo větší než vkládané. +Při té činnosti opakovaně sbírá hodnoty a vkládá je zpět do "\savedcites". +Je-li zařazovaný prvek "\tmpa" menší než odebraný prvek z fronty, vloží se +pomocí \db sortcitesD do "\savedcites" původní "\savedcites" následovaný +"\tmpa" následovaný testovaným prvkem následovaný zbytkem vstupní +fronty (až po "\end"). + +\inext{sortcitesC}{\empty}{+-} + +Makro \db citeB "<položka>," ukončí činnost při prázdném parametru, +jinak se po vytištění "<položky>" zavolá znova. +Vytiskne dva otazníky, je-li parametrem otazník, a jinak vytiskne prostřednictvím "\printcite" jednu "<položku>". Kromě toho řeší při nenulovém "\lastcitenum" slučování po sobě následujících čísel položek do intervalů. Naposledy vytištěnou položku uchovává v registru "\lastcitenum". Při příštím zavolání zvětší "\lastcitenum" o jedničku a srovná ji s -"<položkou>". Jsou-li si rovny, jde o následující položku v řadě a takovou +"<položkou>". Jsou-li si rovny, jde o~následující položku v řadě a takovou položku netiskneme, nicméně si její hodnotu uchováme v "\tmpb". Pokud je mezi souvislou řadou položek díra, tj. "\lastcitenum" se nerovná "<položce>", pak dovytiskneme předchozí interval pomocí "\printdashcite{\the\tmpb}" a následně vytiskneme i "<položku>". Makro \db shortcitations jednoduše nastavuje "\lastcitenum" na nenulovou -hodnotu a tím probudí k životu hlavní část makra "\docite". +hodnotu a tím probudí k životu hlavní část makra "\citeB". -\inext{docite}{\empty}{+-} +\inext{citeB}{\empty}{+-} -Následuje kód makra \db bib "[<lejblík>]", které prostřednictvím -\db wbib "{<lejblík>}{<hodnota>}" vloží do REF souboru propojené údaje o -tom, jaké má "<lejblík>" přiřazeno číslo v seznamu literatury. -Makro "\wbib" připojí před "\wref" příkaz "\immediate" právě tehdy, když -"\wref" je ve stavu, kdy skutečně zapisuje do souboru REF. -Makro \db Xbib pracuje při čtení souboru REF a dělá to, co jsme si řekli už -dříve: nastaví hodnotu makra "\bib:<lejblík>" na "\bibnn{<hodnota>}&". +Činnost "\cite" je konečně završena voláním maker +\db printcite "<položka>" a \db printdashcite "<položka>". První z nich tiskne jednu +položku oddělenou od případné +další čárkou, druhé tiskne položku, před kterou předchází pomlčka +vyznačující interval položek. Pointa makra "\printcite" je v tom, že si samo +po prvním zavolání upraví separátor \db citesep, který je globálně a tedy na začátku +činnosti "\cite" prázdný. Při opakovaném volání "\printcite" se tedy +vytiskne i požadovaný separátor. Pomlčka v~"\printdashcite" je schována do +"\hbox", aby nedocházelo těsně za ní ke zlomu řádku. + +\inext{printcite}{\empty}{+-} + +Při použití \db nonumcitations potlačíme případné předchozí +"\shortcitations" a "\sortcitations" a dále nastavíme \db citelinkA +na jinou, než implicitní prázdnou hodnotu. Makro "\citelinkA" vytiskne +"\bim:<číslo citace>", tedy značku citace (je to nastaveno v "\Xbib"). +Není-li značka citace známá, vypíšeme varování a tiskneme "<číslo citace>". +Makro \db etalchar je potřebné při použití Bib\TeX{}ového stylu "alpha". + +\inext{nonumcitations}{\empty}{+-} + +Makro \db ecite "[<lejblík>]{<text>}" nejprve provede +"\citeA#1,,,", tedy vlastně "\nocite[<lejblík>]" a pak si +\db eciteB vyzvedne ze "\savedcites" +první údaj před čárkou, tedy "<číslo citace>", a uloží do "#1". V~"#2" je případný zbytek ze +"\savedcites" a dále v "#3" pokračuje "<text>". Makro vytiskne jen +"<text>", když je odkaz nedefinován, jinak vytiskne "<text>" prostřednictvím +makra "\citelink". + +\inext{ecite}{\empty}{+-} + +Následuje kód makra \db bib "[<lejblík>]". Nejprve je ošetřeno, zda je použit +zkrácený nebo rozšířený zápis "\bib[<lejblík>] = {<značka>}". V prvním +případě se zavolá "\bibB" s prázdným "\bibmark", v druhém případě se +"\bibmark" nejprve naplní prostřednictvím makra \db bibA. +Makro \db bibB vloží prostřednictvím +\db wbib "{<lejblík>}{<číslo citace>}{<značka>}" do REF souboru propojené údaje o +tom, jaké má "<lejblík>" přiřazeno "<číslo citace>" v seznamu literatury. +Makro "\tmpb" je naplněno "<lejblíkem>" pro případné použití v "\dest" (při +draft módu) nebo pro použití v makru "\printbib". +Makro "\wbib" připojí před "\wref" příkaz "\immediate", aby byly zapsány +do REF souboru aktuální hodnoty parametrů. \inext{bib}{\empty}{+-} +Makro \db Xbib pracuje při čtení souboru REF a dělá to, co jsme si řekli už +dříve: nastaví hodnotu makra "\bib:<lejblík>" na "\bibnn{<číslo citace>}&". +Dále definuje "\bim:<číslo citace>" jako třetí parametr, který je při použití +"\bib" prázdný, ale při čtení "*.bbl" souboru vygenerovaného pomocí +"alpha.bst" nebo "apalike.bst" tam bude uložena "<značka>". Dále "\Xbib" +definuje \db lastbibnum jako "<číslo citace>", takže po přečtení REF souboru +obsahuje největší použité "<číslo citace>". To se může hodit, pokud designér +chce odsadit seznam literatury podle šířky největšího čísla citace. + +\inext{Xbib}{\empty}{+-} + +Makro \db printbib se vloží na začátek každého záznamu v seznamu literatury. +Implicitně vytiskne "\the\bibnum" v hranaté závorce a při "\nonumcitations" +netiskne nic. V obou případech nastaví odsazení druhého a dalších řádků +odstavce na "\iindent". Designér si může toto makro předefinovat dle svého +uvážení. + +\inext{printbib}{\empty}{+-} + Makro \db addcitelist "{<lejblík>}" přidá do \db citelist údaj ve tvaru -"\lcite[<lejblík>]". Hranaté závorky jsou použity proto, aby fungoval test +\db citeI "[<lejblík>]". Hranaté závorky jsou použity proto, aby fungoval test "\isinlist\citelist{[<lejblík>]}". Jak uvidíme za chvíli, makro "\addcitelist" změní během činnosti makra "\usebibtex" svůj význam na -\db writeaux, aby případné použití "\cite" až za "\usebitex" rovnou +\db writeaux, aby případné použití "\cite" až za "\usebibtex" rovnou zapisovalo do AUX souboru. Podobně makro "\addcitelist" změní v makru "\usebbl" svůj význam \db writeXcite "{<lejblík>}", aby v příštím průchodu \TeX{}em @@ -2419,13 +2527,11 @@ V BBL souboru se vyskytují povely \db bibitem. Za každým z nich se možná objeví parametr v~hranaté závorce "[<značka>]" a následně je uveden "{<lejblík>}". Pak na dalších řádcích jsou bibliografická data jednoho záznamu ukončená prázdným řádkem. Objeví-li se "[<značka>]", dává tím -Bib\TeX{} najevo, že se má tato "<značka>" použít místo běžného číslování +Bib\TeX{} najevo, že se může tato "<značka>" použít místo běžného číslování záznamů. Následuje kód, který takové údaje přečte, vytiskne a vloží do REF -souboru o tom zprávu prostřednictvím "\wref{<lejblík>}{<hodnota>}". -Rozlišují se dva režimy tisku: není-li přítomna "[<značka>]" (makro "\tmpa" -je prázdné), pak pomocí "\llap" vytiskneme "[<číslo>]". Jinak se posuneme o -"-\iindent" a tiskneme "[<značku>]" následovanou mezerou. Pak se vytisknou -další údaje bibliografického záznamu. +souboru o tom zprávu prostřednictvím "\wref{<lejblík>}{<číslo citace>}{<značka>}". +Makro "\tmpb" je naplněno "<lejblíkem>" pro případné použití v "\dest" (při +draft módu) nebo pro použití v makru "\printbib". \dgn\nb bibitemB \dgn\nb bibitemC \dgn\nb bibitemD \inext{bibitem}{^^B\cbrace}{++} @@ -2447,7 +2553,7 @@ prázdný řádek alias "\par") přečtena do parametru "#2" makra "\bibitemC". Celý údaj je pak vytištěn jen za předpokladu, že "[<lejblík>]" je přítomen v seznamu "\citelist". Třetí makro "\bbl:c" pracuje jako druhé až na to, že údaj netiskne, ale zapamatuje si ho do makra "\bb:<lejblík>". Po takovém -projití BBL souboru ještě projde "\citelist", kde se "\lcite[<lejblík>]" +projití BBL souboru ještě projde "\citelist", kde se "\citeI[<lejblík>]" promění v "\bb:<lejblík>", takže se záznam vytiskne. Nyní ale v pořadí, v jakém jsou "<lejblíky>" zařazeny do "\citelist". diff --git a/Master/texmf-dist/doc/cstex/opmac-u-en.pdf b/Master/texmf-dist/doc/cstex/opmac-u-en.pdf Binary files differnew file mode 100644 index 00000000000..731fca0656b --- /dev/null +++ b/Master/texmf-dist/doc/cstex/opmac-u-en.pdf diff --git a/Master/texmf-dist/doc/cstex/opmac-u-en.tex b/Master/texmf-dist/doc/cstex/opmac-u-en.tex new file mode 100644 index 00000000000..95408df9a3e --- /dev/null +++ b/Master/texmf-dist/doc/cstex/opmac-u-en.tex @@ -0,0 +1,1251 @@ + +\input opmac + +\def\toasciidata{}\def\r{} + +\typosize[11/13] + +\def\thefnote{$^{\locfnum}$} + +\catcode`<=13 +\def<#1>{\hbox{$\langle$\it#1\/$\rangle$}} + +\activettchar" + +\insertoutline{CONTENTS} \outlines{0} \hyperlinks{\Blue}{\Green} + + +\tit OPmac -- macros for plain\TeX\fnotemark1 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\centerline{\it Petr Ol\v s\'ak, 2012, 2013, 2014} + +\bigskip +\centerline{\url{http://petr.olsak.net/opmac-e.html}} + + +\fnotetext {This text is second revised version. The first version was + published in TUGboat 34:1, 2013, pp.~88--96} + +\notoc\nonum \sec Contents\par\maketoc + +\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 main principles which I followed when creating this macro package, are: + +\begitems + * Simplicity is power. + * Macros are not universal, but are readable and understandable. + * User can easily redefine these macros as he/she wishes. +\enditems + +Each part of the macro code is written in order to maximize readability for +human who will want to read it, understand it and change it. + +OPmac package offers a markup language for authors of texts (like \LaTeX), +i.e. the fixed set of tags to define the structure of the document. This +markup is different from the \LaTeX{} markup. It may offer to write the +source text of the document somewhat clearer and more attractive. The OPmac +package, however, does not care for typographic of the document. The simple +sober document is created if no additional macros are used. We assume that +the author of additional macros is able to create a look of the document to +suit specific requirement. + +OPmac has a small number of additional packages: "pdfuni", "opmac-xetex" and +"opmac-bib" (see the end of \url{http://petr.olsak.net/opmac-e.html} page). +Moreover, there exist many tens of little OPmac tricks comparable with +\LaTeX{} packages +mentioned on \url{http://petr.olsak.net/opmac-tricks.html} page. + +\secnum=-1 + +\sec Using OPmac +%%%%%%%%%%%%%%%% + +OPmac is not compiled as a format. For using it in plain\TeX{}, you can simply +"\input opmac" at the beginning of your document. The example of the simple +document follows: + +\begtt +\input opmac +\typosize[11/13] % setting the basic font size and the baselineskip +\margins/1 a4 (1,1,1,1)in % setting 1in margins for A4 paper + +Here is a text. +\bye +\endtt + +You can use \TeX, pdf\TeX, Xe\TeX{} or lua\TeX{} with eplain 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'' +or ``CZ/SK outline-conversion is off'' may occur without \csplain{}.}. + + +\sec Font sizes +%%%%%%%%%%%%%%% + +The commands for font size setting described here have local validity. It +means that if you put them into group, the font sizes are selected locally. + +The command "\typosize[<fontsize>/<baselineskip>]" sets the font size of text and +math fonts and baselineskip. If one of these two parameters is empty, the +corresponding feature stays unchanged. The metric unit is supposed "pt" and +this unit isn't written in parameters. You can change the unit by the +command "\ptunit=<something-else>", for instance "\ptunit=1mm". +Examples: + +\begtt +\typosize[10/12] % default of plainTeX +\typosize[11/12.5] % font 11pt, baseline 12.5pt +\typosize[8/] % font 8pt, baseline unchanged +\endtt + +The command +"\typoscale[<font-factor>/<baselineskip-factor>]" +sets the text and math fonts +size and baselineskip as a multiple of the current fonts size and +baselineskip. The factor is written in "scaled"-like way, it means that 1000 +means factor one. The empty parameter is equal to the parameter 1000, +i.e. the value stays unchanged. Examples: + +\begtt +\typoscale[800/800] % fonts and baselineskip re-size to 80 % +\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 +10pt). + +The size of the current font can be changed by the command +"\thefontsize[<font-size>]" or can be rescaled by +"\thefontscale[<factor>]". These macros don't change math fonts sizes nor +baselineskip. + +The "\resizefont", "\regfont" and "\resizeall" commands (documented in +\csplain) can be used even if +the used format is not \csplain. The best +design size of the font for desired size is selected. +For example "\typosize[18/]" selects the font "cmr17 at 18pt". + +The "\em" macro acts as "\it" if the current font is "\rm", acts as "\rm" if +the current font is "\it", acts as "\bi" if the current font is "\bf" and +acts as "\bf" if the current font is "\bi". The "\/" spaces are inserted +automatically. Example: + +\begtt +This is {\em important} text. % = This is {\it important\/} text. +\it This is {\em important} text. % = This is\/ {\rm important} text. +\bf This is {\em important} text. % = This is {\bi important\/} text. +\bi This is {\em important} text. % = This is\/ {\bf important} text. +\endtt + + +\sec Parts of the document +%%%%%%%%%%%%%%%%%%%%%%%%%% + +The document can be divided into chapters, sections and subsections and titled +by "\tit" command. The parameters have to be separed by empty line (no +braces are used): + +\begtt +\tit Document title <empty line> +\chap Chapter title <empty line> +\sec Section title <empty line> +\secc Subsection title <empty line> +\endtt + +The chapters are numbered by one number, sections by two numbers +(chapter.section) and subsections by three numbers. If there are no chapters +then section have only one number and subsection two. + +The implicit design of the titles of chapter etc.\ are implemented in the +macros "\printchap", "\printsec" and "\printsecc". User can simply change +these macros if he/she needs another behavior. + +The first paragraph after the title of chapter, section and subsection is +not indented but you can type "\let\firstnoindent=\relax" if you need all +paragraphs indented. + +If a title is so long then it breaks to more lines. It is better to hint the +breakpoints because \TeX{} does not interpret the meaning of the title. +User can put the "\nl" (it means newline) macro to the breakpoints. + +The chapter, section or subsection isn't numbered if the "\nonum" precedes. +And the chapter, section or subsection isn't delivered to the table of +contents if "\notoc" precedes. + + +\sec Another numbered objects +%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +Apart from chapters, sections and subsections, there are another +automatically numbered objects: equations and captions for tables and +figures. + +If user write the "\eqmark" as the last element of the display mode then +this equation is numbered. The format is one number in brackets. This number +is reset in each section. + +If the "\eqalignno" is used, then user can put "\eqmark" to the last column +before "\cr". For example: + +\begtt +\eqalignno{ + a^2+b^2 &= c^2 \cr + c &= \sqrt{a^2+b^2} & \eqmark \cr} +\endtt + +The next numbered object is caption which is tagged by "\caption/t" for +tables and "\caption/f" for figures. Example: + +\begtt +\hfil\table{rl}{ + age & value \crl\noalign{\smallskip} + 0--1 & unmeasured \cr + 1--6 & observable \cr + 6--12 & significant \cr + 12--20 & extremal \cr + 20--40 & normal \cr + 40--60 & various \cr + 60--$\infty$ & moderate} +\par\nobreak\medskip +\caption/t The dependency of the computer-dependency on the age. +\endtt + +This example produces: + +\bigskip +{\def\addto#1#2{\expandafter\def\expandafter#1\expandafter{#1#2}} +\hfil\table{rl}{age & value \crl\noalign{\smallskip} + 0--1 & unmeasured \cr + 1--6 & observable \cr + 6--12 & significant \cr + 12--20 & extremal \cr + 20--40 & normal \cr + 40--60 & various \cr + 60--$\infty$ & moderate} +\par\nobreak\medskip +{ \leftskip=\parindent plus1fil + \rightskip=\parindent plus-1fil + \parfillskip=0pt plus2fil \noindent +{\bf Table 2.3} The dependency of the com\-puter-dependency on the age.\par} +} +\bigskip + +The word ``Table'' followed by a number is added by the macro +"\caption/t". The macro "\caption/f" creates the word figure. +The caption text is centered. If it occupies more lines then the +last line is centered. + +The added word (table, figure) depends on the actual number of the +"\language" register. OPmac implements the mapping from "\language" +numbers to the languages and the mapping from languages to the generated +words. + +If you wish to make the table or figure as floating object, you need to use +plain\TeX{} macros "\midinsert", "\topinsert" and "\endinsert". + +Each automatically numbered object can be referenced, if the +"\label[<label>]" command precedes. The reference commands are +"\ref[<label>]" and "\pgref[<label>]". Example: + +\begtt +\label[beatle] \sec About Beatles + +\label[comp-dependence] +\hfil\table{rl}{...} % the table +\caption/t The dependency of the computer-dependency on the age. + +\label[pythagoras] +$$ a^2 + b^2 = c^2 \eqmark $$ + +Now we can point to the section~\ref[beatle] on the page~\pgref[beatle] +or write about the equation~\ref[pythagoras]. Finally there +is an interesting Table~\ref[comp-dependence]. +\endtt + +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. + + +\sec Lists +%%%%%%%%%% + +The list of items is surrounded by "\begitems" and "\enditems" commands. +The asterisk ("*") is active within this environment and it starts one item. +The item style can be chosen by "\style" parameter written after "\begitems": + +\begtt +\style o % small bullet +\style O % big bullet (default) +\style - % hyphen char +\style n % numbered items 1., 2., 3., ... +\style N % numbered items 1), 2), 3), ... +\style i % numbered items (i), (ii), (iii), ... +\style I % numbered items I, II, III, IV, ... +\style a % items of type a), b), c), ... +\style A % items of type A), B), C), ... +\style x % small rectangle +\style X % big rectangle +\endtt + +Another style can be defined by the command "\sdef{item:<style>}{<text>}". +Default item can be redefined by "\def\normalitem{<text>}". +The list environments can be nested. Each new level of item is indented by +next multiple of "\iindent" which is set to "\parindent" by default. +The vertical space at begin and end of the environment is inserted by the +macro "\iiskip". + + +\sec Table of contents +%%%%%%%%%%%%%%%%%%%%%% + +The "\maketoc" command prints the table of contents of all "\chap", "\sec" +and "\secc" used in the document. These data are read from external "*.ref" file, so +you have to run \TeX{} more than once (typically three times if the table of +contents is at the beginning of the document). + +The name of the section with table of contents is not printed. The direct usage +of "\chap" or "\sec" isn't recommended here because the table of contents +is typically not referenced to itself. You can print the unnumbered and unreferenced +title of the section by the code: + +\begtt +\nonum\notoc\sec Table of Contents +\endtt + +The title of chapters etc.\ are written into the external file and they are +read from this file in a next run of \TeX. This technique can induce some +problems when a somewhat complicated macro is used in the title. OPmac +solves this problem by different way than \LaTeX. User can set the +problematic macro as ``robust'' by "\addprotect\macro" declaration. The +"\macro" itself cannot be redefined. The common macros used in OPmac which +can be occur in the titles are declared by this way. For example: + +\begtt +\addprotect~ \addprotect\TeX \addprotect\thefontsize \addprotect\em +\endtt + + +\sec Making the index +%%%%%%%%%%%%%%%%%%%%% + +The index can be included into document by "\makeindex" macro. No external +program is needed, the alphabetical sorting are done inside \TeX{} at macro +level. + +The "\ii" command (insert to index) declares the word separated by the space +as the index item. This declaration is represented as invisible atom on the +page connected to the next visible word. The page number of the page where +this atom occurs is listed in the index entry. So you can type: + +\begtt +The \ii resistor resistor is a passive electrical component ... +\endtt + +You cannot double the word if you use the "\iid" instead "\ii": + +\begtt +The \iid resistor is a passive electrical component ... +or: +Now we'll deal with the \iid resistor . +\endtt + +Note that the dot or comma have to be separated by space when "\iid" is +used. This space (before dot or comma) is removed by the macro in +the current text. + +The multiple-words entries are commonly organized in the index by the format +(for example): + +\medskip + +linear~dependency 11, 40--50 + +--- independency 12, 42--53 + +--- space 57, 76 + +--- subspace 58 + +\medskip + +To do this you have to declare the parts of the words by the "/" separator. +Example: + +\begtt +{\bf Definition.} +\ii linear/space,vector/space +{\em Linear space} (or {\em vector space}) is a nonempty set of... +\endtt + +The number of the parts of one index entry is unlimited. Note, that you can +spare your typing by the comma in the "\ii" parameter. The previous example +is equivalent to "\ii linear/space" "\ii vector/space". + +Maybe you need to propagate to the index the similar entry to the +linear/space in the form space/linear. You can do this by the shorthand ",@" +at the end of the "\ii" parameter. Example: + +\begtt +\ii linear/space,vector/space,@ +is equivalent to: +\ii linear/space,vector/space \ii space/linear,space/vector +\endtt + +If you really need to insert the space into the index entry, write ``"~"''. + +The "\makeindex" creates the list of alphabetically sorted index entries +without the title of the section and without creating more columns. OPmac +provides another macros for more columns: + +\begtt +\begmulti <number of columns> +<text> +\endmulti +\endtt + +The columns will be balanced. The Index can be printed by the following +code: + +\begtt +\sec Index\par +\begmulti 3 \makeindex \endmulti +\endtt + +Only ``pure words'' can be propagated to the index by the "\ii" command. It +means that there cannot be any macro, \TeX{} primitive, math selector etc. +But there is another possibility to create such complex index entry. Use +``pure equivalent'' in the "\ii" parameter and map this equivalent to the +real word which is printed in the index by "\iis" command. Example: + +\begtt +The \ii chiquadrat $\chi$-quadrat method is +... +If the \ii relax "\relax" command is used then \TeX\ is relaxing. +... +\iis chiquadrat {$\chi$-quadrat} +\iis relax {{\tt \char`\\relax}} +... +\endtt + +The "\iis <equivalent> {<text>}" creates one entry in the ``dictionary +of the exceptions''. The sorting is done by the "<equivalent>" but the +"<text>" is printed in the index entry list. + +The special sorting by the Czech or Slovak standard of alphabetical sorting +is activated if \csplain{} is used and if "\language" register is set to the +Czech or Slovak hyphenation patterns when "\makeindex" is in progress. The +main difference from English sorting is that ``ch'' is treated as one +character between h and i. + + +\sec Colors +%%%%%%%%%%% + +The colors selection macros are working only if pdf\TeX-like engine is used. +OPmac provides a small number of color selectors: +{\localcolor\Blue "\Blue"}, +{\localcolor\Red "\Red"}, +{\localcolor\Brown "\Brown"}, +{\localcolor\Green "\Green"}, +{\localcolor\Yellow "\Yellow"}, +{\localcolor\Cyan "\Cyan"}, +{\localcolor\Magenta "\Magenta"}, +{"\White"}, +{\localcolor\Grey "\Grey"}, +{\localcolor\LightGrey "\LightGrey"} and +"\Black". But user can define more +such selectors by setting the CMYK components. For example + +\begtt +\def\Orange{\setcmykcolor{0 0.5 1 0}} +\endtt + +The selectors itself change the color of the text and of the lines with the +thickness more than 1bp. If the "\linecolor" immediately precedes the color +selector then the lines with thickness less or equal 1bp are colored. This +is a second independent type of the color. + +The color selectors work globally on the one page. If the colored text is +broken to the next page then the color is correctly set on the following +page(s) after the second run of \TeX, because this event is implemented via +external file. User can write "\localcolor" inside the group. This command +saves the current color and restore it after the group is completed. It is +supposed that the group corresponds to the boundary of a box which cannot break +to more pages. If this is not true case then user can use "\longlocalcolor" +instead "\localcolor". Example: + +\begtt +\Red The text is red +\hbox{\loacalcolor \Blue here is blue {\localcolor \Green and green} + restored blue \Brown and brown} +now the text is red. +\endtt + +\def\coloron#1#2#3{% + \setbox0=\hbox{#3}\leavevmode + {\localcolor\rlap{#1\strut \vrule width\wd0}#2\box0}% +} +The more usable example follows. It defines a macro which creates the +\coloron\Yellow\Brown{colored text on the} +\coloron\Yellow\Brown{colored background}. Usage: +"\coloron<background><foreground>{<text>}" + +The "\coloron" can be defined as follows: + +\begtt +\def\coloron#1#2#3{% + \setbox0=\hbox{#3}\leavevmode + {\localcolor\rlap{#1\strut \vrule width\wd0}#2\box0}% +} +\coloron\Yellow\Brown{The brown text on the yellow backround} +\endtt + +{\bf The watermark} is grey text on the backrounf of the page. OPmac offers +an example: the macro "\draft" which creates grey scaled and rotated text +DRAFT on the background of every page. + + +\sec Hyperlinks, outlines +%%%%%%%%%%%%%%%%%%%%%%%%% + +If the command "\hyperlins{<color-in>}{<color-out>}" is used at the beginning of +the file, then the following objects are hyperlinked when PDF output is used: + +\begitems +* numbers generated by "\ref" or "\pgref", +* numbers of chapters, sections and subsections in the table of contents, +* numbers or marks generated by "\cite" command (bibliography references), +* texts printed by "\url" command. +\enditems + +The last object is an external link and it is colored by +"<color-out>". Others links are internal and they are colored by +"<color-in>". Example: + +\begtt +\hyperlinks \Blue \Green % internal links blue, URLs green. +\endtt + +You can use another marking of active links: by frames which are visible in +the PDF viewer but invisible when the document is printed. The way to do it +is to define the macros "\pgborder", "\tocborder", "\citeborder", +"\refborder" and "\urlborder" as the triple of RGB components of the used +color. Example: + +\begtt +\def\tocborder {1 0 0} % links in table of contents: red frame +\def\pgborder {0 1 0} % links to pages: green frame +\def\citeborder {0 0 1} % links to references: blue frame +\endtt + +By default these macros are not defined. It means that no frames are created. + +There are ``low level'' commands to create the links. You can specify the +destination of the internal link by "\dest[<type>:<label>]". The +active text linked to the "\dest" can be created by +"\link[<type>:<label>]{<color>}{<text>}". The "<type>" parameter is one of +the "toc", "pg", "cite", "ref" or another special for your purpose. + +The "\url" macro prints its parameter in "\tt" font and creates a potential +breakpoints in it (after slash or dot, for example). If "\hyperlinks" +declaration is used then the parameter of "\url" is treated as an external URL link. +An example: "\url{http://www.olsak.net}" creates \url{http://www.olsak.net}. +The charecters {\tt\%}, "\", "#", "$", "{" and "}" have to be protected by +backslash in the "\url" argument, the other special charecters "~", "_", +"^", "&" can be written as single character. You can insert the "\|" command +in the "\url" argument as a potential breakpoint. + +If the linked text have to be different than the URL, you can use +"\ulink[<url>]{text}" macro. For example: + +\begtt +\ulink[http://www.olsak.net/opmac-e.html]{OPmac page} +\endtt +creates +\ulink[http://www.olsak.net/opmac-e.html]{OPmac page}. + +The PDF format provides ``outlines'' which are notes placed in the special frame of +the PDF viewer. These notes can be managed as structured and hyperlinked +table of contents of the document. The command "\outlines{<level>}" creates +such outlines from data used for table of contents in the document. The +"<level>" parameter gives the level of opened sub-outlines +in the default view. The deeper levels can be open by mouse click on the +triangle symbol after that.\looseness=-1 + +The strings used in PDF outlines are converted if \csplain{} is used: the +accents are stripped off because they can make problems in outlines. But +user can use "\input pdfuni" in order to convert these strings to internal +UNICODE representation. + +The command "\insertoutline{<text>}" inserts next entry into PDF outlines at +the main level~0. This entry can be placed before table of contents (created +by "\outlines") or after it. + + +\sec Verbatim +%%%%%%%%%%%%% + +The display verbatim text have to be surrounded by the "\begtt" and +"\endtt" couple. +The inline verbatim have to be tagged (before and after) +by a character which is declared by +"\activettchar<char>". For example "\activettchar"{\tt\char`"} +declares the +{\tt\char`"} for inline verbatim markup. + +If the numerical register "\ttline" is set to the non-negative value then +display verbatim will number the lines. The first line has the number +"\ttline+1" and when the verbatim ends then the "\ttline" value is equal to the +number of last line printed. Next "\begtt...\endtt" environment will follow +the line numbering. OPmac sets "\ttline=-1" by default. + +The indentation of each line in display verbatim is controlled by +"\ttindent" register. This register is set to the "\parindent" when +"opmac.tex" is read. User have to change its value if the "\parindent" is +changed after reading of "opmac.tex". + +The "\begtt" starts internal group in which the catcodes are changed. Then +the "\tthook" macro is run. This macro is empty by default and user can +control fine behavior by it. For example the cactodes can be reset here. If +you need to define active character in the "\tthook", use "\adef" as in the +following example: + +{\def\tthook{\adef@{\string\endtt}} +\begtt +\def\tthook{\adef!{?}\adef?{!}} +\begtt +Each occurrence of the exclamation mark will be changed to +the question mark and vice versa. Really? You can try it! +@ +\endtt +} + +The "\adef" command sets its parameter as active {\it after\/} +the body of "\tthook" is read. So you can't worry about active +categories. + +There are tips for global "\tthook" definitions here: + +\begtt +\def\tthook{\typosize[9/11]} % setting font size for verbatim +\def\tthook{\ttline=0} % each listing will be numbered from one +\def\tthook{\adef{ }{\char`\ }} % visualisation of spaces +\endtt + +You can print verbatim listing from external files by "\verbinput" command. +Examples: + +\begtt +\verbinput (12-42) program.c % listing from program.c, only lines 12-42 +\verbinput (-60) program.c % print from begin to the line 60 +\verbinput (61-) program.c % from line 61 to the end +\verbinput (-) program.c % whole file is printed +\verbinput (70+10) program.c % from line 70, only 10 lines printed +\verbinput (+10) program.c % from the last line read, print 10 lines +\vebrinput (-5+7) program.c % from the last line read, skip 5, print 7 +\verbinput (+) program.c % from the last line read to the end +\endtt + + +The "\ttline" influences the line numbering by the same way as in +"\begtt...\endtt" environment. If "\ttline=-1" then real line numbers are +printed (this is default). If "\ttline"{\tt\char`\<-1} then no line +numbers are printed. + +The "\verbinput" can be controlled by "\tthook", "\ttindent" just like +in "\begtt...\endtt". + + +\sec Tables +%%%%%%%%%%% + +The macro "\table{<declaration>}{<data>}" provides similar "<declaration>" +as in \LaTeX: you can use letters "l", "r", "c", each letter declares +one column (aligned to left, right, center respectively). +These letters can be combined by the ``{\tt\char`\|}'' character +(vertical line). Example + +\begtt +\table{||lc|r||}{ \crl + Month & commodity & price \crli + \tskip.2em + January & notebook & \$ 700 \cr + February & skateboard & \$ 100 \cr + July & yacht & k\$ 170 \crl} +\endtt +% +generates the following result: + +\bigskip +\table{||lc|r||}{ \crl + Month & commodity & price \crli + \tskip.2em + January & notebook & \$ 700 \cr + February & skateboard & \$ 100 \cr + July & yacht & k\$ 170 \crl} +\bigskip + +The command "\cr" is generally known. Moreover OPmac defines following similar +commands: + +\begitems +* "\crl" \dots\ the end of the row with a horizontal line after it. +* "\crli" \dots\ like "\crl" but the horizontal line doesn't intersect the + vertical double lines. +* "\crlli" \dots\ like "\crli" but horizontal line is doubled. +\enditems + +The "\tskip<dimen>" command works like the "\noalign{\vskip<dimen>}" +after "\cr*" commands but it doesn't interrupt the vertical lines. + +The configuration macros for "\table" are defined in the following listing +with their default values: + +\begtt +\def\tabiteml{\enspace} % left material in each column +\def\tabitemr{\enspace} % right material in each column +\def\tabstrut{\strut} % strut inserted in each line +\def\vvkern{1pt} % space between double vertical line +\def\hhkern{1pt} % space between double horizontal line +\endtt + +If you do "\def\tabiteml{$\enspace}\def\tabitemr{\enspace$}" then +the "\table" acts like \LaTeX's array environment. + +The "\frame{<text>}" makes a frame around "<text>". You can put the whole "\table" +into "\frame" if you need double-ruled border of the table. Example: + +\begtt +\frame{\table{|c||l||r|}{\crl + \multispan3\vrule\hss\bf Title\hss \vrule\tabstrut \crl + \noalign{\kern\hhkern}\crli + first & second & third \crlli + seven & eight & nine \crli}} +\endtt +% +creates the following result: + +\bigskip +\frame{\table{|c||l||r|}{\crl + \multispan3\vrule\hss\bf Title\hss \vrule\tabstrut \crl + \noalign{\kern\hhkern}\crli + first & second & third \crlli + seven & eight & nine \crli}} +\bigskip + +The "c", "l" and "r" are default <declaration> letters but you can define +more such letters by "\def\tabdeclare<letter>{<left>##<right>}". For +example: + +\begtt +\newdimen\Pwidth +\def\tabdeclareP {\enskip\vtop{\hsize=\Pwidth \rightskip=0pt plus1fil + \baselineskip=1.2em\lineskiplimit=0pt\noindent##\tabstrutA}\hss\enskip} +\endtt +% +declares the letter P which means the tabular column with "\vtop"s. This is +similar to \LaTeX's parbox. + +The rule width of tables (and implicit width of all "\vrule"s and "\hrule"s) +can be set by the command "\rulewidth=<dimen>". The default value given +by \TeX{} is 0.4pt. + +Many tips about tables can be seen on +\url{http://petr.olsak.net/opmac-tricks.html}. + +\sec Images +%%%%%%%%%%% + +The "\inspic <filename>.<extension><space>" inserts the picture stored in +the graphics file with the name "<filename>.<extension>". +You can set the picture width by "\picw=<dimen>" before first "\inspic" command +which declares the width of the picture. +The files can be in the PNG, JPG, JBIG2 or PDF format. The "\inspic" command +works with pdf\TeX{}/Xe\TeX{} only. + +The "\picwidth" is an equivalent register to "\picw". Moreover there is an +"\picheight" register which denotes the height of the picture. If both +registers are set then the picture will be (probably) deformed. + +The file is searched in "\picdir". This macro is empty by default, this +means that the file is searched in current directory. + +\sec PDF transformations +%%%%%%%%%%%%%%%%%%%%%%%% + +All typesetting elements are transformed in pdf\TeX{} by linear +transformation given by the current transformation matrix. The +"\pdfsetmatrix {<a> <b> <c> <d>}" command makes the internal multiplication +with the current matrix so linear transformations can be composed. The +stack-oriented commands "\pdfsave" and "\pdfrestore" gives a possibility of +storing and restoring the current transformation matrix and current point. +The possition of current point have to be the same from \TeX{}'s point of +view as from transformation point of view when "\pdfrestore" is processed. +Due to this fact the "\pdfsave\rlap{<transformed text>}\pdfrestore" +or something similar is recomeded. + +OPmac provides the macros + +\begtt +\pdfscale{<horizontal-factor>}{<vertical-factor>} +\pdfrotate{<angle-in-degrees>} +\endtt + +These macros simply calls the +properly "\pdfsetmatrix" primitive command. + +It is known that the comosition of transformations is not commutative. It +means that the order is important. You have to read the tranformation +matrices from right to left. Example: + +\begtt +First: \pdfsave \pdfrotate{30}\pdfscale{-2}{2}\rlap{text1}\pdfrestore + % text1 is scaled two times and it is reflected about vertical axis + % and next it is rotated by 30 degrees left. +second: \pdfsave \pdfscale{-2}{2}\pdfrotate{30}\rlap{text2}\pdfrestore + % text2 is rotated by 30 degrees left then it is scaled two times + % and reflected about vertical axis. +third: \pdfsave \pdfrotate{-15.3}\pdfsetmatrix{2 0 1.5 2}\rlap{text3}% + \pdfrestore % first slanted, then rotated by 15.3 degrees right +\endtt + +\bigskip\smallskip +This gives the following result. +First: \pdfsave \pdfrotate{30}\pdfscale{-2}{2}\rlap{text1}\pdfrestore +second: \pdfsave \pdfscale{-2}{2}\pdfrotate{30}\rlap{text2}\pdfrestore +third: \pdfsave \pdfrotate{-15.3}\pdfsetmatrix{2 0 1.5 2}\rlap{text3}\pdfrestore +\bigskip\bigskip + +\sec Footnotes and marginal notes +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +The plain\TeX{}'s macro "\footnote" is not redefined. But a new macro +"\fnote{<text>}" is defined. The footnote mark is added automatically and it +is numbered on each page from one\fnote +{This behavior is changed if {\tt\char`\\runningfnotes} is used: +the footnotes are numbered from one in whole document in such case. +Alternatives are possible, see OPmac tricks or technical documentation.}. +The "<text>" is scaled by +"\typoscale[800]". The implicit visual aspect of the footnote mark is defined by +"\def\thefnote{$^{\locfnum}$)}". User can redefine it, for example: + +\begtt +\def\thefnote{\ifcase\locfnum\or + *\or**\or***\or$^{\dag}$\or + $^{\ddag}$\or$^{\dag\dag}$\fi} +\endtt + +The "\fnote" macro is fully applicable only in ``normal outer'' paragraph. +It doesn't work inside boxes (tables for example). If you are solving such +case you can use "\fnotemark<number>" inside the box (only the footnote mark is +generated). When the box is finished you can use "\fnotetext{<text>}". This +macro puts the "<text>" to the footnote. The "<number>" after "\fnotemark" +have to be "1" if only one such command is in the box. Second "\fnotemark" +inside the same box have to have the parameter "2" etc. +The same number of "\fnotetext"s have to be written +after the box as the number of "\fnotemark"s inserted inside the box. + +The marginal note can be printed by the "\mnote{<text>}" macro. The <text> +is placed to the right margin on the odd pages and it is placed to the left +margin on the even pages. This is done after second \TeX{} run because the +relevant information is stored in an external file. If you need to place the +notes only to the fixed margin write "\fixmnotes\right" or +"\fixmnotes\left". + +The <text> is formatted as a little paragraph with the maximal width +"\mnotesize" ragged left on the left margins or ragged right on the right +margins. The first line of this little paragraph is at the same height as +the invisible mark created by "\mnote" in the current paragraph. The +exceptions are possible by "\mnoteskip" register. You can implement such +exceptions to each "\mnote" manually in final printing in order to margin +notes do not overlap. The positive value of "\mnoteskip" shifts the note up +and negative value shifts it down. For example +"\mnoteskip=2\baselineskip \mnote{<text>}" shifts this (and only this) note +two lines up. + + +\sec Bib\TeX ing +%%%%%%%%%%%%%%%% + +The command "\cite[<label>]" or its variations of the type +\hbox{"\cite[<label-1>,<label-2>,<label-3>]"} +create the citations in the form [42] or [15,~19,~26]. +If "\shortcitations" is declared at the beginning of the document then continuous sequences of +numbers are re-printed like this: \hbox{[3--5,~7,~9--11]}. If +"\sortcitations" is declared then numbers generated by one "\cite" command +are sorted upward. + +If "\nonumcitations" is used then the marks instead numbers are generated +depending on the used bib\TeX{} style. For example the citations look like +[Now08] when "alpha" style is used and like [Nowak, 2008] when "apalike" +style is used. + +The "\rcite[<labels>]" creates the same list as "\cite[<labels>]" but without +the outer brackets. Example: "[\rcite[tbn], pg.~13]" creates [4,~pg.13]. + +The "\ecite[<label>]{<text>}" prints the "<text>" only, but the entry labeled +"<label>" is decided as to be cited. If "\hyperlinks" is used then "<text>" +is linked to the references list. + +You can define alternative formating of "\cite" command. Example: + +\begtt +\def\cite[#1]{(\rcite[#1])} % \cite[<label>] creates (27) +\def\cite[#1]{$^{\rcite[#1]}$} % \cite[<label>] creates^{27} +\endtt + +The numbers printed by "\cite" correspond to the same numbers generated in +the list of references. There are four possibilities to generate this +references list: + +\begitems +* Manually using "\bib[<label>]" commands. +* Using bib\TeX{} and "\usebibtex{<bib-base>}{<bib-style>}" command. +* Using pregenerated "*.bbl" file and "\usebbl/<type> <bbl-base>" command. +* By "\usebib/<type> (<style>) <bbl-base>" command which reads "*.bib" + databases directly. +\enditems + +These possibilities are documented here in detail: + +\medskip\noindent +{\bf References created manually using "\bib[<label>]" command.} + +{\def\tthook{\catcode`/=0 \catcode`+=9 } +\begtt +\bib [tbn] P. Ol/v+s/'ak. {\it\TeX{}book naruby.} 468~s. Brno: Konvoj, 1997. +\bib [tst] P. Ol/v+s/'ak. {\it Typografick/'y syst/'em \TeX.} + 269~s. Praha: CSTUG, 1995. +\endtt +} + +If you are using "\nonumcitations" then you need to declare the "<marks>" +used by "\cite" command. To do it you have to use long form of the "\bib" +command which is in the format "\bib[<label>] = {<mark>}". The spaces around +equal sign are mandatory. Example: + +{\def\tthook{\catcode`/=0 \catcode`+=9 } +\begtt +\bib [tbn] = {OlĹĄĂĄk, 2001} + P. Ol/v+s/'ak. {\it\TeX{}book naruby.} 468~s. Brno: Konvoj, 2001. +\endtt +} + +{\bf References using bib\TeX.} +The command "\usebibtex{<bib-base>}{<bst-style>}" + creates the list of cited entries and entries indicated by +"\nocite[<label>]". +After first \TeX{} run the "*.aux" file is created, so user have to run +the bib\TeX{} by the command "bibtex <document>". After second \TeX{} run +the bib\TeX's +output is read and after third \TeX{} run all references are properly +created. + +The "<bib-base>" is one or more "*.bib" database source files (separated by +spaces and without extension) and the "<bst-style>" is the style used by +bib\TeX. The common styles are "plain", "alpha", "apalike", "ieeetr", +"unsrt". + +\medskip\noindent +{\bf Using pregenerated "*.bbl" file by bib\TeX.} +You can create the temporary file ("mybase.tex", for example) +which looks like: + +\begtt +\input opmac +\genbbl{<bib-base>}{<bst-style>} +\end +\endtt +% +After first \TeX{} run the "mybase.aux" is generated. Then you can run +"bibtex mybase" which generates the ".bbl" file with all entries from the +"<bib-base>" "*.bib" file(s). Second \TeX{} run on the file "mybase.tex" generates +the printed form of the list of all bib entries with labels. This is usable +printed matter, you can place it to your notice board when you create +your document. Finally you can insert to your real document one of the +following commands: + +\begtt +\usebbl/a mybase % print all entries from mybase.bbl (a=all) +\usebbl/b mybase % print only \cited and \nocided entries + % sorted by mybase.bbl (b=bbl) +\usebbl/c mybase % print only \cited and \nocited entries + % sorted by \cite-order (c=cite) +\endtt + +Sometimes the pure \LaTeX{} command occurs (unfortunately) +in the ".bib" database or bib\TeX{} +style. User can define such commands in the "\bibtexhook" macro which is a +hook started inside the group before ".bbl" file is read. Example: + +\begtt +\def\bibtexhook{\def\emph##1{{\em##1}}\def\frac##1##2{{##1\over##2}}} +\endtt + +\noindent +{\bf Direct reading of ".bib" files} is possible after "\input opmac-bib". +This package uses the external package "librarian.tex" by Paul Isambert. +The usage is similar to previous case: + +\begtt + % print only \cited and \nocited entries +\usebib/c (<style>) <bib-base> % sorted by \cite-order (c=cite), +\usebib/s (<style>) <bib-base> % sorted by style (s=style). +\endtt + +The "<bib-base>" is one or more "*.bib" database source files (separated by +spaces and without extension) and the "<style>" is the part of the filename +"opmac-bib-<style>.tex" where the formatting of the references list is +defined. Possible styles are "simple" or "iso690". The behavior of +"opmac-bib.tex" and "opmac-bib-iso690.tex" is full documented in these files +(after "\endpinput" command). + +\medskip\noindent +{\bf Formatting of the references list} is controlled by the "\printb" macro. +It is called at the begin of each entry. The default "\printb" macro prints +the number of the entry in square brackets. If the "\nonumcitations" is set +then no numbers are printed, only all lines (but no first one) are indented. +The "\printb" macro can use the following values: "\the\bibnum" (the number +of the entry) and "\the\bibmark" (the mark of the entry used when +"\nonumcitations" is set). Examples: + +\begtt +% The numbers are without square brackets: +\def\printbib{\hangindent=\parindent \indent \llap{\the\bibnum. }} +% Printing of <marks> when \nonumcitations is set: +\def\printbib{\hangindent=\parindent \noindent [\the\bibmark]\quad} +\endtt + +Next examples can be found on the +\ulink[http://petr.olsak.net/opmac-tricks.html]{OPmac tricks WWW page}. + + +\sec Typesetting math +%%%%%%%%%%%%%%%%%%%%% + +There are two files for math typesetting prepared in \csplain: + +\begitems +* "ams-math.tex" loads the AMS math fonts visual compatible with Computer + modern. +* "tx-math.tex" loads the TX fonts visual compatible with Times. +\enditems + +OPmac reads the first file "ams-math.tex" by default. If you are using font +files from \csplain{} ("ctimes.tex", "cbookman.tex", "cs-termes.tex" etc.) +then the second math-file "tx-math.tex" is loaded. + +This section describes the features of the macros from "ams-math.tex" or +"tx-math.tex". More documentation is written in these files themselves. + +Hundreds math symbols and operators like in AMS\TeX{} are accesible. +For example "\alpha" $\alpha$, "\geq" $\geq$, "\sum" $\sum$, +"\sphericalangle" $\sphericalangle$, "\bumpeq", $\bumpeq$. See AMS\TeX{} +manual (or TX-fonts manual) for complete list of symbols. + +The following math alphabets are available: + +{\def\tthook{\catcode`\$=3 \catcode`/=0 \medmuskip=0mu}% +\begtt +\mit % mathematical variables $abc-xyz,ABC-XYZ$ +\it % text italics $/it abc-xyz,ABC-XYZ$ +\rm % text roman $/rm abc-xyz,ABC-XYZ$ +\cal % normal calligraphics $/cal ABC-XYZ$ +\script % script $/script ABC-XYZ$ +\frak % fracture $/frak abc-xyz,ABC-XYZ$ +\bbchar % double stroked letters $/bbchar ABC-XYZ$ +\bf % sans serif bold $/bf abc-xyz,ABC-XYZ$ +\bi % sans serif bold slanted $/bi abc-xyz,ABC-XYZ$ +\endtt +} + +The last two selectors "\bf" and "\bi" select the sans serif fonts regardless +current text font family. The reason is that these shapes are used for +vectors and matrices in Czech math typesetting. + +The math fonts are scaled by "\typosize" and "\typoscale" macros. +Two math fonts collections are prepared: "\normalmath" for normal weight +and "\boldmath" for bold. The first one is set by default. +There is an example for math typesetting in titles: + +\begtt +\def\title#1\par{\centerline{\typosize[17/]\bf\boldmath #1}} +\title The title with math $\int_a^b f(x) {\rm d}x$ is here +\endtt + +Variables are printed by special math italics when "ams-math.tex" is loaded +and by text italics of the current text font when "tx-math.tex" is loaded. +You can change this behavior by following commands: + +\begtt +\itvariables % variables typeset by text italics. +\mitvariables % mariables typeset by math italics. +\endtt + + +\sec Setting the margins +%%%%%%%%%%%%%%%%%%%%%%%% + +OPmac declares paper formats a4, a4l (landscape~a4), a5, a5l, b5, letter and +user can declare another own format by "\sdef": + +\begtt +\sdef{pgs:b5l}{(250,176)mm} +\sdef{pgs:letterl}{(11,8.5)in} +\endtt + +The "\margins" command declares margins of the document. This command have +the following parameters: + +\begtt +\margins/<pg> <fmt> (<left>,<right>,<top>,<bot>)<unit> + example: +\margins/1 a4 (2.5,2.5,2,2)cm +\endtt + +Parameters are: + +\begitems +* <pg> \dots\ "1" or "2" specifies one-page or two-pages design. +* <fmt> \dots\ paper format (a4, a4l, etc.). +* <left>, <right>, <top>, <bot> \dots\ gives the amount of left, right, + top and bottom margins. +* <unit> \dots\ unit used for values <left>, <right>, <top>, <bot>. +\enditems + +Each of the parameters <left>, <right>, <top>, <bot> can be empty. +If both <left> and <right> are nonempty then "\hsize" is set. Else "\hsize" +is unchanged. If both <left> and <right> are empty then typesetting area is +centered in the paper format. The analogical rule works when <top> or <bot> +parameter is empty ("\vsize" instead "\hsize" is used). Examples: + +\begtt +\margins/1 a4 (,,,)mm % \hsize, \vsize untouched, + % typesetting area centered +\margins/1 a4 (,2,,)cm % right margin set to 2cm + % \hsize, \vsize untouched, vertically centered +\endtt + +If "<pg>=1" then all pages have the same margins. If "<pg>=2" then the +declared margins are true for odd pages. The margins at the even pages are +mirrored in such case, it means that <left> is replaced by <right> and vice +versa. + +The command "\magscale[<factor>]" scales the whole typesetting area. The +fixed point of such scaling is the so called the ``Knuth's point'': 1in +below and 1in right of paper sides. Typesetting (breakpoints etc.) is +unchanged. All units are relative after such scaling. Only paper formats +dimensions stays unscaled. Example: + +\begtt +\margins/2 a5 (22,17,19,21)mm +\magscale[1414] \margins/1 a4 (,,,)mm +\endtt +% +The first line sets the "\hsize" and "\vsize" and margins for final +printing at a5 format. The setting on the second line centers the scaled +typesetting area to the true a4 paper while breaking points for paragraphs +and pages are unchanged. It may be usable for +review printing. After review is done, the second line can be commented out. + +\sec The last page +%%%%%%%%%%%%%%%%%% + +The number of the last page (it may be different from number of pages) is +stored in the "\lastpage" register after first \TeX{} run if the working "*.ref" +file is open. This file isn't open for every documents; only for those +where the forward references are printed or table of contents is created. +If the "*.ref" file isn't open for your document and you need to use the "\lastpage" +register then you have to write the command "\openref". This command opens +the "*.ref" file immediatelly. + +There is an example for footlines in the format ``current page / last +page'': + +\begtt +\footline={\hss \rm \thefontsize[10]\the\pageno/\the\lastpage \hss} +\endtt + +\sec Summary +%%%%%%%%%%%% + +\def\tthook{\adef!{\string\endtt}\adef&{\kern.25em}} +\begtt +\tit Title (terminated by a blank line) +\chap Chapter Title (terminated by a blank line) +\sec Section Title (terminated by a blank line) +\secc Subsection Title (terminanted by a blank line) + +\maketoc % table of contents generation +\ii item1,item2 % insertion the items to the index +\makeindex % the index is generated + +\label [labname] % link target location +\ref [labname] % link to the chapter, section, subsection, equation +\pgref [labname] % link to the page of the chapter, section, ... + +\caption/t % a numbered table caption +\caption/f % a numbered caption for the picture +\eqmark % a numbered equation + +\begitems % start list of the items +\enditems % end of list of the items +\begtt % start verbatim text +! % end verbatim text +\activettchar X % initialization character X for in-text verbatim +\verbinput % verbatim extract from the external file +\begmulti num % start multicolumn text (num columns) +\endmulti % end multicolumn text + +\cite [labnames] % refers to the item in the lits of references +\rcite [labnames] % similar to \cite but [] are not printed. +\sortcitations \shortcitations \nonumcitations % cite format +\bib [labname] % an item in the list of references +\usebibtex {bib-base}{bst-style} % use BibTeX for bibliography +\genbbl {bib-base}{bst-style} % prepare the bbl file generation +\usebbl/? bbl-base % use pre-generated bbl file, ? in {a,b,c} +\usebib/? (style) bib-base % direct using of .bib file, ? in {s,c} + +\typosize [font-size/baselineskip] % size setting of typesetting +\typoscale [factor-font/factor-baselineskip] % size scaling +\thefontsize [size] \thefontscale [factor] % current font size + +\inspic file.ext % insert a picture, extensions: jpg, png, pdf +\table {rule}{data} % simple macro for the tables like in LaTeX + +\fnote % footnote (local numbering on each page) +\mnote % note in the margin (left or right by page number) + +\hyperlinks {color-in}{color-out} % PDF links activate as clickable +\outlines {level} % PDF will have a table of contents in the left tab + +\magscale[factor] % resize typesetting, line/page breaking unchanged +\margins/pg format (left, right, top, bottom)unit % margins setting +\endtt + +\end diff --git a/Master/texmf-dist/doc/cstex/opmac-u.pdf b/Master/texmf-dist/doc/cstex/opmac-u.pdf Binary files differindex 31c66e6975b..df1709d7c10 100644 --- a/Master/texmf-dist/doc/cstex/opmac-u.pdf +++ b/Master/texmf-dist/doc/cstex/opmac-u.pdf diff --git a/Master/texmf-dist/doc/cstex/opmac-u.tex b/Master/texmf-dist/doc/cstex/opmac-u.tex index ec321439e99..d005632afdd 100644 --- a/Master/texmf-dist/doc/cstex/opmac-u.tex +++ b/Master/texmf-dist/doc/cstex/opmac-u.tex @@ -20,7 +20,7 @@ \tit OPmac -- rozĹĄiĹujĂcĂ makra plain\TeX{}u %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\centerline{\it Petr OlĹĄĂĄk, listopad, prosinec 2012} +\centerline{\it Petr OlĹĄĂĄk, 2012, 2013, 2014} \bigskip \centerline{\url{http://petr.olsak.net/opmac.html}} @@ -748,7 +748,11 @@ VyskytujĂ-li se v~argumentu "\url" znaky "%", "\", "#", "$", "{" a "}", je tĹeba pouĹžĂt "\%", "\\", "\#", "\$", "\{" a "\}". OstatnĂ speciĂĄlnĂ znaky "~", "_", "^", "&" lze napsat do parametru "\url" -pĹĂmo. LibovolnĂ˝ text odkazovanĂ˝ na webovou strĂĄnku lze vloĹžit pomocĂ +pĹĂmo. +DĂĄle je moĹžno do parametru "\url" napsat "\|" k oznaÄenĂ mĂsta, kde +je dovoleno zlomit ĹĂĄdek. +% +LibovolnĂ˝ text odkazovanĂ˝ na webovou strĂĄnku lze vloĹžit pomocĂ "\ulink[<URL>]{<text>}". NapĹĂklad odkaz na \ulink[http://petr.olsak.net/opmac.html]{strĂĄnky OPmac} jsou vytvoĹeny pomocĂ "\ulink[http://petr.olsak.net/opmac.html]{strĂĄnky OPmac}". @@ -1193,39 +1197,77 @@ nahoru. PĹi zĂĄpornĂŠ hodnotÄ se posune dolĹŻ. NapĹĂklad \sec BibliografickĂŠ Ăşdaje %%%%%%%%%%%%%%%%%%%%%%%%% +{\bf Odkazy.} PomocĂ "\cite[<lejblĂk>]" nebo "\cite[<lejbĂk1>,<lejblĂk2>,<lejblĂk3>]" -(atd.) vytvoĹĂme v textu odkazy na poloĹžky v seznamu literatury. V seznamu -literatury je tĹeba uvĂŠst zĂĄznamy, kterĂŠ majĂ odkazovanĂŠ lejblĂky. Tyto -zĂĄznamy dostanou v seznamu automaticky vygenerovanĂĄ ÄĂsla a sekvence "\cite" -se pak promÄnĂ na ÄĂselnĂŠ odkazy, napĹĂklad [27] nebo [18,~24,~42] (atd.). -SouvislĂŠ Ĺady ÄĂsel [1,~2,~3,~5,~6] se promÄnĂ v~intervaly [1--3,~5--6~] -jen tehdy, kdyĹž je v ĂşvodnĂ deklaraci dokumentu napsĂĄno "\shortcitations". - -Seznam literatury je moĹžnĂŠ vloĹžit do dokumentu tĹemi rĹŻznĂ˝mi +atd. vytvoĹĂme v~textu odkazy na poloĹžky v seznamu literatury. V +seznamu literatury je tĹeba uvĂŠst zĂĄznamy, kterĂŠ majĂ odkazovanĂŠ lejblĂky. +Tyto zĂĄznamy dostanou v seznamu automaticky vygenerovanĂĄ ÄĂsla a sekvence +"\cite" se pak promÄnĂ na ÄĂselnĂŠ odkazy, napĹĂklad [27] nebo [18,~24,~42] +atd. SouvislĂŠ Ĺady ÄĂsel [1,~2,~3,~5,~6] se promÄnĂ v~intervaly +[1--3,~5--6] jen tehdy, kdyĹž je v ĂşvodnĂ deklaraci dokumentu napsĂĄno +"\shortcitations". A seĹadĂ se podle velikosti pĹi "\sortcitations". + +PĹi "\nonumcitations" se odkazy nepĹevĂĄdÄjĂ na ÄĂsla. K tomu je potĹeba +pouĹžĂt navazujĂcĂ Bib\TeX{}ovĂ˝ styl (napĹ. "alpha", "apalike") nebo +rozĹĄĂĹenou formu pĹĂkazu "\bib", viz nĂĹže. Odkazy vypadajĂ pĹi stylu +"alpha" takto [Nov08] a pĹi stylu "apalike" +takto [NovĂĄk, 2008]. + +PĹĂkaz "\rcite[<lejblĂky>]" funguje jako "\cite[<lejblĂky>]", ale kolem odkazĹŻ +nejsou pĹidĂĄny zĂĄvorky. MoĹžnost vyuĹžitĂ: "[\rcite[novak08],~s.~213]" vytvoĹĂ +napĹĂklad odkaz [17,~s.~213]. ZĂĄvorky kolem musĂte napsat sami. + +PĹĂkaz "\ecite[<lejblĂk>]{<text>}" vytiskne pouhĂ˝ "<text>", kterĂ˝ se chovĂĄ +jako odkaz na literaturu. +PĹĂklad pouĹžitĂ: "z~vĂ˝sledĹŻ NovĂĄka [\ecite[novak08]{2008},~s.~213] plyne..." +z~vĂ˝sledkĹŻ NovĂĄka [2008, s. 213] plyne\dots\ PĹitom "novak08" je registrovĂĄn do +seznamu citovanĂ˝ch poloĹžek a tĹeba pĹi "\hyperlinks" bude ÄĂslo 2008 prolinkovĂĄno +s odpovĂdajĂcĂ poloĹžkou v~seznamu literatury. + +PĹĂklady redefinice "\cite" pro alternativnĂ formĂĄtovĂĄnĂ odkazĹŻ: + +\begtt +\def\cite[#1]{(\rcite[#1])} % \cite[lejblĂk] vytvoĹĂ (27) +\def\cite[#1]{$^{\rcite[#1]}$} % \cite[lejblĂk] vytvoĹĂ^{27} +\endtt + +\noindent {\bf Seznam literatury} je moĹžnĂŠ vloĹžit do dokumentu ÄtyĹmi rĹŻznĂ˝mi zpĹŻsoby: \begitems * ManuĂĄlnÄ: pomocĂ jednotlivĂ˝ch poloĹžek "\bib[<lejblĂk>]" pĹĂmo v dokumentu. * S vyuĹžitĂm Bib\TeX{}u makrem "\usebibtex{<bib-bĂĄze>}{<bst-styl>}". * VyuĹžitĂm jednou vygenerovanĂŠ databĂĄze makrem "\usebbl/<typ> <bbl-bĂĄze>". +* PĹĂmĂ˝m ÄtenĂm ".bib" databĂĄze makry \TeX{}u bez vyuĹžitĂ Bib\TeX{}u. \enditems JednotlivĂŠ zpĹŻsoby jsou nĂĹže probrĂĄny podrobnÄji. \medskip\noindent {\bf ManuĂĄlnÄ vloĹženĂ˝ seznam literatury} v dokumentu vypadĂĄ napĹĂklad takto: +\par\nobreak \begtt -\bib[tbn] P. OlĹĄĂĄk. {\it\TeX{}book naruby.} 468~s. Brno: Konvoj, 1997. -\bib[tst] P. OlĹĄĂĄk. {\it TypografickĂ˝ systĂŠm \TeX.} - 269~s. Praha: CSTUG, 1995. +\bib [tbn] Petr OlĹĄĂĄk. {\it\TeX{}book naruby.} 468~s. Brno: Konvoj, 1997. +\bib [tst] Petr OlĹĄĂĄk. {\it TypografickĂ˝ systĂŠm \TeX.} + 269~s. Praha: CSTUG, 1995. \endtt % Výťe uvedenĂĄ ukĂĄzka dĂĄ nĂĄsledujĂcĂ vĂ˝stup: \medskip -\bib[tbn] P. OlĹĄĂĄk. {\it\TeX{}book naruby.} 468~s. Brno: Konvoj, 1997. -\bib[tst] P. OlĹĄĂĄk. {\it TypografickĂ˝ systĂŠm \TeX.} +\bib[tbn] Petr OlĹĄĂĄk. {\it\TeX{}book naruby.} 468~s. Brno: Konvoj, 1997. +\bib[tst] Petr OlĹĄĂĄk. {\it TypografickĂ˝ systĂŠm \TeX.} 269~s. Praha: CSTUG, 1995. +\medskip +Je moĹžnĂŠ pouĹžĂt rozĹĄĂĹenĂ˝ zpĹŻsob zĂĄpisu +"\bib [<lejblĂk>] = {<znaÄka>} <text zĂĄznamu>". Ădaj "<znaÄka>" se +pouĹžije do odkazĹŻ pĹi zapnutĂŠm "\nonumcitations". Kolem rovnĂtka musejĂ bĂ˝t mezery. +NapĹĂklad: + +\begtt +\bib [tbn] = {OlĹĄĂĄk, 1997} + OLĹ ĂK, P. {\it\TeX{}book naruby.} 468~s. Brno: Konvoj, 1997. +\endtt \medskip\noindent {\bf VyuĹžitĂ Bib\TeX{}u.} PĹedpoklĂĄdĂĄ se, Ĺže uĹživatel disponuje souborem @@ -1248,13 +1290,8 @@ stylovĂŠho souboru bez pĹĂpony ".bst", kterĂ˝ pouĹžije Bib\TeX{} pro konverzi "<bib-bĂĄze>.bib" do vĂ˝stupu "<dokument>.bbl". Tento vĂ˝stup pak bude makrem "\usebibtex" pĹeÄten a vloĹžen do dokumentu. Typicky pouĹžĂvanĂŠ <bst-styly> jsou "plain", "alpha", "apalike", "ieeetr", "unsrt". -Styl "alpha" zpĹŻsobĂ, Ĺže se mĂsto ÄĂsel zaÄnou zjevovat v dokumentu zkratky, -a to jednak v seznamu literatury a jednak v mĂstÄ vĂ˝skytu pĹĂkazĹŻ "\cite". -V takovĂŠm pĹĂpadÄ pochopitelnÄ "\shortcitations" nefunguje a pokud byste se -o nÄj pokusili, tak makro havaruje. ExistujĂ desĂtky, moĹžnĂĄ stovky dalĹĄĂch ".bst" stylĹŻ, viz internet. - PĹi prvnĂm zpracovĂĄnĂ dokumentu \TeX{}em makro "\usebibtex" pĹipravĂ vstupnĂ pokyny pro Bib\TeX{} do souboru "<dokument>.aux" a zjistĂ, Ĺže soubor "<dokument>.bbl" zatĂm neexistuje. To dĂĄ najevo na terminĂĄlu: @@ -1338,7 +1375,6 @@ Makro OPmac navrhuje ĹeĹĄenĂ, pĹi kterĂŠm staÄĂ pouĹžĂt Bib\TeX{} pro mnoh \removelastskip \enditems - Kroky 2 aĹž 4 budete muset opakovat pouze tehdy, kdyĹž budete chtĂt pĹidat do "<mojebĂĄze>.bbl" dalĹĄĂ Ăşdaj, tj. po upgradu souboru "<bib-bĂĄze>.bib". PrudĂ-li rĹŻznĂ odbÄratelĂŠ vaĹĄĂ vÄdeckĂŠ Äinnosti poĹžadavky na rĹŻznĂŠ @@ -1346,6 +1382,45 @@ PrudĂ-li rĹŻznĂ odbÄratelĂŠ vaĹĄĂ vÄdeckĂŠ Äinnosti poĹžadavky na rĹŻznĂŠ podle rĹŻznĂ˝ch stylĹŻ rĹŻznĂŠ soubory typu "mybbl-plain.bbl", "mybbl-ieeetr.bbl". +\medskip +\noindent +{\bf PĹĂmĂŠ ÄtenĂ ".bib" databĂĄze} je moĹžnĂŠ po "\input opmac-bib.tex". +Tato pĹĂdavnĂĄ makra navĂc pouĹžĂvajĂ externĂ balĂÄek na ÄtenĂ ".bib" souborĹŻ +"librarian.tex" od Paula Isamberta. UĹžitĂ je podobnĂŠ, jako pĹi "\usebbl": + +\begtt +\usebib/c (<style>) <bib-bĂĄze> % Ĺadit podle poĹadĂ citace (c=cite), +\usebib/s (<style>) <bib-bĂĄze> % Ĺadit podle klĂÄe ve stylu (s=style). +\endtt + +Zde "<bib-bĂĄze>" je jeden nebo vĂce ".bib" souborĹŻ oddÄlenĂ˝ch ÄĂĄrkou bez +mezery a bez pĹĂpony. Prametr "<style>" udĂĄvĂĄ ÄĂĄst jmĂŠna souboru +"opmac-bib-<style>.tex", ve kterĂŠm je specifikace formĂĄtovĂĄnĂ poloĹžek. +SouÄĂĄstĂ balĂÄku je styl "simple", tedy soubor "opmac-bib-simple.tex", +kterĂ˝ si mĹŻĹže uĹživatel zkopĂrovat na jinĂ˝ nĂĄzev a modifikovat dle svĂ˝ch +pĹedstav. VĂce informacĂ je na konci souboru "opmac-bib.tex". + +\medskip +\noindent +{\bf FormĂĄtovĂĄnĂ seznamu literatury} je ĹĂzeno makrem "\printbib", +kterĂŠ je vloĹženo na zaÄĂĄtek kaĹždĂŠ poloĹžky v seznamu. +ImplicitnĂ hodnota makra tiskne ÄĂsla poloĹžek do +hranatĂ˝ch zĂĄvorek a pĹi pouĹžitĂ "\nonumcitations" pĹedsadĂ prvnĂ ĹĂĄdek +poloĹžky a nepĹidĂĄvĂĄ nic. Makro mĹŻĹže vyuĹžĂt "\the\bibnum" pro tisk +ÄĂsla nebo "\the\bibmark" pro tisk znaÄky (pĹi "\nonumcitations"). +PĹĂklady: + +\begtt +% ÄĂslovĂĄnĂ poloĹžek bez hranatĂ˝ch zĂĄvorek: +\def\printbib{\hangindent=\parindent \indent \llap{\the\bibnum. }} + +% Tisk zkratek pĹi pouĹžitĂ bibTeXovĂŠho stylu alpha a \nonumcitations: +\def\printbib{\hangindent=\parindent \noindent [\the\bibmark]\quad} +\endtt + +DalĹĄĂ pĹĂklady (tĹeba jak \TeX{} zmÄĹĂ ĹĄĂĹku nejvÄtĹĄĂho ÄĂsla a podle toho +vypoÄĂtĂĄ odsazenĂ celĂŠho seznamu) jsou uvedeny na +\url{http://petr.olsak.net/opmac-tricks.html}. \sec MatematickĂĄ sazba %%%%%%%%%%%%%%%%%%%%%% @@ -1477,12 +1552,11 @@ NenĂ-li soubor REF otevĹen, je hodnota registru "\lastpage" rovna nule. \footline={\hss \rm \thefontsize[10]\the\pageno/\the\lastpage \hss} \endtt -\vfill\break \sec ShrnutĂ %%%%%%%%%%%% -KlĂÄovĂĄ makra balĂku OPmac jsou struÄnÄ shrnuta v nĂĄsledujĂcĂm vĂ˝pisu. +%KlĂÄovĂĄ makra balĂku OPmac jsou struÄnÄ shrnuta v nĂĄsledujĂcĂm vĂ˝pisu. \def\tthook{\adef!{\string\endtt}\adef&{\kern.25em}} \begtt @@ -1497,7 +1571,6 @@ KlĂÄovĂĄ makra balĂku OPmac jsou struÄnÄ shrnuta v nĂĄsledujĂcĂm vĂ˝pisu. \label[<lejblĂk>] % deklarace pĹed cĂlem odkazu \ref[<lejblĂk>] % odkaz na kapitolu, sekci nebo podsekci -\cite[<lejblĂk>] % odkaz do seznamu literatury \pgref[<lejblĂk>] % odkaz na strĂĄnku \caption/t % ÄĂslovanĂ˝ popisek tabulky @@ -1513,11 +1586,14 @@ KlĂÄovĂĄ makra balĂku OPmac jsou struÄnÄ shrnuta v nĂĄsledujĂcĂm vĂ˝pisu. \begmulti % zaÄĂĄtek vĂcesloupcovĂŠ sazby \endmulti % konec vĂcesloupcovĂŠ sazby -\bib[<lejblĂk>] % poloĹžka v seznamu literatury -\cite[<lejblĂk>] % mĂsto, odkud se odkazuje do seznamu literatury +\cite[<lejblĂky>] % mĂsto, odkud se odkazuje do seznamu literatury +\rcite[<lejblĂky>] % jako \cite, ale bez zĂĄvorek kolem +\sortcitations \shortcitations \nonumcitations % deklarace typu odkazĹŻ +\bib[<lejblĂk>] % poloĹžka v seznamu literatury \usebibtex{<bib-bĂĄze>}{<bst-styl>} % pouĹžitĂ bibTeXu pro seznam literatury \genbbl{<bib-bĂĄze>}{<bst-styl>} % pĹedgenerovĂĄnĂ seznamu literatury \usebbl/? <bbl-bĂĄze> % pouĹžitĂ pĹedgenerovanĂŠ databĂĄze, ? je z {a,b,c} +\usebib/? (<style>) <bib-bĂĄze> % pĹĂmĂŠ ÄtenĂ .bib bez BibTeXu, ? je z {c,s} \typosize[<font-velikost>/<ĹĂĄdkovĂĄnĂ>] % nastavenĂ velikosti sazby \typoscale[<faktor-font>/<faktor-ĹĂĄdkovĂĄnĂ>] % ĹĄkĂĄlovĂĄnĂ velikosti sazby @@ -1526,7 +1602,6 @@ KlĂÄovĂĄ makra balĂku OPmac jsou struÄnÄ shrnuta v nĂĄsledujĂcĂm vĂ˝pisu. \inspic <soubor>.<pĹĂpona> % vloĹženĂ obrĂĄzku, pĹĂpony: jpg, png, pdf \table{<pravidlo>}{<data>} &% makro pro tabulku \frame{<text>} % orĂĄmovanĂ˝ text - \fnote{<text>} % poznĂĄmka pod Äarou (lokĂĄlnĂ ÄĂslovĂĄnĂ na kaĹždĂŠ strĂĄnce) \mnote{<text>} % poznĂĄmka na okraji (pravĂŠm nebo levĂŠm podle strĂĄnky) |