LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-12-2003, 03:15 PM   #1
sk8guitar
Member
 
Registered: Jul 2003
Location: DC
Distribution: mandrake 9.1
Posts: 415

Rep: Reputation: 30
something i've never done...printers?


hey, ok, i'm not sure if this is the right forum but whatever

i have a little script that i wrote that prints out a crapload of addresses (something around 2500)

now i'd rather not have to sit there cut them out and paste them onto a label. instead i would like to be able to format them all so that they can print on the backs of these flyers i am going to send out (there will be something like 2 or 3 flyers per page of paper).

is there any way to somehow spool this to a printer, or a practical way of formatting this information so that it requires as little work as possible on my part?

i only really know perl so thats what i'm using right now to just show all the addresses.

and if you ask how i can just randomly generate 2500 addresses its because its going to be on campus and addresses are just sequential by building.
 
Old 08-12-2003, 05:23 PM   #2
kev82
Senior Member
 
Registered: Apr 2003
Location: Lancaster, England
Distribution: Debian Etch, OS X 10.4
Posts: 1,263

Rep: Reputation: 51
im sure theres a better way to do it but why not get perl to produce a TeX source file. then compile that to give you a pdf and print it out.
 
Old 08-12-2003, 06:14 PM   #3
sk8guitar
Member
 
Registered: Jul 2003
Location: DC
Distribution: mandrake 9.1
Posts: 415

Original Poster
Rep: Reputation: 30
ok, that sounds good but i don't know what a tex source file is. could you maybe help guide me through this?
 
Old 08-12-2003, 06:26 PM   #4
kev82
Senior Member
 
Registered: Apr 2003
Location: Lancaster, England
Distribution: Debian Etch, OS X 10.4
Posts: 1,263

Rep: Reputation: 51
im not a TeX/LaTeX expert but i'll give it a go. have you got a program called latex installed?
 
Old 08-12-2003, 06:34 PM   #5
sk8guitar
Member
 
Registered: Jul 2003
Location: DC
Distribution: mandrake 9.1
Posts: 415

Original Poster
Rep: Reputation: 30
i do now
 
Old 08-12-2003, 06:43 PM   #6
kev82
Senior Member
 
Registered: Apr 2003
Location: Lancaster, England
Distribution: Debian Etch, OS X 10.4
Posts: 1,263

Rep: Reputation: 51
right, latex is what is known as a typesetter, in a program like abiword you do the formatting by pressing keys and menus tex is more like html, you include commands in the document to describe how the document is formatted.

just to test if its working create the following file
Code:
\documentclass{article}
\begin{document}
Hello
\end{document}
and call it something.tex at the command line type latex something.tex followed by xdvi something.dvi

you should see an a4 page with the word hello written at the top. the idea is to write a perl script that creates a tex file full of your addresses and the appropriate formatting that once compiled will be exactly what you want and you can print it out.
 
Old 08-12-2003, 06:50 PM   #7
sk8guitar
Member
 
Registered: Jul 2003
Location: DC
Distribution: mandrake 9.1
Posts: 415

Original Poster
Rep: Reputation: 30
i'm not sure if this is the right thing or not (i'm thinking it is because i went into my folder and double clicked on something.dvi and it said hello). i just want to make sure this output is what correct output is:

Code:
[akropp@localhost tex]$ latex something.txt  xdvi something.dvi
This is TeX, Version 3.14159 (Web2C 7.4.5)
(./something.txt
LaTeX2e <2001/06/01>
Babel <v3.7h> and hyphenation patterns for american, french, german, ngerman, b
asque, italian, portuges, russian, spanish, nohyphenation, loaded.
(/usr/share/texmf/tex/latex/base/article.cls
Document Class: article 2001/04/21 v1.4e Standard LaTeX document class
(/usr/share/texmf/tex/latex/base/size10.clo)) (./something.aux) [1]
(./something.aux) )
Output written on something.dvi (1 page, 220 bytes).
Transcript written on something.log.
[akropp@localhost tex]$ ls
something.aux  something.dvi  something.log  something.txt
 
