Discussion:
reducing space round section, subsection, etc
(too old to reply)
Sharon Kimble
2017-02-05 12:17:04 UTC
Permalink
Raw Message
How can I reduce the space above and below a section, subsection, and
subsubsection please, without using the 'titlesec' package?

I'm writing my document in emacs org-mode and then exporting it into
latex, which is working very well except there is an incompatibility
between org-modes 'org-id' and 'titlesec'. Using both together blocks
'org-id' from working. Therefore I'm having to resort to using what I
term as 'header commands', meaning that they are defined in the preamble
section of the document.

Thanks
Sharon.
--
A taste of linux = http://www.sharons.org.uk
TGmeds = http://www.tgmeds.org.uk
Debian 8.6, fluxbox 1.3.5-2, emacs 25.1.1.1
Axel Berger
2017-02-05 12:56:50 UTC
Permalink
Raw Message
Post by Sharon Kimble
How can I reduce the space above and below a section, subsection, and
subsubsection please, without using the 'titlesec' package?
I have made a package for just that purpose in tight handouts. It works
in both Komascript and standard classes. At the time Markus Kohm gave me
many valid reasons why this was a bad idea.

---------------------------------------------------------------------
\ProvidesPackage{FABtight}
[2015/03/09 Headings with less vertical space, Axel Berger]

% Standardwerte für die Standardklassen
\providecommand*{\***@section}{\Large}%
\providecommand*{\***@subsection}{\large}%
\providecommand*{\***@subsubsection}{\normalsize}%
\providecommand*{\***@paragraph}{\normalsize}%
\providecommand*{\***@subparagraph}{\normalsize}%
\providecommand*{\sectfont}{\normalfont\bfseries}%
\providecommand*{\raggedsection}{}%

\renewcommand\section{\@startsection{section}{1}{\z@}%
{-1.75ex \@plus -.5ex \@minus -.2ex}{1.1ex \@plus.2ex}%
{\setlength{\parfillskip}{\z@ plus 1fil}%
\raggedsection\normalfont\sectfont\nobreak\***@section}%
}
\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
{-1.6ex\@plus -.5ex \@minus -.2ex}{.75ex \@plus .1ex}%
{\setlength{\parfillskip}{\z@ plus 1fil}%
\raggedsection\normalfont\sectfont\nobreak\***@subsection}%
}
\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
{-1ex\@plus -.3ex \@minus -.2ex}{.3ex \@plus .1ex}%
{\setlength{\parfillskip}{\z@ plus 1fil}%
\raggedsection\normalfont\sectfont\nobreak\***@subsubsection}%
}
\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
{-.7ex \@plus-.2ex \@minus-.2ex}{.0001pt}%
{\setlength{\parfillskip}{\z@ plus 1fil}%
\raggedsection\normalfont\sectfont\nobreak\***@paragraph}%
}
\renewcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}%
{.4ex \@plus.1ex \@minus.1ex}{-.7em}%
{\setlength{\parfillskip}{\z@ plus 1fil}%
\raggedsection\normalfont\sectfont\nobreak\***@subparagraph}%
}
---------------------------------------------------------------------

Axel
--
/¯\ No | Dipl.-Ing. F. Axel Berger Tel: +49/ 221/ 7771 8067
\ / HTML | Roald-Amundsen-Straße 2a Fax: +49/ 221/ 7771 8069
 X in | D-50829 Köln-Ossendorf http://berger-odenthal.de
/ \ Mail | -- No unannounced, large, binary attachments, please! --
Sharon Kimble
2017-02-11 20:12:52 UTC
Permalink
Raw Message
Post by Axel Berger
Post by Sharon Kimble
How can I reduce the space above and below a section, subsection, and
subsubsection please, without using the 'titlesec' package?
I have made a package for just that purpose in tight handouts. It works
in both Komascript and standard classes. At the time Markus Kohm gave me
many valid reasons why this was a bad idea.
---------------------------------------------------------------------
\ProvidesPackage{FABtight}
[2015/03/09 Headings with less vertical space, Axel Berger]
% Standardwerte fÃŒr die Standardklassen
\providecommand*{\sectfont}{\normalfont\bfseries}%
\providecommand*{\raggedsection}{}%
}
}
}
}
}
---------------------------------------------------------------------
Thanks for this Axel.

I tried it out on a file which had a 526 pdf as its baseline pagecount.

And with your coding involved the pagecount shot up to 564 pages!

Consequently I'm using this -

