|
Electronic Publication Experiment |
Table Of ContentsE-Pub Main PageSubmission InfoReviewer InfoAuthor InfoExamplesLinks
Project DocumentationDaily Work LogPersonnel |
E-Publishing Documentationby Douglas Bortzfield and Laura BalzanoLast edited June 21, 1999
Table of Contents |
Introduction
The
IEEE Signal Processing Society
has a publication in print, but not on the web. Our goal is to get it there, along with hyperlinks (internal and external to the document), color figures and specific formats. We want to:
1. Make sure all LaTeX and Word documents with hyperlinks, color figures and specific formats will translate exactly as they are into .dvi (device independent) viewers.
2. Translate these from .dvi to .ps (postscript), again without losing linkage, color, and format.
3. Translate these from .ps to .pdf (portable document format), ditto the rest from above.
We also want to get the article submission processes online. When someone sends in their article, it will go directly to a password protected www site. Editors, anonymous to the author, will be able to reach these articles and give their comments.
top
HyperTeX is a standard used in order to include hyperlinks in TeX documents. Hyperlinks include clickable links from one part of the document to another, from a part of the document to a www page, or from a part of the document to another file (be it a matlab file or a wave file or a graphics file or whatever; be creative).
The package hyperref is a LaTeX2e package that provides for constructing hyperlinks in LaTeX documents, and will automatically construct internal links for all the '\cite' and '\ref' commands that LaTeX users use to cite sources and refer to figures. It is avaiable at any CTAN mirror in the directory 'macros/latex2e/contrib/supported/hyperref/'. By including '\usepackage{hyperref}' at the beginning of your document you will be able to take advantage of all it has to offer.
Using hyperref To link to an email address:
\href{mailto:you@yourhost.blah}{linkingtext}To link to a file:for example:
\href{mailto:sunbeam@rice.edu}{Email Laura}
\href{file:///path/to/the.file}{linkingtext}To link to a URL:for example:
\href{file:///home/usr/sounds/mywav.wav}{my speech}
\href{http://www.the.url.blah}{linkingtext}As stated above, internal links are taken care of with the '\cite' and '\ref' commands.for example:
\href{http://www.rice.edu/}{Rice University}
In addition, HyperTeX adds new '\special' commands to deal with hyperlinks. They resemble html. Using these, you can put links directly into your document without using a package, but the package is recommended.
Note: My explanations are fairly conjectural. I haven't tried it; I have only seen hyperlinks work using hyperref. But I think I am basically correct because these commands are supposed to work much like html.
\special{html:<a href="http://www.rice.edu/">}{Rice University}\speical{html:</a>}would link the text Rice University to its URL.
\speical{html:<a name="OneTruth">}{Laura is a genius}\special{</a>}Every time I later referred something to it:
\special{html:<a href = "OneTruth">}{2+2=4}\special{html:</a>}it would send me to anchoring text "Laura is a genius."
Using the fourth command will insert the image stored at location "hrefstring."
Finally, using the fifth command allows you to link documents relative to each other. This way if you are linking to a document with the same base path, all you have to do is use this command and the "hrefstring" will simply be the different ending to the path.
top
AuthUserFile yourpathhere/.htpasswdWhere yourpathhere is a path of your choice and username is your user's name.
AuthGroupFile /dev/null
AuthName ByPassword
AuthType Basic
<Limit GET POST>
require user username
</Limit>
require user usernamebut I received the error "unknown method require" and I also tried
<Limit GET>Neither of those two methods worked for me; if none of these three work for you, ask your system administrator.
require user username
</Limit>
htpasswd -c yourpathhere/.htpasswd usernameThis will prompt you for a password twice (second time for verification) and then will create a file in yourpathhere called .htpasswd with the username and the password encrypted.
htpasswd -c yourpathhere/.htpasswd usernameWhere yourpath here is your chosen path, and user name is the user's name. :)
dvips -z -o example.ps example.dvi3) command to go ps->pdf (with ghostscript)
ps2pdf example.ps4) our *fave* command to give the current calendar!
cal5) Or to give the whole year...
cal 1999
which netscapetop
This example starts at a web page, in html. The html is for a form to submit information: name, email and comments. The perl puts up a return page thanking the submitter for his or her data. Then, the perl sends an email to both the sumitter and me which holds the submitted information. Visit this page to see it work!topThe HTML:
<html> <head> <title>Submission Form</title></head>
<body>
Please fill in the following information:<br> <form
method=post
action="http://spib.ece.rice.edu/cgi-bin/spib-bin/submit.pl">
Your Name:<input type=text size="20" name="username"><br>
Your e-mail: <input type=text size="20" name="email"><br>
Comments:<br>
<textarea cols="40" rows="3" name="comments"></textarea><br>
<input type=submit name="submit" value="submit">
<input type=reset name="reset" value="reset">
</form> </body> </html>
The Perl:
#!/usr/local/bin/perl
#$me holds my email address.
$me = "sunbeam\@rice.edu";
#$mailprog holds the path to the mail program I use to send the email.
$mailprog = "/usr/lib/sendmail";
#cgi-lib.pl is required so that perl will parse the form data.
require "/spib5/httpd_1.4.2/cgi-bin/cgi-lib.pl";
#My first sub-routine is ret_page, which posts up a return page to the
#submitter. The page says Thank you, and shows the submitter the info that
#they submitted. It sings a little song, and then it gives a back option
#just in case the submitter made any mistakes.
sub ret_page{print "Content-type: text/html\n\n";}
print "<head>\n<title>Thank You</title>\n</head>\n";
print "<body>\n<basefont size=5>\n<h1>Thank You</h1>\n";
print "your submission has been received<br>";
print "Thanks $username<br><br>\n";
print "Your email: $email<br>\n";
print "Your comments: $comments<br><br>\n";
print "she bop she bop bop bop a woo bop. <br><br>\n";
print "If this is incorrect, please <a href='http://spib.ece.rice.edu/~sunbeam/esubmit/1/'>go back</a> and re-do it.\n";
print "</body>";
#send_mail sends an email to both the submitter and to me! It has all the
#information that the submitter submitted. peter picked a peck of pickled
#peppers.
sub send_mail{open(MAIL, "| $mailprog -t $me, $email") or die "I can't open $mailprog\n";}
print MAIL "From: $username <$email>\n";
print MAIL "Subject: My Log report\n";
print MAIL "It was filled out by: $username\n";
print MAIL "Here is what they said:\n";
print MAIL "$comments\n";
close(MAIL);
#Finally, submit takes all the data parsed by perl from the html form
#that put it into the array called @in. (&ReadParse does this.) submit puts
#each of the variables in @in into global scalar variables. Then it calls
#send_mail and ret_page with the variables.
sub submit {$username = $in{'username'};}
$email = $in{'email'};
$comments = $in{'comments'};
ret_page;
&send_mail;
#here I send standard error to null, so that the (non-existent, of course)
#errors don't print. I call &ReadParse so that perl reads and parses the
#data, and then I evaluated sub-routine submit.
#ta-da!!!
open (STDERR,"> /dev/null");
&ReadParse;
submit;