Hi, how about \pdfinput {filename} \pdfopenin {filename} \pdfopenout {filename} and maybe even one that accepts a hex encoded string \pdfinput hex {filename} \pdfopenin hex {filename} \pdfopenout hex {filename} Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On Thu, Jun 30, 2005 at 02:09:45PM +0200, Hans Hagen wrote:
how about
\pdfinput {filename} \pdfopenin {filename} \pdfopenout {filename}
Nice idea, I had the same :-)) I have already started to implement them: * \pdfopenin easy to implement, working (as far I have tested it). * \pdfinput more difficult, not working yet. * \pdfoutput more difficult because of output node, unfinished. Therefore I haven't released a patch yet.
and maybe even one that accepts a hex encoded string
\pdfinput hex {filename} \pdfopenin hex {filename} \pdfopenout hex {filename}
\pdfunescapehex provides this feature:
\pdfinput{\pdfunescapehex{filename}}
Yours sincerely
Heiko
"Hans" == Hans Hagen
writes:
Hi, how about
\pdfinput {filename} \pdfopenin {filename} \pdfopenout {filename}
Hi, if you provide new primitives, it would be nice to have a switch which forces \pdfopenout to create a file with the name <filename>. It's quite annoying that `\openout\x=Makefile' creates a file `Makefile.tex'. As far as \input and \openin is concerned, Knuth's rule is clear (first search for <filename> and then for <filename>.tex). This is ok, but kpathsea's search strategy is wrong. But a good solution for \openout is really appreciated. Regards, Reinhard -- ---------------------------------------------------------------------------- Reinhard Kotucha Phone: +49-511-4592165 Marschnerstr. 25 D-30167 Hannover mailto:reinhard.kotucha@web.de ---------------------------------------------------------------------------- Microsoft isn't the answer. Microsoft is the question, and the answer is NO. ----------------------------------------------------------------------------
Reinhard Kotucha wrote:
"Hans" == Hans Hagen
writes: Hi, how about
\pdfinput {filename} \pdfopenin {filename} \pdfopenout {filename}
Hi, if you provide new primitives, it would be nice to have a switch which forces \pdfopenout to create a file with the name <filename>.
It's quite annoying that `\openout\x=Makefile' creates a file `Makefile.tex'.
As far as \input and \openin is concerned, Knuth's rule is clear (first search for <filename> and then for <filename>.tex). This is ok, but kpathsea's search strategy is wrong.
you can influence that in the texmf.cnf file allow_multiple_suffixes = f otherwise you will get searches for reinhard.kotucha.tex first if you ask for reinhard.kotucha explicitly (years ago, when i was running tex over a network i noticed that this was slowing down tex a lot and then fabrice made that option) Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
* Hans Hagen
"Fabrice" == Fabrice Popineau
writes:
allow_multiple_suffixes = f
I think this is windows only.
It would be nice if this option would go into web2c. But there is still the problem with \openout. I suppose that this can only be fixed in pdfTeX rather than in web2c/kpathsea. Cheers, Reinhard -- ---------------------------------------------------------------------------- Reinhard Kotucha Phone: +49-511-4592165 Marschnerstr. 25 D-30167 Hannover mailto:reinhard.kotucha@web.de ---------------------------------------------------------------------------- Microsoft isn't the answer. Microsoft is the question, and the answer is NO. ----------------------------------------------------------------------------
Reinhard Kotucha wrote:
"Fabrice" == Fabrice Popineau
writes: allow_multiple_suffixes = f
I think this is windows only.
you're kidding, i knew that \input http://whatever... and for a while quoted filenames was windows only, but i thoight that this one made it into web2c; i wonder how much more got lost over time ... (some mp and etex patches)
It would be nice if this option would go into web2c.
sure, but .... http://www.fptex.org/xemtex-7.html ... shows some light on this Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Reinhard Kotucha wrote:
"Hans" == Hans Hagen
writes: Hi, how about
\pdfinput {filename} \pdfopenin {filename} \pdfopenout {filename}
Hi, if you provide new primitives, it would be nice to have a switch which forces \pdfopenout to create a file with the name <filename>.
It's quite annoying that `\openout\x=Makefile' creates a file `Makefile.tex'.
how about instead of a switch an extra: \pdfopenoutfile {filename} that does not add the suffix; that way one can also say: \let\pdfopenout\pdfopenoutfile in order to loose the auto .tex appending Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
"Hans" == Hans Hagen
writes:
Reinhard Kotucha wrote:
Hi, if you provide new primitives, it would be nice to have a switch which forces \pdfopenout to create a file with the name <filename>.
It's quite annoying that `\openout\x=Makefile' creates a file `Makefile.tex'.
how about instead of a switch an extra:
\pdfopenoutfile {filename}
Hans, I meant `switch' in a more general way. 1. A command-line switch would be possible but that would determine the behaviour of all occurrences of \pdfopenoutfile within the current job. 2. Another solution would be a prefix command like \immediate. This can be useful if it can be applied to some other primitives. But since we need it for opening a file only, it doesn't look like a good solution. 3. A primitive that acts like a switch, like \pdfcompresslevel would be possible. 4. The best solution is certainly to add an optional argument to \pdfopenoutfile. This would avoid the need for new primitives (which reduces the probability of name clashes). I prefer 4., and if people need a switch (3.) then they can do that by macro programming. Regards, Reinhard -- ---------------------------------------------------------------------------- Reinhard Kotucha Phone: +49-511-4592165 Marschnerstr. 25 D-30167 Hannover mailto:reinhard.kotucha@web.de ---------------------------------------------------------------------------- Microsoft isn't the answer. Microsoft is the question, and the answer is NO. ----------------------------------------------------------------------------
Reinhard Kotucha wrote:
"Hans" == Hans Hagen
writes: Reinhard Kotucha wrote:
Hi, if you provide new primitives, it would be nice to have a switch which forces \pdfopenout to create a file with the name <filename>.
It's quite annoying that `\openout\x=Makefile' creates a file `Makefile.tex'.
how about instead of a switch an extra:
\pdfopenoutfile {filename}
Hans, I meant `switch' in a more general way.
1. A command-line switch would be possible but that would determine the behaviour of all occurrences of \pdfopenoutfile within the current job.
2. Another solution would be a prefix command like \immediate. This can be useful if it can be applied to some other primitives. But since we need it for opening a file only, it doesn't look like a good solution.
3. A primitive that acts like a switch, like \pdfcompresslevel would be possible.
4. The best solution is certainly to add an optional argument to \pdfopenoutfile. This would avoid the need for new primitives (which reduces the probability of name clashes).
I prefer 4., and if people need a switch (3.) then they can do that by macro programming.
yet another alternative is 5. \pdfdefaultoutsuffix{toks} so that we can say \pdfdefaultoutsuffix{} to get rid of the funny default Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
"Hans" == Hans Hagen
writes:
yet another alternative is
5. \pdfdefaultoutsuffix{toks}
so that we can say \pdfdefaultoutsuffix{} to get rid of the funny default
Indeed. But this one invites people to invent new funny defaults. Reinhard -- ---------------------------------------------------------------------------- Reinhard Kotucha Phone: +49-511-4592165 Marschnerstr. 25 D-30167 Hannover mailto:reinhard.kotucha@web.de ---------------------------------------------------------------------------- Microsoft isn't the answer. Microsoft is the question, and the answer is NO. ----------------------------------------------------------------------------
On Mon, Jul 04, 2005 at 01:56:59AM +0200, Reinhard Kotucha wrote:
"Hans" == Hans Hagen
writes: yet another alternative is
5. \pdfdefaultoutsuffix{toks}
so that we can say \pdfdefaultoutsuffix{} to get rid of the funny default
Indeed. But this one invites people to invent new funny defaults.
I would use \pdfinput, \pdfopenin, \pdfopenout with
<general text> as file name and without default extensions.
That is part of the application (macros). E.g. if the macro want to
use image files, than image extensions can be tried.
Yours sincerely
Heiko
participants (4)
-
Fabrice Popineau
-
Hans Hagen
-
Heiko Oberdiek
-
Reinhard Kotucha