--8<---------------cut here---------------start------------->8---
#+latex_header: \setlength{\parskip}{5pt} % gap between paragraphs
#+latex_header: \setlength{\parsep}{0pt} % space between paragraphs within an item
# #+latex_header: \setlength{\headsep}{0pt} % the vertical length between the header and the top of the text area
#+latex_header: \setlength{\topskip}{0pt} % between header and text
#+latex_header: \setlength{\topmargin}{0pt} % gap above header
#+latex_header: \setlength{\topsep}{0pt} % space between first item and preceding paragraph
#+latex_header: \setlength{\partopsep}{0pt} % extra space added to \topsep when environment starts a new paragraph
# http://www-h.eng.cam.ac.uk/help/tpl/textprocessing/squeeze.html

#+latex_header: \linespread{0.9}
--8<---------------cut here---------------end--------------->8---

Thanks
Sharon.
--
A taste of linux = http://www.sharons.org.uk
TGmeds = http://www.tgmeds.org.uk
Debian 8.6, fluxbox 1.3.5-2, emacs 25.1.1.1
Nasser M. Abbasi
2017-02-11 20:51:00 UTC
Permalink
Raw Message
Post by Sharon Kimble
Post by Axel Berger
Post by Sharon Kimble
How can I reduce the space above and below a section, subsection, and
subsubsection please, without using the 'titlesec' package?
I have made a package for just that purpose in tight handouts. It works
in both Komascript and standard classes. At the time Markus Kohm gave me
many valid reasons why this was a bad idea.
---------------------------------------------------------------------
\ProvidesPackage{FABtight}
[2015/03/09 Headings with less vertical space, Axel Berger]
% Standardwerte für die Standardklassen
\providecommand*{\sectfont}{\normalfont\bfseries}%
\providecommand*{\raggedsection}{}%
}
}
}
}
}
---------------------------------------------------------------------
Thanks for this Axel.
I tried it out on a file which had a 526 pdf as its baseline pagecount.
And with your coding involved the pagecount shot up to 564 pages!
Consequently I'm using this -
--8<---------------cut here---------------start------------->8---
#+latex_header: \setlength{\parskip}{5pt} % gap between paragraphs
#+latex_header: \setlength{\parsep}{0pt} % space between paragraphs within an item
# #+latex_header: \setlength{\headsep}{0pt} % the vertical length between the header and the top of the text area
#+latex_header: \setlength{\topskip}{0pt} % between header and text
#+latex_header: \setlength{\topmargin}{0pt} % gap above header
#+latex_header: \setlength{\topsep}{0pt} % space between first item and preceding paragraph
#+latex_header: \setlength{\partopsep}{0pt} % extra space added to \topsep when environment starts a new paragraph
# http://www-h.eng.cam.ac.uk/help/tpl/textprocessing/squeeze.html
#+latex_header: \linespread{0.9}
--8<---------------cut here---------------end--------------->8---
Thanks
Sharon.
When I want to reduce spaces, I normally use savetrees package

https://www.ctan.org/pkg/savetrees

it has 3 main levels of saving space:

\usepackage[subtle]{savetrees}
\usepackage[moderate]{savetrees}
\usepackage[extreme]{savetrees}

I like the first one. But you can try each
and see which one works best for you. But this
reduces spaces everywhere in the document
and not specific to just around section headings,
so may be this is not what you want.

--Nasser
boffi
2017-02-12 13:54:42 UTC
Permalink
Raw Message
Post by Nasser M. Abbasi
When I want to reduce spaces, I normally use savetrees package
https://www.ctan.org/pkg/savetrees
\usepackage[subtle]{savetrees}
\usepackage[moderate]{savetrees}
\usepackage[extreme]{savetrees}
I like the first one. But you can try each and see which one works
best for you. But this reduces spaces everywhere in the document and
not specific to just around section headings, so may be this is not
what you want.
This is not the whole story, `savetrees` has the three levels you
mentioned as a convenient shorthand but you can get a much finer
granularity in the activation of space saving techniques, e.g.,

\usepackage[
all=normal,
mathdisplays=tight,
title=tight,
sections=tight}{savetrees}

it's all in the fine manual...