Old 08-12-2003, 06:51 PM   #8
sk8guitar
Member
 
Registered: Jul 2003
Location: DC
Distribution: mandrake 9.1
Posts: 415

Original Poster
Rep: Reputation: 30
kev, could you maybe give me an example of how i could do this in perl and maybe a website that shows me the functions of tex/latex?

and btw thanks for helping me out, i really appreciate it kev
 
Old 08-12-2003, 07:00 PM   #9
kev82
Senior Member
 
Registered: Apr 2003
Location: Lancaster, England
Distribution: Debian Etch, OS X 10.4
Posts: 1,263

Rep: Reputation: 51
the output above is fine but i meant
Code:
$ latex something.tex
(latex output)
$ xdvi something.dvi
the xdvi does the same as you double clicking on something.dvi

Here is a pretty good website on latex. do you wana try and get on with it yourself then or did you want me to continue

as for me showing you how to do it in perl, i dont know perl, i thought you did but that doesnt matter, its just as easy to use bash script instead.
 
Old 08-12-2003, 07:00 PM   #10
sk8guitar
Member
 
Registered: Jul 2003
Location: DC
Distribution: mandrake 9.1
Posts: 415

Original Poster
Rep: Reputation: 30
actually kev, i found some good tex tutorials. but i'm still not sure how to implement them with perl. unless you are saying that i format the output of the perl file in tex standards and then compile that tex file. actually i'm gonna try that tomorrow and let you know how it all goes
 
Old 08-12-2003, 07:05 PM   #11
kev82
Senior Member
 
Registered: Apr 2003
Location: Lancaster, England
Distribution: Debian Etch, OS X 10.4
Posts: 1,263

Rep: Reputation: 51
Quote:
by sk8guitar
unless you are saying that i format the output of the perl file in tex standards and then compile that tex file.
if i understand you right then that is exactly what i mean.
 
Old 08-12-2003, 07:10 PM   #12
sk8guitar
Member
 
Registered: Jul 2003
Location: DC
Distribution: mandrake 9.1
Posts: 415

Original Poster
Rep: Reputation: 30
word. i'll hit that up tomorrow at "work" :P
 
Old 08-12-2003, 07:35 PM   #13
kev82
Senior Member
 
Registered: Apr 2003
Location: Lancaster, England
Distribution: Debian Etch, OS X 10.4
Posts: 1,263

Rep: Reputation: 51
your perl script wants to produce something like This if i understand what you want. I know nothing about printing but to get you a bit further than the dvi you want

dvips -Ppdf something.dvi

to get a postscript file, and

ps2pdf something.ps

to get a pdf file

Last edited by kev82; 08-12-2003 at 07:40 PM.
 
Old 08-13-2003, 04:39 AM   #14
DIYLinux
Member
 
Registered: Jul 2003
Location: NL
Distribution: My own
Posts: 92

Rep: Reputation: 18
Why not a2ps or enscript ?

With (La)TeX you can produce very pretty reports, but it takes a lot of work. a2ps and enscript turn plain text files into postscript with a minimum of fuz. No need for dvips either.
 
Old 08-13-2003, 05:23 AM   #15
kev82
Senior Member
 
Registered: Apr 2003
Location: Lancaster, England
Distribution: Debian Etch, OS X 10.4
Posts: 1,263

Rep: Reputation: 51
i dont really know what im talking about here but sk8guitar wants 2-3 addresses per page so the spacing needs to be right. i dont think you can do this with a2ps/enscript but as i say im not sure. also i dont think the amount of work to do this in latex is hard at all see the above link to a sample tex file.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
recommendation on photo printers and general purpose printers raminolta Linux - Hardware 3 01-21-2004 12:27 PM
Printers titfer Linux - Hardware 2 09-09-2003 12:48 PM
Printers Pedroski Linux - Hardware 1 06-23-2002 03:17 AM
printers insmanbob Linux - Hardware 0 06-11-2002 03:07 PM
printers Fried General 1 08-29-2001 07:14 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration