Journal home page
General information
Submit an item
Download style files
Copyright
Contact us
logo for The PracTeX Journal TUG logo

Ask Nelly:
     How can I use hyperlinks in documents?;
     How do I use the apa style?

The Editors


Ask Nelly is a question and answer column. Nelly is the quiet person who sits at the back corner desk, who knows a lot, and when asked any question is always ready with a patient answer. If Nelly doesn't know the answer, Nelly will know an expert who has the answer. Feel free to Ask Nelly about any aspect of LaTeX, TeX, Context, etc.



Q: How can I use internal and external hyperlinks in documents?

A: I will say what I do but there are many different answers, depending on your TeX setup and your target media. See The LaTeX Web Companion for more.

I use pdftex as my TeX compiler, and the hyperref package to make the links. My document starts with \documentclass{article} \usepackage[pdftex]{hyperref} and I make a link that includes a full URL like this. \href{http://www.ctan.org/search.html#byDescription}{This text} is a hyper-reference to a site on the Internet. Note that the link includes the special character # without the special handling that LaTeX normally requires for this character.

To make links internal to your document, where having to type in the entire URL is not desirable, you can use the pair

   Jump elsewhere by clicking \hyperlink{target}{here}.

and

   \hypertarget{target}{This text} is the target of a link.

The words "here" and "This text" will appear in the document. The word "target" is how the system knows what link points where (that is, for another link you would need another word).

View a sample hyperlinked document and the LaTeX source.


Jim Hefferon is Professor of Mathematics at Saint Michael's College, Colchester, Vermont (USA). He is also the maintainer of the US CTAN site and was a founding member of The PracTeX Journal Editorial Board. You can reach Jim at

tpjlogo


Q: How can I typeset a document to match the style of the APA (American Psychological Association)?

A: Athanassios Protopapas has written apa.cls which permits easy creation of documents in this style. Information on this package, including a short example paper, is available at APA text instructions and at APA web instructions page, and can be downloaded from CTAN.

But a bigger question is, how could one find this information? Well, there are several ways. If you go to the CTAN home page and click on the `documentation' button next to `know sort-of what you want' and then enter `apa' in the `search using Google' box, among the first URLs that are retrieved is the url for the apacls.txt file that was referenced earlier. If you click on this, you get to the list of files you need to get going.

The PracTeX Journal contacted the author of the package, Athanassios Protopapas, and he was nice enough to send a sample apa file and a sample bibliography file. But if you just want to learn how to use apa.cls to write your paper, the documentation will probably be enough.

See the pdf image of this answer.


Peter Flom is the Assistant Director of Statistics and Data Analysis Core, Center for Drug Use and HIV Research, National Development and Research Institutes. He is also an independent consultant assisting researchers in the social and behavioral sciences with statistics. He began using LaTeX in the summer of 2004. Peter may be contacted at mailto

tpjlogo


Page generated June 9, 2010 ; TUG home page; search; contact webmaster.