ciao
gb
Axel Berger
2017-02-12 09:13:59 UTC
Permalink
Raw Message
Post by Sharon Kimble
And with your coding involved the pagecount shot up to 564 pages!
In that case you can't have been using standard settings. You must have
had other space savers in place which my redefinitions have undone.
Unfortunately there was no way (there is in the newest versions of
Komascript, that I don't use) just to change the spaces above and below
headings, I had to redefine the whole thing from scratch. It might help
to run my redefinition first and your space saver second, but that will
probably undo my settings.
Post by Sharon Kimble
Consequently I'm using this -
That's extremely drastic and I hope you have very good reasons for it.
I'd hate to have to read hundreds of pages of that. The same goes for my
changes. Perhaps acceptable for a two-page handout, not for a long
paper.

Axel
--
/¯\ No | Dipl.-Ing. F. Axel Berger Tel: +49/ 221/ 7771 8067
\ / HTML | Roald-Amundsen-Straße 2a Fax: +49/ 221/ 7771 8069
 X in | D-50829 Köln-Ossendorf http://berger-odenthal.de
/ \ Mail | -- No unannounced, large, binary attachments, please! --
Sharon Kimble
2017-03-09 13:02:00 UTC
Permalink
Raw Message
Post by Axel Berger
Post by Sharon Kimble
How can I reduce the space above and below a section, subsection, and
subsubsection please, without using the 'titlesec' package?
I have made a package for just that purpose in tight handouts. It works
in both Komascript and standard classes. At the time Markus Kohm gave me
many valid reasons why this was a bad idea.
---------------------------------------------------------------------
\ProvidesPackage{FABtight}
[2015/03/09 Headings with less vertical space, Axel Berger]
% Standardwerte fÃŒr die Standardklassen
\providecommand*{\sectfont}{\normalfont\bfseries}%
\providecommand*{\raggedsection}{}%
}
}
}
}
}
---------------------------------------------------------------------
Thanks for this Axel.

I tried it out on a file which had a 526 pdf as its baseline pagecount.

And with your coding involved the pagecount shot up to 564 pages!

Consequently I'm using this -

--8<---------------cut here---------------start------------->8---
#+latex_header: \setlength{\parskip}{5pt} % gap between paragraphs
#+latex_header: \setlength{\parsep}{0pt} % space between paragraphs within an item
# #+latex_header: \setlength{\headsep}{0pt} % the vertical length between the header and the top of the text area
#+latex_header: \setlength{\topskip}{0pt} % between header and text
#+latex_header: \setlength{\topmargin}{0pt} % gap above header
#+latex_header: \setlength{\topsep}{0pt} % space between first item and preceding paragraph
#+latex_header: \setlength{\partopsep}{0pt} % extra space added to \topsep when environment starts a new paragraph
# http://www-h.eng.cam.ac.uk/help/tpl/textprocessing/squeeze.html

#+latex_header: \linespread{0.9}
--8<---------------cut here---------------end--------------->8---

Sorry for not replying sooner, its been stuck in my drafts folder and
I'd forgotten it was there.

Thanks
Sharon.
--
A taste of linux = http://www.sharons.org.uk
TGmeds = http://www.tgmeds.org.uk
Debian 8.6, fluxbox 1.3.5-2, emacs 25.1.1.1
Peter Flynn
2017-03-09 20:38:49 UTC
Permalink
Raw Message
[...]
Post by Sharon Kimble
Post by Axel Berger
I have made a package for just that purpose in tight handouts.
Thanks for this Axel.
I tried it out on a file which had a 526 pdf as its baseline pagecount.
And with your coding involved the pagecount shot up to 564 pages!
There is more than one way to skin a cat (a fine old British saying :-)
Post by Sharon Kimble
Consequently I'm using this -
--8<---------------cut here---------------start------------->8---
#+latex_header: \setlength{\parskip}{5pt} % gap between paragraphs
If you really need to save pages, leave \parskip=0pt (the default) and
reset the \parindent=1em
Post by Sharon Kimble
#+latex_header: \setlength{\parsep}{0pt} % space between paragraphs within an item
Better,
\usepackage{enumitem}
\setlist[noitemsep]
\setlist[1]{\labelindent=\parindent}
(for more, see documentation for enumitem, p.9)
Post by Sharon Kimble
#+latex_header: \setlength{\headsep}{0pt} % the vertical length between the header and the top of the text area
#+latex_header: \setlength{\topskip}{0pt} % between header and text
#+latex_header: \setlength{\topmargin}{0pt} % gap above header
#+latex_header: \setlength{\topsep}{0pt} % space between first item and preceding paragraph
#+latex_header: \setlength{\partopsep}{0pt} % extra space added to \topsep when environment starts a new paragraph
Just \usepackage[nohead]{geometry} (pretty much always use the geometry
package instead of trying to fiddle with all the settings individually)

I know Times is not a very elegant bookface, but it's *marrow*, so just
\usepackage{mathptmx}
can save a dozen pages or more on a 500pp document.

///Peter

Loading...