Received: by nummer-3.proteosys id <01C19443.A90F543C@nummer-3.proteosys>; Thu, 3 Jan 2002 11:44:46 +0100 In-Reply-To: <01GJAVDN6PXWD7PQRI@MATH.AMS.COM> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C19443.A90F543C" Return-Path: X-MimeOLE: Produced By Microsoft Exchange V6.5 x-vm-v5-data: ([nil nil nil nil nil nil nil nil nil][nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil]) Content-class: urn:content-classes:message Subject: Re: L3 suggestion: different file extension Date: Mon, 27 Apr 1992 17:06:51 +0100 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: From: "Michael Downes" Sender: "Mailing list for the LaTeX3 project" To: "Rainer M. Schoepf" Reply-To: "Mailing list for the LaTeX3 project" Status: R X-Status: X-Keywords: X-UID: 694 This is a multi-part message in MIME format. ------_=_NextPart_001_01C19443.A90F543C Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Kresten wrote: > >This may be a bit radical, but could it be possible for LaTeX files > >to have the extension .ltx instead of .tex? > > > >I assume this is a function of tex the program, rather than of the > >LaTeX macros. But I mention it in case there is some clever way > >to achieve this by macro programming (Frank, Rainer and others > >have already managed several things I would have said were impossible > >with TeX). > > As TeX is now, it's not possible. The .tex extension is hardcoded > into the program, and cant possibly be altered, without changing the > TeX itself, and it would be impossible, to have all TeX installations > changed to reflect this. Actually I believe you can make .ltx work instead of .tex by editing the string pool file (since there is the same number of letters in both extensions you can do this without changing the checksum). This is at least not as difficult as editing the TeX executable. Here using TeX with VAX/VMS we have used this method to change TeX's .log to .lis because .log is a standard file extension for VMS command procedure log files and we want to avoid the possibility of conflicts. > The problem is not even specific to the command line, which at > first glance may seem the only problem, but also, \input like > commands, will fail, because, if you ask TeX to load the file `myfile' > It will first try to see if it can find any files that are actually > called `myfile', and then try `myfile.tex'. If a new macro for \input > was coded to use `.ltx' as extension, it had to try to see if the > expansion of the argument matched `.ltx' at the end, and then if not > *always* apply this extension (This is quite hard to accomplish). > You'd miss the possibility of having a name with either no extension > or a extension different from `.ltx'. Changing the string pool file would avoid these problems, but introduce some new ones perhaps, e.g. if someone tries to use a non-LaTeX-specific add-on package such as pictex.tex that makes any use of \input (PiCTeX defines some commands such as \!plotfromfile which use \input). > In my oppinion it's a shame. In general, TeX i/o system is not much > configurable in any way... Also, it would be nice if one could change > the look of error messages, and also make some better way of > displaying the fact that a file is beeing loaded. This is currently > written as processing , which is > quite hard to parse for some external program for possibly further > processing. (I've made an attempt on writing a such parser for my > LaTeX mode, AUC TeX, but it's much too heuristic (does guessing)). I have experimented with the approach of requiring always \input{...} and never \input ... terminated by \space or \relax or arbitrary non-expandable non-character command. This allows one to define \input to do whatever---in particular, to record the file name so that \inputfilename is always available like \inputlineno. You could add messages in the definition of \input so that extra information is written to the log file: ... <<*Reading file: (filename.tex ... ) *>> Come to think of it, this probably could be achieved by changing the string pool file also, since the opening and closing parentheses of file name messages are also in the string pool. But not without changing the checksum. For more extensive changes to the string pool, it would be best to make a WEB change file rather than editing the string pool file directly. This would however allow some other nice customizations such as changing error and help messages, e.g. change ! Undefined control sequence. to ! Undefined command. which is more in keeping with the language of the LaTeX manual. Michael Downes mjd@math.ams.com (Internet) ------_=_NextPart_001_01C19443.A90F543C Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Re: L3 suggestion: different file extension

Kresten wrote:

> >This may be a bit radical, but could it be = possible for LaTeX files
> >to have the extension .ltx instead of = .tex?
> >
> >I assume this is a function of tex the = program, rather than of the
> >LaTeX macros.  But I mention it in case = there is some clever way
> >to achieve this by macro programming (Frank, = Rainer and others
> >have already managed several things I would = have said were impossible
> >with TeX).
>
> As TeX is now, it's not possible.  The .tex = extension is hardcoded
> into the program, and cant possibly be altered, = without changing the
> TeX itself, and it would be impossible, to have = all TeX installations
> changed to reflect this.

Actually I believe you can make .ltx work instead of = .tex by editing
the string pool file (since there is the same number = of letters in
both extensions you can do this without changing the = checksum).  This
is at least not as difficult as editing the TeX = executable.  Here
using TeX with VAX/VMS we have used this method to = change TeX's .log
to .lis because .log is a standard file extension for = VMS command
procedure log files and we want to avoid the = possibility of conflicts.

>       The problem is not = even specific to the command line, which at
> first glance may seem the only problem, but = also, \input like
> commands, will fail, because, if you ask TeX to = load the file `myfile'
> It will first try to see if it can find any = files that are actually
> called `myfile', and then try = `myfile.tex'.  If a new macro for \input
> was coded to use `.ltx' as extension, it had to = try to see if the
> expansion of the argument matched `.ltx' at the = end, and then if not
> *always* apply this extension (This is quite = hard to accomplish).
> You'd miss the possibility of having a name with = either no extension
> or a extension different from `.ltx'.

Changing the string pool file would avoid these = problems, but
introduce some new ones perhaps, e.g. if someone = tries to use
a non-LaTeX-specific add-on package such as = pictex.tex that makes
any use of \input (PiCTeX defines some commands such = as \!plotfromfile
which use \input).

> In my oppinion it's a shame.  In general, = TeX i/o system is not much
> configurable in any way... Also, it would be = nice if one could change
> the look of error messages, and also make some = better way of
> displaying the fact that a file is beeing = loaded. This is currently
> written as <left paren><filename> = processing <right paren>, which is
> quite hard to parse for some external program = for possibly further
> processing. (I've made an attempt on writing a = such parser for my
> LaTeX mode, AUC TeX, but it's much too heuristic = (does guessing)).

I have experimented with the approach of requiring = always \input{...}
and never \input ... terminated by \space or \relax = or arbitrary
non-expandable non-character command. This allows one = to define \input
to do whatever---in particular, to record the file = name so that
\inputfilename is always available like \inputlineno. = You could add
messages in the definition of \input so that extra = information is
written to the log file:

  ... <<*Reading file: (filename.tex ... ) = *>>

Come to think of it, this probably could be achieved = by changing the
string pool file also, since the opening and closing = parentheses of
file name messages are also in the string pool. But = not without
changing the checksum. For more extensive changes to = the string pool,
it would be best to make a WEB change file rather = than editing the
string pool file directly. This would however allow = some other nice
customizations such as changing error and help = messages, e.g. change

  ! Undefined control sequence.

to

  ! Undefined command.

which is more in keeping with the language of the = LaTeX manual.

Michael = Downes           &= nbsp;           &n= bsp;      mjd@math.ams.com (Internet)




------_=_NextPart_001_01C19443.A90F543C--