Opened 16 years ago

Closed 15 years ago

#4828 closed defect (invalid)

article (APA): Adds Extra Linebreaks in level-four headings

Reported by: myownlittlworld@… Owned by: nobody@…
Priority: high Milestone:
Component: latex export Version: 1.5.4
Severity: normal Keywords:
Cc: lasgouttes@…, j.spitzmueller@…

Description

In the APA document class, extra linebreaks are added in level four headings.
According to APA formatting the text following the paragraph header MUST be on
the same line as the subsequent text. The level four heading is basically a
micro-sentence describing the topic of the ensuing paragraphs. In the output
file, LyX unfortunately places the text two new lines after the heading. This
is a problem due to the fact that the document can have at most one line break
between the level-4 heading title and the paragraph content, while LyX inserts
two. The only way to get around this problem is to export your file to LaTeX
and remove the extra line break manually...

Manually correcting this problem is difficult as it depends on how many heading
levels are used (a level-four heading could be a SubSubSection, a Paragraph, or
a SubParagraph, depending on whether 3, 4, or 5 levels of headings were being
used - and the number of headings used will often change over the life of a
document).

Currently, the TeX output looks like (in a 3 level document for example, though
everything is the same other than the name of the heading for other levels):

\subsubsection{Participants}

The participants were chosen randomly, whichever particpants the experimenters

were able to wrestle to the ground and drag to the lab were used.

However, in the .tex file, it SHOULD look like (only one line break):

\subsubsection{Participants}
The participants were chosen randomly, whichever particpants the experimenters

were able to wrestle to the ground and drag to the lab were used.

