Document ClassesIndenting subsections using the article.cls

Information and discussion about specific document classes and how to create your own document classes.
pvogt38
Posts: 9
Joined: Thu May 03, 2007 11:38 pm

Indenting subsections using the article.cls

Post by pvogt38 »

Folks,
I am using the article class, but have one issue.
I would like for subsections and subsubsections to be progressively indented. As it is, they are never indented.

Can someone give me some coaching on this??
Thanks for any help.
Paul Vogt,
Charlotte, NC

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
balfonsi
Posts: 93
Joined: Wed Mar 14, 2007 12:05 am

Re: Indenting subsections using the article.cls

Post by balfonsi »

The easiest way would be to use the titlesec package, which lets you customize entirely every sectional title (from part to paragraph).

B.A.
pvogt38
Posts: 9
Joined: Thu May 03, 2007 11:38 pm

Re: Indenting subsections using the article.cls

Post by pvogt38 »

Thanks B.A.
A quick look says this is perfect.
Best Regards,
Paul
pvogt38
Posts: 9
Joined: Thu May 03, 2007 11:38 pm

Re: Indenting subsections using the article.cls

Post by pvogt38 »

B.A. and All,
Despite the 27 pages of gobble-de-gook in the titlesec documentation, I still can't indent subsections.
Can anybody help?
Is there not an easy way? See below.
Thanks for any help,
Paul

1.0 My First Section
This first section is dedicated to the subject of section one.
1.1 The First Subsection
some words about the topic.
1.2 The Second SubSection
A terrifically interesting point about the second subsection.
2.0 My Second Section
2.1 A subheading
here are some compelling words.
pvogt38
Posts: 9
Joined: Thu May 03, 2007 11:38 pm

Re: Indenting subsections using the article.cls

Post by pvogt38 »

OK,
I figured out how to indent the subsection headings by making a simple edit in article.cls
Now I have to figure out how to indent the body text under the subsection heading
Any sugestions?
Thanks for any help,
paul
balfonsi
Posts: 93
Joined: Wed Mar 14, 2007 12:05 am

Re: Indenting subsections using the article.cls

Post by balfonsi »

Ah! I see what you mean -- at least I guess so: something like

1.0 My First Section
This first section is dedicated to the subject of section one.
___1.1 The First Subsection
___some words about the topic.
___1.2 The Second SubSection
___A terrifically interesting point about the second subsection.
2.0 My Second Section
___2.1 A subheading
___here are some compelling words.
Right?
If that's the case, are sure you want those subsections, etc. to be real subsections and so on? I'm saying that because there is an easy solution if you may consider them as sort of theorems, corollaries, ...: the ntheorem package lets you do that quite easily: it introduces a newlength called theoremindent. I personally use it to have an indention of proofs with respect to the surrounding text. Have a look at the doc to see the possibilities.

Best regards,
B.A.
pvogt38
Posts: 9
Joined: Thu May 03, 2007 11:38 pm

Re: Indenting subsections using the article.cls

Post by pvogt38 »

B.A.
Thanks so much for responding, Yes, That is what I'm trying to do. Is it just me or this rediculously complicated for such a simple thing? All I want to do is indent the subsections progressively. It seems to me that that another edit to the article.cls should take care of it. I probably just have to set up an if block and look at the subsection depth or something. Unfortunately, I'm at the point where I have to either figure this out or go back to MSWord. I have work to do!!

Can you recommend a good resource for learning the language so I can get past this?
Thanks again for any help,
Paul Vogt,
Charlotte, NC
balfonsi
Posts: 93
Joined: Wed Mar 14, 2007 12:05 am

Re: Indenting subsections using the article.cls

Post by balfonsi »

Here's a solution: a simple patch to the section,etc., commands: if you want, say, an indention of 1 inch for subsections:

\let\oldsubsbsection\subsection
\renewcommand{\subsection}{\leftskip=1in\oldsubsection}

Of course, it's up to you to do the same for other levels. This way of doing was found in the excellent uktexfaq (question 291).
For learning the language, there are nowadays quite a number of tutorials on the web (see the tug site); the LaTeX Companion is also quite useful. Actually, it all depends on the level at which these tutorials aim (my english isn't very good, I'm afraid). I think people learn progressively, and as they learn, they become more demanding. Personally, I first learnt to do simple things, and, as I progressively discovered the power of (La)TeX, I began to write some macros. Finally, when I have something 'nonstandard' to do, I first search whether some real guru has done it more or less. Examples of such packages, that let the user customize extensively are (for me) titlesec (for sections and such stuff), ntheorem (if one types a lot of maths) and enumitem(for all sorts of lists).

Best regards,
B.A.
pvogt38
Posts: 9
Joined: Thu May 03, 2007 11:38 pm

Re: Indenting subsections using the article.cls

Post by pvogt38 »

B.A.
Once again, Thank You!
Can you tell me how to navigate to this uktexfaq 291?
I don't know how to find it.
Thnaks Very Much,
Paul
balfonsi
Posts: 93
Joined: Wed Mar 14, 2007 12:05 am

Re: Indenting subsections using the article.cls

Post by balfonsi »

If you're under Windows, I guess you're using the MiKTeX distribution, and there's a package called uk-tex-faq.cab. Just install it with the package manager. Under linux I suppose it's in the TeX Live distribution, and you do the same If it's not,you'll find it in any of the CTAN mirrors, eg
http://www.tex.ac.uk/tex-archive/

There's a direct link in the home page.

Btw, did you use the parameter !ht (! means 'do all you can to put it here'). If your float appears on top of a page, and your document in final form, try:
\clearpage
\thispagestyle{empty}
\begin{figure}
...

B.A.
Post Reply