ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Passing a string via texexec
@ 2002-11-06 15:36 John Culleton
  2002-11-06 15:57 ` Gregory D. Collins
  2002-11-06 17:21 ` Hans Hagen
  0 siblings, 2 replies; 6+ messages in thread
From: John Culleton @ 2002-11-06 15:36 UTC (permalink / raw)


This is more of a convenience feature than a necessity, but here goes. 

I plan to personalize copies of an ebook in pdf format by putting the
string:
"This copy prepared for Joe Smith" on the page, perhaps in a footer.
This means I have to recompile the book for each separate customer. It
would save a minute if I could just pass a named string to pdfetex in
the same way one passes a mode to the program. I am looking for
something like:
texexec --mode=ebook --string="Joe Smith" mybook.tex

...and then have a way to pick up that string in the TeX file and use
it. 

All this does is save me from editing the file in every instance. If
it is too big a deal forget it. 
-- 
John Culleton
Able Indexers and Typesetters, Rowse Reviews, Culleton Editorial 
Services
http://wexfordpress.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Passing a string via texexec
  2002-11-06 15:36 Passing a string via texexec John Culleton
@ 2002-11-06 15:57 ` Gregory D. Collins
  2002-11-06 20:12   ` Henning Hraban Ramm
  2002-11-06 17:21 ` Hans Hagen
  1 sibling, 1 reply; 6+ messages in thread
From: Gregory D. Collins @ 2002-11-06 15:57 UTC (permalink / raw)


John Culleton wrote:
> This is more of a convenience feature than a necessity, but here goes. 
> 
> I plan to personalize copies of an ebook in pdf format by putting the
> string:
> "This copy prepared for Joe Smith" on the page, perhaps in a footer.
> This means I have to recompile the book for each separate customer. It
> would save a minute if I could just pass a named string to pdfetex in
> the same way one passes a mode to the program. I am looking for
> something like:
> texexec --mode=ebook --string="Joe Smith" mybook.tex
> 
> ...and then have a way to pick up that string in the TeX file and use
> it. 
> 
> All this does is save me from editing the file in every instance. If
> it is too big a deal forget it. 

You can solve this using scripting.

In your TeX file:

...\input{name}...

On the command line (in Windows): put then names in names.txt, then:

for /f %i in (names.txt) do @echo %i > name.tex && texexec --pdf foo.tex 
&& ren foo.pdf "%i.pdf"

In the Bourne shell:

for i in `cat names.txt`; do echo $i > name.tex; texexec --pdf 
foo.tex; 	mv foo.pdf "$i.pdf"; done

-- 
Gregory D. Collins <gcollins@cs.yale.edu>
GPG key available at pgp.mit.edu keyserver, id 0xD2EECA60

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Passing a string via texexec
  2002-11-06 15:36 Passing a string via texexec John Culleton
  2002-11-06 15:57 ` Gregory D. Collins
@ 2002-11-06 17:21 ` Hans Hagen
  1 sibling, 0 replies; 6+ messages in thread
From: Hans Hagen @ 2002-11-06 17:21 UTC (permalink / raw)


At 10:36 AM 11/6/2002 -0500, you wrote:
>This is more of a convenience feature than a necessity, but here goes.
>
>I plan to personalize copies of an ebook in pdf format by putting the
>string:
>"This copy prepared for Joe Smith" on the page, perhaps in a footer.
>This means I have to recompile the book for each separate customer. It
>would save a minute if I could just pass a named string to pdfetex in
>the same way one passes a mode to the program. I am looking for
>something like:
>texexec --mode=ebook --string="Joe Smith" mybook.tex
>
>...and then have a way to pick up that string in the TeX file and use
>it.
>
>All this does is save me from editing the file in every instance. If
>it is too big a deal forget it.

in your tex file:

   \message{\envvar{test}{it does not work}}\wait

combined with

   texexec --arguments="test=it works" test

so, it's there -)

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Passing a string via texexec
  2002-11-06 15:57 ` Gregory D. Collins
@ 2002-11-06 20:12   ` Henning Hraban Ramm
  2002-11-06 20:38     ` Hans Hagen
  0 siblings, 1 reply; 6+ messages in thread
From: Henning Hraban Ramm @ 2002-11-06 20:12 UTC (permalink / raw)


Am Mittwoch, 6. November 2002 16:57 schrieb Gregory D. Collins:
> > I plan to personalize copies of an ebook in pdf format by putting the
> > string:
> You can solve this using scripting.
> On the command line (in Windows): put then names in names.txt, then:
...

I do it similar with the actual date (maybe there's a date function in TeX, 
but I cannot TeX... ;-)

Grüßlis vom Hraban!
-- 
http://www.fiee.net
http://www.ramm.ch
---

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Passing a string via texexec
  2002-11-06 20:12   ` Henning Hraban Ramm
@ 2002-11-06 20:38     ` Hans Hagen
  2002-11-09 10:44       ` Henning Hraban Ramm
  0 siblings, 1 reply; 6+ messages in thread
From: Hans Hagen @ 2002-11-06 20:38 UTC (permalink / raw)


At 09:12 PM 11/6/2002 +0100, Henning Hraban Ramm wrote:
>Am Mittwoch, 6. November 2002 16:57 schrieb Gregory D. Collins:
> > > I plan to personalize copies of an ebook in pdf format by putting the
> > > string:
> > You can solve this using scripting.
> > On the command line (in Windows): put then names in names.txt, then:
>...
>
>I do it similar with the actual date (maybe there's a date function in TeX,
>but I cannot TeX... ;-)

\currentdate

\currentdate[dd,mm,yy] etc

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Passing a string via texexec
  2002-11-06 20:38     ` Hans Hagen
@ 2002-11-09 10:44       ` Henning Hraban Ramm
  0 siblings, 0 replies; 6+ messages in thread
From: Henning Hraban Ramm @ 2002-11-09 10:44 UTC (permalink / raw)


Am Mittwoch, 6. November 2002 21:38 schrieb Hans Hagen:
> >I do it similar with the actual date (maybe there's a date function in
> > TeX, but I cannot TeX... ;-)
> \currentdate
> \currentdate[dd,mm,yy] etc

Thank you. Andres showed me at thursday it's in the manual...

Grüßlis vom Hraban!
-- 
http://www.fiee.net
http://www.ramm.ch
---

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2002-11-09 10:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-06 15:36 Passing a string via texexec John Culleton
2002-11-06 15:57 ` Gregory D. Collins
2002-11-06 20:12   ` Henning Hraban Ramm
2002-11-06 20:38     ` Hans Hagen
2002-11-09 10:44       ` Henning Hraban Ramm
2002-11-06 17:21 ` Hans Hagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).