I'm sure you can now see why proper formatting of an APA document is problematic
(but thank god for LyX, I can't imagine doing this in Word), though I'm not sure
how to correct the second error outside of correcting it manually.

Would it make sense to treat the level four header in the user interface the
same way the "Definition" style (in the default article class) is treated, with
the bold item starting the line and ending with the first breaking space? I'm
not sure if this is possible, but it might be an obvious and intuitive method of
handing paragraph headers.

Corrected .tex (and resultant pdf) files are attached, along with their .lyx source.

If you need more explanation on the idea of "level four headers", I can attach
it, I've left it off the initial bug report as it's lengthy and confusing (also
see the APA publication manual, section 3.31). APA formatting is insane.

Attachments (3)

levelFourLinebreak.lyx (1.0 KB ) - added by myownlittlworld@… 16 years ago.
Example source file.
levelFourLinebreak.tex (630 bytes ) - added by myownlittlworld@… 16 years ago.
Partially corrected example .tex file
levelFourLinebreak.pdf (13.5 KB ) - added by myownlittlworld@… 16 years ago.
Partially corrected PDF output

Download all attachments as: .zip

Change History (16)

by myownlittlworld@…, 16 years ago

Attachment: levelFourLinebreak.lyx added

Example source file.

by myownlittlworld@…, 16 years ago

Attachment: levelFourLinebreak.tex added

Partially corrected example .tex file

by myownlittlworld@…, 16 years ago

Attachment: levelFourLinebreak.pdf added

Partially corrected PDF output

comment:1 by myownlittlworld@…, 16 years ago

Note: the demonstration files attached here have already had the patch for bug
#4827 applied, producing more correct output than LyX is currently capable of
producing.

The unpatched LyX will produce strangely formatted level-four headers with
incorrect line breaks.

LyX will currently produce: "*.One Line Break" instead of (italicized) "One Line
Break."

comment:2 by Juergen Spitzmueller, 16 years ago

Cc: j.spitzmueller@… added

I do not really understand the report. The apa.layout shipped with LyX does not
support subsubsection, so your test document does not open properly. Where do
you got your apa.layout file from?

Or is this an enhancement request to implement subsubsection in apa.layout?

comment:3 by myownlittlworld@…, 16 years ago

Please see #4827 and its patch to make the source file open properly in LyX.

That patch makes this bug more evident.

The problem is that level four headers in APA formatting (as explained by:
http://owl.english.purdue.edu/owl/resource/560/16/ ) must be on the same line as
the paragraphs they begin.

In LyX's current output, the level four headings are not on the same line as
their paragraphs (there is a line break between the heading and it's paragraph,
unless the exported .tex files are edited by hand). This error is a break with
official APA formatting, and makes the document unsubmittable to a professional
institution.

comment:4 by Juergen Spitzmueller, 16 years ago

Cc: lasgouttes@… added

I see. This is not easy to resolve.
Jean-Marc, is there a way to remove the empty line under a sectioning command
for a specific class?

comment:5 by Juergen Spitzmueller, 16 years ago

(I should add that, at least in the example file shipped with apa, the empty
line below sectionings is generally omitted).

comment:6 by myownlittlworld@…, 16 years ago

Note: This problem becomes even worse when figures are added between a section
header and the paragraph's text. In this case LyX's output is:


\paragraph{Parent Questionnaire}

%
\begin{figure}
\label{fig:parentQuestionnaire}\caption{Parent Questionnaire}

\includegraphics[width=1\columnwidth]{/home/nick/my/questionnaire.pdf}
\end{figure}

To determine if teaching children to read brought about any social
change in their lives, parents were questioned about their reactions


To fix this output, the line breaks must be removed in two separate places:

  1. before the "%"
  2. between "\end{figure}...To determine"

The end result should look like this:


\paragraph{Parent Questionnaire}
%
\begin{figure}
\label{fig:parentQuestionnaire}\caption{Parent Questionnaire}

\includegraphics[width=1\columnwidth]{/home/nick/my/questionnaire.pdf}
\end{figure}
To determine if teaching children to read brought about any social
change in their lives, parents were questioned about their reactions


Sorry for making your lives even more complicated than they already were.

comment:7 by Juergen Spitzmueller, 16 years ago

dependson: 4415

This is the second class we support that needs the empty line after sectioning
to be ommitted (see also #4415 about moderncv).

Even though one might call this bad class design practice, it's a practice
nevertheless, and I wonder if we should introduce a tag in the layout
declaration that ommits the extra line.

Jean-Marc?

comment:8 by lasgouttes, 16 years ago

Seeing comment 9, I'd think that there is little chance to be able to fix the
problem.

Would it be possible to try the other way round and convinve the apa.cls authors
to fix their class? \paragraph{} is able to cope with empty lines in all
latex classes, I do not see why apa cannot do it.

comment:9 by myownlittlworld@…, 16 years ago

If I knew enough latex to be able to fix the problem, I would... But as apa.cls
is available under the LPPL, anyone who knows how could fix it and submit the
changes back to the author; he's happy to accept fixes, and I think he might
even be looking for another maintainer to take the project. As long as the fix
to apa.cls doesn't break old documents, it should be ok.

comment:10 by myownlittlworld@…, 15 years ago

Since initially reporting this bug, I have been in contact with the author of
apa.cls, Mr. Protopapas[0], who has succeeded in making apa.cls indifferent
about line spacing. Mr. Protopapas sent me a pre-release version of apa.cls
which correctly handled all the line-spacing problems reported in this bug, even
the complex corner-case of comment #9.

Thus, best as I can tell, thanks to the gracious efforts of Mr. Protopapas, this
bug is ready to be closed, contingent upon the release of apa.cls > 1.32. I
don't know when apa.cls > 1.32 will be released so I would appreciate if this
bug were left open until that time, just as a reminder that its resolution
depends on not yet released software.

Thank you so much for all your help regarding this bug, LyX now works seamlessly
with apa.cls for easy production of APA formatted documents!

[0] http://www.ilsp.gr/homepages/protopapas/apacls.html

comment:11 by lasgouttes, 15 years ago

Subject: Re: article (APA): Adds Extra Linebreaks in level-four headings

bugzilla-daemon@… writes:

Since initially reporting this bug, I have been in contact with the author of
apa.cls, Mr. Protopapas[0], who has succeeded in making apa.cls indifferent
about line spacing.

This is excellent news. Thanks for following up with this, it is
important for us to be able to avoid hardcoding workarounds in LyX...

I would appreciate if this bug were left open until that time, just as
a reminder that its resolution depends on not yet released software.

Please keep us informed about this apa.cls release.

comment:12 by myownlittlworld@…, 15 years ago

Since last talking with you, apa.cls 1.3.3 has been released[0]. This new
version of apa.cls successfully fixes the line-break problem described in this
bug (the actual changes needed are noted in apa.cls's changelog in case any
other style needs to make the same type of changes), meaning that this bug may
now be closed, resolved fixed.

Using the APA template file, LyX now produces output correctly conforming to the
APA format!

Thank you all very much for your help concerning this bug!

0: http://www.ctan.org/tex-archive/macros/latex/contrib/apa/

comment:13 by lasgouttes, 15 years ago

Component: exportlatex export
op_sys: LinuxAll
rep_platform: PCAll
Resolution: invalid
Status: newclosed

Thanks for your persistence. I fix the bug as INVALID just to mark that it was
not really our bug (would WORKSFORME be better?)

Note: See TracTickets for help on using tickets.