cannot center one section

316 views
Skip to first unread message

Juliet Hannah

unread,
Feb 17, 2010, 2:36:37 PM2/17/10
to latexus...@googlegroups.com
Hi Group,

I am pasting some lines that are working using WinEdt. Unfortunately,
I cannot center the second section. It currently has

\section{SECOND SECTION}

If I replace this with

\begin{center}
\section{SECOND SECTION}
\end{center}

as I do with the other two sections, this gives me the following error:

! LaTeX Error: Something's wrong--perhaps a missing \item.

See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...

l.39 \end{center}

?

Thanks,

Juliet

% Here is my document

\documentclass[fleqn,12pt]{article}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{amssymb}
\pagestyle{plain}
\setlength{\parindent}{.2in}
\setlength{\parskip}{8pt}
\setlength{\mathindent}{18pt}
\setlength{\oddsidemargin}{0in}
\setlength{\textwidth}{6.5in}
\setlength{\topmargin}{-.4in}
\setlength{\textheight}{9in}
\renewcommand{\baselinestretch}{1.5}
\newcommand{\mypar}{\vspace{4mm}}

\begin{document}

\newpage


\newpage
\setcounter{page}{1}
\begin{center}
\section{INTRODUCTION}
\end{center}

Intro


\section{SECOND SECTION}

Here is another section


\begin{center}
\section{THIRD SECTION}
\end{center}

Here is another section


\section*{REFERENCES}

\begin{list} %no label
{\mbox{}} %note that the next 7 lines are within { }
{ \setlength{\leftmargin} {20pt}
\setlength{\rightmargin} {0pt}
\setlength{\labelsep} {5pt}
\setlength{\labelwidth} {15pt}
\setlength{\listparindent} {-20pt}
\setlength{\parsep} {.15ex}
\setlength{\itemsep} {-3ex} }


\item \ \par
Stephens, M. A. (1986), ``Tests Based on EDF Statistics'' in
D'Agostino, R. B. (ed.) and Stephens, M. A.,
{\it Goodness-of-fit Techniques}, Marcel Dekker Inc (New York), 97-193.


\end{list}
\end{document}

Cedric Cordenier

unread,
Feb 17, 2010, 3:58:30 PM2/17/10
to LaTeX Users Group
That's strange... When I add in the center environment around the
\section command, the warning does pop up, but I have no problem
giving LaTeX the go ahead to typeset the document. Have you tried
processing the tex file anyway using pdfTeX?

Alternatively, if you *really* want to get rid of the warning, remove
"\ \par" from the line "\item \ \par." This should help somewhat. I
would recommend the use of BibTeX for bibliographies; it allows for
negative indentation of the first line without intruding on the
margins. Try using the jurabib biliography style.


If on the other hand, you don't mind about the margins (a bit ugly in
my opinion), simply try setting \parindent to the desired negative
value, for example (I repeat despite noticing your use of it),
\setlength{\parindent}{-.2em}.

Hope this helps,

Cédric Cordenier

Werner Grundlingh

unread,
Feb 17, 2010, 4:30:23 PM2/17/10
to LaTeX Users Group

If you're interested, here's a way to centre your section commands,
following the example of Vincent Zoonekynd on the website:
http://zoonek.free.fr/LaTeX/LaTeX_samples_section/0.html
See his example "02".

Werner

Peter Flynn

unread,
Feb 17, 2010, 4:53:32 PM2/17/10
to latexus...@googlegroups.com
Please, please, PLEASE don't do this. All that manual formatting is completely unnecessary: LaTeX is about automating your document specifically so that you don't need to do it by hand all the time.

1. I'm not sure what you are trying to do with topmargin. I've set the top margin to .6".
2. There is no oddsidemargin in the article class because it prints one-sided.
3. Use the sectsty package to change the appearance of section headings (there
   are other packages as well, with other facilities).
4. Use the geometry package to set your margins.
5. Use the setspace package to set your line-spacing.
6. Use BIBTeX or BIBLaTeX for your references.
7. Re-set the title of the references using the \renewcommand{\refname}{...}
8. I have added the bibliography example you gave in BIBTeX format and embedded it in the document so that it gets written to hannah.bib when you run the file through LaTeX. Normally you would keep your references in hannah.bib (or whatever) anyway, using JabRef of whatever bibliographic reference manager you like; if you do that, you can get rid of the \usepackage{fancyvrb} and all of the VerbatimOut stuff. I didn't know what reference format you wanted: I have used apacite here but there are dozens to choose from.


\documentclass[fleqn,12pt]{article}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{sectsty}
\allsectionsfont{\centering}
\usepackage[top=.6in,textwidth=6in,textheight=9in]{geometry}

\pagestyle{plain}
\setlength{\parindent}{.2in}
\setlength{\parskip}{8pt}
\setlength{\mathindent}{18pt}
\usepackage{fancyvrb}
\usepackage{apacite}
\usepackage{setspace}
\onehalfspacing
\renewcommand{\refname}{REFERENCES}
\begin{document}

\section{INTRODUCTION}

Intro

\section{SECOND SECTION}

Here is another section referencing \cite{steph86}

\section{THIRD SECTION}

 Here is another section

\bibliography{hannah}
\bibliographystyle{apacite}

