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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
08-12-2003, 04:15 PM
|
#1
|
Member
Registered: Jul 2003
Location: DC
Distribution: mandrake 9.1
Posts: 415
Rep:
|
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.
|
|
|
08-12-2003, 06:23 PM
|
#2
|
Senior Member
Registered: Apr 2003
Location: Lancaster, England
Distribution: Debian Etch, OS X 10.4
Posts: 1,263
Rep:
|
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.
|
|
|
08-12-2003, 07:14 PM
|
#3
|
Member
Registered: Jul 2003
Location: DC
Distribution: mandrake 9.1
Posts: 415
Original Poster
Rep:
|
ok, that sounds good but i don't know what a tex source file is. could you maybe help guide me through this?
|
|
|
08-12-2003, 07:26 PM
|
#4
|
Senior Member
Registered: Apr 2003
Location: Lancaster, England
Distribution: Debian Etch, OS X 10.4
Posts: 1,263
Rep:
|
im not a TeX/LaTeX expert but i'll give it a go. have you got a program called latex installed?
|
|
|
08-12-2003, 07:34 PM
|
#5
|
Member
Registered: Jul 2003
Location: DC
Distribution: mandrake 9.1
Posts: 415
Original Poster
Rep:
|
i do now 
|
|
|
08-12-2003, 07:43 PM
|
#6
|
Senior Member
Registered: Apr 2003
Location: Lancaster, England
Distribution: Debian Etch, OS X 10.4
Posts: 1,263
Rep:
|
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.
|
|
|
08-12-2003, 07:50 PM
|
#7
|
Member
Registered: Jul 2003
Location: DC
Distribution: mandrake 9.1
Posts: 415
Original Poster
Rep:
|
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
|
|
|
08-12-2003, 07:51 PM
|
#8
|
Member
Registered: Jul 2003
Location: DC
Distribution: mandrake 9.1
Posts: 415
Original Poster
Rep:
|
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
|
|
|
08-12-2003, 08:00 PM
|
#9
|
Senior Member
Registered: Apr 2003
Location: Lancaster, England
Distribution: Debian Etch, OS X 10.4
Posts: 1,263
Rep:
|
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.
|
|
|
08-12-2003, 08:00 PM
|
#10
|
Member
Registered: Jul 2003
Location: DC
Distribution: mandrake 9.1
Posts: 415
Original Poster
Rep:
|
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
|
|
|
08-12-2003, 08:05 PM
|
#11
|
Senior Member
Registered: Apr 2003
Location: Lancaster, England
Distribution: Debian Etch, OS X 10.4
Posts: 1,263
Rep:
|
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.
|
|
|
08-12-2003, 08:10 PM
|
#12
|
Member
Registered: Jul 2003
Location: DC
Distribution: mandrake 9.1
Posts: 415
Original Poster
Rep:
|
word. i'll hit that up tomorrow at "work" :P
|
|
|
08-12-2003, 08:35 PM
|
#13
|
Senior Member
Registered: Apr 2003
Location: Lancaster, England
Distribution: Debian Etch, OS X 10.4
Posts: 1,263
Rep:
|
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 08:40 PM.
|
|
|
08-13-2003, 05:39 AM
|
#14
|
Member
Registered: Jul 2003
Location: NL
Distribution: My own
Posts: 92
Rep:
|
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.
|
|
|
08-13-2003, 06:23 AM
|
#15
|
Senior Member
Registered: Apr 2003
Location: Lancaster, England
Distribution: Debian Etch, OS X 10.4
Posts: 1,263
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 09:23 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|