You are not logged in.

#1 2008-12-02 06:28:49

cautha
Member
From: Kingston, Ontario
Registered: 2008-06-02
Posts: 115
Website

hangparas environment in LaTeX (hanging.sty)

I'm trying to make a list of references for a paper in APA format - incidentally, the same one I talk about in a couple of other posts. I know this can be done with BibTeX somehow, but I'm not quite there yet wink At any rate, I don't have a huge list.

The problem is, although I've tried to make use of the hangparas environment in hanging.sty (e.g. \begin{hangparas}{.5in}{1} ... \end{hangparas} instead of \hangpara{.5in}{1} for each separate paragraph), only the first paragraph is indented properly, upon compiling; the rest are flush left.

Instead of posting my entire paper, I made a separate file with just the reference page to demonstrate this:

\documentclass{report}
\usepackage[margin=1in]{geometry}
\usepackage{hanging}
\usepackage{setspace}
\usepackage{ragged2e}
\usepackage{url}
\hyphenpenalty=10000
%% Define a new 'leo' style for the package that will use a smaller font.
\makeatletter
\def\url@leostyle{%
  \@ifundefined{selectfont}{\def\UrlFont{\sf}}{\def\UrlFont{\small\ttfamily}}}
\makeatother
%% Now actually use the newly defined style.
\urlstyle{leo}
\begin{document}\setlength{\RaggedRightParindent}{.5in}\RaggedRight\doublespacing
\begin{center}References\end{center}
\begin{hangparas}{.5in}{1}
Affect. (2008). In \textit{Merriam-Webster Online Dictionary}. Retrieved November 24, 2008, from \url{http://www.merriam-webster.com/dictionary/affect}

American Psychiatric Association. (2000). \textit{Diagnostic and statistical manual of mental disorders} (Revised 4th ed.). Washington, DC: Author. 

Cutter Psy.D., D., Jaffe Ph.D., J, \& Segal Ph.D., J. (2008, February 26). \textit{Self-injury: Types, causes and treatment}. Helpguide. Retrieved October 10, 2008, from \url{http://www.helpguide.org/mental/self_injury.htm}

Dingfelder, S. F. (2004). Treatment for the `untreatable' [Electronic version]. \textit{Monitor on Psychology}, \textit{35}(3), 46.

Kersting, K. (2004). Axis II gets short shrift [Electronic version]. \textit{Monitor on Psychology}, \textit{35}(3), 50.

Kreisman M.D., J., \& Straus, H. (2004). \textit{Sometimes I act crazy: What we know and what you can do about BPD}. Hoboken, NJ: John Wiley \& Sons, Inc.

Morrison M.D., J. (1995). \textit{DSM-IV made easy: The clinician's guide to diagnosis}. New York: Guilford Press.
\end{hangparas}
\end{document}

The document typesets like this:

http://ifile.it/ald27gj (pdf)

and the documentation for hanging.sty is here (also pdf).

Any ideas?

Thanks in advance: I'm learning a lot.

Harry

P.S. Note that when I use \hangpara{.5in}{1} exclusively, it works as expected; but it doesn't seem as convenient as the other method, assuming it would work.

Last edited by cautha (2008-12-02 06:58:55)

Offline

#2 2008-12-08 05:14:40

escondida
Package Maintainer (PM)
Registered: 2008-04-03
Posts: 157

Re: hangparas environment in LaTeX (hanging.sty)

If you're going for apa format, I *highly* recommend saving time and effort and just using apa.cls.

And I *very* highly recommend using BibTeX! It's one of the nicest features of LaTeX, and well worth using. Trust me, it will make writing papers (not to mention managing references across projects) *much* easier. Seriously, it's not worth the time and effort to manually format citations in LaTeX when you have a system as powerful as BibTeX already in place.

I'm sorry I can't be more help with the specific package you're having trouble with.

Offline

#3 2008-12-08 13:52:00

cautha
Member
From: Kingston, Ontario
Registered: 2008-06-02
Posts: 115
Website

Re: hangparas environment in LaTeX (hanging.sty)

Don't worry about it smile I thought that I might have to bump the thread artificially, just to get a response, so I'm happy that I didn't have to do that.

Maybe you can help me out after all: I made a post on apa.cls a while back, but nobody seemed to know the answer.

The code for the title page looked something like this:

\documentclass[man,12pt,nobf]{apa}
\title{Borderline Personality Disorder: Key Features and Their Impact on the Social \& Emotional Well-Being of Patients and Others}
\author{Harry Bellemare}
\rightheader{Impact of Borderline Personality Disorder}
\shorttitle{Borderline Personality Disorder}
\affiliation{(Course code) \\ Instructor: Name \\ \today}
\begin{document}
\maketitle
\end{document}

The problem was, I needed it to look as close to this file as possible. At that point, I was even just thinking in terms of the title page. I forget exactly how it typesets with apa.cls, but I believe the running head is in the wrong spot, as well as some other small issues.

This is what I ended up doing for the title page (with the preamble):

\documentclass[letterpaper,12pt]{report}
\usepackage[margin=1in]{geometry}
\usepackage{fancyhdr}
\usepackage{ragged2e}
\usepackage{setspace}
\usepackage{hanging}
\usepackage{url}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}
\fancyhead[R]{Borderline Personality Disorder\hspace{1em}\thepage}
\fancyfoot{}
\hyphenpenalty=10000

%% Define a new 'leo' style for the url package that will use a smaller font.
\makeatletter
\def\url@leostyle{%
  \@ifundefined{selectfont}{\def\UrlFont{\sf}}{\def\UrlFont{\small\ttfamily}}}
\makeatother
%% Now actually use the newly defined style.
\urlstyle{leo}

\begin{document}
Running head: \MakeUppercase{impact of borderline personality disorder}
\vspace*{\fill}
\doublespacing
\begin{center}
Borderline Personality Disorder: Key Features and Their Impact on the Social \& Emotional Well-Being of Patients and Others\\
Harry Bellemare\\ 
(Course code)\\
Instructor: Name\\ 
\today\\
\end{center}
\vspace*{\fill}
\end{document}

Obviously, apa.cls would make things much easier for me, if only I could figure out how to make it work the way I wanted it to. Certainly, there's a lot less code involved big_smile

I've just reuploaded the results I got from my original attempt at using apa.cls: http://ifile.it/t7d3aqm

I appreciate all of the help!

Harry

Offline

#4 2008-12-08 19:35:27

escondida
Package Maintainer (PM)
Registered: 2008-04-03
Posts: 157

Re: hangparas environment in LaTeX (hanging.sty)

cautha wrote:

I've just reuploaded the results I got from my original attempt at using apa.cls

I wasn't able to view the file you posted; it seems the site requires a login.

\documentclass[man,12pt,nobf]{apa}

Well, I'm willing to bet that at least some of your formatting problems have to do with choosing manuscript-mode. You're going to want doc instead of man. I don't remember if that gives you a separate title page  by default, but if not, you can get one with \newpage.

As far as the header goes, if you've looked at psychological or sociological articles, you'll note that header formatting varies pretty widely from journal to journal; it's not specified by APA, as far as I know. However, you should go with whatever your professor asks.

*shrug*. I hope that helps.

P.S.: Don't forget to print double-sided! Wasting paper is never a good idea. </evangelism>

Offline

#5 2008-12-08 22:52:57

cautha
Member
From: Kingston, Ontario
Registered: 2008-06-02
Posts: 115
Website

Re: hangparas environment in LaTeX (hanging.sty)

joyfulgirl wrote:

I wasn't able to view the file you posted; it seems the site requires a login.

Really? that's odd.

joyfulgirl wrote:

\documentclass[man,12pt,nobf]{apa}

Well, I'm willing to bet that at least some of your formatting problems have to do with choosing manuscript-mode. You're going to want doc instead of man. I don't remember if that gives you a separate title page  by default, but if not, you can get one with \newpage.

I'll try that big_smile

joyfulgirl wrote:

*shrug*. I hope that helps.

It does! Would it be creepy to ask for your MSN or something (via PM), in case I had more questions?

P.S.: Don't forget to print double-sided! Wasting paper is never a good idea. </evangelism>

I would if I could, but my prof. is adamant about one-sided printing sad

Harry

Offline

#6 2008-12-08 23:17:38

escondida
Package Maintainer (PM)
Registered: 2008-04-03
Posts: 157

Re: hangparas environment in LaTeX (hanging.sty)

cautha wrote:

Would it be creepy to ask for your MSN or something (via PM), in case I had more questions?

I don't use MicroSoft Network, sorry. However, you can find me on Freenode; I sometimes make an appearance in #archlinux.

my prof. is adamant about one-sided printing

Yuck, *why*? It has no benefits, but lots of problems! How creepy.

Offline

Board footer

Powered by FluxBB