\begin{VerbatimOut}{hannah.bib}
@incollection{steph86,
  author = {Stephens, M. A.},
  title = {{Tests Based on EDF Statistics}},
  booktitle = {{Goodness-of-fit Techniques}},
  editor = {D'Agostino, R. B. and Stephens, M. A.},
  publisher = {Marcel Dekker Inc},
  address = {New York},
  year = {1986},
  pages = {97--193}
}
\end{VerbatimOut}

\end{document}

///Peter


--
You received this message because you are subscribed to the Google Groups "LaTeX Users Group" group.
To post to this group, send email to latexus...@googlegroups.com.
To unsubscribe from this group, send email to latexusersgro...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/latexusersgroup?hl=en.


Peter Flynn

unread,
Feb 17, 2010, 4:55:33 PM2/17/10
to latexus...@googlegroups.com
I should have added that there is probably a way to uppercase your section titles automatically as well...I just haven't looked in the documentation.

The objective should be to minimise your effort...

///Peter
 

Juliet Hannah

unread,
Feb 17, 2010, 6:03:54 PM2/17/10
to latexus...@googlegroups.com
Thanks Everyone.

I wasn't sure how to do my references in another way. The requirements are on:

http://pubs.amstat.org/page/styleguide?cookieSet=1

Also pasted below. The citation depends on how many authors there are
and is different for the first time you use the citation as compared
to later in the text (see #5)? Can Latex do that. I had less than 10
references, so I just did it by hand to avoid this confusion.

Also, what do you think they mean by this:

Each figure must have a figure caption, including the figure number.
Figures are numbered consecutively, using arabic numerals, as they are
cited in text. Prepare the captions on a separate sheet and place them
after the tables. They will be typeset and placed beneath the figures.

On a separate sheet? I am assuming the Figures go right into the text
(they didn't say otherwise).

Thanks,

Juliet

Reference Citations. All references included in the References at the
end of an article must be cited in the text of the article. For text
citations, ASA uses the author's surname and date of publication,
according to the following style.

1. A direct citation of a reference places only the date within parentheses.
Gentleman (1978) explored this in greater detail.

2. An indirect citation of a reference as an example places both the
name and the date within parentheses with no punctuation between them:
Other recent suggestions include the use of Chernoff faces (Smith 1980).

3. Citation of a particular page, section, or equation of a work
should follow the date and be preceded by a comma. Use sec., chap,
app., eq., p., and pp. in such citations.
We rely on an algorithm of Das Gupta (1965, pp. 115-120).
This distribution is known to be normal (Smith and Smith 1958, chap. 5).

4. References following direct quotations must include the page
number(s) of the quote:
"This was found to be fallacious thinking upon closer investigation"
(Smith and Smith 1958, p. 209).

5. For works with multiple authors, use the full form of citation at
all times for two authors. Use the full form the first time only for
three to five authors; thereafter use the first author's surname
followed by the phrase "et al." (not underlined). Use the first
author's surname followed by the phrase "et al." for citations of
references with six or more authors.

Peter Flynn

unread,
Feb 17, 2010, 6:47:24 PM2/17/10
to latexus...@googlegroups.com
On Wed, Feb 17, 2010 at 11:03 PM, Juliet Hannah <juliet...@gmail.com> wrote:
Thanks Everyone.

I wasn't sure how to do my references in another way.

1. Download asa.bst from http://www.stat.ufl.edu/~presnell/Downloads/TeX/StatBib/
2. For the moment, put asa.bst in the same folder as your main TeX file (it actually
   belongs elsewhere, but there will do for now).
3. Change \usepackage{apacite} in my example to \usepackage{natbib}
4. Change \bibliographystyle{apacite} to \bibliographystyle{asa}
5. Reprocess the file and re-run BIBTeX and reprocess the file again twice (ignore any
   errors the first time round; those are just the asa complaining about the old apacite
   commands).
 
Also pasted below. The citation depends on how many authors there are
and is different for the first time you use the citation as compared
to later in the text (see #5)? Can Latex do that. I had less than 10
references, so I just did it by hand to avoid this confusion.

Don't be tempted. It's so easy to slip up when doing it by hand. Put all your refs in a .bib file (download and install JabRef to help you do this). Then use BIBTeX as described above.
 
Also, what do you think they mean by this:

Each figure must have a figure caption, including the figure number.

It means exactly what it says. "Figure 3.2: Diagram of where I went wrong."
This is automatic in LaTeX if you use the figure environment and the \caption command.
 
Figures are numbered consecutively, using arabic numerals, as they are
cited in text. Prepare the captions on a separate sheet and place them
after the tables. They will be typeset and placed beneath the figures.

The ASA must be out of their tiny minds. Statistically speaking, that is...they're
still thinking in the days of paper, scissors, and glue-pots.
 
On a separate sheet? I am assuming the Figures go right into the text
(they didn't say otherwise).

They are 30 years behind the times. Urgently find a statistician who uses LaTeX and writes for the ASA journals and ask for their help. It is just possible you will have to do what they say, because they are going to rip your paper to shreds, tear out ALL your formatting, and retypeset the entire thing completely from scratch themselves.
 
///Peter



Reply all
Reply to author
Forward
0 new messages