From 3718baf0c743e1846d48839f867ad5924e79c8a3 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 9 May 2014 21:59:33 +0000 Subject: cstex (9may14) git-svn-id: svn://tug.org/texlive/trunk@33942 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/cstex/opmac-u-en.tex | 1251 ++++++++++++++++++++++++++++ 1 file changed, 1251 insertions(+) create mode 100644 Master/texmf-dist/doc/cstex/opmac-u-en.tex (limited to 'Master/texmf-dist/doc/cstex/opmac-u-en.tex') 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[/]" 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=", 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[/]" +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[]" or can be rescaled by +"\thefontscale[]". 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 +\chap Chapter title +\sec Section title +\secc Subsection title +\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[