
TUGb oat, Volume 17 1996, No. 3 255 characters are not usually intended to be printed on the page, rather their purp ose is to control the T Xtensions E printing pro cess in some way. This mechanism can be used to embed some text into the .dvi le, but one should The Editing .dvi Files, or Visual T X E T Xbook, page 228 \b e careful not to make the E Jonathan Fine list [of characters, i.e., the text] to o long, or you mightover owT X's string memory." The author E do es not know if this will be a danger for the Abstract constructions ab out to b e describ ed. Using emT X E This note outlines the sp eci cation of a T X format, E he has created a .dvi le with 500,000 di erent that will allow the resulting .dvi le to be edited sp ecials, whose content is the numb ers from 1 to via a suitable previewer and a .dvi le editor. Such 500,000, as digit strings. close linking of editing and typ esetting app ears to One solution to the added value problem is to b e within the present capabilities of T X. E place the entire text of the input le myfile.tex as sp ecial in the do cument. Although this satis es Value Added Typ esetting the formal requirement, it is a little coarse. To edit the le myfile.dvi consists of editing the copy Typ esetting can be thought of as a pro cess which of myfile.tex which is emb edded as a sp ecial in adds value to the do cument b eing pro cessed. This myfile.dvi. It would not be dicult to adapt a may not b e true for works typ eset from the author's text editing program, so that it op erated on this original manuscript and corrected pro ofs, for such emb edded sp ecial, rather than a self-contained le. physical do cuments reveal change of mind, history T X can then b e run, without an error arising one E of comp osition and other details which are lost in hop es, to refresh myfile.dvi. the printed version of the do cument. But here we Although coarse, this illustrates the essence of consider the typ esetting of, say, a suitably tagged the metho d by which .dvi les maybe edited via ASCI I le. the previewer. What is required is that the pro cess Throughout this do cument we will use the b e re ned. language and conventions of T X, but most of the E So far as I know, pro ducts such as Lightning issues involved are of a more general nature, and Textures continually refresh the previewed .dvi le apply to any computer typ esetting system. as the the user changes the source .tex le, but Supp ose throughout that myfile.tex is typ eset do not asso ciate the individual characters, words or to pro duce myfile.dvi. If the latter le is the markup in the underlying .tex le to the content former, together with some added value, then it of the displayed .dvi le. Thus, the user cannot should be p ossible to recover the former from edit the .tex le solely by interacting with the the latter. Oddly enough, a recent p osting to .dvi le. This is p ossible with Scienti c Word, an electronic discussion list raised precisely this which should b e thought ofasaWSYIWYG or more problem. An author had in error deleted the exactly visual editor, whose underlying le format original .tex le, and wished to recover its content, A is L T X. I b elieve that it is precisely b ecause T X E E as b est as was p ossible, from the .dvi le. This as usually used do es not allow the solution of the then is the de nition of value added typesetting | problems describ ed here, that Scienti c Word do es from the typ eset le it must b e p ossible to extract not use tex to format les for the editor to display. the source le. Popp elier 1991 also contains a discussion of Smaller Sp ecials the pro cess by whichtyp esetting adds value to the do cument, but from a di erent p oint of view. The text of a do cument, say as an ASCI I le, is naturally broken down into paragraphs, words, Sp ecials characters, and spaces. It seems natural to break a do cument down into words. They are the T X has a pro cess by which sp ecial instructions can E smallest units of meaning. This is re ected in the be transmitted to printing devices The T Xbook, E very name of the to ol used by authors to prepare page 226, and that is the \special mechanism. do cuments, the word pro cessor. Programmers are Each \special that makes it to the .dvi le more accustomed to using the le editor. will pro duce in it a string of characters, attached to some sp eci c lo cation on the page. These 256 TUGb oat, Volume 17 1996, No. 3 For the moment, we shall assume that the \if 2 \sentinel do cument is very plain, with no changes of font \let \next \relax or other control sequences. Supp ose that we have \else a T X format that will, b esides typ esetting the \let \next \dopar E do cument, place b efore eachword in the do cument \fi a \special, whose content is the following word, as \next represented in the source le. Because of ligatures } and hyphenation, this may not b e the same as the The macro \doword similarly go es through the characters which follow the \special in the .dvi paragraph word byword until \sentinel is reached. le. \def \doword 1~2 Supp ose that myfile.dvi is created from my- { file.tex by using this format. It will not be \special { 1 } 1~ dicult, by extracting the text of the sp ecials, to \ifx 2 \sentinel recreate myfile.tex from myfile.dvi. This is not \let \next \gobble strictly correct. Assuming the usual category co des, \else additional spaces between words, additional lines \let \next \doword between paragraphs, and the lo cation of line breaks \fi within paragraphs, will all be lost when passing \next 2 from myfile.tex to myfile.dvi. This is probably } no great loss. Contrarywise, typ eset paragraph line This sample co de is not intended to be the breaks have b een intro duced. It may even be an basis for a practical implementation of a format advantage to have a source le whose line breaks that will create value-added .dvi les. Rather, its agree with those of the .dvi le. purp ose is to show that such a format is p ossible, and to draw attention to some of the diculties A Sp ecial Format which may be encountered when creating such an It is not so dicult to create a format that will ob ject. read the input le word by word, and place the words as it reads them into \specials. The Editing via a Previewer co de b elow, which is intended to be read in an Supp ose now that myfile.dvi has b een created environment where white space is ignored, and ~ is by a format le as ab ove. The viewer notices a a space character, shows the basic features of such missp elt wro d. Within a sp ecial in the .dvi le, it an environment. is easy to change the letters wrod into word. It will The macro \sentinel is used simply to indicate b e harder to add or delete letters within the sp ecial, the end of a paragraph, or the end of the le. b ecause there would not be ro om for the addition \def \sentinel { \noexpand \sentinel } at the correct p ointinthe .dvi le, or a hole would The idea now is to de ne \dopar so that b e left in it. But this is the sort of problem which \dopar editing programs are accustomed to dealing with. The first paragraph is not very Now that the copy of myfile.tex which is long at all. within myfile.dvi has b een changed, one would like the rest of myfile.dvi to b e brought up to date. For simplicity,we shall assume that myfile.dvi is The second paragraph is even simply one page, a galley that is long enough to shorter. accommo date all that is placed on it. Changing \sentinel wrod to word will change the paragraph in which it is placed. The change will in general be more will result in appropiate typ esetting and sp ecials. complicated than replacing wrod by word. Even Here is a simple to o simple implementation. this simple change may change the line breaks in The macro \dopar will read text paragraph by the paragraph. Hyphenation may change, as may paragraph, until the \sentinel follows a blank line ligatures and kerning. Correcting a simple letter or explicit \par. transp osition error will require resetting the whole \def\dopar 1 \par 2 paragraph. { \doword 1 ~\sentinel \par TUGb oat, Volume 17 1996, No. 3 257 In most T X formats, the size and content pages, and p erhaps the previous page, will have E of one paragraph do es not in uence the setting of to be reconsidered.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages5 Page
-
File Size-