Document Classesproblem of the subsection style

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
winglj
Posts: 4
Joined: Mon Jan 21, 2008 5:56 pm

problem of the subsection style

Post by winglj »

hi, I have a question about the following subsection style definition in one of the class file I am using right now. It seems when I use this file, it cannot break a line properly according to the margin setting for the whole document. It means some of the subsection sentences will exceeds into the right margin area of the paper. I am wondering how can I solve this problem. Thanks.

\def\subsection{%
\@startsection{subsection} % name of section and also name of
% the counter.
{2} % level, level 0 is chapter
% (for report.sty)
{0 pt} % Indentation from left margin.
% It can be negative -$>$ moved into
% the left margin.
{2 pt plus 3 pt minus 4 pt}
% Skip before heading is printed.
% see expl. above for neg. val.
{5 pt plus 1 pt minus 2 pt}
% After heading skip. If negative
% The text will be printed next
% to the heading text leaving
% the space (absolute value)
% indicated. Don't use
% zero as it will be printed on
% the same line without any space
% If negative remove stretch.
{\normalsize\bfseries}}
% \end{macrocode}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

problem of the subsection style

Post by Juanjo »

You'd better provide a minimal example showing the undesired behaviour of \subsection. Attach all the relevant files so as everybody can typeset it.
winglj
Posts: 4
Joined: Mon Jan 21, 2008 5:56 pm

Re: problem of the subsection style

Post by winglj »

Hi, the attached picture show that the error of the subsection with the code:

\subsection{A Subsection}

Some chapters have subsections too! Cool!

This is a subsection to show the margin. This is a subsection to show the margin. This is a subsection to show the margin. This is a subsection to show the margin. This is a subsection to show the margin. This is a subsection to show the margin. This is a subsection to show the margin.

\subsection{This is a veryveryveryveryvery longlonglonglonglonglonglonglong subsections that error happens!}

This is a subsection to show the margin. This is a subsection to show the margin. This is a subsection to show the margin. This is a subsection to show the margin. This is a subsection to show the margin. This is a subsection to show the margin. This is a subsection to show the margin.

It seems that the when I use the subsection commend, the line-break cannot be finished by Latex and some sentences exceed to the right margin.
Attachments
The subsection line-break error
The subsection line-break error
subsection error.jpg (42.72 KiB) Viewed 4710 times
User avatar
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

Re: problem of the subsection style

Post by Juanjo »

Please, read carefully the link I provide to learn what a minimal example is and attach the required files. With no code, it is difficult to help. I conjecture however that the fact that the subsection title is underlined has some influence in the problem.
Post Reply