%PS% % Quikscript qsuserdoc.qs % To print, concatenate Qs with this file and send the resulting file to a % PostScript printer or to a PostScript interpreter such as ghostscript. % % If your printer does not support A4 paper and you wish to use US Letter % (8.5x11), uncomment the two lines below that refer to this paper size. % To uncomment the lines, remove the leading '%' on each line. QSdict begin /Eject { NumberIt{PrPagNum}if PagCnt PagLow lt {erasepage} {showpage /PagLow 0 store} ifelse PagCnt PagHi ge {stop} if NCol 1 gt {SetCol}if ToTop % 20 0 translate 0.94 0.94 scale %%%%%%%% US Letter (8.5x11) %%%%%%%% }store % 20 0 translate 0.94 0.94 scale %%%%%%%% US Letter (8.5x11) %%%%%%%% /HdrPre (%FN,Tim%%SZ,10%) store %/HdrFnt /Times-Roman findfont 10 scalefont store /PagLow 1 store % The range of pages to be printed /PagHi 99999 store /Tit1 (G. Freeman)def /Tit2 (Quikscript)def /PagStr () store /PrPagNum { IncPagNum PagCnt 1 gt { gsave WordWid SaveTempState 0 mark HdrPre UseKwds pop pop %% set header font /PagNum PagCnt TmpS cvs store %% convert page number to integer PagCnt 2 mod 0 eq {LftNumPos PagNum show ( ) show PagStr show () Tit2 PagNumPos Tit2 show} {PagNum PagStr PagNumPos PagStr show PagNum show LftNumPos Tit2 show} ifelse gsave newpath LftMrg 36 moveto RgtBnd 36 lineto LftMrg 780 moveto RgtBnd 780 lineto 1.5 setlinewidth stroke grestore LftMrg 26 moveto Tit1 show RestoreStates pop pop RestoreTempState /WordWid exch store grestore} if } store %% - LftNumPos - Move to position for left page number. /LftNumPos { LftMrg 790 moveto }store %% str2 str1 PagNumPos - Move to position for right page number. /PagNumPos {RgtBnd exch stringwidth pop sub exch stringwidth pop sub 790 moveto}store end /reencsmalldict 12 dict def /ReEncodeSmall {reencsmalldict begin /newcodesandnames exch def /newfontname exch def /basefontname exch def /basefontdict basefontname findfont def /newfont basefontdict maxlength dict def basefontdict { exch dup /FID ne {dup /Encoding eq { exch dup length array copy newfont 3 1 roll put } { exch newfont 3 1 roll put } ifelse } { pop pop } ifelse } forall newfont /FontName newfontname put newcodesandnames aload pop newcodesandnames length 2 idiv { newfont /Encoding get 3 1 roll put } repeat newfontname newfont definefont pop end } def /pdfvec [ 24 /breve 25 /caron 26 /circumflex % \030 \031 \032 27 /dotaccent 28 /hungarumlaut 29 /ogonek % \033 \034 \035 30 /ring 31 /tilde % \036 \037 128 /bullet 129 /dagger 130 /daggerdbl % \200 \201 \202 131 /ellipsis 132 /emdash 133 /endash % \203 \204 \205 134 /florin 135 /fraction 136 /guilsinglleft % \206 \207 \210 137 /guilsinglright 138 /minus 139 /perthousand % \211 \212 \213 140 /quotedblbase 141 /quotedblleft 142 /quotedblright % \214 \215 \216 143 /quoteleft 144 /quoteright 145 /quotesinglbase % \217 \220 \221 146 /trademark 147 /fi 148 /fl % \222 \223 \224 149 /Lslash 150 /OE 151 /Scaron % \225 \226 \227 152 /Ydieresis 153 /Zcaron 154 /dotlessi % \230 \231 \232 155 /lslash 156 /oe 157 /scaron % \233 \234 \235 158 /zcaron % \236 161 /exclamdown 162 /cent 163 /sterling % \241 \242 \243 164 /currency 165 /yen 166 /brokenbar % \244 \245 \246 167 /section 168 /dieresis 169 /copyright % \247 \250 \251 170 /ordfeminine 171 /guillemotleft 172 /logicalnot % \252 \253 \254 174 /registered 175 /macron % \256 \257 176 /degree 177 /plusminus 178 /twosuperior % \260 \261 \262 179 /threesuperior 180 /acute 181 /mu % \263 \264 \265 182 /paragraph 183 /periodcentered 184 /cedilla % \266 \267 \270 185 /onesuperior 186 /ordmasculine 187 /guillemotright % \271 \272 \273 188 /onequarter 189 /onehalf 190 /threequarters % \274 \275 \276 191 /questiondown % \277 192 /Agrave 193 /Aacute 194 /Acircumflex % \300 \301 \302 195 /Atilde 196 /Adieresis 197 /Aring % \303 \304 \305 198 /AE 199 /Ccedilla 200 /Egrave % \306 \307 \310 201 /Eacute 202 /Ecircumflex 203 /Edieresis % \311 \312 \313 204 /Igrave 205 /Iacute 206 /Icircumflex % \314 \315 \316 207 /Idieresis 208 /Eth 209 /Ntilde % \317 \320 \321 210 /Ograve 211 /Oacute 212 /Ocircumflex % \322 \323 \324 213 /Otilde 214 /Odieresis 215 /multiply % \325 \326 \327 216 /Oslash 217 /Ugrave 218 /Uacute % \330 \331 \332 219 /Ucircumflex 220 /Udieresis 221 /Yacute % \333 \334 \335 222 /Thorn 223 /germandbls 224 /agrave % \336 \337 \340 225 /aacute 226 /acircumflex 227 /atilde % \341 \342 \343 228 /adieresis 229 /aring 230 /ae % \344 \345 \346 231 /ccedilla 232 /egrave 233 /eacute % \347 \350 \351 234 /ecircumflex 235 /edieresis 236 /igrave % \352 \353 \354 237 /iacute 238 /icircumflex 239 /idieresis % \355 \356 \357 240 /eth 241 /ntilde 242 /ograve % \360 \361 \362 243 /oacute 244 /ocircumflex 245 /otilde % \363 \364 \365 246 /odieresis 247 /divide 248 /oslash % \366 \367 \370 249 /ugrave 250 /uacute 251 /ucircumflex % \371 \372 \373 252 /udieresis 253 /yacute 254 /thorn % \374 \375 \376 255 /ydieresis % \377 ] def /europevec [ 128 /bullet 129 /emdash 130 /endash 144 /dotlessi 145 /grave 146 /acute 147 /circumflex 148 /tilde 149 /macron 150 /breve 151 /dotaccent 152 /dieresis 154 /ring 155 /cedilla 129 /emdash 157 /hungarumlaut 158 /ogonek 159 /caron 160 /space 192 /Agrave 193 /Aacute 194 /Acircumflex 195 /Atilde 196 /Adieresis 197 /Aring 198 /AE 199 /Ccedilla 200 /Egrave 201 /Eacute 202 /Ecircumflex 203 /Edieresis 204 /Igrave 205 /Iacute 206 /Icircumflex 207 /Idieresis 209 /Ntilde 210 /Ograve 211 /Oacute 212 /Ocircumflex 213 /Otilde 214 /Odieresis 216 /Oslash 217 /Ugrave 218 /Uacute 219 /Ucircumflex 220 /Udieresis 221 /Yacute 223 /germandbls 224 /agrave 225 /aacute 226 /acircumflex 227 /atilde 228 /adieresis 229 /aring 230 /ae 231 /ccedilla 232 /egrave 233 /eacute 234 /ecircumflex 235 /edieresis 236 /igrave 237 /iacute 238 /icircumflex 239 /idieresis 241 /ntilde 242 /ograve 243 /oacute 244 /ocircumflex 245 /otilde 246 /odieresis 248 /oslash 249 /ugrave 250 /uacute 251 /ucircumflex 252 /udieresis 253 /yacute 255 /ydieresis ] def /FontVec [ /Times-Roman /Times-Roman-Europe /Times-Italic /Times-Italic-Europe /Times-Bold /Times-Bold-Europe /Times-BoldItalic /Times-BoldItalic-Europe /Helvetica /Helvetica-Europe /Helvetica-Oblique /Helvetica-Oblique-Europe /Helvetica-Bold /Helvetica-Bold-Europe /Helvetica-BoldOblique /Helvetica-BoldOblique-Europe /Courier /Courier-Europe /Courier-Oblique /Courier-Oblique-Europe /Courier-Bold /Courier-Bold-Europe /Courier-BoldOblique /Courier-BoldOblique-Europe /Palatino-Roman /Palatino-Roman-Europe /Palatino-Italic /Palatino-Italic-Europe /Palatino-Bold /Palatino-Bold-Europe /Palatino-BoldItalic /Palatino-BoldItalic-Europe /NewCenturySchlbk-Roman /NewCenturySchlbk-Roman-Europe /NewCenturySchlbk-Italic /NewCenturySchlbk-Italic-Europe /NewCenturySchlbk-Bold /NewCenturySchlbk-Bold-Europe /NewCenturySchlbk-BoldItalic /NewCenturySchlbk-BoldItalic-Europe /Bookman-Light /Bookman-Light-Europe /Bookman-LightItalic /Bookman-LightItalic-Europe /Bookman-Demi /Bookman-Demi-Europe /Bookman-DemiItalic /Bookman-DemiItalic-Europe /AvantGarde-Book /AvantGarde-Book-Europe /AvantGarde-BookOblique /AvantGarde-BookOblique-Europe /AvantGarde-Demi /AvantGarde-Demi-Europe /AvantGarde-DemiOblique /AvantGarde-DemiOblique-Europe /Helvetica-Narrow /Helvetica-Narrow-Europe /Helvetica-Narrow-Oblique /Helvetica-Narrow-Oblique-Europe /Helvetica-Narrow-Bold /Helvetica-Narrow-Bold-Europe /Helvetica-Narrow-BoldOblique /Helvetica-Narrow-BoldOblique-Europe ] def QSdict begin userdict begin 0 1 FontVec length 2 idiv 1 sub { 2 mul dup FontVec exch get dup FontDirectory exch known not {pop pop exit}if FontVec 3 -1 roll 1 add get 1 index 1 index pdfvec ReEncodeSmall exch /I 0 def {Font I get 1 index eq { pop Font I 3 -1 roll put exit} { /I I 1 add def} ifelse } loop } for end end PE %PM,25,25,30,20% %PN% %VT,70%%T,43% %PS% 30 10 100 {/Palatino-Bold findfont exch scalefont setfont gsave (Qs)dup stringwidth pop 0.5 mul 0 rmoveto true charpath gsave 1 setgray fill grestore stroke grestore}for (Qs) dup stringwidth pop 0.5 mul 0 rmoveto show PE %VT,131%%NF%%BD%%SZ,20%%CL%Guide to Quikscript %SZ% %CL%T. Graham Freeman%LT% %L%%CL%October 1998 %FI%%L% %CL%Technical Report CS01/98 %L,1%%CL%School of Computer Science %L%%CL%Australian Defence Force Academy %P%%CL%g-freeman@adfa.edu.au %VT,220%%CL%%SZ,9% This document supersedes and expands on Technical Reports CS91/5 and CS05/94. %L%%CL%Most recent revision January 2007.%SZ% %NP% %TB,20%%VM,50% Guide to Quikscript %P% Copyright %C,169% 2007 by Graham Freeman %L%%P% In past releases, Quikscript and this Guide were marked as not to be used for commercial purposes without the written consent of the author. With the October 2005 release of Quikscript, this is relaxed so that now both Quikscript and this document may be freely used or transmitted provided that this authorship and copyright notice is retained unmodified. The author accepts no legal liability for any damage or loss caused by the use of Quikscript or any software or documentation related to it. %P% Quikscript has been developed progressively since 1985, when it was used prior to the widespread availability of word-processing software to format documents and produce overhead transparencies, relying only on the existence of PostScript printers to interpret the embedded layout marks that determine the appearance of the final pages. %TB,0% %NP% %\%%SZ,14%%BD%%CL%Contents%NF% %\%%TB,20%%SZ%%LT%%T,140%%W% %\%Lines, Paragraphs %DF,?%%RL% 5 %\%Bold, Italic %DF,?%%RL% 6 %\%Horizontal tab %DF,?%%RL% 7 %\%Numbered Points %DF,?%%RL% 9 %\%Remembering position %DF,?%%RL% 10 %\%Not Filling Lines (new-line taken seriously) %DF,?%%RL% 11 %\%Headings, Font Size, Centring %DF,?%%RL% 12 %\%Changing font %DF,?%%RL% 13 %\%Paragraph styles %DF,?%%RL% 14 %\%Vertical Tab %DF,?%%RL% 16 %\%Headings at Page Bottom %DF,?%%RL% 17 %\%Multi-column layout %DF,?%%RL% 17 %\%Page margins %DF,?%%RL% 18 %\%Column width %DF,?%%RL% 18 %\%Special character %DF,?%%RL% 18 %\%Non-breaking space %DF,?%%RL% 19 %\%Page numbering %DF,?%%RL% 19 %\%Superscripts, Subscripts, Mathematics %DF,?%%RL% 19 %\%Full Justification, Centred, Right Justification %DF,?%%RL% 20 %\%Dot Fill %DF,?%%RL% 22 %\%Table %DF,?%%RL% 22 %\%Table of Contents %DF,?%%RL% 26 %\%Index %DF,?%%RL% 28 %\%Embedded PostScript %DF,?%%RL% 30 %\%%_,6%Double Spacing %DF,?%%RL% 30 %\%%_,6%Special page annotation and numbering %DF,?%%RL% 30 %\%%_,6%Landscape Orientation %DF,?%%RL% 32 %\%%_,6%Layout marker character %DF,?%%RL% 32 %\%%_,6%Graphic Page Border %DF,?%%RL% 32 %\%%_,6%European/ISO Characters %DF,?%%RL% 33 %\%%_,6%Outline Font %DF,?%%RL% 34 %\%%_,6%Small Capitals Font %DF,?%%RL% 34 %\%%_,6%Embedded Graphics %DF,?%%RL% 36 %\%%_,6%External Illustration %DF,?%%RL% 36 %\%%_,6%Embedding Quikscript %DF,?%%RL% 38 %\%Appendix A: Instructions Summary %DF,?%%RL% 40 %\%Appendix B: Quikscript Files %DF,?%%RL% 50 %\%%_,6%catex %DF,?%%RL% 53 %\%%_,6%catm %DF,?%%RL% 55 %\%%_,6%macros.qs %DF,?%%RL% 61 %\%%_,6%QstoHTML %DF,?%%RL% 63 %\%%_,6%epstopnm %DF,?%%RL% 66 %\%%_,6%epstogif %DF,?%%RL% 66 %\%%_,6%sortIndex %DF,?%%RL% 67 %\%Appendix C: Other useful software %DF,?%%RL% 69 %\%%_,6%ghostscript %DF,?%%RL% 69 %\%%_,6%distillery %DF,?%%RL% 70 %\%Appendix D: Special Characters %DF,?%%RL% 71 %\%%FI%%TB,0%%NP% %PN,5% %P,,,,L2%%L%%BD%%SZ,14% %CL%Introduction %SZ%%P%%LT% Traditionally, the choice when creating a document has been to use a word processor on a personal computer, or to use a typesetting package on a more powerful machine. Quikscript is a typesetting package that does not run on a mainframe computer, but rather within the printer itself. The advantage of this is portability. Any computer can be used for document preparation, provided that a PostScript printer is available. %P% The second advantage that Quikscript provides is precision of control over output. Because it is written in PostScript, it is interpreted at run-time within the printer. It is possible to create documents that modify the Quikscript program during execution. It is very easy to include other PostScript programs or fragments with Quikscript. It is possible to use special PostScript fonts, such as hand-generated ones. Graphics generated from a variety of sources can be easily included, as can text output from computer programs. %P% Document preparation consists of typing the document into an editor or word processor on your computer. Then layout instructions are added to the document. Finally the Quikscript program is sent to the PostScript printer together with the document file. Quikscript executes in the printer, reading your document, and acting on any layout instructions. It breaks the text into words, and fits them into lines of output across the page. If the computer has a PostScript previewer such as %IT%ghostscript%RO% or %IT%gsview%RO%, the process of creating a document can be assisted by running the previewer on Quikscript and your document. This can more quickly display errors in layout instructions. %IT%ghostscript%RO% also enables non-PostScript printers to be used to print Quikscript documents. %P% This introductory guide is designed to show how to use the basic features of Quikscript with simple examples. It proceeds to show more sophisticated layouts and how they might be achieved. Finally it covers examples of how PostScript programs can be embedded in your document to achieve special effects. This is a major strength of Quikscript. The commands of Quikscript are formally described in Appendix A. %VM,80%%VM,-80%%BD%%SZ,14%%P% %CL%Commands for Simple Layout %SZ%%LT%%P%%TB,45% %W%%CW,40%%TB,0%%BD% Paragraphs, lines %LT%%VT,?%%CW,160%%TB,45% %SH%Lines, Paragraphs %EH% %SC%Lines, Paragraphs%EC% Under normal use, Quikscript takes input lines of text, breaks them up into words, and tries to fill output lines with the words. To control this process, certain layout instructions can be used with the text. The instructions are separated from the text by being enclosed by percent signs, eg. %%P%% indicates a new paragraph; %%L%% indicates a new line; %%NP%% forces a new page. %SI%Paragraph%EI%%SI%New line%EI% %SI%New page%EI%%SI%%%NP%%%EI%%SI%%%L%EI% %P% For example, if we want to set text in this way: %L,.5%%TB,55% %SZ,10% PostScript is a programming language in which numbers or parameters precede the operator that acts on them. Thus to add two numbers, 1.3 and 5.5, the instruction is%L% 1.3 5.5 add%L% The numbers are placed on a stack, and the "add" operator acts on and removes the numbers from the stack, returning the result there. %P% It is necessary sometimes to place items on the stack well before an operator or procedure acts on them. It can then be most unclear to the reader just what an operator is doing. This causes many PostScript programs to be hard to read, and makes debugging the program difficult. %P% As a general comment, 90%% of programmers have not worked with a language like PostScript before. %SZ%%TB,45%%L,.5% we could type it thus:%L,.5%%TB,55% %FN,Cou%%SZ%%NF%PostScript is a programming language in which numbers or parameters precede the operator that acts on them. Thus to add two numbers, 1.3 and 5.5, the instruction is%%L%% 1.3 5.5 add%%L%% The numbers are placed on a stack, and the "add" operator acts on and removes the numbers from the stack, returning the result there. %%P%% It is necessary sometimes to place items on the stack well before an operator or procedure acts on them. It can then be most unclear to the reader just what an operator is doing. This causes many PostScript programs to be hard to read, and makes debugging the program difficult. %%P%%As a general comment, 90%%%% of programmers have not worked with a language like PostScript before.%FI% %TB,45%%FN%%SZ% %P%%SI% % in text %EI%%SI%%%%EI% Care is required if %% is needed in the text, as it is interpreted by Quikscript as the start of a layout instruction. To include a %% within text, it should be doubled: %%%%, as in the example above. In this way, Quikscript can see that the %% was really meant for output. If the text following a single %% is clearly not a layout instruction, it will be output as the character unchanged by Quikscript. %P% The text typed needs to be broken into lines; it cannot be a stream of unbroken text as most word processors expect. Quikscript reads text in chunks up to the Return keystroke, and does not have the capacity to read chunks beyond 1024 characters in length. %P% %VM,50%%VM,-50%%W%%CW,40%%TB,0%%BD% Bold and Italic %LT%%VT,?%%CW,160%%TB,45% %SH%Bold, Italic %EH% %SC%Bold, Italic%EC% PostScript provides a number of fonts, which mostly have a choice of styles. %IT%Italic%RO%, or slanted, is selected in Quikscript by %%IT%%, %BD%bold%LT% by %%BD%%, and %BD%%IT%bold italic%LT%%RO% by%%BD%%%%IT%%. Care is needed to remember to turn off the style selected. The opposite of italic is Roman, %%RO%%, and the opposite of bold is light %%LT%%. A style remains selected until turned off with the correct instruction. %SI%Bold%EI%%SI%Italic%EI%%SI%%%BD%%%EI%%SI%%%IT%%%EI%%SI%Italic deselecting%EI% %SI%Bold deselecting%EI%%SI%%%LT%%%EI%%SI%%%RO%%%EI% %P% For example, this typed text:%L,.5%%TB,55% %FN,Cou%%SZ,10%%NF%%%BD%%HMAS %%IT%%Voyager%%RO%% Disaster%%LT%% %%P%% The naval exercise was proceeding well on the day of the accident. The aircraft carrier HMAS %%IT%%Sydney%%RO%% was travelling at cruising speed.%FI% %TB,45%%FN%%SZ%%L,.5%will be output as%L,.5%%TB,55% %SZ%%BD%HMAS %IT%Voyager%RO% Disaster%LT% %P% The naval exercise was proceeding well on the day of the accident. The aircraft carrier HMAS %IT%Sydney%RO% was travelling at cruising speed. %SZ%%TB,45% %L%%P% %VM,30%%VM,-30%%W%%CW,40%%TB,0%%BD% Tabulation, or horizontal text placement %LT%%VT,?%%CW,160%%TB,45% %SH%Horizontal tab. %EH% %SC%%SI%Horizontal tab%EI%%EC% If text is to be placed at a particular point in the current line, then the tabulation facility assists. In the simplest form, %%T,%IT%number%RO%%% will move to a new position on the page, %IT%number%RO% of millimeters from the normal left-hand margin on the current line. %SI%Tabulation%EI%%SI%%%T,%EI% %P% For example, this typed text:%L,.5%%TB,55% %FN,Cou%%SZ,10%%NF%PostScript is a programming language in which numbers or parameters precede the operator that acts on them. Thus to add two numbers, 1.3 and 5.5, the instruction is%%L%% %%T,10%%1.3 5.5 add%%L%% The numbers are placed on a stack, and the "add" operator acts on and removes the numbers on the stack, returning the result there. %FI% %TB,45%%FN%%SZ%%L,.5%will be output as%L,.5%%TB,55% %SZ% PostScript is a programming language in which numbers or parameters the operator that acts on them. Thus to add two numbers, 1.3 and 5.5, the instruction is%L% %T,65%1.3 5.5 add%L% The numbers are placed on a stack, and the "add" operator acts on and removes the numbers on the stack, returning the result there. %SZ%%TB,45% %P% In interpreting the %%T,10%%, Quikscript will move to the position requested, regardless of what text has been placed on the line already. This instruction is useful for setting up simple tables; care is needed that the positions chosen allow enough width for the text content. %P% Leading blanks on a line are usually ignored, so in this example, the fifth input line has its leading blanks removed before the text on the line is added to the output. In all other places, blanks in your typed text are taken seriously. %P% If several lines of text are to share the same left alignment, a different instruction %%TB,%IT%number%RO%%% is used. Again %IT%number%RO% is the number of millimeters from the normal left-hand margin. In effect, this command sets a new left-hand margin for the following input text. %SI%Tabulation of a block%EI%%SI%%%TB,%EI%%SI%Block indentation%EI% %SI%Indentation of block%EI% %P% For example, this typed text:%L,.5%%TB,55% %FN,Cou%%SZ,10%%NF%The following instructions should be followed in order to run Quikscript: %%TB,5%%%%L%% 1. Create your document as a simple text file.%%L%% 2. "New-line"/"Return" keystrokes will be ignored.%%L%% 3. Add layout instructions%%L%% 4. Send Quikscript and your document to a PostScript printer.%%L%% %%TB,0%%Quikscript will process your document within the printer, interpreting any layout instructions.%FI% %TB,45%%FN%%SZ%%L,.5%will be output as%L,.5%%TB,55% %SZ% The following instructions should be followed in order to run Quikscript: %TB,60%%L% 1. Create your document as a simple text file.%L% 2. "New-line"/"Return" keystrokes will be ignored.%L% 3. Add layout instructions%L% 4. Send Quikscript and your document to a PostScript printer.%L% %TB,55%Quikscript will process your document within the printer, interpreting any layout instructions. %SZ%%TB,45% %P% It is important to remember to reset the left margin to its original position at the end of the indented text, the %%TB,0%% in this example. Another way of resetting the left margin is with the instruction %%TB%%, which means revert to the previous left margin setting. It is possible with this instruction to toggle between two states. %SI%Tabulation of block, toggling%EI% %P% %%TB sets the current left margin, and moves to that point on the current line. It is normally necessary to move to a new line if previous text is not to be overwritten, so a new line or new paragraph instruction will frequently accompany a %%TB. %L%%P% %VM,80%%VM,-80%%W%%CW,40%%TB,0%%BD% Numbered points %L,1%Fractional line spacings %LT%%VT,?%%CW,160%%TB,45% %SH%Numbered Points %EH% %SC%Numbered Points%EC% The above example shows how short points can be presented effectively. However, if the points are longer, a combination of %%TB for setting the new left margin for line continuations, together with %%T for positioning particular details is useful. The gap between points can be made larger with an instruction %%L,%IT%number%RO%%%; %IT%number%RO% is the number of line heights to be moved down in addition to the normal movement. This can be fractional if necessary. %SI%Numbered points%EI%%SI%Paragraph style, numbered%EI% %P% For example, to achieve this text layout: %L,.5%%TB,55% %SZ% The layout instructions are implemented using a table of three-element arrays.%TB,65% %L,.5%%T,55%1. %T,65%The first element contains the layout command code, with multi-character codes preceding single character codes. This order prevents confusion between single character codes and multi-character codes commencing with the same letter. %L,.5%%T,55%2. %T,65% The second element is a true/false value, indicating whether the layout code is "word-terminating" or not. This function will be explained below. %L,.5%%T,55%3. %T,65% The third element is a PostScript procedure to be executed for that layout code. %SZ%%TB,45%%L,.5% we could type the text as: %L,.5%%TB,55% %FN,Cou%%SZ%%NF%The layout instructions are implemented using a table of three-element arrays.%%TB,10%% %%L,.5%%%%T,0%%1. %%T,10%% The first element contains the layout command code, with multi-character codes preceding single character codes. This order prevents confusion between single character codes and multi-character codes commencing with the same letter. %%L,.5%%%%T,0%%2. %%T,10%% The second element is a true/false value, indicating whether the layout code is "word-terminating" or not. This function will be explained below. %%L,.5%%%%T,0%%3. %%T,10%% The third element is a PostScript procedure to be executed for that layout code. %%TB,0%%%%P%% %FI%%TB,45%%FN%%SZ% %P% The %%TB,10%% sets the left-hand margin, which will be obeyed when words must be placed on the next line. The %%T,0%% forces the point numbers to be placed at the original left margin, and the %%T,10%% causes text to begin at the same position as any line continuations. The %%L,.5%% causes a larger space between points, an extra half line height. %P% A similar layout can be achieved a little more easily with a special form of the new-paragraph instruction, as discussed in the "Paragraph layout" section below. %L%%P% %VM,80%%VM,-80%%W%%CW,40%%TB,0%%BD% Parameterized positioning %LT%%VT,?%%CW,160%%TB,45% %SH%Remembering positions %EH% %SI%%SC%Remembering position%EC%%EI%%SI%Position remembering%EI%%SI%?%EI% In the above example, the position "10" MM from the left margin recurs in many lines. It is possible to record this position once and reuse it many times without referring to the measurement again. The advantage of this is, if we later decide to alter the layout and change the indentation, only one number will need to be changed, rather than several. There is a command %L%%T,55%%%W%% %L%which will record the current position ("Where"). That position can be referred to in %%T or %%TB instructions by %L%%T,55%%%T,?%% or %%TB,?%% %L%If several positions are to be recorded, they are referred to by index: %%W,1%% stores the current position with index "1", and is referred to as %%T,?1%%. Up to fifty positions can be stored this way. %P% The above example can be expressed in this manner, giving identical output: %L,.5%%TB,55% %FN,Cou%%SZ,10%%NF%The layout instructions are implemented using a table of three-element arrays.%%TB,10%%%%W%% %%L,.5%%%%T,0%%1. %%T,?%% The first element contains the layout command code, with multi-character codes preceding single character codes. This order prevents confusion between single character codes and multi-character codes commencing with the same letter. %%L,.5%%%%T,0%%2. %%T,?%% The second element is a true/false value, indicating whether the layout code is "word-terminating" or not. This function will be explained below. %%L,.5%%%%T,0%%3. %%T,?%% The third element is a PostScript procedure to be executed for that layout code. %%TB,0%%%%P%% %FI% %TB,45%%FN%%SZ%%P% Then, if we decide to change the body indentation of the text to 15 MM, only the one number will need to be changed. %L%%P% %VM,80%%VM,-80%%W%%CW,40%%TB,0%%BD% New-line/Return taken seriously (eg Poetry) %LT%%VT,?%%CW,160%%TB,45% %SH%Not Filling Lines %EH% %SI%Poetry%EI%%SI%Not filling lines%EI%%SI%Preformatted text%EI% %SI%Code listing%EI%%SI%Line breaks respected%EI%%SI%%%NF%EI%%SI%%%FI%%%EI% %SI%Filling lines%EI%%SC%Not Filling Lines (new-line taken seriously)%EC% There are many situations where we do not want the input text to be split up into words for packing into the output lines. Poetry, songs, program examples, and addresses are the most common. For this type of text, there is an instruction %L%%T,55%%%NF%% %L%("No Fill") to take each line of input text and put it out on a separate line. It will still check to see whether the whole line will fit, and go to a new line if there is too much text. At the end of such text, we usually want to revert to the normal way of filling output lines with words. The instruction %L%%T,55%%%FI%% %L%is used for this. %P% For example, this typed text: %L,.5%%TB,55% %FN,Cou%%SZ,10%%NF%%%NF%% Joy to the world! The Lord is come; let earth receive her king; let every heart prepare him room, and heaven and nature sing, and heaven and nature sing, and heaven, and heaven and nature sing. %%FI%% %TB,45%%FI%%FN%%SZ%%L,.5% will be output as%L,.5%%TB,55% %SZ%%NF%Joy to the world! The Lord is come; let earth receive her king; let every heart prepare him room, and heaven and nature sing, and heaven and nature sing, and heaven, and heaven and nature sing.%FI% %SZ%%L,.8%%TB,45% The last two lines had leading spaces in the original, which were retained in the output. In normal text processing mode, leading spaces on every input line are discarded, in contrast to the behaviour here in %%NF%% mode. The width of the space in the output was narrower than the original. This is because a space in most printing fonts is quite narrow, while most text preparation systems show a space the same width as any other character. %P% If we were including computer instructions or program listings in our document, we would probably choose to use a Courier (fixed-width) font, which shows better how the text characters line up. Font selection is explained below. Tab characters are generally ignored, so programs containing Tabs should be suitably filtered first. %P% If any of the input lines were too long to fit on a single output line, they would have been split at an inter-word gap, and continued from the beginning of the next line. It is frequently more desirable to have such continuations indented from the normal margin. This can be requested with an instruction %L%%T,55%%%NF,%IT%number%RO%%% %L%where %IT%number%RO% is the number of millimeters of indentation desired on continuation lines. %P% A converse problem arises if we need to split the input line to prevent it being too long, possibly because of a large number of layout instructions. In other words, we want two input lines to be set on the one output line, within the context of all other input lines being placed on separate output lines. There is an instruction %L%%T,55%%%\%% %L%that means: ignore anything that follows on this input line, but continue the current output line with the next input line. %SI%Comments within document%EI%%SI%Ignored text%EI%%SI%%%\%%%EI% %L%%P% %VM,80%%VM,-80%%W%%CW,40%%TB,0%%BD% Headings %L%Font Size %L%Centring %LT%%VT,?%%CW,160%%TB,45% %SH%Headings and Font Size %EH% %SI%Headings%EI%%SI%Font size%EI%%SI%Centred line%EI%%SI%%%SZ,%EI% %SI%%%CL%%%EI%%SI%Size of font%EI%%SC%Headings, Font Size, Centring%EC% When headings are needed, and in other situations, it is desirable to alter the size of the text. Size is expressed in "Printer's Points", of which there are 72 per inch. The default size is 12 pp, but any size, including fractional can be set. The instruction is %L%%T,55%%%SZ,%IT%number%RO%%% %L%Headings are frequently wanted centred upon the page. An instruction %L%%T,55%%%CL%% %L%takes the text following on the line and centres it between the current left and right text margins. Such a line would normally be followed by a %%L%% or similar instruction. Otherwise, following text would be set on the same line, following the centred text! %P% For example: %L,.5%%TB,55% %FN,Cou%%SZ,10%%NF%%%SZ,15%%%%BD%%%%CL%%Centred large heading%%SZ,12%% %%LT%% %FI% %TB,45%%FN%%SZ%%L,.5%will be output as%L,.5%%TB,45% %SZ,15%%BD%%CL%Centred large heading%LT% %SZ%%TB,45% %P% It is possible to omit the number from a %%SZ%% instruction. %L,.5%%TB,55% %FN,Cou%%SZ,10%%NF%%%SZ,15%%%%BD%%%%CL%%Centred large heading%%SZ%% %%LT%% %FI% %TB%%FN%%SZ%%L,.5% This is taken to mean, use the previous size. A short history of font-size changes is maintained, allowing several size-undo operations to be performed in this way. If only one change is recorded, then this becomes a toggle between the two states in the history. %SI%Font size undo%EI% %P% The number given as font size is different from line height, the distance moved from one line to the next. This height is 1.17 times the font size by default (12 pp size gives 14 pp per line). %SI%Inter-line spacing%EI%%SI%Leading%EI%%SI%%%SN%EI% %P% There is another instruction (%%SN) for altering font size. %L%%T,55%%%SN,%IT%number%RO%%% %L%differs from %%SZ,%IT%number%RO%%% in that it alters the height of text, but not the line spacing. %SI%%%SN,%%%EI% %P% This is useful if text of a different height is to be mixed with other text %IT%within a paragraph%RO%. This happens fairly frequently in computing documentation, when including examples that are set in a Courier font within a paragraph of text in a more usual font, such as Times. The Courier text would appear very large and ungainly compared with the Times text, unless is was reduced in size. However, we would not want to alter the inter-line spacing just for a small piece of embedded text in another font. If such text occurs at the end of a line, it would give uneven line spacing if %%SZ,%IT%number%RO%%% were used. %L%%P% %VM,80%%VM,-80%%W%%CW,40%%TB,0%%BD% Font Selection %LT%%VT,?%%CW,160%%TB,45% %SH%Selecting Font %EH% PostScript printers provide a good range of fonts. In Quikscript, font is selected by name of a font family, with an instruction %%FN,%IT%name%RO%%%. %IT%name%RO% can be one of the following:%NF%%L,-.5% %FN,Cou%Tim%FN% (Times) %T,95%%FN,Cou%Hel%FN% (Helvetica) %FN,Cou%Cou%FN% (Courier) %T,95%%FN,Cou%Sym%FN% (Symbol)%L,-.5% %FN,Cou%Pal%FN% (Palatino) %T,95%%FN,Cou%NewC%FN% (New Century Schoolbook) %FN,Cou%Book%FN% (Bookman) %T,95%%FN,Cou%Ava%FN% (Avant Garde) %FN,Cou%Cha%FN% (Zapf Chancery) %T,95%%FN,Cou%HelN%FN% (Helvetica Narrow) %FN,Cou%Din%FN% (Zapf Dingbats) %T,95%%FN,Cou%Uft%FN% User-defined %FI%%L,-.5% %SI%Font name%EI%%SI%%%FN%%%EI%%SI%%SC%Changing font%EC%%EI% The first four are guaranteed to be present in any PostScript machine. The user-defined font can be set up for a special purpose font, as is illustrated in some of the examples of embedded PostScript below. %P% Example of usage: %L,.5%%TB,55% %FN,Cou%%SZ,10%%NF%%%FN,Hel%%The quick brown fox died. Long live the lazy dog.%%FN%% %FI% %TB,45%%FN%%SZ%%L,.5%will be output using Helvetica font as %L,.5%%TB,55% %SZ% %FN,Hel%The quick brown fox died. Long live the lazy dog.%FN% %SZ%%TB,45% %P%A point to note in this example is the use of %%FN%% without a font family name. If the font family name is omitted, the font that was in use prior to the most recent change will be reverted to. This is useful if fonts need to be switched frequently, as when a fixed-width font such as Courier is wanted for computer examples. A short history of font changes is maintained, allowing more than one font-undo operation to be performed. If only one change is recorded, then this becomes a toggle between the two states in the history. %SI%Font change undo%EI% %P% The default font is Times-Roman, %%FN,Tim%%, in Quikscript. %L%%P% %VM,80%%VM,-80%%W%%CW,40%%TB,0%%BD% Paragraph styles %LT%%VT,?%%CW,160%%TB,45% %SH%Paragraph Style %EH% There are more paragraph forms than those shown in the simple example above. Sometimes, we want to indent the first line. To achieve this paragraph layout: %SI%%SC%Paragraph styles%EC%%EI%%SI%%%P%EI% %L,.5%%TB,55%%SZ,10% %T,60%This is an example of a common paragraph style. The first line of each paragraph is indented to make the paragraph beginning stand out. The paragraph body is flush with the normal left margin.%SZ%%TB,45% %L,.5% we precede the text with%L%%SZ%%T,55% %%P,,5%% %SZ%%P% If we want to include a quotation, the paragraph can have its whole body indented: %L,.5%%TB,55%%SZ% Lewis Carroll has been quoted many times by mathematicians for comments such as: %L,1%%TB,65% %IT%"Mine is a long and sad tale" said the Mouse, turning to Alice and sighing. "It is a long tail, certainly" said Alice, looking down with wonder at the Mouse's tail; "but why do you call it sad?"%RO% %L,1%%TB,55%It is unusual for a mathematics professor to be able to bring pleasure to children, to think at so simple... %SZ%%L,1%%TB,45% The quotation is preceded by a new-paragraph instruction %L%%T,55%%%P,10%% %%IT%% %L%and followed by the instruction %L%%T,55%%%P,0%% %%RO%% %P% Thus, the %%P%% instruction can include some numbers to control its layout. The general form is %L%%T,55%%%P,%IT%body,firstline,ipgap,botgap%RO%%% %L%where %P,20,-20,-1%%IT%body%RO% %T,+20%is the body alignment, in millimeters, relative to the current left margin as set by the last %%TB in force; %P%%IT%firstline%RO% %T,+20%is the indentation of the first line, relative to body alignment; %P%%IT%ipgap%RO% %T,+20%is the change from the normal inter-paragraph gap; %P%%IT%botgap%RO% %T,+20%is the minimum distance that must remain between the start of the paragraph and the bottom of the page. %P,0,0,0% The indentation and alignment are measured in millimeters, and the change in the inter-paragraph gap and the distance from the page bottom are measured in line height units. Normally,%TB,+10% %L%%C,128% paragraph alignment is at the current left margin, %L%%C,128% first-line indentation is zero, %L%%C,128% inter-paragraph gap is one blank line, and %L%%C,128% minimum page bottom distance is 30 MM. %TB%%L%To reduce inter-paragraph gap, the third number should be negative. %P% Any following %%P%% instructions will use the same numbers as were most recently specified on a %%P instruction. If we give a paragraph specification %L%%T,55%%%P,,10,%C,138%.5%% %L%then any following %%P%% instruction without numbers will adopt this same format. %P% %SI%Hanging first line%EI% Hanging first line style, as is useful for references or first word emphasis, could be set with %L%%T,55%%%P,10,%C,138%10%% %L%For example: %L,.5%%TB,55% %FN,Cou%%SZ,10%%NF%%%P,10,-10%% Adobe (1985a) %%IT%%PostScript Language Reference Manual%%RO%%, Adobe Systems Inc., Addison-Wesley. %%P%%Adobe (1985b) %%IT%%PostScript Language Tutorial and Cookbook%%RO%%, Adobe Systems Inc., Addison-Wesley.%FI% %TB,45%%FN%%SZ%%L,.5%will be output as%TB,55% %SZ%%P,10,-10% Adobe (1985a) %IT%PostScript Language Reference Manual%RO%, Adobe Systems Inc., Addison-Wesley. %P%Adobe (1985b) %IT%PostScript Language Tutorial and Cookbook%RO%, Adobe Systems Inc., Addison-Wesley. %SZ%%TB,45% %P,0,0,0% %SI%Inter-paragraph spacing%EI% In the above example the inter-paragraph gap is the normal single blank line. It is common for a smaller gap than this to be used in references or tabular point layouts. The instruction would become %L%%T,55%%%P,10,%C,138%10,%C,138%.5%% %L%that is, the inter-paragraph gap is wanted to be half a line-height less than the default. %P% As we have seen earlier, the same sort of hanging first line could be achieved with use of a combination of %%L%%, %%TB and %%T instructions. The use of options on a %%P%% instruction is sometimes simpler. %P% We saw earlier how numbered points can be set; they can also be set using %%P instructions: %L,.5%%TB,55% %FN,Cou%%SZ%%NF%The layout instructions are implemented using a table of three-element arrays.%%P,10,-10,-.5%% 1. %%T%% The first element contains the layout command code, with multi-character codes preceding single character codes. This order prevents confusion between single character codes and multi-character codes commencing with the same letter. %%P%%2. %%T%% The second element is a true/false value, indicating whether the layout code is "word-terminating" or not. This function will be explained below. %%P%%3. %%T%% The third element is a PostScript procedure to be executed for that layout code. %%P,0,0,0%% %FI%%TB,45%%FN%%SZ% %P% %SI%Numbered points%EI% This will produce the same output as was shown in the "Numbered points" section earlier. The advantage of using %%P and %%T to give the desired layout is that the position on the page is checked for each new-paragraph, and a new paragraph is not commenced unless there is at least a minimum amount of space at the bottom of the page. %P% The use of %%T%% without any indication of position has not been referred to before. Quikscript interprets this to mean go on the current line to the left margin plus any paragraph body alignment. %P% %SI%Left margin%EI% It is clear that %%TB and %%P can both set a left alignment for text. If both instructions are used in combination, the effect is for the %%TB to set a left margin relative to the normal left margin, and the %%P to set the paragraph alignment relative to the current left margin as set by %%TB instructions. %L%%P% %VM,80%%VM,-80%%W%%CW,40%%TB,0%%BD% Vertical Placement %LT%%VT,?%%CW,160%%TB,45% %SH%Vertical Tab %EH% %SI%Vertical placement%EI%%SC%Vertical Tab%EC%%SI%%%VT,%EI%%SI%%%VM,%EI% Just as it is possible to request a movement to a particular place across the line, it is also possible to move to a particular spot down the page. %L%%T,55%%%VT,%IT%number%RO%%% %L%is the means of positioning at %IT%number%RO% millimeters from the normal first-line position at the top of the page. This can be useful for certificates or documents where precise positioning is wanted. %P% It is also possible to move vertically to a position remembered from before. If we have issued a %%W%% instruction in a document, then %%VT,?%% will return to the remembered vertical height. The horizontal position moved to is always the current left-hand margin. An example of its use will be shown in "Tabulation with Continuation" below. If there are several remembered positions, they can be distinguished, as before, by number, %%W,1%% to record position "1", and %%VT,?1%% to move there. %P% If space is to be set aside, perhaps for insertion of an illustration, whether by cut-and-paste or computer-generated, there is an instruction %L%%T,55%%%VM,%IT%number%RO%%% %L%to move down the page by the %IT%number%RO% of millimeters. If there is not sufficient space at the bottom of the page, then Quikscript will go to a new page, and there move down the distance requested. %P% The distance to be moved can also be expressed as a certain number of line heights, by preceding the number by the letter "L". To move up the page by three lines, we would say %L%%T,55%%%VM,L%C,138%3%% %L%In other words, if moving up the page (a negative number of lines), the sign must precede the number, not the "L". %L%%P% %VM,80%%VM,-80%%W%%CW,40%%TB,0%%BD% Headings at Page Bottom %LT%%VT,?%%CW,160%%TB,45% %SH%Headings at Page Bottom %EH% %SI%Heading placement%EI%%SC%Headings at Page Bottom%EC%%SI%%%PH%EI% %SI%Paragraph gap for heading%EI% This ability of %%VM,%IT%number%RO%%% to guarantee an uninterrupted block of space can be used to prevent section headings, major paragraphs, or tables from commencing too close to the bottom of a page. If we want a heading and part of the next paragraph, say 20 MM of text, to be unbroken, the input can be preceded by the instructions%L% %T,55%%%VM,20%% %%VM,%C,138%20%% %L%The %%VM,20%% moves down by 20 MM, either on the current page if it will fit, or from the top of the next page. The %%VM,%C,138%20%% will move back to the start of the block, to the left margin. %P% An alternative method is to use a %%PH instruction instead of a %%P before the paragraph heading. %%PH will ensure that a larger distance exists to the bottom of the page than a simple %%P, sufficient for the header, another %%P, and then a couple of lines of text. If insufficient distance exists, the text will be placed at the top of the next page. This feature of paragraphs is discussed in more detail above (Paragraph Style). %L%%P% %VM,80%%VM,-80%%W%%CW,40%%TB,0%%BD% Multi-columns %LT%%VT,?%%CW,160%%TB,45% %SH%Multi-Column Layout %EH% %SI%Columns, number%EI%%SI%Number of columns%EI%%SC%%SI%Multi-column layout%EI%%EC% %SI%%%NC%EI% Most documents run simply down the page in a single column. Quikscript does allow multi-column output. There is an instruction %L%%T,55%%%NC,%IT%number%RO%%% %L%which can be used to request the following text to be set into %IT%number%RO% columns. %P% It is sometimes desirable to commence a page with a single column, with heading and possibly with a summary across the page. Below this, the text is set in multi-columnar layout. The %%NC,%IT%number%RO%%% command enables this, in that the current point when the instruction is issued is remembered, and the second column is commenced at the same height on the page. Following pages will be fully multi-columnar. If you want to place text at the start of the next column, the %%NC%% instruction moves to this position. %L%%P% %VM,80%%VM,-80%%W%%CW,40%%TB,0%%BD% Page Margins %LT%%VT,?%%CW,160%%TB,45% %SH%Page Margins %EH% %SI%Margins%EI%%SI%%SC%Page margins%EC%%EI%%SI%%%PM,%EI% The white space around the page of text can be set with a single command. By default, the left and top margins are 25.4 MM, and the right and bottom margins are 19 MM. These can be modified with %L%%T,55%%%PM,%IT%l,r,t,b%RO%%% %L%where %P,10,-10,-1%%IT%l%RO% is the left margin, %P%%IT%r%RO% is the right margin, %P%%IT%t%RO% is the top margin, and %P%%IT%b%RO% is the bottom margin, all in millimeters. %P,0,0,-1% Only those numbers to be changed from the existing setting need to be specified, eg. %L%%T,55%%%PM,,,19,%% %L%would reduce the top margin to 19 MM. %L%%P,0,0,0% %VM,80%%VM,-80%%W%%CW,40%%TB,0% Column Width %VT,?%%CW,160%%TB,45% %SH%Column Width %EH% %SI%%SC%Column width%EC%%EI%%SI%%%CW%EI% The overall width of the set text can be defined with a command, %L%%T,55%%%CW,%IT%number%RO%%%. %L%%IT%number%RO% is the width in millimeters. By default, the column width is determined from the page dimensions, the width of the page margins, and the number of columns of output per page. This can be locally adjusted with the %%CW command. The former width can be reverted to with %%CW%%. %P% By default the page width of an A4 page is 165.6 MM. A width of 161 MM will give a right margin the same width as the left. %L%%P% %VM,80%%VM,-80%%W%%CW,40%%TB,0%%BD% Special Characters %LT%%VT,?%%CW,160%%TB,45% %SH%Special Characters %EH% %SI%%SC%Special character%EC%%EI%%SI%Characters, special%EI%%SI%%%C,%EI% PostScript fonts contain many characters other than the normal keyboard characters. They can be output in Quikscript with a %L%%T,55%%%C,%IT%number%RO%%% %L%instruction. The %IT%number%RO% can be chosen by looking in the table in Appendix C. %P%For example: %L,.5%%TB,55% %FN,Cou%%SZ,10%%NF%%%C,183%% %%TB,10%%The monitor cost %%C,163%%200 %%C,208%% $500 %%C,208%% but could have been bought for %%C,165%%40000 in Japan. %FI% %TB,45%%FN%%SZ%%L,.5%will be output as%L,.5%%TB,55% %SZ% %C,128% %TB,65%The monitor cost %C,163%200 %C,132% $500 %C,132% but could have been bought for %C,165%40000 in Japan. %SZ%%TB,45% %P% %SI%Minus%EI%%SI%Dash%EI%%SI%Em-dash%EI% It is possible by this means to distinguish between the three characters -, %C,133%, and %C,132%, respectively hyphen, minus, and dash. The first is obtained with the simple minus keystroke, the second with %%C,177%%, and the third with %%C,208%% in the normal PostScript character set. See Appendix C for the complete set. %P% It is also possible in this way to create European characters that are not in the usual character set. This will be illustrated below in an example ("European Characters") and in Appendix C. %L%%P% %VM,80%%VM,-80%%W%%CW,40%%TB,0%%BD% Gaps not to be broken %LT%%VT,?%%CW,160%%TB,45% %SH%Non-breaking space %EH% %SI%%SC%Non-breaking space%EC%%EI%%SI%Space, non-breaking%EI%%SI%%%_%EI% Quikscript takes the input text, and looks for spaces to break between words, each word being fitted separately into the current output line. If it does not fit, it is placed on the next line. Sometimes, we do not want a word break at particular gaps. Common examples are in telephone numbers, credit card numbers, or between initials and a person's surname. To prevent such breaks from occurring, they can be represented to Quikscript with the notation %%_%%, as for example in %L% %T,55%258%%_%%7734 %L%Longer spaces can be set aside with more underline characters between the %% characters. %L%%P% %VM,80%%VM,-80%%W%%CW,40%%TB,0%%BD% Page Numbering %LT%%VT,?%%CW,160%%TB,45% %SH%Simple Page Numbering %EH% %SI%%SC%Page numbering%EC%%EI%%SI%%%PN%EI% Pages can be numbered, if desired, with the instruction %%PN%%. The page number will be placed at the upper right-hand corner of the page, preceded by the text, "Page". Page numbering will commence on the next page, number "2". If page numbering is to commence at a different number, the number can be given in %%PN,%IT%number%RO%%%, in which case the %IT%number%RO% will appear on the current page. %P% More sophisticated page numbering or annotations are described below in "Special page annotation and numbering". %L%%P% %VM,80%%VM,-80%%W%%CW,40%%TB,0%%BD% Superscripts, Subscripts, Mathematics %LT%%VT,?%%CW,160%%TB,45% %SH%Super- and Subscripts %EH% %SI%Superscript%EI%%SI%Subscript%EI%%SI%Mathematics%EI%%SI%%%^%%%EI% %SI%%%V%%%EI%%SI%%%=%%%EI% %SC%Superscripts, Subscripts, Mathematics%EC% Technical documents often need superscripts or subscripts, to represent a number raised to a power or an instance of a set, for example. The instruction for subscript is %%V%%, for superscript %%^%%, and to revert to normal size %%=%%. %P%For example: %L,.5%%TB,55% %FN,Cou%%SZ,10%%NF%A%%V%%i%%^%%2%%=%% %FI% %TB,45%%FN%%SZ%%L,.5%will be output as%L,.5%%TB,55% %SZ% A%V%i%^%2%=% %SZ%%TB,45% %P% Many mathematical symbols are available in the Symbol font (Sym), as shown in Appendix C. To represent a summation%L,.5%%T,55% %IT%%FN,Sym%S%FN%%W,1%%^%8%T,?1%%V%i=1%=%( Max(0, Slope%V%i%^%p%=%) )%RO% %L,.5% we would give the instructions %L,.5%%TB,55% %FN,Cou%%SZ,10%%NF%%%IT%%%%FN,Sym%%S%%FN%%%%W,1%%%%^%%8 %%T,?1%%%%V%%i=1%%=%%( Max(0, Slope%%V%%i%%^%%p%%=%%) )%%RO%% %FI% %L,.5%%TB,45%%FN%%SZ% Although this may be somewhat daunting, piece by piece it is very simple. The whole line is set as italic (%%IT%%, with %%RO%% at the end), because mathematics often looks best this way. We change font to Symbol (%%FN,Sym%%) and output the character "S", which in that font is the Greek %FN,Sym%S%FN%. We must revert to the normal font for the remaining output (%%FN%%). After the summation sign, we want a subscript (i=1) and superscript (8), and we want them at the same horizontal position. So we record the position (%%W,1%%) and return to it (%%T,?1%%) after putting out the superscript (%%^%%8). At the end of the subscript (%%V%%i=1) we need to revert to normal size and placement (%%=%%). %P% The only tricky part of this example is the need in this case to represent the superscript before the subscript. There is a general rule that if we want to have both superscript and subscript with the same horizontal alignment, then we must first request the %IT%shorter%RO% of the strings. Otherwise, following text could overwrite earlier output. %L%%P% %VM,80%%VM,-80%%W%%CW,40%%TB,0%%BD% Full Justification, Centred, Right Justification %LT%%VT,?%%CW,160%%TB,45% %SH%Text Justification %EH% %SI%Justification of text%EI%%SI%Alignment of text%EI%%SI%%%RJ%EI%%SI%%%CT%EI% %SI%%%LJ%%%EI%%SI%%%FJ%%%EI% %SI%Centred text%EI%%SC%Full Justification, Centred, Right Justification%EC% Quikscript allows you to output text fully justified (ie. right and left ends of lines aligned), centred, or right-justified, as well as the default behaviour of left-justification. This default was chosen because of the firm belief that ragged-right text is easier to read, although less tidy, than fully justified text. Furthermore, if text is output in a narrow column, the allocation of white space between words to pad out the right margin can be quite ugly. This can be alleviated to a limited extent by allocating some of the spare space between characters of words, or by hyphenating long words. Neither of these is currently done in Quikscript. %P% The layout instructions to select the method of text justification are: %%FJ%% for full justification, %%LJ%% for left-justification, %%CT%% for centred, and %%RJ%% for right-justification. %P% For example:%SZ,10%%P%%FJ% Quikscript allows you to output text fully justified (ie. right and left ends of lines aligned), centred, or right-justified, as well as the default behaviour of left-justification. This default was chosen because of the firm belief that ragged-right text is easier to read, although less tidy, than fully justified text. If text is output in a narrow column, the allocation of white space between words to pad out the right margin can be quite ugly. This can be alleviated to a limited extent by allocating some of the spare space between characters of words, or by hyphenating long words. There is no hyphenation facility currently in Quikscript, but space is sometimes apportioned between letters of words to space them out. %P%%SZ%%LJ% is set with %%FJ%% preceding the text. With %%CT%% instead of %%FJ%%, it would look like:%SZ,10%%P%%CT% Quikscript allows you to output text fully justified (ie. right and left ends of lines aligned), centred, or right-justified, as well as the default behaviour of left-justification. This default was chosen because of the firm belief that ragged-right text is easier to read, although less tidy, than fully justified text. If text is output in a narrow column, the allocation of white space between words to pad out the right margin can be quite ugly. This can be alleviated to a limited extent by allocating some of the spare space between characters of words, or by hyphenating long words. There is no hyphenation facility currently in Quikscript, but space is sometimes apportioned between letters of words to space them out. %SZ%%LJ% %P% If full-justification is being used and a block of text is to be set using %%NF%% (do not fill lines, see "Not filling lines" above), this will override the full-justification until %%FI%% is encountered. %P% There is a common need to centre or right-justify a single line or piece of text, and separate instructions are provided for this. To centre a line, the %%CL%% instruction was described above. To right-justify a line of text, the %%RL%% instruction should be used preceding the text. %P% Text can be right-justified to a certain position within a line, with%L%%T,55% %%RL,%IT%pos%RO%%% %L%where %IT%pos%RO% is the distance from the normal left margin. Remembered positions can also be used with the "?" notation. %P% This feature can be useful in simple tables of numbers:%L,-.5%%NF%%SZ,10% %T,55%%W,11%%T,70%%W,12%%T,85%%W,13% %RL,?11% 20 %RL,?12% 400 %RL,?13% 2 %RL,?11% 5000 %RL,?12% 7 %RL,?13% 7932 %L,-.5%%SZ%would be set as%SZ%%L,-.5%%FN,Cou% %%T,20%%%%W,1%% %%T,40%%%%W,2%% %%T,60%%%%W,3%% %%RL,?1%% %BD%20%LT% %%RL,?2%% %BD%400%LT% %%RL,?3%% %BD%2%LT% %%RL,?1%% %BD%5000%LT% %%RL,?2%% %BD%7%LT% %%RL,?3%% %BD%7932%LT% %FI%%SZ%%FN% %L%%P% %VM,80%%VM,-80%%W%%CW,40%%TB,0%%BD% Dot Fill %LT%%VT,?%%CW,160%%TB,45% %SH%Dot Fill %EH% %SI%Dotted line%EI%%SC%Dot Fill%EC%%SI%%%DF,%EI% There are times such as in a table of contents when the space between two pieces of text is wanted to be filled with a repeating character, such as dots. This is provided with %L%%T,55%%%DF,%IT%pos,ch%RO%%% %L% where %IT%pos%RO% is the horizontal position on the current line from the left margin that is to be filled to, and %IT%ch%RO% is the character to be used for filling. If %IT%pos%RO% is omitted, fill occurs to the end of the line. If %IT%ch%RO% is omitted, the normal full-stop (period) character is used. %P% For example, the output%L,-.5%%TB,55%%NF%%SZ,10%%FN,Hel% 1. Introduction %DF,150%%RL%3 2. Simple Quikscript examples %DF,150%%RL%15 %FI%%FN%%SZ%%TB,45%%L,-.5% is achieved with the instructions %L,-.5%%TB,55%%FN,Cou%%SZ,10%%NF% %%NF%% 1. Introduction %%DF,150%%%%RL%%3 2. Simple Quikscript examples %%DF,150%%%%RL%%15 %FI%%%FI%% %SZ%%L,.5%%TB,45%%FN% Dots can be filled to a position remembered from earlier in the document using the notation %%DF,?2%%, for example, if the position was saved earlier with a %%W,2%%. %P% The character can be the actual keystroke, or a decimal numeric code as used as used for special characters. %L%%P% %VM,80%%VM,-80%%W%%CW,40%%TB,0%%BD% Tables %LT%%VT,?%%CW,160%%TB,45% %SH%Tables %EH% %SI%%SC%Table%EC%%EI%%SI%%%ST,%EI%%SI%%%ET%%%EI%%SI%%%VL,%EI%%SI%%%HL%EI% The simplest way a table can be built in Quikscript is to turn off the normal line-filling behaviour, by setting %%NF%% as described in the earlier section on "not filling lines". Columns of text can be aligned by use of %%T,%IT%position%RO%%% before each piece of text. The position can be a distance in millimeters from the normal left margin, or can be a remembered position set up at the start of the table as described in the section "parameterized positioning" above. An example of this is shown in a earlier section entitled "right-justified text". %P% If the text of a cell could span more than one line, or if we want boxes to be drawn around the cells, this simple approach is cumbersome and inadequate. A more powerful scheme is available using the instructions %%ST,... to start a table, %%VL... to indicate where vertical lines are to be drawn, %%HL... for horizontal lines, %%NR%% to commence a new row of the table, %%CO%% to commence a new column in this row, and %%ET%% to end a table. %P% %SZ,10%%VM,L9%%VM,L-9% %ST,45,65,90,115,160%%VL,1,1,2,3,4,5,5%%HL2% Fruit %CO%Amount %CO%Timing %CO%Directions %HL%%NR% Apples %CO%2 spoonfuls per litre %CO%Early June %CO%Do not spray after bud burst. %HL%%NR% Peaches %CO%4 spoonfuls per litre %CO%May or June %CO%May be mixed with winter oil in the early part of the spraying season. %HL%%NR% %CO,1%Nectarines %CO,2%2 spoonfuls per litre %CO,3,4%First spray in early June. Second spray must not follow bud-burst, and may be combined with an aphid treatment. %HL2% %ET% %SZ%%P%This table can be created with the instructions: %L,.5%%TB,55%%FN,Cou%%SZ,10% %NF% %%ST,45,65,90,115,160%%%%VL,1,1,2,3,4,5,5%%%%HL2%% Fruit %%CO%%Amount %%CO%%Timing %%CO%%Directions %%HL%%%%NR%% Apples %%CO%%2 spoonfuls per litre %%CO%%Early June %%CO%%Do not spray after bud burst. %%HL%%%%NR%% Peaches %%CO%%4 spoonfuls per litre %%CO%%May or June %%CO%%May be mixed with winter oil in the early part of the spraying season. %%HL%%%%NR%% %%CO,1%%Nectarines %%CO,2%%2 spoonfuls per litre %%CO,3,4%%First spray in early June. Second spray must not follow bud-burst, and may be combined with an aphid treatment. %%HL2%%%%ET%% %FI% %TB,45%%FN%%SZ% %P% The %%ST,45,65,90,115,160%% instruction (start-table) establishes where the column margins are. The numbers indicate distance in millimeters from the normal left margin. Remembered positions can be referred to using the "?%IT%number%RO%" notation described in "parameterized positioning" above. The number indicating the right-hand margin of the table can be omitted, provided that the trailing comma is present, and the page margin will be assumed implicitly. Eg. %%ST,45,65,90,115,%% %P% The table is ended with the instruction %%ET%%. %P% %%VL,1,1,2,3,4,5,5%% determines which of the column margins will have vertical lines drawn, and how thick they will be. Duplicating a margin number doubles the line thickness. %P% %%HL2%% will cause a horizontal line of double thickness to be drawn across the table. Normal horizontal lines are produced by %%HL%%. %P% Text is placed in different columns of the current row in sequence, with %%CO%% causing a move to the next column. A column can be chosen explicitly by referring to the column number, as is done in the "Nectarines" row with %%CO,2%%. The last cell in this line is forced to span two columns width by giving a column range %%CO,3,4%%. %P% Note that row depth is determined automatically by the content of the deepest of the cells in that row. %P%%VM,L6%%VM,L-6% %ST,55,80,100,120%%HL2%%VL,1,1,2,4,4%%TJ,lcr% Product %CO,2,3%%CL%Price %HL%%NR% gnats%CO%gram%CO%$13.65 %HL,2,3%%NR,2% each%CO%0.01 %HL%%NR% gnu%CO%stuffed%CO%92.50 %HL,1%%HL,3% %NR% emur%CO,3%33.33 %HL%%NR% armadillo%CO%frozen%CO%8.90 %HL2%%ET% %P% This more artificial example illustrates control over where horizontal lines are placed, and control over justification of the columns. It is produced by: %L,.5%%TB,55%%FN,Cou%%SZ,10% %NF% %%ST,55,80,100,120%%%%HL2%%%%VL,1,1,2,4,4%%%%TJ,lcr%% Product %%CO,2,3%%%%CL%%Price %%HL%%%%NR%% gnats %%CO%%gram %%CO%%$13.65 %%HL,2,3%%%%NR,2%% each %%CO%%0.01 %%HL%%%%NR%% gnu %%CO%%stuffed %%CO%%92.50 %%HL,1%%%%HL,3%% %%NR%% emur %%CO,3%%33.33 %%HL%%%%NR%% armadillo %%CO%%frozen %%CO%%8.90 %%HL2%%%%ET%% %FI% %TB,45%%FN%%SZ% %P% %SI%%%TJ,%EI% The text in the second column is centred while the text in the third is right-justified. The instruction %%TJ,lcr%% establishes this table justification. The lower case characters "l", "c" and "r" mean respectively left-justified, centred, and right-justified. "f" can be used to request full justification, though this is likely to produce ugly results unless a column is fairly wide. As we saw in the first example, left justification will be used if no specific rule is requested in a %%TJ instruction. %P% The column justification can be overridden for a particular cell, as was achieved with the "Price" heading, which would have been right-justified if the %%CL%% had been omitted before the word. %P% The "gnats" row has a horizontal line beneath that spans the second and third columns only. This was produced by %%HL,2,3%%. Similarly, where we did not want a line beneath "stuffed", two line segments were requested with %%HL,1%%%%HL,3%%. A single number following "%%HL," indicates the column that is to have a horizontal line, whereas two numbers indicate a column range. %P% Vertical lines do not need to be drawn at all column margins; the third margin is omitted from the %%VL list by omitting the number "3", eg %%VL,1,1,2,4,4%%. %L%%P% Professional typesetters use vertical and horizontal lines sparingly in setting tables, in contrast to computer users more experienced with spread-sheets than in visual design. Many drawn lines tend to have a heavy and formal appearance. Compare the table below with the earlier example. %P% %SZ,10%%VM,L11%%VM,L-11% %ST,45,65,90,115,160%%HL2% %CO,2%Amount %CO%Timing %CO%Directions%HL% %NR% Apples %CO%2 spoonfuls per litre %CO%Early June %CO%Do not spray after bud burst. %NR% Peaches %CO%4 spoonfuls per litre %CO%May or June %CO%May be mixed with winter oil in the early part of the spraying season. %NR% %CO,1%Nectarines %CO,2%2 spoonfuls per litre %CO,3,4%First spray in early June. Second spray must not follow bud-burst, and may be combined with an aphid treatment. %HL2%%ET%%SZ% %P% These table features will not handle very well large tables that span more than a page. If text within a cell must spill onto a new page, then subsequent cells in the same row will commence on the new page, rather than being similarly split across the page boundary. %L%%P% Most of the text of this document has been set as a table by a different method, using a combination of the %%TB , %%W , %%VT and %%CW instructions. Each section contains a title in the narrow left column, and the descriptive text on the right. At the start of each new section, the position is remembered (%W), the left margin is fixed with %%TB, the right margin with %%CW, and the heading is then placed. To place the right-hand column, we change the left and right margins again using %%TB and %%CW, and set the vertical placement of the first line using %%VT to return to the remembered position. This is a workable scheme, though is more cumbersome than the simpler scheme described above, which automates the margin setting. This approach has been used because there is no way in Quikscript to place a table within a table. %L%%P% %VM,80%%VM,-80%%W%%CW,40%%TB,0%%BD% Page Header %LT%%VT,?%%CW,160%%TB,45% %SH%Page Header %EH% %SI%Page header%EI% If pages are to be output with page numbers (see %%PN%%), there will be a short piece of text printed beside the number at the top of the page. By default, this will be "Page%_%". %P% The text beside the page number can be changed using two layout markers, %%SH%% and %%EH%%. %%SH%% indicates the start of header text, and %%EH%% marks the end of header text. Multiple words can be included between these markers, and it is possible to include Quikscript layout marks such as %%C for special characters. It is not possible to include PostScript or line-breaking layout marks within the text. %P% For example, %L,.5%%T,55%%FN,Cou%%SZ,10% %%SH%%Special Features %%EH%% %SZ%%FN%%L,.5% would cause this and following pages to have page numbers printed as: %L,.5%%T,55%%SZ,10% Special Features 2 %SZ%%L,.5% %L%%P% %VM,80%%VM,-80%%W%%CW,40%%TB,0%%BD% Text Colour %LT%%VT,?%%CW,160%%TB,45% %SH%Colour %EH% %SI%Colour%EI%%SC%%SI%Text colour%EI%%EC%%SI%%%TC%EI% The colour used for text output can be set with the layout marker%L%%T,55% %%TC,%IT%red,green,blue%RO%%% %L,.5%The numbers for %IT%red, green, blue%RO% should be in the range from zero to one. To revert to normal black text, %%TC%% should be used. %L%%P% %VM,80%%VM,-80%%W%%BG,1,1,.85%%CW,40%%TB,0%%BD% Background Colour %LT%%VT,?%%CW,160%%TB,45% %SC%Background Colour%EC%%SI%Background%EI%%SI%%%BG%EI% There is restricted support for a background colour for text in a document. This is intended for use in highlighting a paragraph or block of text. The layout marker takes the form: %L,.5%%T,55%%%BG,%IT%red,green,blue,left,right%RO%%% %L,.5%The numbers for %IT%red, green, blue%RO% should be in the range from zero to one. %L,.5% Thr final two numbers indicate the left and right boundaries of the background. The %IT%left%RO% will be subtracted from the normal left margin of the text, and %IT%right%RO% will be added to the normal right margin. Both are measured in millimetres. If these numbers are omitted, the default values for them are 14 and zero printers points respectively. %P% To restore the normal background, use %L%%T,55%%%BG%% %P% It is not suitable for providing a background to a piece of text within a paragraph; it fills an area from the left to the right margin of the column or page. It will not work very well if there are large changes in font size within the block of text. It will not provide a background for illustrations that might be included. If a table is part of the text requiring a background, any horizontal cell borders will probably be lost by the filling operation. There is a separate facility to fill the background of a table (%%BC below). %P% If a whole document is to be prepared with a background colour, it would be simpler to modify the new-page PostScript procedure /Eject as described below, filling a rectangular area of each new page before text is placed. %BG% %L%%P% %VM,80%%VM,-80%%W%%CW,40%%TB,0%%BD% Table background colour %LT%%VT,?%%CW,160%%TB,45% %SI%Table background%EI%%SI%Background colour%EI%%SI%%%BC%EI% %SC%Table background colour%EC% It is possible to specify a background colour for selected cells or columns of a table. The marker is %L%%T,55%%%BC,%IT%col1,col2,red,green,blue%RO%%% %L%The first two numbers indicate the range of columns that are to have their background filled. If only a single column is to have a background, then the same number must be repeated. %L% Colour is given by three numbers in the range from zero to one. %P% To finish using the background colour for a particular column range, use %L%%T,55% %%BC,%IT%col1,col2%RO%%% %P% To finish using background colour in the table, simply use %L%%T,55% %%BC%% %P% The main caution with selectively using colour in a table is that colour should be turned on immediately after %%NR or %%CO, and turned off before %%NR or %%CO. Also, background colour in a table will not be handled correctly in some situations where there is a variety of font sizes in a cell of a table. %P% Example:%L% %ST,45,65,90,115,160%%VL,1,1,2,3,4,5,5%%HL2% Fruit %CO%Amount %CO%Timing %CO%Directions %HL%%NR%%BC,1,1,1,.8,.9%%BC,2,4,.8,1,1% Apples %CO%2 spoonfuls per litre %CO%Early June %CO%Do not spray after bud burst. %BC,2,4% %HL%%NR% Peaches %CO%4 spoonfuls per litre %CO%May or June %CO%May be mixed with winter oil in the early part of the spraying season. %HL%%NR% %CO,1%Nectarines %CO,2%2 spoonfuls per litre %CO,3,4%First spray in early June. Second spray must not follow bud-burst, and may be combined with an aphid treatment. %BC%%HL2% %ET% %L% is created with these instructions: %L,.5%%TB,55%%FN,Cou%%SZ,10%%VM,L16%%VM,L-16% %NF% %%ST,45,65,90,115,160%%%%VL,1,1,2,3,4,5,5%%%%HL2%% Fruit %%CO%%Amount %%CO%%Timing %%CO%%Directions %%HL%%%%NR%%%BD%%%BC,1,1,1,.8,.9%%%%BC,2,4,.8,1,1%%%LT% Apples %%CO%%2 spoonfuls per litre %%CO%%Early June %%CO%%Do not spray after bud burst. %BD%%%BC,2,4%%%LT% %%HL%%%%NR%% Peaches %%CO%%4 spoonfuls per litre %%CO%%May or June %%CO%%May be mixed with winter oil in the early part of the spraying season. %%HL%%%%NR%% %%CO,1%%Nectarines %%CO,2%%2 spoonfuls per litre %%CO,3,4%%First spray in early June. Second spray must not follow bud-burst, and may be combined with an aphid treatment. %BD%%%BC%%%LT%%%HL2%% %%ET%% %FI%%TB,45%%FN%%SZ% %P% If you need to change font size within a table where background colour is being used, it might help to understand how Qs works in order to find the set of instructions to do what you want. %P% When the %%BC instruction is encountered, a shaded stripe is drawn at the top of the table in the selected columns. The height of this stripe is determined from the current font size. Each time a new line is needed in a cell, a coloured stripe is drawn before any text is output, and again, the position of the top and bottom of this stripe is based on the current text height. %P% If you are going to change font size, it may be safest to first go to the line position where the text will be output, change the size, and then output the text in that line, restoring the original size before going to the next line. %L%%P% %VM,80%%VM,-80%%W%%CW,40%%TB,0%%BD% Table of Contents %LT%%VT,?%%CW,160%%TB,45% %SH%Table of Contents %EH% %SI%Contents%EI%%SC%Table of Contents%EC% %SI%%%SC%%%EI%%SI%%%CA%%%EI%%SI%%%EC%%%EI% If a document is to be added to over time, it is convenient to have Quikscript generate the table of contents. It is necessary to place markers and text within the document body, indicating what is to appear in the contents. Quikscript will add the page number to the text, recording it for subsequent output with all the other items. %P% An item for the contents is indicated with the markers %%SC%% and %%EC%%, eg: %L,.5%%T,55%%FN,Cou%%SZ,10% %%SC%%Chapter 4: Colour separation%%EC%% %SZ%%FN%%L,.5% This text will not appear in the document at this point, but will be held over for later output. The text may contain Quikscript layout marks. These will have no effect locally within the document, and are only acted on when the table of contents is printed. %P% Each contents line will have appended to it the text %L,.5%%T,55%%FN,Cou%%SZ,10% %%DF,?%%%%RL%% %SZ%%FN%%L,.5%and the page number. The DF and RL layout marks are intended to improve layout of the table when it is printed. For these to work properly, it would be necessary to tab to a suitable position for the end of the dots, and record it with, for example, %L,.5%%T,55%%FN,Cou%%SZ,10% %%T,150%%%%W%% %SZ%%FN%%L,.5% before printing the contents. %P% The page number recorded in the index may have a chapter abbreviation in front of it, if chapters or appendices are numbered separately from one. This chapter abbreviation can be set up by eg: %L,.5%%T,55%%FN,Cou%%SZ,10% %%CA,A-%% %SZ%%FN%%L,.5% which will cause all page numbers following this point to commence with "A-" when they are recorded in the index or table of contents. No blanks are allowed in this abbreviation. %P% At the end of the document, the table of contents could be printed with the following: %L,.5%%TB,55%%FN,Cou%%SZ,10%%LP%%NF% %%BD%%%%SZ,16%%%%CL%%Contents %%SZ%%%%LT%%%%P%% %%TB,20%%%%CW,140%%%%T,130%%%%W%%%%T%% %%PC%% %%TB%%%%CW%% %LP%%FI%%SZ%%FN%%TB%%L,.5% The first two lines put out the heading in an appropriate style. The third line sets the left margin (%%TB,20%%) and the right margin (%%CW,140%%) so that the table is not too wide. Each line of the table will have a dotted line going to a point previously recorded using a %%W%%, so the remaining instructions on the third line record a position 130 MM from the normal left margin for this dotted line. The table of contents is printed with %%PC%%. Finally, the left and right margins are restored to their previous values (%%TB%%%%CW%%). %P% The line above could be printed as: %L,.5%%T,50%Chapter 4: Colour separation %DF,140% A-37 %P% The printed contents page will need to be moved to the start of the printed document. Its page number will be wrong unless an extra instruction is given before the %%PC%% to set the page number correctly. If no page number is needed on the contents page, we would give: %L,.5%%T,55%%FN,Cou%%SZ,10% %%PN,0%% %SZ%%FN%%P% If a large document is being written with chapters separately prepared, then it is possible to output the table of contents in parts to the screen or to "standard output" if a PostScript interpreter is used. These parts would be collected from the separate chapters or sections of the document, joined together into a single file, and printed separately. The command to output to the screen is: %L,.5%%T,55%%FN,Cou%%SZ,10% %%OC%% %SZ%%FN% %L%%P% %VM,80%%VM,-80%%W%%CW,40%%TB,0%%BD% Index %LT%%VT,?%%CW,160%%TB,45% %SH%Index %EH% %SI%%SC%Index%EC%%EI% %SI%%%SI%%%EI%%SI%%%CA%%%EI%%SI%%%EI%%%EI% An index to a lengthy document can be built by including layout marks and appropriate text near the section to be indexed. This text will be recorded, and can be output at the end of the document along with page numbers, all neatly sorted alphabetically. %P% To specify an item for the index, the markers %%SI%% and %%EI%% are used around the text: %L,.5%%T,55%%FN,Cou%%SZ,10% %%SI%%Succulent plants%%EI%% %SZ%%FN%%L,.5% This text will not be output at the current point. It will be held for later printing or output to the screen. %P% The page number may have a chapter abbreviation in front of it, if chapters or appendices are numbered separately from one. This chapter abbreviation can be set up by eg: %L,.5%%T,55%%FN,Cou%%SZ,10% %%CA,3-%% %SZ%%FN%%L,.5% which will cause all page numbers following this point to commence with "3-". No blanks are allowed in this abbreviation. %P% To print the index at the end of the document, the following set of instructions would typically be given: %L,.5%%TB,55%%FN,Cou%%SZ,10%%LP%%NF% %%NP%%%%BD%%%%SZ,16%%%%CL%%Index %%SZ%%%%LT%%%%P%% %%NC,2%% %%PI%% %%NC,1%% %LP%%FI%%SZ%%FN%%TB%%L,.5% The first two lines put out a suitable header. The third line makes the remainder of the page be printed using two columns. The fourth line %L,.5%%T,55%%FN,Cou%%SZ,10% %%PI%% %SZ%%FN%%L,.5% causes the index to be printed. %P% Text can contain layout marks. These are not acted upon until the index is to be printed. Be aware that the sorting of the index is based on the raw text, and that layout marks are treated as text in the sorting process. %P% If the document was being built up with sections as separate documents, the index for each section could be output to the screen or to "standard output" for merging into a single index. This can be done with the instruction %L,.5%%T,55%%FN,Cou%%SZ,10% %%OI%% %SZ%%FN%%P% It is common for the same text to appear in the table of contents and in the index. Quikscript accepts the one text description embedded within both index item and contents item markers: %L,.5%%T,55%%FN,Cou%%SZ,10% %%SC%%%%SI%%Egyptian hieroglyphs%%EI%%%%EC%% %SZ%%FN%%L,.5% A single buffer is used to hold the text being recorded for later output, so it is important that the index and contents text have a common starting point. Do not put any text between the %%SC%% and the %%SI%%. %P% The index is built in sorted order. Sorting is based on the ASCII representation of characters, which is not always the desirable sorting order. A major disadvantage is that all upper-case letters precede lower-case letters. This means that a word such as "HTML" will precede "applet" in the index. It is not easy to fix this in Quikscript, without greatly enlarging the program. %P% There are two approaches you can adopt to avoid this problem. In the first approach, when indicating the text that is to appear in the index, always start with an upper-case letter. This will not give ideal sorting of the remaining characters in the words, but will at least group items sensibly based on the first character. %P% In the second approach, the index would be output rather than printed, with the output collected into a file. That file could be sorted ignoring case of the text using some sort package on your computer, and output using Quikscript in a subsequent step. This approach may already be necessary if a document is split into separate files, with the index for each file merged into a single sorted file. %P% A program is provided to assist with index sorting. See the description of "sortIndex" in Appendix B. %TB,0%%NP% %BD%%SZ,14% %CL%More Sophisticated Applications %C,132% Embedding PostScript %SZ%%P%%LT% %SI%%SC%Embedded PostScript%EC%%EI%%SI%PostScript embedded%EI% Provision is made in Quikscript for PostScript code to be included in the text input itself. One application for this is to enable Quikscript to be modified from within a document being formated by it. In essence, Quikscript can be self-modifying, because PostScript code is interpreted rather than compiled. Another reason for doing this is to gain access to special PostScript features, such as modified fonts or rotated page layouts, that will be illustrated in the examples that follow. %P% Two constructions can be used for including PostScript instructions in a document. The first is the simple form: %L%%T,10%%%PS %IT%embedded PostScript%RO% %% %L%The whole instruction must fit on the one line. It is restricted further in that it cannot use string variables, that is, text within parentheses, with the simple %IT%def%RO% PostScript operator. %P% The alternative is:%NF%%TB,10% %%PS%% %IT%embedded PostScript%RO% PE %TB,0%%FI%This construction is unrestricted in what PostScript may be used, except that it must execute without error. It does not have automatic access to internal Quikscript functions or variables in the same way that the first construction does. %TB,45% %L%%P% %VM,30%%VM,-30%%W%%CW,40%%TB,0% %BD%Double Spacing%LT% %VT,?%%CW,160%%TB,45% %SH%Double Spacing %EH% %SI%Double spacing%EI%%SI%Spacing between lines%EI%%SI%Inter-line spacing%EI% %SC%%_,6%Double Spacing%EC% If a document were needed to be printed double spaced, perhaps to meet the requirements of a publisher, the command: %FN,Cou%%L%%SN,10%%T,55%%%PS /IlGap 2 store%%%%SZ,12%% %TB,45%%FN%%SN%%L% would effect the change. Paragraph specifications might need to be altered to reduce the inter-paragraph gap, which will also be almost doubled by this instruction. The default value for parameter %IT%IlGap%RO% is 1.17; this establishes the distance between lines based on the font size. If the font size is 12 pt, an %IT%IlGap%RO% of 1.17 will give the distance between baselines of 14 pt (12 x 1.17). Any interline spacing can be set by changing this number. %P%A size specification must follow the PostScript for the change to take effect. %L%%P% %VM,30%%VM,-30%%W%%CW,40%%TB,0% %BD%Special page annotation and numbering%LT% %VT,?%%CW,160%%TB,45% %SH%Special page annotation and numbering %EH% %SI%Page numbering%EI%%SI%Running title%EI% %SC%%_,6%Special page annotation and numbering%EC% As was discussed earlier, the text that usually accompanies the page number, "Page", can be changed to something more specific to the document using %%SH%% and %%EH%% to bracket the text. This text can include a limited set of layout marks that affect the font. Before this text is displayed, a header prefix set of commands is executed, which by default is %FN,Cou% %L%%SZ,10%%TB,55%(%%FN,Tim%%%%SZ,12%%) %TB,45%%FN%%SZ% %P% The font or text size can be changed by modifying this string, eg. %FN,Cou% %L%%SZ,10%%TB,55%%NF%%%PS%% QSdict /HdrPre (%%FN,Hel%%%%SZ,10%%) put PE %FI% %TB,45%%FN%%SZ% %P% Page numbering is performed by two routines in Quikscript: %L,.5%%FN,Cou%%SZ,10%%TB,55% %NF%%%PS%% QSdict begin %% - PrPagNum - %% Increment and print page number /PrPagNum { IncPagNum PagCnt 1 gt NumberIt and { gsave WordWid SaveTempState 0 mark HdrPre UseKwds pop pop /PagNum PagCnt TmpS cvs store %% convert page number to integer PagNumPos PagStr showStr PagNum show RestoreStates pop pop RestoreTempState /WordWid exch store grestore} if } def %% - PagNumPos - %% Move to the position for page number. /PagNumPos { RgtBnd PagNum stringwidth pop sub PagStr MeasureStr sub PagLen TopMrg sub HdrSpa add moveto } def end PE%SZ% %FI% %TB,45%%FN%%L,.5% The first routine establishes whether the page number is wanted, and outputs it on the page. The second routine determines the position for the start of the page number text. These routines can be changed if you want page numbers to be placed in different positions, or if you want several text items, either as running headers or footers to the page. %P% %VM,30%%VM,-30%%W%%CW,40%%TB,0% Centred Page Numbers %VT,?%%CW,160%%TB,45% %SI%Page numbering%EI% If page numbers were wanted centred on the page, the routine for moving to the position for page numbering would need to be revised. The PostScript instructions in %IT%cntpagnm.qs%RO% should be included following Quikscript and before the document. This will put the page number centred at the bottom of the page, and the page heading text (PagStr) centred at the top of the page. (See %%SH and %%EH for setting the header text.) %P% Note that it is still necessary to use the %%PN%% directive to request page numbers to be included in the page. %P% %VM,30%%VM,-30%%W%%CW,40%%TB,0% Left/Right Page Numbering %VT,?%%CW,160%%TB,45% Documents that are to be reproduced double-sided ideally need the page number to be on the outside of the page, ie. on the right-hand side of odd numbered pages and on the left for even-numbered pages. To achieve this in Quikscript, the two procedures would need to be replaced by including the PostScript instructions in file %IT%altpagnm.qs%RO% between Quikscript and the document. %P% Note that it is still necessary to use the %%PN%% directive to request page numbers to be included in the page. %L%%P% %VM,30%%VM,-30%%W%%CW,40%%TB,0% %BD%Landscape orientation%LT% %VT,?%%CW,160%%TB,45% %SH%Landscape Orientation %EH% %SI%Landscape%EI%%SC%%_,6%Landscape Orientation%EC% If a document is to be printed sideways on a page, the PostScript instructions in %IT%rotate.qs%RO% should be included after Quikscript and before the document. %L%%P% %VM,30%%VM,-30%%W%%CW,40%%TB,0% %BD%Layout marker character%LT% %VT,?%%CW,160%%TB,45% %SH%Layout marker character %EH% %SI%Layout marker character%EI%%SI%/Esc%EI%%SI%%%%EI% %SC%%_,6%Layout marker character%EC% If the character that delimits Quikscript commands, %%, is inconvenient, another may be substituted. To change to using # instead of %%, the command would be: %L,.5%%SZ,10%%FN,Cou%%TB,55%%NF%%%PS%% QSdict /Esc (#) put PE %FI% %TB,45%%FN%%SZ%%L,.5% A one-line %%PS instruction cannot be used because a text string is involved. This constraint arises from the way composite objects are handled on the stack. %L%%P% %VM,30%%VM,-30%%W%%CW,40%%TB,0% %BD%Graphic Page Border%LT% %VT,?%%CW,160%%TB,45% %SH%Graphic Page Border %EH% %SI%Page border%EI%%SI%Border to page%EI%%SC%%_,6%Graphic Page Border%EC% To place a border around every page, an internal routine in Quikscript, %IT%PrPagNum%RO%, can be redefined. The normal version of this routine is given above in "Special page annotation". In this example, the organization name is to be placed at the bottom below the border, and the section within the organization will be placed at the top of the page, also outside the border: %L,.5%%FN,Cou%%NF%%SZ,10%%TB,50%%%PS%% /Tit1 (University of Woolloomooloo) def /Tit2 (Department of Leisure) def /PagNumPos{295 780 moveto} def QSdict begin /PagStr() def /PrPagNum { IncPagNum gsave WordWid SaveTempState 0 mark % put a nice border around the page newpath 60 36 moveto 535 60 24 -90 0 arc 535 780 24 0 90 arc 60 780 24 90 180 arc 60 60 24 180 270 arc stroke HdrPre UseKwds pop pop % convert page number to integer /PagNum PagCnt TmpS cvs def PagNumPos PagStr showStr PagNum show 65 26 moveto Tit1 show 65 808 moveto Tit2 show RestoreStates pop pop RestoreTempState /WordWid exch store grestore } def end PE %%CW,161%% %FI% %SZ%%TB,45%%FN%%L,.5% Clearly, any type of graphics can be placed on every page in this way. The graphics are placed just before the page is output. In those rare cases where the graphics must be placed before any text on the page (such as for the word DRAFT in large grey letters across the page), then the "Eject" routine would need to be altered instead, or the "showpage" operator redefined (see the file "draft.qs"). %SI%Draft%EI% %L%%P% %VM,30%%VM,-30%%W%%CW,40%%TB,0% %BD%European characters%LT% %VT,?%%CW,160%%TB,45% %SH%European Characters %EH% %SI%European characters%EI%%SI%Special characters%EI%%SI%Character codes%EI% %SC%%_,6%European/ISO Characters%EC% PostScript fonts include drawing instructions for most European characters, but these are initially inaccessible. If some of these are to be used, the Encoding Vector of the current font must be altered to add reference to them. There are several ways this could be done. %P% The approach we adopt in %IT%pdffnt.qs%RO% or %IT%isolatin2.qs%RO% is to redefine some of the characters given in Appendix C so that the number corresponding to the European characters matches the ISO Latin-1 or ISO Latin-2 encoding. This is consistent with the ISO standard, except that the Latin-1 set also contains all of the common typesetting characters. The special characters are shown in Appendix C, along with their code numbers. This example is based on Program 18 of the original PostScript blue book. %P% The file %IT%pdffnt.qs%RO% or %IT%isolatin2.qs%RO% must be sent to the printer following %IT%Qs%RO% and preceding the text to be output. The European characters would be selected using %%C,%IT%code%RO%%% within the input text, or by the document containing the 8-bit code for the Latin-1 or Latin-2 character. Eg. %L%%T,55%Br%C,252%ckner %L%would be requested using Br%%C,252%%ckner. The number to use can be determined by inspecting the numbers and character names in the PostScript text in %IT%pdffnt.qs%RO%. The appearance of the characters is shown in Appendix C. %P% The PostScript program %IT%pdffnt.qs%RO% or %IT%isolatin2.qs%RO% should typically be included at the top of a document, following the Quikscript header. It is necessary to declare which font is to be used in your document %IT%after%RO% this program. All fonts (except for %IT%Sym%RO% and %IT%Din%RO%) will be affected by this program, so that switching between fonts will retain a consistent character representation. %L%%P% %VM,80%%VM,-80%%W%%CW,40%%TB,0% %BD%Adding a new font (Outline)%LT% %VT,?%%CW,160%%TB,45% %SH%Outline Font %EH% %SI%Outline font%EI%%SC%%_,6%Outline Font%EC% It is possible in PostScript to add a new font, or define a new font based on an existing font. An example is given in the PostScript blue book of an outline font, with the centre of the characters white rather than filled. Quikscript has been set up with an extra, undefined font family for you to add an extra one of your own. It is referred to in a document with the instruction %%FN,Uft%% (for user-font). If we want to set up this font to be the outline font given in the blue book, we would include the PostScript from %IT%outlinft.qs%RO% in our document. %P% This example defines bold, italic, and italic bold versions of the font, so that all Quikscript instructions may be used with the font. The Helvetica font was used here, but other fonts could have been used if the explicit font name references in the last seventeen lines of that file are replaced with the corresponding names for the desired font. %P% Text can be output with the font in this way:%L%%T,55%%FN,Cou%%SN,10% %%SZ,14%%%%FN,Uft%% Outline font text%%FN%%%%SZ%% %L%%FN%%SN%which will print as: %PS% /MakeOutlineDict 7 dict def /MakeOutlineFont { MakeOutlineDict begin /Uniqueid exch def /Strokewidth exch def /Newfontname exch def /Basefontname exch def /Basefontdict Basefontname findfont def /Numentries Basefontdict maxlength 1 add def Basefontdict /UniqueID known not {/Numentries Numentries 1 add def} if /Outfontdict Numentries dict def Basefontdict {exch dup /FID ne {exch Outfontdict 3 1 roll put} {pop pop} ifelse } forall Outfontdict /FontName Newfontname put Outfontdict /PaintType 2 put Outfontdict /StrokeWidth Strokewidth put Outfontdict /UniqueID Uniqueid put Newfontname Outfontdict definefont pop end } def /Helvetica /HelOutline 1000 54 div /Helvetica findfont dup /UniqueID known {/UniqueID get 1 add} {pop 1} ifelse MakeOutlineFont QSdict begin Font 44 /HelOutline put end PE %SZ,14%%L,.5%%T,55%%FN,Uft%Outline font text%FN%%SZ% %L%%P% %VM,30%%VM,-30%%W%%CW,40%%TB,0% %BD%Adding a new font (Small Capitals)%LT% %VT,?%%CW,160%%TB,45% %SH%Small Capitals Font %EH% %SI%Small capitals font%EI%%SC%%_,6%Small Capitals Font%EC% Another example of adding a new font arises from the need to represent some words in capitals. If normal capitals are used, the words stand out in the surrounding text because capitals are generally wider than lower case letters. In typesetting, this is often overcome by using a smaller font for such letters. This is possible in Quikscript, but if several words are to be output, there is the risk that a new line break will come in their midst, and the line gap will be inappropriate for the surrounding text. The %%SN instruction can fix the line gap problem, but this can still cause problems in that such an instruction within a word will act as word end as far as Quikscript is concerned. %P% A better way is to define a new font based on the current font, in which lower case letters are represented with smaller capitals than the normal upper case letters. This will allow large capitals to be intermixed with the smaller capitals, as well as overcoming the word-break problem. %P% The instructions to set up the "Uft" font for small capitals is given in file %IT%smallcap.qs%RO%. This acts on the font that is current when it is executed, so if a font other than Times is to be set in small capitals, that font should be selected first before the %IT%smallcap.qs%RO% instructions are included. The small capital font can be selected at any place in the following document using the instruction %%FN,Uft%%. %P% %PS% %% Create smallcap fonts from the current font %% Uft %% Uft-Italic %% Uft-Bold %% Uft-BoldItalic % %/makescapdict 7 dict def % % % original-font new-font unique-id MakeSCapFont - %/MakeSCapFont % { % makescapdict begin % /uniqueid exch def % /newfontname exch def % /basefontname exch def % /basefontdict basefontname findfont def % /numentries basefontdict maxlength 2 add def % basefontdict /UniqueID known not % {/numentries numentries 1 add def} if % /scapfontdict numentries dict def % basefontdict % {exch dup /FID ne % {exch scapfontdict 3 1 roll put} {pop pop} ifelse % } forall % scapfontdict begin % /FontName newfontname def % /UniqueID uniqueid def % /FontType 3 def % /BasefontName basefontname def % /FontMatrix [0.001 0 0 0.001 0 0] def % /BuildChar % { exch begin % dup 97 ge 1 index 122 le and % {BasefontName findfont 700 scalefont setfont 32 sub} % {BasefontName findfont 1000 scalefont setfont} % ifelse % ( ) dup 0 4 -1 roll put % Put char in a string. % dup stringwidth setcharwidth % Set charwidth % 0 0 moveto show % end % } def % end % newfontname scapfontdict definefont pop % end % } def % %QSdict begin userdict begin %Font FontStack FontInd get 4 mul 2 add get /SmallCap %Font FontStack FontInd get 4 mul get findfont dup /UniqueID known % {/UniqueID get 5 add} {pop 1} ifelse % MakeSCapFont %Font 44 /SmallCap put end end % Create smallcap fonts from the current Quikscript font % To use this font from Quikscript, use %FN,Uft%. Bold or italic can be used % Uft % Uft-Italic % Uft-Bold % Uft-BoldItalic % original-font new-font unique-id MakeSCapFont - /MakeSCapFont { 10 dict begin /UniqueID exch def /FontName exch def /BasefontName exch def /FontType 3 def BasefontName findfont dup /FontBBox get /FontBBox exch def dup /Encoding get /Encoding exch def /FontMatrix get /FontMatrix exch def /BuildChar { exch begin dup 97 ge 1 index 122 le and {BasefontName findfont 700 scalefont setfont 32 sub} {BasefontName findfont 1000 scalefont setfont} ifelse ( ) dup 0 4 -1 roll put % Put char in a string. dup stringwidth setcharwidth % Set charwidth 0 0 moveto show end } def FontName currentdict end definefont pop } def QSdict begin userdict begin Font FontStack FontInd get 4 mul get /SmallCap Font FontStack FontInd get 4 mul get findfont dup /UniqueID known {/UniqueID get 5 add} {pop 1} ifelse MakeSCapFont Font FontStack FontInd get 4 mul 2 add get /SmallCap-Bold Font FontStack FontInd get 4 mul get findfont dup /UniqueID known {/UniqueID get 7 add} {pop 2} ifelse MakeSCapFont Font FontStack FontInd get 4 mul 1 add get /SmallCap-Italic Font FontStack FontInd get 4 mul get findfont dup /UniqueID known {/UniqueID get 9 add} {pop 3} ifelse MakeSCapFont Font FontStack FontInd get 4 mul 3 add get /SmallCap-BoldItalic Font FontStack FontInd get 4 mul get findfont dup /UniqueID known {/UniqueID get 11 add} {pop 4} ifelse MakeSCapFont Font 44 /SmallCap put Font 45 /SmallCap-Italic put Font 46 /SmallCap-Bold put Font 47 /SmallCap-BoldItalic put end end PE Using this example, the text %SZ,20%%L%%T,55%%FN,Uft%PostScript%FN%%L%%SZ% would be achieved by embedding the program segment in %IT%smallcap.qs%RO% in the document %IT%after%RO% the initial font selection, and representing the text with %%FN,Uft%%PostScript%%FN%%. %L%%P% %VM,30%%VM,-30%%W%%CW,40%%TB,0% %BD%Adding a new font family%LT% %VT,?%%CW,160%%TB,45% %SI%Font family%EI% The names of fonts in Quikscript are set in two tables: "Font" contains the PostScript names of the fonts that are available, and "FontNam" contains the abbreviations by which they are known in a Quikscript document. The names in Font come in groups of four for the different styles, and there must always be four font names for each family, whether there are actually four fonts or not. At the end of these tables there are three spare slots for abbreviations, named Uft, U2 and U3, which have corresponding dummy names in the Font table. To install one of the fonts described above in Quikscript, the names in the table are replaced with the newly created font names. %P% Quikscript contains a procedure, "AddFont", which simplifies registering a Quikscript abbreviated name and the associated internal font names. This procedure adds the names to the "Font" and "FontNam" tables. %P% For example, a family that is widely used is called CharterBT. If this family was to be given the abbreviation "Cht", the following PostScript might be used at the head of a document: %\%%L,.5%%SZ,10%%FN,Cou%%TB,55%%NF%%%PS%% %\%QSdict begin %\% %\% FontNam 11 (Cht) put %TR,100%%FN%%IT%%RL%Replace "Uft" with "Cht"%RO%%FN% %\% %FN%%IT%%RL%Replace the font names in Font%RO%%FN% %\% Font 44 /CharterBT-Roman put %\% Font 45 /CharterBT-Italic put %\% Font 46 /CharterBT-Bold put %\% Font 47 /CharterBT-BoldItalic put %\%end %L,.5%%SZ,10%%FN,Cou%%TB,55%%NF%%%PS%% QSdict begin (Cht) /CharterBT-Roman /CharterBT-Italic /CharterBT-Bold /CharterBT-BoldItalic AddFont end %FN%%IT%%RL%The actual font definitions are put here%RO%%FN% %W,1%%%%T,?1% include fonts/Charter-Bold%% %W,1%%%%T,?1% include fonts/Charter-Roman%% %W,1%%%%T,?1% include fonts/Charter-Italic%% %W,1%%%%T,?1% include fonts/Charter-BoldItalic%% PE %FI% %TB,45%%FN%%SZ%%L,.5% The internal names of the fonts must be found from within the font files, which must be included in the document to be printed. The program %IT%catex.c%RO% (see below) is a useful tool to pull the font files into the document only when they are required. %L%%P% %VM,L9%%VM,L-9%%W%%CW,40%%TB,0% %BD%Embedded graphics%LT% %VT,?%%CW,160%%TB,45% %SH%Embedded Graphics %EH% %SI%Graphics embedded%EI%%SI%Embedded graphics%EI%%SI%Horizontal line%EI% %SC%%_,6%Embedded Graphics%EC% Graphics can be output. To place a solid horizontal line from the current position:%L,.5%%FN,Cou%%SZ,10%%TB,50% %NF%%%PS%% gsave 80 MM 0 rlineto .5 MM setlinewidth stroke grestore PE %%L%% %FI% %SZ%%TB,45%%FN%%L,.5% is a simple example. After a %%L%%, it will produce:%L% %PS% gsave 80 MM 0 rlineto .5 MM setlinewidth stroke grestore PE %P% %SI%Currentpoint%EI% Any PostScript can be included in this way. If the embedded PostScript leaves a current point in the graphics state (such as by gsave/grestore as in the example above or by an explicit moveto at the end), that point will be used for placing following text on the page. If there is no current point, the last current point known to Quikscript will be used for following text. %P% %SI%Stack%EI% It is important that embedded PostScript should not remove any items from the stack. Some state information is held on the stack for when Quikscript resumes. New items may be left on the stack by the embedded Postscript, and Quikscript will simply discard them. %L%%P% %VM,30%%VM,-30%%W%%CW,40%%TB,0% %BD%External Illustration%LT% %VT,?%%CW,160%%TB,45% %SH%External Illustration %EH% %SI%Including graphics%EI%%SC%%_,6%External Illustration%EC% In general it is possible to include any PostScript drawing instruction anywhere in a Quikscript document. The most common need is to insert an illustration that has been created with some external drawing package or image scanner. %P% The general procedure is to move to a suitable place on the page, move the origin so that the illustration does not interfere with text on the page, output the illustration, and then restore normal Quikscript text processing. %P% The general form is:%L,.5%%FN,Cou%%SZ,10%%TB,50% %NF%%%VM,100%%%%PS%% gsave currentpoint translate %FN%place the PostScript illustration here%FN% grestore PE %FI% %SZ%%TB,45%%FN% %P% The distance moved with the %%VM would have to be sufficient for the size of the illustration. Also, the "currentpoint translate" assumes that the illustration is set up to appear at the lower-left corner of a page. Any other placement would require another "translate", which may have to be established by trial and error. %P%%SI%EPS files%EI% It is important that PostScript instructions included in this way be "encapsulated PostScript", that is, instructions that are capable of being embedded within another document. This PostScript is not allowed to include instructions that have irreversible effects on the state of the current page being output, such as "initgraphics" or "erasepage". It is common for packages generating illustrations to include a "showpage" at the end. This is not in breach of encapsulated PostScript rules, for this makes it possible to print an EPS file by itself. However, it assumes that either the call to "showpage" at the end of the illustration must be removed, or "showpage" must be disabled before including the illustration in a document. In the latter case, "showpage" would need to be re-enabled after the illustration for Quikscript to continue to work properly. %L,.5%%FN,Cou%%SZ,10%%TB,50% %NF%%%VM,100%%%%PS%% /QsEPSsave save def currentpoint translate /showpage {} def %FN%place the unmodified EPS illustration here%FN% QsEPSsave restore PE %FI% %SZ%%TB,45%%FN% %P% Because this arises so often in document preparation, a couple of procedures have been added to Quikscript to reduce typing in a document: %L,.5%%FN,Cou%%SZ,10%%TB,50% %NF%%%VM,100%%%%PS%% EPSstart %FN%place the unmodified EPS illustration here%FN% EPSend PE %FI% %SZ%%TB,45%%FN% %L%%P% %VM,30%%VM,-30%%W%%CW,40%%TB,0% Guidelines for Embedding PostScript %VT,?%%CW,160%%TB,45% %SH%Advice for Embedding PostScript %EH% %SI%Embedded PostScript, guidelines%EI% With the construction %L%%TB,55%%%PS%% %L%%IT%embedded PostScript%RO% %L%PE %TB,45%%L% the PostScript interpreter itself will commence reading input from the start of the line following the %%PS%%. Any text following %%PS%% on the same line will be ignored. PE is defined as a PostScript procedure to reinvoke Quikscript. It must not be followed by any other text on the same line. %P% It is possible to redefine any of the Quikscript procedures or values, intentionally or accidentally. If only graphic output is intended without any side-effects, it is safest to bracket your PostScript with "gsave" and "grestore" commands. This will ensure that the current position is not lost in the PostScript, and that any font, colour, or line thickness changes are local to the embedded PostScript. %P% To protect against accidental changes to Quikscript procedure or variables, they are all isolated in a separate dictionary, %IT%QSdict%RO%. If you wish to change Quikscript from within embedded PostScript, you should have a PostScript instruction %L%%T,55%%FN,Cou%%SN,10% QSdict begin %L%%FN%%SN%after %%PS%%, and %L%%T,55%%FN,Cou%%SN,10% end %L%%FN%%SN%before PE, as was shown in the "Special page annotation" section above. Alternatively, the other form of embedded PostScript %L%%T,55%%FN,Cou%%SN,10% %%PS instructions %% %L%%FN%%SN%should be used. %L%%P% %VM,30%%VM,-30%%W%%CW,40%%TB,0% %BD%Embedding Quikscript in a PostScript file%LT% %VT,?%%CW,160%%TB,45% %SH%Qs within PostScript %EH% %SI%Embedding Quikscript%EI%%SI%Advertisement example%EI% %SC%%_,6%Embedding Quikscript%EC% Occasionally, it is better to embed Quikscript and the text within a PostScript file. An example of this is to prepare an advertisement, where the bounds of the area are fixed, there are graphics on some of the borders, and the text content needs to be neatly laid out within it. %VM,120%%T,55% %PS% gsave currentpoint translate /Width 67 MM def /Depth 120 MM def 0 0 moveto Width 0 lineto Width Depth lineto 0 Depth lineto closepath clip newpath 0 setgray gsave 0.1 setlinewidth 3 Depth 20 sub moveto 7.5 2.5 25 {/Palatino-Bold findfont exch scalefont setfont gsave (Qs)dup stringwidth pop 0.5 mul 0 rmoveto true charpath gsave 1 setgray fill grestore stroke grestore}for (Qs) dup stringwidth pop 0.5 mul 0 rmoveto show ( Consulting) show grestore Width Depth 30 sub dup 0 exch moveto lineto Width Depth lineto 0 Depth lineto closepath 2 setlinewidth stroke 0 0 moveto 20 0 lineto 0 Depth 30 sub dup 20 exch lineto lineto closepath fill gsave /Palatino-Bold findfont [0 17 -17 0 0 0] makefont setfont 1 setgray 15 5 moveto (PostScript, Java, X-Windows solutions) show grestore grestore PE %W%%TB,65%%CW,120.9%%VM,-100%%PS /IlGap 1.1 store % %FN,Hel%%SZ,15%%CT%%BD%Document Preparation Assistant%SZ% %SZ,11%%L,.5%Innovative Designer%LT%%SZ% %SZ,8.1%%P,,3,-.7%%FJ% Qs Consulting is a small company specializing in electronic delivery of documents and graphical software. It handles classified advertising by designing corporate layouts using PostScript, and can deliver advertisements to newspapers and magazines electronically within one day of receipt of advertising content. %P% A person is sought who can assist in liaising with corporate clients, writing PostScript programs to represent logos and other graphical elements of advertisements that convey corporate style. The person will deal with the client regularly in advertisement preparation. There is also scope for work in Java in preparing WWW advertisements containing animations. %P% The successful applicant should be competent in writing PostScript, and desirably in Java as well. Social skills in dealing with clients should be of a high level. %P% An attractive salary package will be negotiated. Applications should be sent to: Qs Consulting, 8 Lavan Pl, Evatt, ACT 2617 (Fax: 6268 8581) by 25th February. %SZ%%FN%%LJ% %TB,45%%CW%%VT,?%%PS /IlGap 1.17 store %%PF,0,0,0% %P% This can be achieved with:%L,.5%%VM,L6%%VM,L-6%%FN,Cou%%SZ,10%%TB,50% %NF,10% %%!PS-Adobe-3.0 EPSF-3.0 %%%%BoundingBox: 0 0 190 340 /MM {72 mul 25.4 div} def /Width 67 MM def %FN%%IT%%RL%Dimensions of whole area%FN%%RO% /Depth 120 MM def gsave %FN%%IT%%RL%Clip to boundary, for safety%FN%%RO% 0 0 moveto Width 0 lineto Width Depth lineto 0 Depth lineto closepath clip newpath 0 setgray gsave %FN%%IT%%RL%Place graphics at top%FN%%RO% 0.1 setlinewidth 3 Depth 20 sub moveto . . . Width Depth 30 sub dup 0 exch moveto lineto Width Depth lineto 0 Depth lineto closepath 2 setlinewidth stroke grestore %FN%%IT%%RL%Place graphics at side%FN%%RO% 0 0 moveto 20 0 lineto 0 Depth 30 sub dup 20 exch lineto lineto closepath fill gsave /Palatino-Bold findfont [0 17 -17 0 0 0] makefont setfont 1 setgray 15 5 moveto (PostScript, Java, X-Windows solutions) show grestore %W,1%%%%T,?1% include Qs%%%FN%%IT%%RL%Place Quikscript at this point%FN%%RO% %FN%%IT%%RL%Set margins and currentpoint according to size and graphics%FN%%RO% %%PM,10,,,1%% %%PS /RgtCol Width 3 sub store /IlGap 1.1 store %% %%PS LftCol Depth 58 sub moveto%% %FN%%IT%%RL%Now the text to be typeset%FN%%RO% %%FN,Hel%%%%SZ,15%%%%CT%%%%BD%% Document Preparation Assistant %%SZ,11%%%%L,.5%%Innovative Designer%%LT%% %%SZ,8.1%%%%P,,3,-.7,0%%%%FJ%% Qs Consulting is a small company specializing in electronic delivery of . . . (Fax: 6268 8581) by 25th February. %FN%%IT%%RL%Finally return to normal PostScript processing%FN%%RO% %%PS%% cleartomark pop grestore %FN%%IT%%RL%Turn off clipping which was set above%FN%%RO% %%showpage %FN%%IT%%RL%May be wanted%FN%%RO% %TB,45%%FN%%SZ%%FI% %P%%L% %NP%%TB,0%%BD%%SZ,16% %CL%Appendix A: Quikscript Instructions Reference Manual %SZ%%LT% %SH%Appendix A: Instructions Summary %EH% %SI%Summary of layout markers%EI%%SI%Layout markers summary%EI% %SC%Appendix A: Instructions Summary%EC% %P,0,0%%PF,,,-.5%%TB,35%%T,0%%%BC,%IT%col1,col2,r,g,b%RO%%% %TR,35%Set the background colour in a table for the range of columns from %IT%col1%RO% to %IT%col2%RO%. The first column is column 1. %IT%r,g,b%RO% must be in the range from zero to one in value. %SI%%%BC%EI%%SI%Column colour%EI%%SI%Colour%EI%%SI%Background colour%EI% %P%%T,0%%%BC,%IT%col1,col2%RO%%% %TB,35%Turn off the background colour in the table for the range of columns from %IT%col1%RO% to %IT%col2%RO%. %P%%T,0%%%BC%% %TB,35%Turn off the background colour in the table. %P%%T,0%%%BD%% %TB,35%%BD%Bold%LT% typeface. To undo this command, use %%LT%%. %SI%%%BD%%%EI%%SI%Bold%EI% %P%%T,0%%%BG,%IT%r,g,b,left,right%RO%%% %TR,35%Set the background colour for a block of text. %IT%r,g,b%RO% must be in the range from zero to one in value. The background will be set from the normal left margin minus %IT%left%RO% to the normal right margin plus %IT%right%RO%. These two distances are interpreted as millimeters; if they are omitted, 14 pp and zero respectively will be used. %SI%%%BG%EI%%SI%Background colour%EI%%SI%Colour%EI% %P%%T,0%%%BG%% %TB,35%Turn off the background colour. %P%%T,0%%%C,%IT%number%RO%%% %TB,35%Special characters can be output by specifying the decimal value of the character in the PostScript extended ASCII table. Several numbers can be specified, separated by commas. %SI%%%C,%%%EI%%SI%Special character%EI% %PS /Times-Roman findfont 12 scalefont setfont % %L%Eg. %W,1%Dash %C,132% %FN,Cou%%SN,10%%%C,208%%%FN%%SN% %T,95%%W,2%Bullet %C,128% %FN%%SN%%%C,183%%%FN%%SN% %L%%T,?1%Minus %C,138% %FN,Cou%%SN,10%%%C,177%%%FN%%SN% %T,?2%Degrees %C,30% %FN,Cou%%SN,10%%%C,202%%%FN%%SN% %L%%T,?1%Minutes %C,180% %FN,Cou%%SN,10%%%C,194%%%FN%%SN% %T,?2%Seconds %C,28% %FN,Cou%%SN,10%%%C,205%%%FN%%SN% %L%%T,?1%Pounds %C,163% %FN,Cou%%SN,10%%%C,163%%%FN%%SN% %T,?2%Cents %C,162% %FN%%SN%%%C,162%%%FN%%SN% %L%%T,?1%Decimal point %C,183% %FN,Cou%%SN,10%%%C,180%%%FN%%SN% %L%The numbers used will change if ISO Latin-1 encoding (European Characters above) is used. See Appendix C for a list of the character codes. %L,.5% If you prefer to use octal numeric code as given in the PostScript reference manual and elsewhere, this is possible with %%C,8#%IT%number%RO%%%. %P%%T,0%%%CA,%IT%text%RO%%% %TB,35%Contents abbreviation. This defines the text which will appear left-abutted to the page number in a table of contents or index. It can be used to specify a short name or number for a chapter. Eg. %%CA,Ch.1-%% %P%%T,0%%%CL%% %TB,35%Centre the single line of text that follows between the current left margin and the current column right margin. New-line is not automatically generated (Beware!). %SI%Centred line%EI%%SI%%%CL%%%EI% %L,.5% It is also possible to request that the line be centred about a certain position, with %%CL,%IT%pos%RO%%%, the position given as MM from the left margin. %P%%T,0%%%CO%% %TB,35%Commence a cell in a new column of the table in the current row. %SI%%%CO%%%EI%%SI%Column of table%EI% %P%%T,0%%%CO,%IT%n%RO%%% %TB,35%Commence a cell in column "n" of the table in the current row, where "n" is a number such as 2, 3, etc. %P%%T,0%%%CO,%IT%n1,n2%RO%%% %TB,35%Commence a cell in column "n1" that will span the columns from "n1" to "n2" of the table in the current row, where "n1" and "n2" are numbers such as 2, 3, etc. %P%%SI%%%CT%EI%%SI%Centred text%EI% %T,0%%%CT%% %TB,35%Centre the following text between the current left and right column margins. Text will still be measured to see how many words will fit on each line, and lines will be broken accordingly unless deliberately broken by some other formating instruction. Alternatives to this are FJ, LJ, or RJ. See also CL and RL. %P%%SI%%%CW%EI%%SI%Column width%EI% %T,0%%%CW,%IT%n%RO%%% %TB,35%Column width, or more correctly, position of the right-hand column margin relative to the current left column margin, measured in millimetres. For single-column output this is no different from the page width. For single- or multi-column output, this enables local control of the right margin in the same way that %%TB controls the local left margin. %L,.5% Its effect can be undone with %%CW%%, which reverts to the previous column width. The column width can be increased or decreased by having a "+" or "%C,138%" before the number. %%CW is useful for building tables. %L,.5% This is unrelated to the "column" of a table which is specified through the %%ST and %%CO instructions. It refers to the right margin of text within an ordinary document whether the pages are multi-columnar or a single column. %P%%SI%%%DF,%EI%%SI%Dot Fill%EI% %T,0%%%DF,%IT%n,ch%RO%%% %TB,35%Dot fill using %IT%n%RO% as an optional position on the page, and %IT%ch%RO% as an optional fill-character. It has a similar effect to %%TR, but in moving rightwards to the given position, dots are placed regularly along the current line. If the number is not given, dots fill out to the right margin. If a character or numeric code is given after the number, this character is used instead of a dot. %P%%SI%%%EC%%%EI%%SI%End contents item%EI%%SI%Contents%EI% %T,0%%%EC%% %TB,35%Stop recording text for an entry in table of contents. Add the page number. See %%SC, %%PC, %%OC, %%CA. %P%%SI%%%EH%%%EI%%SI%End of header%EI%%SI%Header text%EI% %T,0%%%EH%% %TB,35%Stop recording text for the page header that will appear beside the page number. See %%SH. %P%%SI%%%EI%%%EI%%SI%End index item%EI%%SI%Index%EI% %T,0%%%EI%% %TB,35%Stop recording text for an entry in the index. Add the page number. See %%SI, %%PI, %%OI, %%CA. %P%%SI%End of table%EI%%SI%%%ET%%%EI% %T,0%%%ET%% %TB,35%End the table, restoring column margins and justification rule to the state prior to the table. Leave the current point at the lower right corner. %P%%SI%%%FI%%%EI%%SI%Filling lines%EI% %T,0%%%FI%% %TB,35%Resume the default behaviour of output line filling (after a %%NF directive). The lines of input are split into words, and output so as to fill the lines within the set margins. %P%%SI%%%FJ%%%EI%%SI%Full justification%EI% %T,0%%%FJ%% %TB,35%Set full-justification (left and right) for output of following text. Alternatives to this are LJ, RJ, or CT. See also CL and RL. %P%%SI%%%FN%EI%%SI%Changing font%EI%%SI%Font name%EI% %T,0%%%FN,name%% %TB,35%Change font family. The font name is given by a three or four letter code. Unrecognized codes will be ignored. %NF% %FN,Cou%Tim%FN% (Times) %T,90%%FN,Cou%Hel%FN% (Helvetica) %FN,Cou%Cou%FN% (Courier) %T,90%%FN,Cou%Sym%FN% (Symbol)%L,-.5% %FN,Cou%Pal%FN% (Palatino) %T,90%%FN,Cou%NewC%FN% (New Century Schoolbook) %FN,Cou%Book%FN% (Bookman) %T,90%%FN,Cou%Ava%FN% (Avant Garde) %FN,Cou%Cha%FN% (Zapf Chancery) %T,90%%FN,Cou%HelN%FN% (Helvetica Narrow) %FN,Cou%Din%FN% (Zapf Dingbats) %T,90%%FN,Cou%Uft%FN% User-defined %FI%%%FN,Tim%% (Times-Roman) is the default. Only the first four families are guaranteed to be present in a PostScript machine. %L%%T,0%%%FN%% %T,35%If no name is given, the font in use before the last change will be used. A history of up to eight fonts is maintained, allowing progressive undo of font changes to a limited extent. %L,.5% Earlier versions of Quikscript used this as a simple toggle between the two most recent fonts. This behaviour can be restored by uncommenting the line "%FN,Cou%/ToggleFont%_%true%_%def%FN%" near the head of Qs. %P%%SI%%%HL%EI%%SI%Horizontal line%EI% %T,0%%%HL%% %TB,35%Draw a horizontal line across the full width of the table below the current row, or at the top if nothing has yet been placed in the table. %P%%T,0%%%HL,%IT%n%RO%%% %TB,35%Draw a horizontal line below cell "n" of the current row, or above if the table is still empty. %P%%T,0%%%HL,%IT%n1,n2%RO%%% %TB,35%Draw a horizontal line spanning the cells "n1" to "n2" below the current row, or at the top if nothing has yet been placed in the table. %P%%T,0%%%HL%IT%n%RO%,...%% %TB,35%Each of the above forms of line instruction can include a line width "n" before the comma. %%HL2%% will give a double-width line; %%HL3,2%% will draw a triple-width line below column two. %P%%SI%%%IT%%%EI%%SI%Italic%EI% %T,0%%%IT%% %TB,35%"Italic", or %IT%slanted font style%RO%. To undo this command, use %%RO%%. %P%%SI%%%L%EI%%SI%New line%EI% %T,0%%%L%% %TB,35%Go to the start of a new line. The horizontal position is based on the left margin set by the most recent %%TB instruction, plus the paragraph body alignment. If no output has been placed on a page, %%L%% will not move down the page. %P%%T,0%%%L,%IT%n%RO%%% %TB,35%Go to a new line, leaving an extra 'n' blank lines. %%L,0%% is equivalent to %%L%%. %%L,%C,138%1%% will go to the start of the current line. Fractional line spacings are allowed. %P%%SI%Left justify%EI%%SI%%%LJ%%%EI% %T,0%%%LJ%% %TB,35%Left justify the following output text. This is the default behaviour, which is sometimes called "ragged right". Alternatives to this are FJ, RJ, or CT. See also CL and RL. %P%%SI%%%LP%%%EI%%SI%Line previous%EI%%SI%Previous line%EI% %T,0%%%LP%% %TB,35%Move to start of the previous line. In general, this could be achieved with %%L,%C,138%2%%. However, if the current position is at the top of the page, this will have undesirable consequences which %%LP%% avoids. %P%%SI%%%LT%%%EI%%SI%Light font%EI% %T,0%%%LT%% %TB,35%Light typeface, the opposite of bold. %P%%SI%%%NC%EI%%SI%Number of columns%EI%%SI%Columns, number%EI% %T,0%%%NC,%IT%number%RO%%% %TB,35%Change the following page layout to multi-columns. %IT%number%RO% is the number of columns. If this command is issued part way down a page, the multi-columnar layout commences from that position, so that text above is not overwritten. %P%%T,0%%%NC%% %TB,35%Go to the top of the next column. In single column layout, this will cause a new page. %P%%SI%%%NF%EI%%SI%No fill%EI%%SI%Code listing%EI%%SI%Preformatted text%EI% %T,0%%%NF%% %TB,35%No fill; lines input will not be reformated to fill the lines output. Each line of input will become a separate line in output. Words are still checked to ensure that they will fit in the output line, and a new line will be forced if words do not fit. This is used frequently for setting poetry, songs, program listings, addresses, and simple tables. See also %%FI%% and %%\%%. %P%%T,0%%%NF,%IT%number%RO%%% %TB,35%No fill; if input lines will not fit in the space provided, the line will be split at a word boundary, and the line continuation will be indented by %IT%number%RO% millimeters. Remembered positions can be specified with the "?" notation; see %%W below. %P%%SI%%%NP%%%EI%%SI%New page%EI% %T,0%%%NP%% %TB,35%Start a new page. If no output has been placed on the current page, no action will result. %P%%SI%%%NR%EI%%SI%New row%EI% %T,0%%%NR%% %TB,35%Start a new row of the current table, moving to the first column for following text. %P%%T,0%%%NR,%IT%number%RO%%% %TB,35%Start a new row of the current table, moving to the column indicated by the number for following text. %P%%SI%%%OC%EI%%SI%Output contents%EI%%SI%Contents%EI% %T,0%%%OC%% %TB,35%Output the text for the table of contents to the screen or standard output. See also %%PC. %P%%SI%%%OI%EI%%SI%Output index%EI%%SI%Contents%EI% %T,0%%%OI%% %TB,35%Output the text for the index to the screen or standard output. See also %%PI. %P%%SI%%%P%EI%%SI%Paragraph%EI% %T,0%%%P%% %TB,35%Start a new paragraph. The parameters of the paragraph will be the same as the previous paragraph. %L,.5% By default, paragraphs have the body aligned with the left margin; there is no first line indentation; a blank line is left between paragraphs; and a new paragraph will not start within two lines of the bottom of the page, but instead be placed at the top of the next page. %P%%T,0%%%P,%IT%n1,n2,n3,n4%RO%%% %TB,35%Start a new paragraph. Set the body alignment %IT%n1%RO% MM to the right of the current tab margin. Indent the first line relative to the body by %IT%n2%RO% MM. Set the inter-paragraph gap to one plus %IT%n3%RO% blank lines; setting %IT%n3%RO% to 0 will leave a single blank line between paragraphs, and setting %IT%n3%RO% to %C,138%1 will cause new paragraphs to commence on a new line with no intervening blank line. Set the minimum acceptable distance from the bottom of the page for the start of a new paragraph to %IT%n4%RO% MM; the default %IT%n4%RO% is 30 MM. If the distance %IT%n4%RO% is more easily measured as a number of inter-line gaps, this can be done by preceding the number with the character "L". %L,.5%Any of the numeric fields can be altered without affecting the others, by simply not providing numbers for the unchanging field. Eg. %%P,,,%C,138%1%% will go to a new paragraph, leave unchanged the body alignment and first line indentation, and set the inter-paragraph gap to zero (1%C,138%1) lines. %L,.5% Typical uses of these controls are:%L% %%P,,10%% %TB,60%will cause paragraphs to have their first lines indented by 10 MM, but normal body alignment.%L%%T,35% %%P,20,0%% %TB,60%would be used for including a quotation in a body of text. The whole quotation would be indented relative to the main text. %L%%T,35%%%P,0,0,0%% %TB,60%would restore paragraph layout to the default.%L%%T,35% %%P,15,%C,138%15%% %TB,60%would have a hanging first line. The body is indented 15 MM, but the first line is aligned with the normal margin. This is useful for references, or for drawing attention to the first word of a paragraph. %TB,35%%L,.5%If no output has been placed on a page, a new paragraph request will not move the current point down the page. %L,.5%See also %%PF to set paragraph style without commencing a new paragraph. %P%%SI%%%PC%%%EI%%SI%Print contents%EI%%SI%Contents%EI% %T,0%%%PC%% %TB,35%Print the table of contents in the document at this point. Each line of the contents will contain the markers %%DF,?%%%%RL%% before the page number. This will give a dotted line from the text to a horizontal position that must already have been set up with a %%W%%. The page number will be right-justified within the column. It may be necessary to use a narrower column (see %%CW) to improve appearance. It will also be necessary to change the current page number (%%PN) if this page is to be inserted early in the document. %P%%SI%PostScript embedded%EI%%SI%Embedded PostScript%EI%%SI%PE%EI% %T,0%PE %TB,35%Flag the end of embedded PostScript; the following text will be processed normally by Quikscript. Note the absence of %% delimiting characters. This is actually a PostScript procedure within Quikscript. %P%%SI%%%PF,%EI%%SI%Paragraph format%EI% %T,0%%%PF,%IT%n1,n2,n3,n4%RO%%% %TB,35%Modify the attributes of this and following paragraphs, but do not force a new paragraph immediately. The numbers are the same as for the %%P%% command. It is used mostly to modify the next inter-paragraph gap or the body alignment of the remainder of this paragraph, and is particularly useful in tables where the text in each cell is to commence at the top of its area, but the cells are to have different first line indentation or body alignment. %P%%SI%%%PH%EI% %T,0%%%PH,%IT%n1,n2,n3,n4%RO%%% %TB,35%This is the same as the %%P%% command, except that the minimum distance from the bottom of the page is increased to 2.5 times the normal distance. This makes it suitable before a paragraph heading, where space for the heading and some of the following paragraph must be guaranteed. %P%%SI%%%PI%%%EI%%SI%Print index%EI%%SI%Index%EI% %T,0%%%PI%% %TB,35%Print the index at this point in the document. Each item will be on a new line. Multi-column (%%NC) format should be set first to improve layout. %P%%SI%%%PM,%EI%%SI%Page margins%EI% %T,0%%%PM,%IT%l,r,t,b%RO%%% %TB,35%Set the page margins, the distance from the page edges to the text margins. By default, these are 25, 19, 25, 19 MM for left, right, top and bottom. Numbers omitted are left unchanged. Current point is not altered (so a %%VT may be needed following this at the start of a document). %P%%SI%%%PN%EI%%SI%Page numbering%EI% %T,0%%%PN%% %TB,35%Number the pages, starting at page two on the following page. %P%%T,0%%%PN,%IT%number%RO%%% %TB,35%Number the pages, starting with the given number on the current page. If the number is zero, page numbering will be disabled. %P%%SI%PostScript embedded%EI%%SI%Embedded PostScript%EI%%SI%%%PS%EI% %T,0%%%PS %IT%commands%RO%%% %TB,35%Execute the PostScript commands that follow %%PS (beware strings). %L%Eg. %FN,Cou%%SN,10%%%PS /IlGap 1.8 def%%%%SZ,12%% %FN%%SZ% %L%will cause text to be output double spaced. This means of embedding raw PostScript instructions within a document is suitable if the instructions can be fitted into a single input line. It allows access to the Quikscript procedures and variables. It is unsuitable for changing the content of text strings. (The %%SZ command is required in the above example because the line spacing is calculated from the inter-line gap and the text size, and just altering the inter-line gap factor will not directly alter line spacing.) %P%%T,0%%%PS%% %TB,35%The following input text will be interpreted as embedded PostScript by the PostScript interpreter. Anything following on the current input line is ignored. To revert to normal text processing by Quikscript, use the PE PostScript command. The Quikscript environment is no longer current, so accidental redefinition of names of Quikscript procedures or variables is prevented. If you need access to them, the Quikscript dictionary must be used, either with %L%%T,55% %FN,Cou%%SN,10%QSdict%_%begin...end%FN%%SN% %L%or %L%%T,55% %FN%%SN%QSdict%_%/%IT%name%_%value%RO%%_%put%FN%%SN% %P%%SI%%%RJ%EI%%SI%Right justify%EI% %T,0%%%RJ%% %TB,35%Right justify the following output text. Alternatives to this are FJ, LJ, or CT. See also CL and RL. %P%%T,0%%%RL%% %TB,35%The remainder of the line, or all characters up to the next positioning Quikscript command on the current input line, are to be right-justified on the output line. %P% If the text is to be right-justified to a certain position, this can be done with %%RL,%IT%pos%RO%%%, the position in MM. %P%%SI%Roman%EI%%SI%%%RO%%%EI% %T,0%%%RO%% %TB,35%"Roman", or normal vertical font style, the opposite of Italic. %P%%SI%%%SC%%%EI%%SI%Start contents item%EI%%SI%Contents%EI% %T,0%%%SC%% %TB,35%Start recording text to make an item in the table of contents. See %%EC, %%OC, %%PC, %%CA. %P%%SI%%%SH%%%EI%%SI%Start header text%EI%%SI%Header%EI% %T,0%%%SH%% %TB,35%Start recording text for the page header, to appear beside the page number. See %%EH. %P%%SI%%%SI%%%EI%%SI%Start index item%EI%%SI%Index%EI% %T,0%%%SI%% %TB,35%Start recording text to make an item in the index. See %%EI, %%OI, %%PI, %%CA. %P%%SI%%%SN%EI%%SI%Font size%EI% %T,0%%%SN,%IT%number%RO%%% %TB,35%Set the font height in printer's points, but do not alter the inter-line spacing. %L%%T,0%%%SN%%%T,35%If no number is given, the size in use before the last change will be used. A history of the most recent eight sizes is maintained, allowing progressive undo of size changes to a limited extent. %L,.5% Earlier versions of Quikscript used this as a simple toggle between the two most recent sizes. This behaviour can be restored by uncommenting the line "%FN,Cou%/ToggleFont%_%true%_%def%FN%" near the head of Qs. %P%%SI%Start table%EI%%SI%%%ST,%EI%%SI%Table%EI% %T,0%%%ST,%IT%pos,pos,pos...%RO%%% %TR,35%Start a table based on the given positions that define the margins of each column. The position is measured in MM from the normal left margin, or can be remembered positions (see %%W%% below). Text following this will be placed in the first column. A trailing comma signifies the right margin of the page. See %%CO%% to change column, %%VL%% to draw vertical lines separating selected columns, %%HL%% to draw horizontal lines below a row, %%TJ%% to set the justification rule for the columns, %%NR%% to commence a new row, and %%ET%% to end a table. %P%%SI%%%SZ,%EI%%SI%Font size%EI% %T,0%%%SZ,%IT%number%RO%%% %TB,35%Set the font height in printer's points. A printer's point is 1/72 of an inch. Inter-line spacing is 1.17 times the chosen height. Default size is 12 on 14. %L%%T,0%%%SZ%%%T,35%If no number is given, the size in use before the last change will be used. A history of the most recent eight sizes is maintained, allowing progressive undo of size changes to a limited extent. %L,.5% Earlier versions of Quikscript used this as a simple toggle between the two most recent sizes. This behaviour can be restored by uncommenting the line "%FN,Cou%/ToggleFont%_%true%_%def%FN%" near the head of Qs. %P%%SI%Tab%EI%%SI%%%T,%EI% %T,0%%%T,%IT%n%RO%%% %TB,35%Move horizontally to the position, measured in millimetres, relative to the default left margin, on the current line only. It provides a local "go to". %L,.5%For details of %%T,?%%, see %%W%% below. %L%%T,0%%%T%%%T,35%If no number is given, go to the current left margin, as set in the most recent %%TB plus the current paragraph body alignment. %P%%T,0%%%T,+%IT%n%RO%%% %TB,35%Move horizontally to the position, measured in millimeters, relative to the current left margin, on the current line only. %P%%SI%%%TB,%EI%%SI%Left margin%EI%%T,0%%%TB,%IT%number%RO%%% %TB,35%Move to a new left-hand tab margin, measured in millimetres, relative to the default left margin. All following text will be set to this margin. %L,.5%Paragraph alignment will be relative to this position, so %%TB,10%%%%P,5%% will have the paragraph aligned to 15 MM from the normal left margin. %%P,5%%%%TB,10%% will have the same effect, except that the first line of this paragraph will commence 10 MM from the normal left margin, because the %%TB sets the new margin as well as an immediate repositioning. %P%For details of %%TB,?%%, see %%W%% below. %P%%T,0%%%TB%% %TB,35%Revert to the previous left margin, saving the current margin in case a %%TB%% is again encountered. %P%%T,0%%%TB,+%IT%n%RO%%% %TB,35%Move to and set a new left-hand tab margin, measured in millimeters, relative to the current left margin, remembering the old one. %P%%SI%Text colour%EI%%SI%%%TC,%EI%%SI%Colour%EI% %T,0%%%TC,%IT%r,g,b%RO%%% %TB,35%Set the colour for following text. %IT%r,g,b%RO% must be in the range from zero to one. %P%%T,0%%%TC%% %TB,35%Restore the text colour to black. %P%%SI%Table justification%EI%%SI%%%TJ,%EI% %T,0%%%TJ,%IT%chars%RO%%% %TB,35%Set the justification rule to apply to each column of the current table. The rule is specified as a lower-case character: 'l' for left justified (the default), 'c' for centred, 'r' for right-justified, and 'f' for fully justified (ie both left and right). The characters are not separated by commas. %%TJ,ccr%% would mean that the first and second columns were to be centred, and the third right-justified. %P%%SI%%%TR,%EI%%SI%Tab rightwards%EI% %T,0%%%TR,%IT%n%RO%%% %TB,35%Move horizontally rightwards to the position, measured in millimeters, relative to the default left margin, on the current line only. If the current position is already to the right of this position, do not move left; current position will be unchanged. Remembered positions can be specified with the "?" notation; see %%W below. %P%%T,0%%%TR,+%IT%n%RO%%% %TB,35%Move horizontally rightwards to the position, measured in millimeters, relative to the current left margin, on the current line only. %P%%SI%%%V%%%EI%%SI%Subscript%EI% %T,0%%%V%% %TB,35%Make the following text a subscript. It is not possible for subscripts themselves to have subscripts or superscripts. The end of the subscript is indicated by %%=%%. %P%%SI%Vertical line%EI%%SI%%%VL,%EI% %T,0%%%VL,%IT%n1,n2,...%RO%%% %TB,35%Record the table boundary positions where vertical lines are to be drawn, eg %%VL,1,2,5%% will draw vertical lines at the first, second and fifth table margins defined in the most recent %%ST instruction. Numbers can be repeated, indicating that those lines are to have double thickness: %%VL,1,1,1,5,5,5%% will place thick boundaries at the first and fifth margins, but not at intervening positions. Vertical line information is cleared by a %%ST instruction, so %%VL must be placed after the start of the table. Vertical line placement can be modified within a table. %P%%T,0%%%VL%% %TB,35%Do not draw vertical lines in the table. %P%%SI%%%VM,%EI%%SI%Vertical movement%EI% %T,0%%%VM,%IT%n%RO%%% %TB,35%Vertical move from the present position, to the start of the line the requested number of millimeters below. If the new position is below the bottom margin, go to a new page and move down the requested distance. It guarantees that an unbroken space of the requested size is left. If the current position is not at the start of a line, it will be moved to the start of the next line before moving down the requested distance. %P% If you know how many lines rather than millimeters are to be left empty, this can specified with an "L" before the number (%%VM,L%C,138%2%% will move up by 2 lines. %P% %%VM can be used to prevent widow lines at the start of a section or paragraph that might fall at the end of a page. Eg. %FN,Cou%%SN,10%%%VM,20%%%%VM,-20%%%FN%%SN% will go to the start of a line with at least 20 MM clear space below it. If there is not 20 MM at the foot of a page, it will go to the top of the next page. %P%%SI%Vertical placement%EI%%SI%%%VT,%EI% %T,0%%%VT,%IT%n%RO%%% %TB,35%Vertical tab: Go to the start of a new line at the given position from the top of the page, measured in millimeters. %P%%%VT,0%% moves to the start position on the page. This will vary in response to current font size, to prevent large text from going beyond the strict page limits. %P%It is also possible to move to a line number remembered from a %%W command using the "?" notation. %P%%SI%Where%EI%%SI%Remembering position%EI%%SI%%%W%EI% %T,0%%%W%% %TB,35%Record the X,Y coordinates of the current position for later use. The position is referred to with the character '?' in VT, T, TB, TR, DF, RL, P, PH, ST, CL or NF instructions. Eg. %%W%% at a point in a document will record the position so that %%T,?%% subsequently will tab across to the same horizontal position, and %%VT,?%% will move to the same vertical position. In use with %%P, only the body alignment can be set this way. %P%%T,0%%%W,%IT%number%RO%%% %TB,35%Record the X,Y coordinates of the current position, to be identified with the given number. It may be referred to in VT, T, TB, TR, DF, RL, P, PH, ST, CL or NF instructions with '?%IT%number%RO%'. %P%Eg. Very simple tables can be set up by defining tab positions, say at 10 MM, 50 MM, and 100 MM. These positions are recorded with %L% %FN,Cou%%SN,10%%%T,10%%%%W,1%% %%T,50%%%%W,2%% %%T,100%%%%W,3%%%FN%%SN% %L%The data in the table is then set by referring in turn to the positions as %L% %FN,Cou%%SN,10%%%T,?1%% %%T,?2%% %%T,?3%%%FN%%SN% %L%If a column is subsequently found to be too narrow, it can be widened by changing the numbers in the one line where the settings are recorded. %P% In general, the %%ST method of creating a table is greatly superior to simple use of remembered positions. Up to fifty positions can be remembered in this way. %P%%SI%%%\%%%EI%%SI%Comments within document%EI% %T,0%%%\%% %TB,35%Ignore any following text on the line. This enables comments to be included in a document. If "no fill" (%%NF) applies, treat the following line as a continuation of the current one. %P%%SI%%%_%EI%%SI%Non-breaking space%EI% %T,0%%%_%% %TB,35%Output a blank character, and do not allow the space to be the place where a line break occurs. Sometimes, spaces are wanted within a word, eg. a telephone number 268%_%8111. To ensure that no line break occurs at the gap, it is represented by %FN,Cou%%SN,10%268%%_%%8111%FN%%SN%. If more than one space is wanted, a number may be given: eg. %%_,3%%. %P%%SI%%%^%%%EI%%SI%Superscript%EI% %T,0%%%^%% %TB,35%Make the following text a superscript. It is not possible for superscripts themselves to have subscripts or superscripts. The end of the superscript is indicated by %%=%%. %P%%SI%%%=%%%EI% %T,0%%%=%% %TB,35%Return to normal size and position after super- or subscript. %P%%SI%%%%EI% %T,0%%%%% %TB,35%Output a %% symbol. Whatever character is used to mark Quikscript layout instructions (%% by default), then repeating the character enables it to be output in ordinary text. %P% In many situations, a single %% can be typed and it will be treated as a single character to be output. However, Quikscript will look at the next character to see if it can be interpreted as a layout command, and if so, all following characters up to the next %% will be taken to be part of that command. %TB,0% %L,-.5%%P% Any of the parameters or procedures of Quikscript may be altered, either in the original program, or within a text document using embedded PostScript. They are all held in the %IT%QSdict%RO% dictionary. The ones most eligible for change are: %TB,35%%P% %SI%IlGap%EI%%SI%Inter-line spacing%EI% %T,0%IlGap %T,35%The inter-line gap factor, by default set to 1.17. As mentioned in the example in %%PS above, changing this number must be followed by a %%SZ command in order to take effect. %P% %SI%Page heading%EI%%SI%PagStr%EI% %T,0%PagStr %T,35%The text string output with page numbers. By default, this is (Page%_%). This is changed by putting text between %%SH%% and %%EH%% layout markers, or with the %%PS%% form of embedded PostScript: %L%Eg. %W%%TB,?%%FN,Cou%%SN,10%%%PS%% %L%QSdict /PagStr (Technical Report ) put %L%PE%FN%%SN%%TB,35% %P% %SI%Length of page%EI%%SI%PagLen%EI% %T,0%PagLen %T,35%Length of the piece of paper. 297 MM for A4 paper, but if the output is to be in landscape mode, 210 MM; 280 MM (11 Inch) for US letter, or 217 MM (8.5 Inch) in landscape mode. %P% %SI%Width of page%EI%%SI%PagWid%EI% %T,0%PagWid %T,35%Width of the piece of paper. 210 MM for A4 paper, but if the output is to be in landscape mode, 297 MM; 217 MM (8.5 Inch) for US letter, or 280 MM (11 Inch) if output is in landscape mode. It is used initially to calculate the printable width, establishing the left and right margins. Subsequently, printable width is set within a document with the %%PM command. %P% %SI%Gap between columns%EI%%SI%ColGap%EI% %T,0%ColGap %T,35%Width of the gap between columns in a multi-column output. 5 MM by default. %P% %SI%Keyword character%EI%%SI%Esc%EI% %T,0%Esc %T,35%The character for delimiting layout instructions. In this document we have used %%, but any ASCII character could be used, printable or otherwise. Printable characters are usually easier to edit in a text document. However, care is then needed if that character is likely to occur in the natural text and be misinterpreted as part of a layout instruction. Non-printable characters can be used, but are hard to edit unless the editor is able to display them in some way. %P% %SI%Font for page header%EI%%SI%HdrPre%EI% %T,0%HdrPre %T,35%The font style and size for the page number and associated text. By default, it is defined with: %L%%FN,Cou%%SN,10%/HdrPre (%%FN,Tim%%%%SZ,12%%%%RO%%%%LT%%) def%FN%%SN% %P% %SI%New page procedure%EI%%SI%Eject%EI% %T,0%Eject %T,35%The procedure that is called to go to a new page. The default procedure is as follows: %L%%FN,Cou%%SN,10%%VM,L2%%VM,L-2%/Eject %L% { PrPagNum showpage NCol 1 gt {SetCol} if ToTop } def %L%%FN%%SN%PrPagNum is the procedure called to increment the page number, and output it with a piece of text at the top of the page if the flag NumberIt is true. %L,.5% If the number of columns is greater than 1, routine SetCol is called to ensure that output will commence in the left-most column. Finally, in procedure ToTop, the starting position is set to the top of the page. %NP%%TB,0%%BD%%SZ,16% %CL%Appendix B %C,132% Quikscript Files %SZ%%LT% %SH%Appendix B: Quikscript Files %EH% %P% %SI%Files with Quikscript%EI%%SC%Appendix B: Quikscript Files%EC% All ".qs" files described below should follow the Qs file and either precede the document, or be included within the document at the appropriate position. %P,50,,-.5% %T,0%Qs %T%The Quikscript program. %P% %T,0%stdcodes %T%A text file containing the numeric codes and names of all the special characters in standard PostScript fonts. %SI%Character codes%EI% %P% %T,0%rotate.qs %T%The PostScript program to modify Quikscript to rotate every page so that output is in landscape format rather than portrait format.%SI%Rotate%EI%%SI%Landscape%EI% %P% %T,0%draft.qs %T%The PostScript program to modify Quikscript so that each page will be drawn with the word "DRAFT" added in large shadow letters across the page.%SI%Draft%EI% %P% %T,0%border.qs %T%Example PostScript routine to modify Quikscript, adding a border with rounded corners to each page.%SI%Border drawing%EI% %P% %SI%European characters%EI%%SI%PDF font%EI%%SI%ISO-Latin1 encoding%EI% %T,0%pdffnt.qs %T%The PostScript program to modify the character encodings of the standard PostScript fonts so that western European characters are available using the correct ISO character codes. This differs from the standard ISOLatin1Encoding in that typesetting characters like ellipsis, trademark, florin, dagger, bullet which are not included in the ISO set are also provided. %P% %SI%ISO-Latin2 encoding%EI%%SI%Czech characters%EI%%SI%Polish characters%EI% %T,0%isolatin2.qs %T%The PostScript program to modify the character encodings of the standard PostScript fonts so that they use an ISO-Latin-2 encoding vector. Composite characters are created from the accent marks and the base characters. %P% %T,0%outlinft.qs %T%The PostScript program to set up a Helvetica font which draws characters in an outline form.%SI%Outline font%EI% %P% %T,0%smallcap.qs %T%The PostScript program to set up a version of the current font with lower case letters drawn as small capitals. %SI%Small capitals font%EI% %P% %T,0%dijkstra.qs %T% A cute font imitating a person's handwriting, good for hand-written correspondence that you can type at the keyboard! (Original obtained from the network.) %SI%Dijkstra font%EI% %P% %T,0%altpagnm.qs %T%The PostScript routine to change the Quikscript behaviour to alternate page numbering from left to right side of page. It is also necessary to include %%PN%% for page numbers to appear.%SI%Alternating page number%EI% %P% %T,0%cntpagnm.qs %T%The PostScript routine to change the position of page numbers so that they will be centred at the top of the page. It is also necessary to include %%PN%% for page numbers to appear.%SI%Centred page number%EI% %P% %T,0%pagrange.qs %T%Restrict the pages output to those between certain limits specified in the file. The file must be edited each time it is used to set the desired limits. %SI%Page range%EI%%SI%Range of pages%EI% %P% %T,0%2col.qs, 3col.qs %TR%Print the document on a landscape page in two or three columns, suitable for producing a simple leaflet. %SI%Leaflets%EI%%SI%Three-column leaflet%EI%%SI%Two-column leaflet%EI% %P% %T,0%2colleaf.qs %T%Print the document in two columns suitable for folding as a simple leaflet. The paper will need to be trimmed at the trim marks. %P% %T,0%3narrowcols.qs %T%Print the document on a portrait page in three narrow columns, using Courier font and No-Fill mode, printing the text exactly as it is in the file. %P% %T,0%2p.qs, 2pend %T%Print the document two pages per sheet, side-by-side. File "2pend" should be concatenated to the end of the document to ensure that nothing is missing from the last page.%SI%Two pages per sheet%EI% %P% %SI%Catex%EI%%SI%%% include %EI% %T,0%catex.c %T%A version of the UNIX %IT%cat%RO% command that concatenates several files into one and writes the result to standard output. This version examines the content of every file, looking instructions to include other files at that point. It allows macros to be defined, simplifying the preparation of Quikscript documents. It also allows the current date to be generated automatically. It is described more fully below. %P% This is an extremely useful tool with Quikscript since it removes the necessity for including the above PostScript pieces explicitly in every document that uses them. It also enables PostScript drawing instructions for externally prepared diagrams to be held as separate files, rather than being embedded within the document where they will ultimately appear. If the included file is modified, the whole document will automatically reflect the change when next printed. %P% %SI%Catm%EI%%SI%Mail merge%EI% %T,0%catm.c %T%An embellishment of "catex.c" suitable for performing a mail merge on a set of files. As well as including the functionality of "catex.c", it allows a set of fields to be defined, and will make multiple copies of a set of files, substituting the different values for the fields in each copy. %P% The most common use for this is in preparing a letter in which references are made to "fields" such as name, address, appellation, etc, and having a separate file containing the text for the fields for each intended recipient. %P% The first argument when running "catm" is the "fields" file, defining the names of the fields and a series of values for the fields to be used when "catm" repeatedly copies the remaining files to standard output. "catm" is described in more detail below. %P% %SI%Notab%EI%%SI%TAB removal%EI% %T,0%notab.c %T%A simple filter program to replace tabs with a sensible amount of white space. %P% %SI%Macros%EI% %T,0%macros.qs %T%Example of how macros can be used with %IT%catex%RO% or %IT%catm%RO%. This example shows how to set up a structured document containing sections, dot-lists, and hanging first line lists which can be embedded. %P% %SI%QstoHTML%EI%%SI%HTML%EI% %T,0%QstoHTML.java %T%Quikscript documents can be converted to HTML format if they need to be displayed with a web browser. %P% %T,0%QstoHTML.class, EditBuffer.class, OctalString.class %TR%The three files comprise the binary version of QstoHTML.java. Execute the first with a Java virtual machine. %P% %SI%Epstopnm%EI% %T,0%epstopnm %T%A Unix script for converting an EPS file into a PNM image. This is most useful as a step in handling illustrations when a Quikscript document is to be converted into HTML. It relies on ghostscript being available to do the work. %P% %SI%Epstogif%EI% %T,0%epstogif %T%A Unix script for converting an EPS file into a GIF image. It uses epstopnm, and relies on ghostscript and pbmplus or netpbm being installed. %P% %SI%sortIndex%EI%%SI%avlsort%EI% %T,0%sortIndex.java, avl.java, sortindex.c, avlsort.c %TR%If Quikscript documents output an index to the output screen when run in a PostScript interpreter, the index can be externally sorted with either the C or Java sort program. This is most useful if the document is organized into several separate chapters or sections, where the indexes from each section will need to be merged into a single index. %P% %T,0%sortIndex.class, AVLnode.class, AVLsortable.class, IndexItem.class, AVLtree.class %L%%TR%The five files comprise the binary version of the Java program to sort an index. Execute %IT%sortIndex%RO% with a Java virtual machine. %P% %T,0%userdoc.qs %T%This document. To print this document, you should send Qs and this document to a PostScript printer. %TB,0%%PH,0,0,0%%NP% %SI%Catex%EI%%SI%%%include%EI%%SI%%%DM%EI%%SI%%%M%EI%%SC%%_,6%catex%EC% %BD%%SZ,15% catex %LT%%SZ% (Concatenate and expand files) %SH%Appendix B: Quikscript Files (catex) %EH% %P,10% This C program requires the names of one or more files as arguments, and will copy each of them in turn to standard output, eg %L%%FN,Cou%%SN,10% catex file1 file2 >tempfile %L%%FN%%SN% The single file ("tempfile" in this case) will contain the contents of "file1" and "file2". In the process of copying the files, certain special text strings are scanned for and processed without copying verbatim. %PH% %T,5%%BD%File inclusion%LT%%P% If the string %W,1%%FN,Cou%%SN,10%%%%T,?1% include %IT%name%RO%%%%FN%%SN% is found, the name is interpreted as a file name; reading of the original file is suspended, and the new file is inserted in the output stream. %P% A file being included will itself be checked in the same way as the original file for occurrences of instructions such as %W,1%%FN,Cou%%SN,10%%%%T,?1% include %IT%newname%RO%%%%FN%%SN% and such new files will be inserted appropriately. Calls to include files can be nested to any depth. %P% A file-name is interpreted relative to the file from which it was called, and simple names are interpreted as being in the same directory. Names beginning with '..' are interpreted as being in a higher level directory. %PH% %T,5%%BD%Current date%LT% %P% A string %W,1%%FN,Cou%%SN,10%%%%T,?1% DATE%%%FN%%SN% within a file will be replaced by the current local date. %PH% %T,5%%BD%Macro definition and invocation%LT% %P% Macros can be defined using the form %W,1%%FN,Cou%%SN,10%%%%T,?1% DM,name:string:%%%FN%%SN%, and such strings will not be copied to the output. These set up text substitutions that will apply to the remainder of the document. %P% Such macros can be invoked with %FN,Cou%%SN,10%%%M,name%%%FN%%SN%, so that this text will be replaced by the string in the definition. Invocation is recursive, by which I mean that the replacement text is not simply copied directly to standard output, but instead is processed as the input stream. Within this replacement text may be other macro invocations (%FN,Cou%%SN,10%%%M%IT%,othername%RO%%%%FN%%SN%), new macro definitions, or %W,1%%FN,Cou%%SN,10%%%%T,?1% include..%FN%%SN% directives. (A macro cannot be redefined within its own body; our simple syntax will not allow colons to appear in the 'string' part of a definition). %P% A situation where macros might be useful is if we wanted to use two paragraph styles within the one document. Paragraphs have four attributes, the body alignment, the first line indentation, the inter-paragraph gap, and the minimum distance from the bottom of the page for the start of a new paragraph. If we needed to use the style of paragraph with indented first line for most of the document, but in some areas to switch to a hanging first line style for numbered points, we could define two macros for each style: %L%%T,20% %W,1%%FN,Cou%%SN,10%%%%T,?1% DM,Num:%%P,15,-10,-.5%%:%%%FN%%SN% %L%%T,20% %W,1%%FN,Cou%%SN,10%%%%T,?1% DM,Par:%%P,0,5,0%%:%%%FN%%SN% %L%Then to commence a normal paragraph, we would use %%M,Par%%, and commence a numbered paragraph, %%M,Num%%. The parameters of the two styles would be defined once, and we could switch between the two styles as needed without needing to remember to reset the parameters of the original style at the end of a section. %P% Similar styles can be set up for section titles, where a little extra space before the title, a change in font size and paragraph style, and the use of bold will be used systematically for all headings throughout the document. %L%%T,20% %W,1%%FN,Cou%%SN,10%%%%T,?1% DM,Head:%%L%%%%SZ,16%%%%PH,0,0,0%%%%BD%%:%%%FN%%SN% %L%%T,20% %W,1%%FN,Cou%%SN,10%%%%T,?1% DM,Body:%%SZ,11%%%%P,0,0,0%%%%LT%%:%%%FN%%SN% %P% A file is provided (macros.qs) which contains a set of macro definitions that are useful for structured documents, with lists possibly containing sub-lists. In this way, a layout style can be established in the one place, so that measurements of offsets or indentations do not need to be actually used within the document. %PH,0,0,0%%NP% %SI%Catm%EI%%SI%Mail merge%EI%%SC%%_,6%catm%EC% %BD%%SZ,15% catm %LT%%SZ% (Concatenate, merge, and expand files) %SH%Appendix B: Quikscript Files (catm) %EH% %P,10% Usage: %L%%FN,Cou%%SN,10% catm [-f %FN%%IT%fname%RO%%FN%] [-s %FN%%IT%char%RO%%FN%] [-e %FN%%IT%end-of-page-text%RO%%FN%] %FN%%IT%listfile%RO%%FN% %FN%%IT%file2%RO%%FN% %FN%%IT%file3%RO%%FN% >%FN%%IT%tempfile%RO%%FN% %L%%FN%%SN%or %L%%FN,Cou%%SN,10% catm [-f %FN%%IT%fname%RO%%FN%] [-s %FN%%IT%char%RO%%FN%] [-e %FN%%IT%end-of-page-text%RO%%FN%] %FN%%IT%listfile%RO%%FN% -o %FN%%IT%file-once%RO%%FN% -r %FN%%IT%file3%RO%%FN% %FN%%IT%file4%RO%%FN% %_,10%>%FN%%IT%tempfile%RO%%FN% %L%%FN%%SN%or %L%%FN,Cou%%SN,10% catm [-f %FN%%IT%fname%RO%%FN%] [-s %FN%%IT%char%RO%%FN%] [-e %FN%%IT%end-of-page-text%RO%%FN%] %FN%%IT%listfile%RO%%FN% -o %FN%%IT%file-once%RO%%FN% -r %FN%%IT%file3%RO%%FN% %FN%%IT%file4%RO%%FN% %_,10%-o %FN%%IT%file2-once%RO%%FN% >%FN%%IT%tempfile%RO%%FN% %FN%%SN%%P% "catm" will read the first file ("%IT%listfile%RO%"), the field value file, and repeatedly copy the remaining files to standard output, performing substitutions based on information read from the field value file. "%IT%listfile%RO%" is the field values file, and will contain the names of "fields" and sets of values for them. The files repeatedly copied will be searched for references to the field names in <> brackets, and such references to a field will be replaced by the current value of this field as determined from the field value file. %P% Redirection of this output to a file or a pipe is most common. %P% The "%C,138%f" option, which must precede the "%IT%listfile%RO%", indicates that the field-names are defined in a separate file. This allows the "%IT%listfile%RO%" to contain only field values, without needing the field names to be defined at the top with the first set of fields. This file can also contain the "END=" directive described below, further enabling field content to be completely separated from "catm" processing instructions. Note that "END" is a reserved field name. %P% The "%C,138%s" option allows the field separator character to be changed from the Tab character. This only has effect if the field file is organized with multiple field values per line. %P% The "%C,138%e" option allows the value of an "END=" directive to be specified on the command-line. If field names are given as the first line of "%IT%listfile%RO%", then this option removes any need for a separate file containing this directive. If the END text contains blanks, it will need to be given in quotes. The default end text could be given with %L%%FN,Cou%%SN,10%%T,20% -e "%%NP%%%%PS%%\nQSdict begin Init ToTop end PE\n" %FN%%SN% %P% While copying the files:%P,20,-5,-.5% If the text string "%W,1%%FN,Cou%%SN,10%%%%T,?1% include %IT%file-name%RO%%%%FN%%SN%" is encountered, the file named will be included in the output at that point. If the text string %W,1%%FN,Cou%%SN,10%%%%T,?1% DATE%%%FN%%SN% is encountered, the current date will be substituted. (Include processing).%P% If the text string "<%IT%field-name%RO%>" is encountered, then it will be replaced by the current value associated with the name %IT%field-name%RO% found from the first file (%IT%listfile%RO%) in the above examples. (Field processing).%P% If the text %W,1%%FN,Cou%%SN,10%%%%T,?1% DM,%IT%name%RO%:%IT%string%RO%:%%%FN%%SN% is encountered, it will be taken as defining a macro. Wherever %FN,Cou%%SN,10%%%M%IT%,name%RO%%%%FN%%SN% is subsequently found, the text in %IT%string%RO% will be substituted. (Macro processing) %PH,15,-5,0% COMMAND ARGUMENT PROCESSING:%P,20,-5,-.5% The list of arguments is interpreted as filenames, except for the flags "%C,138%o" meaning output once, and "%C,138%r" meaning output repeatedly.%P% The first file is read and interpreted as a set of field definitions that will be applied to other files (the ones to be repeatedly output).%P% If a "%C,138%o" is encountered after the first file, it indicates that the following files are to be output directly with only "include" processing and macro processing being performed.%P% If a "%C,138%r" is encountered after the first file, it indicates that the following files are to be output repeatedly, in turn using each set of field values from the first file. That is, a set of field values is found from the first file. All files following the "%C,138%r" are output using this set of field values. Then the next set of field values is read and the process repeated. On each occasion, full "include" and macro processing is performed.%P% If neither "%C,138%o" nor "%C,138%r" are present, all files after the first are repeatedly output with field, macro and include processing. %PH,15,-5,0% FIELD PROCESSING%P,20,-5,-.5% Files for repeated processing are read in turn and copied to standard output.%P% If a string <%IT%text%RO%> is encountered in the file, where %IT%text%RO% is a field-name defined in the first file or in a "%C,138%f" field-name file, the value of the field is substituted for the string.%P% This process of substituting and copying all the remaining files is repeated for each of the groups of field definitions in the first file.%P% The simplest way to set up the fields file is to provide on the first line the names of the fields, Tab separated. Subsequent lines will then contain the values of the fields for the next version of the document being generated.%P% If the "%C,138%f" option is used, then the file specified after "%C,138%f" will be read seeking the field names, rather than expecting them at the head of the field values file. The field names will be separated by tabs or new-line characters. There may also be an END= directive. The file of fields will contain values for the fields, tab separated, in the same order as the field names.%P% When a reference to a <%IT%fieldname%RO%> is found in a document to be output, the current replacement text is treated as if it is part of the input document. As this replacement text is output, it is scanned for any macro references, "include" directives, or other field references which are processed as they are encountered. %PH,15,-5,0% INCLUDE PROCESSING%P,20,-5,-.5% If the string %W,1%%FN,Cou%%SN,10%%%%T,?1% include name%%%FN%%SN% is found at the beginning of a line, %NF% 1. the name is interpreted as a file name; 2. reading of the original file is suspended, and 3. the new file is inserted in the output stream. %FI%%P% A file being included can itself contain %W,1%%FN,Cou%%SN,10%%%%T,?1% include newname%%%FN%%SN% instructions, and such new files will be inserted appropriately. Calls to include files can be nested to any depth. (Including a file recursively will cause an infinite loop.) %P% A file-name is interpreted relative to the file from which it was called. Names beginning with '..' are interpreted as being in a higher level directory.%P% A string %W,1%%FN,Cou%%SN,10%%%%T,?1% DATE%%%FN%%SN% within a file will be replaced by the current local date. %PH,15,-5,0% MACRO PROCESSING%P,20,-5,-.5% Within a file that is to be copied to output, macros can be defined using the form %L%%W,1%%FN,Cou%%SN,10%%%%T,?1% DM,name:string:%%%FN%%SN%, and such strings will not immediately be copied to the output. These set up text substitutions that will apply to the remainder of the files as they are copied to output.%P% Such macros can be invoked with %FN,Cou%%SN,10%%%M,name%%%FN%%SN%, so that this text will be replaced by the string in the definition. Invocation is recursive, by which I mean that the replacement text is not simply copied directly to standard output, but instead is processed as the input stream. Within this replacement text may be other macro invocations (%FN,Cou%%SN,10%%%M,othername%%%FN%%SN%), new macro definitions, or %FN,Cou%%SN,10%%%include..%FN%%SN% directives. (A macro cannot be redefined within its own body; our simple syntax will not allow colons to appear in the 'string' part of a definition). %PH,15,-5,0% %BD%EXAMPLE 1:%LT% %L% The simplest way to perform a mail merge is to ignore the "field-names" file and provide a single file containing a single line with the names of the fields followed by lines giving the field values. This file, called "fields" (say), might look like: %NF,20%%FN,Cou%%SZ,8% NAME \t PERS \t ADDR1 \t ADDR2 \t ADDR3 Mr H. Bloggs \t Henry \t 360 Hindmarsh Dr \t Phillip, ACT 2616 \t Australia Ms R. McManus \t Rosemary \t 19 McWilliam Cres \t Florey, WA 6517 \t Mr GA Spence \t Mr Spence \t 40 Plenty Ave \t Lower Hutt \t New Zealand Mrs P Thomas \t Penni \t Computer Science \t ADFA \t Campbell, ACT 2600 %SZ%%FN%%FI% ("\t" means the Tab character.) %P,15,0% The second file (letter) might look like %NF,20%%FN,Cou%%SZ,10% %W,1%%%%T,?1% include ../pscode/letter.hd.qs%% %W,1%%%%T,?1% DATE%% Dear %%FI%%We are having a reunion of all students and staff who ... %FN%%SZ%%FI%%P% The Unix file "letter.hd.qs" will be found in a directory called "pscode" which is a sister directory to the directory that the file "letter" is in. %P% This letter could now be output with the Unix command%L%%FN,Cou%%SN,10%%T,20% catm fields -o Qs -r letter | lpr -Plaser %LP%%FN%%SN% %P% In this case, the output generated by this %IT%catm%RO% command will be: %NF,20%%FN,Cou%%SZ,10% %FN%Quikscript file%FN% %FN%letter.hd.qs file%FN% %FN%today's date%FN% Mr H. Bloggs 360 Hindmarsh Dr Phillip, ACT 2616 Australia Dear Henry %%FI%%We are having a reunion of all students and staff who ... %%NP%%%%PS%% QSdict begin Init ToTop end PE %FN%letter.hd.qs file%FN% %FN%today's date%FN% Ms R. McManus 19 McWilliam Cres Florey, WA 6517 Dear Rosemary %%FI%%We are having a reunion of all students and staff who ... %%NP%%%%PS%% QSdict begin Init ToTop end PE %FN%letter.hd.qs file%FN% %FN%today's date%FN% Mr GA Spence 40 Plenty Ave . . .%SZ%%FN%%FI% %PH,15,-5,0% %BD%EXAMPLE 2:%LT% %L% The names of the fields (ie. the first line in the example above) could be given in a separate file, called "fnames". %P% This letter could now be output with the Unix command%L%%FN,Cou%%SN,10%%T,20% catm -f fnames fields -o Qs -r letter | lpr -Plaser %FN%%SN% %PH,15,-5,0% %BD%EXAMPLE 3:%LT% %L% In this more challenging example, an invitation is to be sent to many people, some local, and some remote. The letter will contain name, address and personal identification as in the first example, but will also contain some tailoring of the letter content depending on where the invitee lives. %L,.5% The field values file, "fields3", could be set up as %NF,20%%FN,Cou%%SZ,7% NAME \t PERS \t ADDR1 \t ADDR2 \t ADDR3 \t WHERE Mr H. Bloggs \t Henry \t 360 Hindmarsh Dr \t Phillip, ACT 2616 \t Australia \t %%M,Local%% Ms R. McManus \t Rosemary \t 19 McWilliam Cres \t Florey, WA 6517 \t \t %%M,Remote%% Mr GA Spence \t Mr Spence \t 40 Plenty Ave \t Lower Hutt \t New Zealand \t %%M,Remote%% Mrs P Thomas \t Penni \t Dept Computer Science \t ADFA \t Campbell, ACT 2600 \t \t %%M,Local%% %FN%%SZ%%FI% %P,15,0% A second file, possibly called %IT%styles%RO%, would be set up to establish style features that were to apply to all of the letters. It might look like:%NF,20%%FN,Cou%%SZ,10% %W,1%%%%T,?1% DM,Remote:%%P%%If you would like accommodation arranged...:%% %W,1%%%%T,?1% DM,Local::%% %W,1%%%%T,?1% include dijkstra%% %%FN,Uft%% %FN%%SZ%%FI% %L% This would be included in the output once, after Qs, and before the letters. It defines the text to substitute for the %FN%%SN,10%%FN%%SN% field, and sets up the font to be used in the letters. The text following DM,Remote must all be on the one line. In this case, no alternative text is provided if the person lives locally; their letter will be shorter. %P% The letter would commence in the same way as the previous example, but would have %FN%%SN,10%%FN%%SN% at the end of a paragraph to pull in the text defined in the second file. %P% The command to print the letters would then be:%L%%FN,Cou%%SN,10%%T,20% catm fields3 -o Qs styles -r letter | lpr -Plaser %FN%%SN% %P% If the volume of text in Remote was too great to include on one line (or exceeded the input buffer size of 1024 characters), then Remote could be defined to instead include text from another file: %L%%FN,Cou%%SN,10%%T,20% %W,1%%%%T,?1% DM,Remote:%W,1%%%%T,?1% include accom.txt%%:%% %FN%%SN% %PH,15,-5,0% %BD%EXAMPLE 4:%LT% %L%%SI%Envelope addresses%EI% To put addresses on the envelopes, we might want to use label stationery, which has three columns of eight rows of labels per sheet. We could use the same field values file as previously. We do not want to go to a new page after each person, so we would need to change the default end-of-page processing. We could provide a field-names file containing the line%L%%FN,Cou%%SN,10%%T,20% END=%%L,.6%%%%P%% %FN%%SN%%L% or we could more simply specify this on the command line with%L%%FN,Cou%%SN,10%%T,20% -e %%L,.6%%%%P%% %FN%%SN%%L% Some trials may be needed to get the spacing correct between labels, and a new-paragraph instruction will be useful to force a new column when we are near the bottom of the page. %P,15,0% The printer we are using might allow text to be placed quite close to the top, left and right margins, but it might be limited at the bottom of the page because of the paper-feed mechanism. We would set up a page style that allowed for this: %NF,20%%FN,Cou%%SZ,10% %%PM,0,0,5,36%%%%PS /ColGap 0 store%%%%NC,3%%%%NF%%%%TB,10%%%%\%% %FN%%SZ%%FI% This causes page margins to be set up (%%PM,0,0,5,36%%), remove any gap between columns (%%PS /ColGap 0 store%%), make three columns per page (%%NC,3%%), make input lines be simply output without filling the previous line (%%NF%%), set the left margin 10mm from the left (%%TB,10%%), and do not go to a new output line when the next input line is read (%%\%%). %P% Then the document to be repeated (called "labels") might look like: %NF,20%%FN,Cou%%SZ,10% %FN%%SZ%%FI% and the command to print the labels could be:%L%%FN,Cou%%SN,10%%T,20% catm -e "%%L,.6%%%%P%%" fields -o Qs -r labels | lpr -Plaser %FN%%SN% %PH,15,-5,0% %BD%EXAMPLE 5:%LT% %L% An alternative format for the fields file could be adopted. There will be one line per field, and the lines for the first letter must define the names to be used in this and in subsequent letters. %L,.5% The field values file (fields2) might look like%NF,20%%FN,Cou%%SZ,10% NAME=Mr H. Bloggs PERS=Henry ADDR1=360 Hindmarsh Dr ADDR2=Phillip, ACT 2616 ADDR3=Australia NEXT Ms R. McManus Rosemary 19 McWilliam Cres Florey, WA 6517 Mr GA Spence Mr Spence 40 Plenty Ave Lower Hutt New Zealand Mrs P Thomas Penni Dept Computer Science ADFA Campbell, ACT 2600 %FN%%SZ%%FI% The letter would be the same as in the example above. %P,15,0,0% The output pages could be generated with Qs layout using the Unix command%L%%FN,Cou%%SN,10%%T,20% catm fields2 -o Qs -r letter | lpr -Plaser %L%%FN%%SN% so that the Quikscript file (Qs) will be copied once at the start, followed by four copies of "%IT%letter%RO%", each tailored to a name and address given in the "%IT%fields2%RO%" file. %PH,0,0,0%%NP% %SI%Macros%EI%%SI%%%M%EI%%SC%%_,6%macros.qs%EC% %BD%%SZ,15% macros.qs %LT%%SZ% (structured documents) %SH%Appendix B: Quikscript Files (macros.qs) %EH% %P,10% %IT%macros.qs%RO% is an example of how macros can be used with the %IT%catex%RO% or %IT%catm%RO% programs. A set of Quikscript instructions is given a simple synonym, reducing the amount of typing and in this case allowing most features of a document style affecting size or alignment of text to be held in a single file, avoiding repetition of the same information within a document. %P% The following macros are given: %P,40,-30% %%M,Title%% %T%Very large, bold, centred line of text at the top of the page. %P% %%M,Section%% %T%Large, bold text, separated from previous text by a larger inter-paragraph gap, and suitable to head a new major section of the document. %P% %%M,Head%% %T%Large, bold text, separated from previous text by a larger inter-paragraph gap, and suitable for a sub-heading which will not interfere with the surrounding paragraph layout. %P% %%M,Body%% %T%Normal text, preceded by a paragraph gap. %P% %%M,Note%% %T%Small, bold text, intended as a heading for "Detail" text, preceded by an inter-paragraph gap. %P% %%M,Detail%% %T%Smaller text, for giving explanatory detail about material given earlier, starting with an inter-paragraph gap. %P% %%M,Small%% %T%Very small text at the current point in the document. This can be undone with %%SZ%%. %P% %%M,DList%% %T%Start of a list of dot-points, with the first bullet placed. %P% %%M,DP%% %T%Next dot-point in the current list. %P% %%M,DEnd%% %T%End of the list of dot-points. %P% %%M,List%% %T%Start of a list, using a hanging first line style. Use either %%T%% or %%L%% according to preference to enlarge on the hanging text. Use %%P%% to go to the next list item. %P% %%M,LEnd%% %T%End of a list using hanging first line style. %P% %%M,Code%% %T%The following test is to be output using a monospaced font a little smaller than the normal text. %P% %%M,Norm%% %T%Mark the end of "Code", reverting to previous font and size. %P% %%M,Asis%% %T%Treat all white space and new-lines as intended in the output. %P% %%M,Fmt%% %T%Ignore new-line characters, filling the output lines except when layout marks indicate otherwise. %P% %%M,1%% to %%M,10%% %TR%Output the number as white within a black circle. %P% %%M,mi%% %T%Minus sign. %P% %%M,rarrw%% %T%Right-pointing arrow. %P,10,0% Tabs are preset to positions every 15 MM, accessible using %%T,?1%% etc. using numbers from 1-4 and then from 15-19. %P,0,0,0% %NP% %SI%QstoHTML%EI%%SI%HTML%EI%%SC%%_,6%QstoHTML%EC% %BD%%SZ,15% QstoHTML %LT%%SZ% (Convert Quikscript documents to HTML) %SH%Appendix B: Quikscript Files (QstoHTML) %EH% %P,10% HTML is a mark-up language similar to Quikscript in many respects, so it should be feasible to convert a Quikscript document to HTML for viewing with a web browser. QstoHTML does this, quite well for most documents. However, the two layout languages are different in a number of ways that makes some situations difficult to handle properly. Most of the problem areas are dealt with by putting out a comment in the HTML and usually also to the screen, allowing them to be fixed by hand. QstoHTML does a good job with tables, and handles different paragraph styles as best it can, given the limited mechanisms in HTML for representing style. %PH,10,-10,0%%BD% Usage %LT%%P,10,0% QstoHTML is written as a Java application. It can be compiled (if necessary) with %L%%FN,Cou%%SN,10%%T,20% javac QstoHTML.java %FN%%SN% %P% It can be run with the command: %L%%FN,Cou%%SN,10%%T,20% java QstoHTML [-s %IT%sub-file%RO%] [-c %IT%char-file%RO%] [-sz %IT%numb%RO%] %L% [%IT%input-file%RO% [%IT%output-file%RO%]] %FN%%SN% %L% This executes the program in files QstoHTML.class, EditBuffer.class, and OctalString.class that are generated by the compilation. %P% All options should be given on the one command-line. Input comes from <%IT%input-file%RO%> or from standard-input. Output is written to standard output or to <%IT%output-file%RO%>. Messages are sent to standard error, indicating the line number in the input file where difficulties were encountered in conversion. %PH,,-10%%BD% Keyword substitutions %LT%%P,,0% QstoHTML has a large set of fixed conversions, some of which require look-ahead, and some which require the state of the machine to be remembered. However, it is possible to override any of the conversions by reading from a given file the substitutions that are to apply. Keyword substitution is performed when a keyword has been identified, after the leading and trailing "%" character has been stripped off, and before it is checked against the rules embedded in QstoHTML. This allows us to modify any of the default processing performed by QstoHTML if we wish. It also allows us to indicate replacements for Quikscript macros that can be defined for expansion by "catex". A file of substitutions %L%%FN,Cou%%SN,10%%T,20% -s %IT%sub-file%RO% %L%%FN%%SN% can be provided containing lines with the format %L%%FN,Cou%%SN,10%%T,20% %IT%string1=string2%RO% %L%%FN%%SN% where <%IT%string1%RO%> is the text between "%" Quikscript delimiters, and <%IT%string2%RO%> is the text to be put in the HTML output file. Eg, if a Quikscript macro was defined: %L%%FN,Cou%%SN,10%%T,20% %W%%%%T,?% DM,1:%%FN,Din%%%%C,182%%%%FN%%:%% %L%%FN%%SN% enabling the Dingbats character 1 in a black circle %FN,Din%%C,182%%FN% to be represented by %%M,1%%, then this could be handled in QstoHTML with a line in the substitution file %L%%FN,Cou%%SN,10%%T,20% M,1=(1) %L%%FN%%SN% "(1)" is as good as we can achieve with the limited typesetting features of standard HTML. %PH,,-10%%BD% Character substitutions %LT%%P,,0% A number of character encodings are commonly used in PostScript, and these can easily be set up in Quikscript by including PostScript code. Unfortunately, the HTML character set is impoverished, and there are many PostScript characters that cannot be represented in HTML. QstoHTML allows the character encoding to be established through a file %L%%FN,Cou%%SN,10%%T,20% "-c %IT%char-file%RO%" %L%%FN%%SN% where the corresponding HTML character (or string) is identified. The format of this file is %L%%FN,Cou%%SN,10%%T,20% %IT%number=repl%RO% %L%%FN%%SN% where is the numeric representation of a character, and is the text that will be output in the HTML file if that character is encountered. Character substitution is only performed on the actual text of the document after keyword processing has been performed, and in %%C,number%% Quikscript layout marks. Eg. %TB,10%%FN,Cou%%SN,10%%NF,50% 162=¢ 163=£ 177=- %SN%%FN%%FI% %TB,0%%P% If no character substitution file is explicitly mentioned, the file "pschcode" will be read if it is available. %PH,,-10%%BD% Default size %LT%%P,,0% Quikscript documents contain explicit size specifications for text, measured in printers points. HTML does not use this scheme, but rather a base-font and sizes relative to this. It is possible with QstoHTML to indicate which PostScript font size is to be taken as the base-font size %L%%FN,Cou%%SN,10%%T,20% -sz %IT%numb%RO% %L%%FN%%SN% The size must be an integer, and the default size is 13. The number does not need to be an actual size used in the document. Sizes encountered will be compared with this number to determine approximately how much larger or smaller than the default they are. Choosing a default size that is too large will cause small text in PostScript to be almost unreadable on the screen. %PH,,-10%%BD% Illustrations %LT%%P,,0% The most common form of illustration used in Quikscript documents is an EPS file. QstoHTML will flag any included PostScript in its output. It is convenient to convert such EPS files to a form displayable in a browser. Two Unix scripts are provided to assist with this. The first is "epstopnm", which uses ghostscript to render the PostScript and create a PPM file. The second is "epstogif", which calls "epstopnm" and then "ppmtogif", a pbmplus (or netpbm) utility. %PH,,-10%%BD% Problem areas %LT%%P,,0% Quikscript allows any PostScript to be embedded within it, which can have a wide variety of effects on layout and representation of following text. QstoHTML simply outputs the PostScript code as a comment in the HTML, and also puts a message to the screen showing the first three lines of the PostScript to warn that it has not been converted. %P% The purpose of many Quikscript layout marks is to precisely position text. HTML has no concept of precise positioning. It does not even support tabs. QstoHTML ignores many layout marks, and performs a rough substitution in other cases. %P% HTML does not allow all text styles to accumulate, so that for italic and for bold are mutually exclusive rather than additive. It has a scheme for treating every character as intentional, similar to %%NF%% in Quikscript, but it only renders such text in monospaced font. %P% HTML has the notion of embedding of one style within another, and most browsers require that the termination of styles be done in the reverse sequence of their declaration. So, %L%%FN,Cou%%SN,10%%T,20% testsmaller %L%%FN%%SN% may not be rendered properly if the styles overlap, as in %L%%FN,Cou%%SN,10%%T,20% testsmaller %L%%FN%%SN% Quikscript does not have this concept of embedding, so layout marks in generated HTML may not always be in the correct order. Some hand-editing of the HTML may be required to overcome such problems. Any desired hot links will also have to be added by hand. %P,0,0,0% %NP% %SI%Epstopnm%EI%%SC%%_,6%epstopnm%EC% %BD%%SZ,15% epstopnm %LT%%SZ% (Convert EPS files to PNM images) %SH%Appendix B: Quikscript Files (epstopnm and epstogif) %EH% %P,10% EPS files can be converted to image files using ghostscript. PNM format is a portable format allowing easy conversion to other formats such as GIF or TIFF, which are used in much other software. It is particularly useful in converting PostScript files included in Quikscript documents into GIF format for display within a web browser. %P% This Unix shell script is based on a script %IT%pstopnm%RO% written by Alberto Accomazzi and distributed with ghostscript. It differs from the original in the way the size of the image is determined, and in the command arguments that can optionally be used. %P% The script is run with the command: %NF%%FN,Cou%%SN,10%%TB,10% epstopnm [-llx %IT%s%RO%] [-lly %IT%s%RO%] [-urx %IT%s%RO%]%\% [-ury %IT%s%RO%] %FN%(printers points)%FN% [-xsize %IT%n%RO%] [-ysize %IT%n%RO%] %FN%%\% (size in pixels)%FN% [-pbm|-pgm|-ppm] [-rot] [-forceplain] [-verbose] [-help] %IT%psfile%RO%[.[e]ps] %TB,0%%FI%%SN%%FN%%T% where the optional arguments would all appear on the same command line. %P% %BD%Input area size%LT% %L% The page area rendered into the image is determined from the BoundingBox details within the PostScript file, which must be present. This area can be modified by specifying all of the -llx, -lly, -urx, -ury optional arguments. A 4-pp margin is always added automatically. %P% %BD%Image size%LT% %L% The size of the output image can be specified by giving one or both of -xsize and -ysize. Otherwise its pixel size will be 100/72 times the rendered area size in printers points. %P% %BD%Output format%LT% %L% Output will go to a file or files based on the name of the input file. Names are generated of the form %IT%psfile%RO%001.ppm, %IT%psfile%RO%002.ppm. The format of this file will be "ppm" by default, suitable for colour images, but "pbm" for black-and-white or "pgm" for gray-scale images can alternatively be chosen. If the -forceplain option is specified, the data is written in a raw format, binary data rather than ASCII, giving a more compact output file. %P% The image can be rotated by 90 degrees with the -rot option. %L%%P,0,0,0% %SI%Epstogif%EI%%SC%%_,6%epstogif%EC% %BD%%SZ,15% epstogif %LT%%SZ% (Convert EPS files to GIF images) %P,10% This Unix script uses %IT%epstopnm%RO%, so it relies on ghostscript being installed. It also uses %IT%ppmtogif%RO%, a %IT%pbmplus%RO% (or %IT%netpbm%RO%) utility program. It will convert an EPS file directly into a GIF image. It takes command-line arguments which it passes to %IT%epstopnm%RO%. It creates the file %IT%psfile%RO%.gif. %PH,0,0,0%%NP% %SI%sortIndex%EI%%SI%index sorting%EI%%SC%%_,6%sortIndex%EC% %BD%%SZ,15% sortIndex %LT%%SZ% (sort an index containing text and page numbers) %SH%Appendix B: Quikscript Files (sortIndex) %EH% %P,10% This program is provided in three forms, as C source code, and as Java source code and binary, any of which can be used. %P% C code: compile with %NF%%FN,Cou%%SN,10%%TB,10% gcc sortindex.c avlsort.c -o sortindex %TB,0%%FI%%SN%%FN%%T% and run with %NF%%FN,Cou%%SN,10%%TB,10% sortindex < %IT%inputfile%RO% > %IT%outputfile%RO% %TB,0%%FI%%LP%%SN%%FN% %P% Java code: compile with %NF%%FN,Cou%%SN,10%%TB,10% javac avl.java sortIndex.java %TB,0%%FI%%SN%%FN%%T% and run with %NF%%FN,Cou%%SN,10%%TB,10% java sortIndex < %IT%inputfile%RO% > %IT%outputfile%RO% %TB,0%%FI%%SN%%FN%%T% index. %P% %SI%%%PI%%%EI%%SI%%%OI%%%EI% Quikscript has two instructions for dealing with an index, %%PI%% to print an index, and %%OI%% to output the index to standard output, which will be the screen if running in a PostScript interpreter such as ghostscript, or could be a message-logging file if run in a PostScript printer. %%PI%% is appropriate to use if the whole document can be processed in one run through Quikscript. %%OI%% is used if the document is organized into several files that are impractical to handle in a single pass through Quikscript, or if the sorting used in Quikscript is inadequate. %P% The %IT%sortIndex%RO% program is intended for use with the output from %%OI%% commands. It reads from standard input, and writes to standard output the sorted index. The index files from different sections should first be concatenated into a single file, in the order of the chapters or sections in the final document. If an index item is found in several places, %IT%sortIndex%RO% will combine them into a single index item, with the page information from both pages in the order in which they appeared in the input to the program. %P% Example: If I have a document consisting of three chapters, with each chapter in a separate file. %P,20,-10,-.5%%C,128%%T%Within the first chapter, I might indicate that page numbers are to commence with "1-", the second chapter with "2-", etc. This is achieved with %%CA,1-%% in the first chapter and so on. %P%%C,128%%T%At the end of the each chapter file is the instruction %%OI%%. If this file is run with Quikscript in a PostScript interpreter such as ghostscript, the window from which ghostscript is run will have the index text displayed in it. %P%%C,128%%T%I will then use the mouse to select this text, paste it into an editor, and save it. %P%%C,128%%T%The other chapters would be set up and processed similarly. %P%%C,128%%T%Then the three indexes should be combined into a single file. %P%%C,128%%T%If the first two chapters both contained an index item %%SI%%fractal compression%%EI%%, then the combined index file should contain a line similar to %NF%%FN,Cou%%SN,10%%TB,10% fractal compression 1-7 %TB,0%%FI%%SN%%FN%%T% and the line %NF%%FN,Cou%%SN,10%%TB,10% fractal compression 2-4 %TB,0%%FI%%SN%%FN%%T% It is important that the index from the first chapter be placed before the index from the second chapter in the combined index file. %P%%C,128%%T%When %IT%sortIndex%RO% is run on this file, it will be sorted on the basis of the text before the page number. Case of the text is ignored in sorting, so upper- and lower-case will be interspersed rather than having all upper-case preceding all lower-case as will be done in sorting within Quikscript. %P%%T% The two items will be combined into a single index item: %NF%%FN,Cou%%SN,10%%TB,10% fractal compression 1-7, 2-4 %TB,0%%FI%%SN%%FN%%T% %P%%C,128%%T%The output from %IT%sortIndex%RO% would then need to be given appropriate Quikscript heading text, and printed using Quikscript. This header might look like: %NF%%FN,Cou%%SN,10%%TB,10% %%PM,25,25,25,25%% %RL%%FN%%IT%Set suitable page margins%RO%%FN% %%SH%%Index-%%EH%%%%PN%% %RL%%FN%%IT%Number the pages clearly%RO%%FN% %%SZ,20%%%%BD%%%%CL%%Index %RL%%FN%%IT%Give a centred heading to the page%RO%%FN% %%LT%%%%SZ%%%%P%% %RL%%FN%%IT%Revert to original font, and new paragraph%RO%%FN% %%NC,3%%%%LP%%%%NF,7%% %\% %RL%%FN%%IT%Set 3 columns, with no-fill processing starting next line%RO%%FN% %TB,0%%FI%%SN%%FN%%T% %P,0,0,0% %NP% %SH%Appendix C: Other software %EH% %BD%%SZ,16% %CL%Appendix C %C,132% Other Useful Software%SZ%%LT% %P% %SI%Ghostscript%EI%%SI%Gs%EI% %SC%Appendix C: Other useful software%EC%%SC%%_,6%ghostscript%EC% %VM,30%%VM,-30%%W%%CW,40%%TB,0% %BD%ghostscript%LT% %VT,?%%CW,160%%TB,45% A PostScript previewer is an invaluable tool to assist in developing Quikscript documents. "ghostscript" or its related versions "gsview" and "ghostview", is particularly recommended, and it will run on most platforms. Versions of it are freely available from many sites, including %L,.5%%T,55% http://www.cs.wisc.edu/~ghost/ %P% To preview a Quikscript document with ghostscript, copy Quikscript and your document into a single file, and type %L,.5%%T,55%%FN,Cou%%SN,10% gs %IT%yourfilename%RO% %SN%%FN% %P% As well as checking layout, ghostscript allows non-PostScript printers to be used for printing PostScript documents and Quikscript files. There are drivers included for most types of printer. %P% %SI%PDF%EI% Ghostscript has (or will soon have) a component for converting a PostScript file into a PDF (portable document format) file. PDF files are binary, and are much smaller than PostScript. They are intended for viewing with a PDF viewer, such as AcroRead, which is freely available from Adobe Systems (http://www.adobe.com/prodindex/acrobat), and which can be easily set up to be called directly by a web browser if a fetched document is in PDF format. %P% %SI%Ps2pdf%EI% The ghostscript tool %IT%ps2pdf%RO% will create a PDF file. It is structured as separate pages which can be accessed in any order. This means for the Quikscript user that there is an easy mechanism to convert a Quikscript document into a form viewable by a web browser. However, it is not possible to include hot links within the document as it is in binary format. %P% %SI%Pdf2ps%EI% There is also a tool %IT%pdf2ps%RO% which will generate a PostScript file from a PDF file. Combined use of these two tools gives a way of converting a Quikscript document into one structured with distinct pages but still in PostScript format. This can be a useful way to prepare lecture material. %P% %SI%Ps2epsi%EI% Another tool in ghostscript is %IT%ps2epsi%RO% which produces a document in EPS format, suitable for including within another PostScript document, with bounding-box dimensions at the top, and other comments giving an image representation of the document which can be viewed in some document preparation systems. %P% %VM,30%%VM,-30%%W%%CW,40%%TB,0% %BD%distillery%LT% %VT,?%%CW,160%%TB,45% %SI%Distillery%EI%%SI%Document Structuring Conventions%EI% %SC%%_,6%distillery%EC% Multi-page documents can easily be created using Quikscript. However, some page viewering software works better if the pages are distinct, with no dependence between them, and printable in any order. This is impossible to achieve with Quikscript alone, because it reads the document as an input stream and dynamically determines where the line- and page-breaks should occur. %P% "Distillery" is a program that converts almost any PostScript program into separate distinct pages conforming to the PostScript Document Structuring Conventions. The original version of this program was developed by Glenn Reid when he worked for Adobe Systems Inc. The most recent version of this program is maintained by Graham Freeman and is available from %IT%ftp.adfa.edu.au%RO% in directory %IT%pub/postscript%RO%. See http://www.cs.adfa.edu.au/~gfreeman %P% The simplest way to use this program is to set up the PostScript file to be distilled, for instance by concatenating Quikscript with the document. Distillery can be run in a PostScript previewer such as %IT%ghostscript%RO% with: %TB,55%%L,-.5%%FN,Cou%%SN,10%%NF% gs (distillery) run (mypsfile) distill quit %FI%%SN%%FN%%TB%%L,-.5% This will create a file "mypsfilex" (the original file name with an 'x' added). This file will no longer contain Quikscript; it will have a short header and then raw PostScript drawing instructions. Some fonts and some embedded graphics produced with external packages do not survive the distillation process accurately. %P% %VM,30%%VM,-30%%W%%CW,40%%TB,0% %BD%Qse%LT% %VT,?%%CW,160%%TB,45% %SI%Qse%EI%%SI%Quikscript editor%EI% %SC%%_,6%Qse%EC% Qse is a companion program to Qs. It is written in Java, and should be portable to most platforms. It allows use of menus for previewing and printing documents, and gives ready access to the other ancillary files for font or style. It includes a set of fonts that work on PostScript machines. %P% Although Qs can be used without Qse and for many people this would be its preferred method of use, Qse provides a pleasant environment in which to create and work with Quikscript documents. %NP% %SI%ISO encoding%EI%%SI%European characters%EI%%SI%Special characters%EI% %SC%Appendix D: Special Characters%EC% %PS% /FontVec [ /Times-Roman-Europe /Times-Roman /Times-Italic-Europe /Times-Italic /Times-Bold-Europe /Times-Bold /Times-BoldItalic-Europe /Times-BoldItalic /Helvetica-Europe /Helvetica /Helvetica-Oblique-Europe /Helvetica-Oblique /Helvetica-Bold-Europe /Helvetica-Bold /Helvetica-BoldOblique-Europe /Helvetica-BoldOblique /Courier-Europe /Courier /Courier-Oblique-Europe /Courier-Oblique /Courier-Bold-Europe /Courier-Bold /Courier-BoldOblique-Europe /Courier-BoldOblique /Palatino-Roman-Europe /Palatino-Roman /Palatino-Italic-Europe /Palatino-Italic /Palatino-Bold-Europe /Palatino-Bold /Palatino-BoldItalic-Europe /Palatino-BoldItalic /NewCenturySchlbk-Roman-Europe /NewCenturySchlbk-Roman /NewCenturySchlbk-Italic-Europe /NewCenturySchlbk-Italic /NewCenturySchlbk-Bold-Europe /NewCenturySchlbk-Bold /NewCenturySchlbk-BoldItalic-Europe /NewCenturySchlbk-BoldItalic /Bookman-Light-Europe /Bookman-Light /Bookman-LightItalic-Europe /Bookman-LightItalic /Bookman-Demi-Europe /Bookman-Demi /Bookman-DemiItalic-Europe /Bookman-DemiItalic /AvantGarde-Book-Europe /AvantGarde-Book /AvantGarde-BookOblique-Europe /AvantGarde-BookOblique /AvantGarde-Demi-Europe /AvantGarde-Demi /AvantGarde-DemiOblique-Europe /AvantGarde-DemiOblique /Helvetica-Narrow-Europe /Helvetica-Narrow /Helvetica-Narrow-Oblique-Europe /Helvetica-Narrow-Oblique /Helvetica-Narrow-Bold-Europe /Helvetica-Narrow-Bold /Helvetica-Narrow-BoldOblique-Europe /Helvetica-Narrow-BoldOblique ] def QSdict begin 0 1 FontVec length 2 idiv 1 sub { 2 mul dup FontVec exch get dup FontDirectory exch known not {pop pop exit}if FontVec 3 -1 roll 1 add get exch /I 0 def {Font I get 1 index eq { pop Font I 3 -1 roll put exit} { /I I 1 add def} ifelse } loop } for end PE %PS% /StdChars { currentpoint 1 index 1 index moveto (abcdefghijklmnopqrstuvwxyz) show LinSpa sub 1 index 1 index moveto (ABCDEFGHIJKLMNOPQRSTUVWXYZ) show LinSpa sub 1 index 1 index moveto (0123456789 !"#$%&'()*+-/,.:;<=>?@[\\]^_`{|}~) show LinSpa sub moveto }def /Chars1 [161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 177 178 179 180 182 183 184 185 186 187 188 189 191 193 194 195 196 197 198 199 200 202 203 205 206 207 208 225 227 232 233 234 235 241 245 248 249 250 251] def /Chars2 [128 129 130 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 177 178 179 180 182 183 184 185 186 187 188 189 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 216 217 218 219 220 221 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 241 242 243 244 245 246 248 249 250 251 252 253 255 ] def /Chars3 [48 49 50 51 52 53 54 55 56 57 33 34 35 36 37 38 39 40 41 42 43 45 47 44 46 58 59 60 61 62 63 64 91 92 93 94 95 96 123 124 125 126] def /Chars4 [ 28 30 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 161 162 163 164 165 166 167 168 169 170 171 172 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 ] def /Chars5 [ 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 ] def /Special { % array Special - currentpoint 1 index 9 MM add 1 index 4 index ArrayChLoop pop pop /Times-Roman findfont FntSizStack FntSiz get scalefont setfont 3 -1 roll ArrayNumLoop pop pop } def /Special3 { currentpoint 1 index 9 MM add 1 index 97 122 AllChLoop LinSpa sub 65 90 AllChLoop LinSpa sub Chars3 ArrayChLoop LinSpa sub 161 255 AllChLoop pop pop /Times-Roman findfont FntSizStack FntSiz get scalefont setfont 97 122 AllChLoop LinSpa sub 65 90 AllChLoop LinSpa sub Chars3 ArrayChLoop LinSpa sub 161 255 AllNumLoop pop pop }def /AllChLoop {1 index 3 1 roll 1 exch {/i exch def /j i 2 index sub 8 mod def 2 index 20 MM j mul add 2 index moveto Char 0 i put Char show j 1 add 8 mod 0 eq {exch LinSpa sub exch}if }for pop } def /AllNumLoop {1 index 3 1 roll 1 exch {/i exch def /j i 2 index sub 8 mod def 2 index 20 MM j mul add 2 index moveto i Str cvs show j 1 add 8 mod 0 eq {exch LinSpa sub exch}if }for pop } def /ArrayChLoop % x y array ArrayChLoop - {0 1 2 index length 1 sub {/i exch def /j i 8 mod def 2 index 20 MM j mul add 2 index moveto dup i get Char 0 3 -1 roll put Char show i 1 add 8 mod 0 eq {exch LinSpa sub exch}if }for pop } def /ArrayNumLoop % x y array ArrayNumLoop - {0 1 2 index length 1 sub {/i exch def /j i 8 mod def 2 index 20 MM j mul add 2 index moveto dup i get Str cvs show i 1 add 8 mod 0 eq {exch LinSpa sub exch}if }for pop } def PE %SH%Appendix D: Special Characters %EH% %TB,0%%BD%%SZ,16% %CL%Appendix D %C,132% Special Characters in PostScript Fonts%SZ%%LT% %P% Almost all fonts contain the following characters, accessible with their numeric codes: %L,.5%%TB,10% %PS Chars1 Special % %TB%%P%%SI%ISO-Latin1 encoding%EI% If the program "pdffnt.qs" is run, the special characters will change to the following: %L,.5%%TB,10% %PS /Times-Roman-Europe findfont 12 scalefont setfont Chars4 Special % %FN,Tim%%TB,0% %P%%VM,L13%%VM,L-13% For eastern European languages, the file "isolatin2.qs" will give these special characters: %SI%Czech characters%EI%%SI%Polish Characters%EI%%SI%ISO-Latin2 encoding%EI% %L,-.5% %PS% /ISO8859_2_vec [ /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef /space/exclam/quotedbl/numbersign/dollar/percent/ampersand/quoteright /parenleft/parenright/asterisk/plus/comma/hyphen/period/slash/zero/one/two /three/four/five/six/seven/eight/nine/colon/semicolon/less/equal/greater /question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft /backslash/bracketright/asciicircum/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j /k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/braceleft/bar/braceright/asciitilde/.notdef /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef /dotlessi/grave/acute/circumflex/tilde/macron/breve/dotaccent /dieresis/.notdef/ring/cedilla/.notdef/hungarumlaut/ogonek/caron % ISO 8859-2 encoding % Character name %C,code% Octal code in PS string /.notdef/Aogonek/breve % 160 161 162 \240 \241 \242 /Lslash/currency/Lcaron % 163 164 165 \243 \244 \245 /Sacute/section/dieresis % 166 167 168 \246 \247 \250 /Scaron/Scedilla/Tcaron % 169 170 171 \251 \252 \253 /Zacute/hyphen/Zcaron % 172 173 174 \254 \255 \256 /Zdot/degree/aogonek % 175 176 177 \257 \260 \261 /ogonek/lslash/acute % 178 179 180 \262 \263 \264 /lcaron/sacute/circumflex % 181 182 183 \265 \266 \267 /cedilla/scaron/scedilla % 184 185 186 \270 \271 \272 /tcaron/zacute/hungarumlaut % 187 188 189 \273 \274 \275 /zcaron/zdot/Racute % 190 191 192 \276 \277 \300 /Aacute/Acircumflex/Abreve % 193 194 195 \301 \302 \303 /Adieresis/Lacute/Cacute % 196 197 198 \304 \305 \306 /Ccedilla/Ccaron/Eacute % 199 200 201 \307 \310 \311 /Eogonek/Edieresis/Ecaron % 202 203 204 \312 \313 \314 /Iacute/Icircumflex/Dcaron % 205 206 207 \315 \316 \317 /Eth/Nacute/Ncaron % 208 209 210 \320 \321 \322 /Oacute/Ocircumflex/Ohungarumlaut % 211 212 213 \323 \324 \325 /Odieresis/multiply/Rcaron % 214 215 216 \326 \327 \330 /Uring/Uacute/Uhungarumlaut % 217 218 219 \331 \332 \333 /Udieresis/Yacute/Tcedilla % 220 221 222 \334 \335 \336 /germandbls/racute/aacute % 223 224 225 \337 \340 \341 /acircumflex/abreve/adieresis % 226 227 228 \342 \343 \344 /lacute/cacute/ccedilla % 229 230 231 \345 \346 \347 /ccaron/eacute/eogonek % 232 233 234 \350 \351 \352 /edieresis/ecaron/iacute % 235 236 237 \353 \354 \355 /icircumflex/dcaron/dstroke % 238 239 240 \356 \357 \360 /nacute/ncaron/oacute % 241 242 243 \361 \362 \363 /ocircumflex/ohungarumlaut/odieresis % 244 245 246 \364 \365 \366 /divide/rcaron/uring % 247 248 249 \367 \370 \371 /uacute/uhungarumlaut/udieresis % 250 251 252 \372 \373 \374 /yacute/tcedilla/dotaccent % 253 254 255 \375 \376 \377 ] def % new-font intermediate-font original-font MakeISO2Font - /MakeISO2Font { findfont dup length dict begin { 1 index /FID eq 2 index /Encoding eq or 2 index /UniqueID eq or {pop pop}{def}ifelse } forall /Encoding ISO8859_2_vec def dup currentdict end definefont pop 11 dict begin /BasefontName exch def /FontName exch def /FontType 3 def BasefontName findfont dup /FontBBox get /FontBBox exch def /Encoding ISO8859_2_vec def /FontMatrix get /FontMatrix exch def /SpecialChars 45 dict begin /Abreve [(A)(\226)] def /abreve [(a)(\226)] def /Aogonek [(A)(\236) .7] def /aogonek [(a)(\236) .7] def /Cacute [(C)(\222)] def /cacute [(c)(\222)] def /Ccaron [(C)(\237)] def /ccaron [(c)(\237)] def /Dcaron [(D)(\237)] def /dcaron [(d)(')1] def /dstroke [(d)(-) .9 1.1] def /Eogonek [(E)(\236) .5] def /eogonek [(e)(\236)] def /Ecaron [(E)(\237)] def /ecaron [(e)(\237)] def /Lacute [(L)(\222)] def /lacute [(l)(\222)] def /Lcaron [(L)(')] def /lcaron [(l)(') 1] def /Nacute [(N)(\222)] def /nacute [(n)(\222)] def /Ncaron [(N)(\237)] def /ncaron [(n)(\237)] def /Ohungarumlaut [(O)(\235)] def /ohungarumlaut [(o)(\235)] def /Racute [(R)(\222)] def /racute [(r)(\222)] def /Rcaron [(R)(\237)] def /rcaron [(r)(\237)] def /Sacute [(S)(\222)] def /sacute [(s)(\222)] def /Scedilla [(S)(,) .45] def /scedilla [(s)(,)] def /Tcaron [(T)(\237)] def /tcaron [(t)(') .9] def /Tcedilla [(T)(,) .45] def /tcedilla [(t)(,) .47] def /Uring [(U)(\232)] def /uring [(u)(\232)] def /Uhungarumlaut [(U)(\235)] def /uhungarumlaut [(u)(\235)] def /Zacute [(Z)(\222)] def /zacute [(z)(\222)] def /Zdot [(Z)(\227)] def /zdot [(z)(\227)] def currentdict end def /BuildChar { exch begin BasefontName findfont 1000 scalefont setfont Encoding 1 index get SpecialChars exch 2 copy known { get dup length 2 gt {dup length 3 eq { % X position, as fraction of b.box aload pop 2 index stringwidth % (1)(2) x dx dy newpath 0 0 moveto 4 index true charpath flattenpath pathbbox newpath 0 0 moveto 7 index true charpath flattenpath pathbbox % (1)(2) x dx dy lx1 ly1 ux1 uy1 lx2 ly2 ux2 uy2 5 index 11 index mul cvi dup 13 1 roll % (1)(2) d2x x dx dy lx1 ly1 ux1 uy1 lx2 ly2 ux2 uy2 d2x 3 -1 roll add 6 -1 roll 2 copy gt {pop}{exch pop}ifelse % (1)(2) d2x x dx dy lx1 ly1 uy1 lx2 ly2 uy2 ux exch 5 -1 roll 2 copy gt {pop}{exch pop}ifelse % (1)(2) d2x x dx dy lx1 ly1 lx2 ly2 ux uy 3 -1 roll 5 -1 roll 2 copy lt {pop}{exch pop}ifelse % (1)(2) d2x x dx dy lx1 lx2 ux uy ly 5 -2 roll 2 copy lt {pop}{exch pop}ifelse % (1)(2) d2x x dx dy ux uy ly lx exch 4 2 roll 1 index 6 index gt {1 index 7 1 roll 6 -1 roll pop }if % (1)(2) d2x x dxf dy lx ly ux uy 7 -1 roll pop 0 7 1 roll % (1)(2) d2x d2y dxf dyf lx ly ux uy } { % X,Y positions, as fractions of b.box aload pop 3 index stringwidth % (1)(2) x y dx dy newpath 0 0 moveto 4 index true charpath flattenpath pathbbox newpath 0 0 moveto 9 index true charpath flattenpath pathbbox % (1)(2) x y dx dy lx1 ly1 ux1 uy1 lx2 ly2 ux2 uy2 4 index 11 index mul cvi dup 14 1 roll % (1)(2) d2y x y dx dy lx1 ly1 ux1 uy1 lx2 ly2 ux2 uy2 d2y 6 index 13 index mul cvi dup 16 1 roll % (1)(2) d2x d2y x y dx dy lx1 ly1 ux1 uy1 lx2 ly2 ux2 uy2 d2y d2x 4 -1 roll add 7 -1 roll 2 copy gt {pop}{exch pop}ifelse % (1)(2) d2x d2y x y dx dy lx1 ly1 uy1 lx2 ly2 uy2 d2y ux 3 1 roll add 5 -1 roll 2 copy gt {pop}{exch pop}ifelse % (1)(2) d2x d2y x y dx dy lx1 ly1 lx2 ly2 ux uy 3 -1 roll 5 -1 roll 2 copy lt {pop}{exch pop}ifelse % (1)(2) d2x d2y x y dx dy lx1 lx2 ux uy ly 5 -2 roll 2 copy lt {pop}{exch pop}ifelse % (1)(2) d2x d2y x y dx dy ux uy ly lx exch 4 2 roll 1 index 6 index gt {1 index 7 1 roll 6 -1 roll pop }if % (1)(2) d2x d2y x y dxf dy lx ly ux uy 8 -2 roll pop pop % (1)(2) d2x d2y dxf dyf lx ly ux uy }ifelse} { aload pop 1 index stringwidth newpath 0 0 moveto 3 index true charpath flattenpath pathbbox newpath 0 0 moveto 6 index true charpath flattenpath pathbbox 8 copy pop neg exch pop exch sub 3 -1 roll add 4 -1 roll add 3 1 roll pop pop 2 div newpath 0 0 moveto (X) true charpath flattenpath pathbbox 4 1 roll pop pop pop newpath 0 0 moveto (x) true charpath flattenpath pathbbox 4 1 roll pop pop pop dup 3 1 roll sub dup 2 div 3 -1 roll add 7 index ge {pop 0} if 2 copy 14 2 roll 2 copy 5 -1 roll add 7 1 roll 4 -1 roll add 6 1 roll 3 -1 roll add 5 1 roll add 4 1 roll 5 -1 roll 2 copy gt {pop}{exch pop} ifelse 7 1 roll 4 -1 roll 2 copy gt {pop}{exch pop} ifelse 6 1 roll 3 -1 roll 2 copy lt {pop} {exch pop} ifelse 5 1 roll 2 copy lt {pop}{exch pop} ifelse 4 1 roll } ifelse setcachedevice moveto show 0 0 moveto show pop } { pop pop ( ) dup 0 3 index put dup stringwidth newpath 0 0 moveto 3 -1 roll true charpath flattenpath pathbbox setcachedevice Encoding exch get 0 0 moveto glyphshow }ifelse end } def FontName currentdict end definefont pop } def /Times-Latin2 /Times-Latin1 /Times-Roman MakeISO2Font PE %FN%%FN% %L%%TB,10% %PS /Times-Latin2 findfont 12 scalefont setfont Chars5 Special % %FN,Tim%%TB,0% %L%%P%%VM,L26%%VM,L-26% The Symbol font contains the following characters: %SI%Symbol font%EI% %L%%FN,Sym%%TB,10% %PS Special3 % %FN%%TB,0%%P% %P% %VM,L27%%VM,L-27% Most machines also provide the ZapfDingbats font: %SI%ZapfDingbats%EI% %L%%FN,Din%%TB,10% %PS Special3 % %TB,0%%FN% %NP%%BD%%SZ,16%%CL%Index %SH%Index %EH% %SZ,12%%LT%%P% %NC,3%%PI% %NC,1%%NP%%PN,3% %SH%Contents %EH% %BD%%SZ,16%%CL%Contents %SZ%%LT%%P% %TB,20%%T,130%%W%%T%%CW,140%%PC% %TB%%CW%