Text FormattingSpacing with sectsty

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
alarswilson
Posts: 26
Joined: Thu Apr 02, 2009 3:42 pm

Spacing with sectsty

Post by alarswilson »

I need to have precisely two empty lines before each section, and one empty line after. I managed the space before with the following:

Code: Select all

% Setup for Section Headings (sectsty)
\sectionfont{\normalfont\itshape\normalsize\vspace*{0pt}}
\subsectionfont{\normalfont\normalsize\vspace*{0pt}}
\subsubsectionfont{\normalfont\normalsize\vspace*{12pt}}
but the space after the section heading is still more than a usual double space. I'm using setspace:

Code: Select all

\usepackage{setspace}
\doublespacing
Thanks for your help.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

Spacing with sectsty

Post by localghost »

A possible solution has been given in another topic [1]. The sectsty package is not the right one for this job.

[1] View topic: Trouble with dissertation formatting in Turabian style


Best regards
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
alarswilson
Posts: 26
Joined: Thu Apr 02, 2009 3:42 pm

Re: Spacing with sectsty

Post by alarswilson »

Are you suggesting I edit the document style itself?

I attempted to post your code into my preamble with "renewcommand", but when I ran LaTeX it stopped at the first section break, claiming some kind of problem with vertical space.

How do I go about editing the report.cls file? I'm embarassed to say I don't even know where to find it. I'm using MacTeX.

Andrew
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

Spacing with sectsty

Post by localghost »

alarswilson wrote:Are you suggesting I edit the document style itself? [...]
I wonder how you come to this realization. Please explain to me where and how I did that.
alarswilson wrote:[...] I attempted to post your code into my preamble with "renewcommand", but when I ran LaTeX it stopped at the first section break, claiming some kind of problem with vertical space. [...]
Which code? I don't see where I posted code here in this topic. And please be precise in your description of a problem. Such trivial statements are not helpful. For the exact error message take a look at the log file and post the relevant parts if necessary.
alarswilson wrote:[...] How do I go about editing the report.cls file? I'm embarassed to say I don't even know where to find it. [...]
Never edit a class or package file. Essential modifications can be done in the preamble of a document or in a separate package of your own.

In the topic I linked in my last reply you can find a complete example. In case of upcoming questions I suggest to continue the discussion there.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
alarswilson
Posts: 26
Joined: Thu Apr 02, 2009 3:42 pm

Re: Spacing with sectsty

Post by alarswilson »

Thank you for your reply, and my apologies for not being specific enough, or for following your responses in the other posts. The titlesec modifications handled the section spacing issues.
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

Spacing with sectsty

Post by localghost »

alarswilson wrote:[...] The titlesec modifications handled the section spacing issues.
It would be good if you could give feedback in the related topics just to show that the issues are solved or the discussions have to be continued.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
Post Reply