LATEX-L Archives

Mailing list for the LaTeX3 project


Options: Use Classic View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
"Randolph J. Herber" <[log in to unmask]>
Thu, 15 Feb 2001 13:03:38 -0600
text/plain (54 lines)
The following header lines retained to effect attribution:
|Date: Thu, 15 Feb 2001 14:34:47 +0100
|From: Jan Erik =?iso-8859-1?Q?Mostr=F6m?= <[log in to unmask]>
|Subject: Re: Side remarks about TeX input sequence
|To: Multiple recipients of list LATEX-L <[log in to unmask]>
|Reply-to: Mailing list for the LaTeX3 project <[log in to unmask]>

|On 2001-02-15 at 13:37, Hans Aberg <[log in to unmask]> wrote:

|> The idea of open a file as text file does not work well say on a Mac, if
|> you happen to have a mixture say UNIX, MSOS & MacOS files.

|What do you mean?

|            jem

|Jan Erik Moström                             mailto:[log in to unmask]
|Free Elektron            

        UNIX text files have '\n' as line terminators.

        MSDOS text files have "\r\n" as line terminators and
        '\032' as a file terminator.

        MacOS text files have '\r' as line terminators.

        The java language specification defines all three character
        sequences as line terminators and '\032' (also known as Control-Z)
        if it is the last character of the file as a file terminator
        (in MSDOS, Control-Z does mark the logical end of a text file).

        TeX and LaTeX could take a similar approach:

                If the underlaying operating system file is
                record structured and therefore is not a
                character stream file, then suffix each record
                with one of the above line terminator sequences.

                Then, in TeX's mouth, any of the line terminator
                sequences could be recognized as being a line
                terminator and, if Java's example is followed,
                then '\032' or end-of-file would mark the logical
                end of the input file.

        With such processing, it would not matter that one had
        transfered a text file between systems with incompatible text
        file structures as binary files (e.g., the scientists at
        CDF do that frequently then ask me to repair the problem).

Randolph J. Herber, [log in to unmask], +1 630 840 2966, CD/CDFTF PK-149F,
Mail Stop 318, Fermilab, Kirk & Pine Rds., PO Box 500, Batavia, IL 60510-0500,
USA.  (Speaking for myself and not for US, US DOE, FNAL nor URA.)  (Product,
trade, or service marks herein belong to their respective owners.)