tags:

views:

39

answers:

1

Hi everybody,

when I use the TITLESEC-package to for leftmargin paragraph headings, this headings will align perfectly with normal text, but they won't align with an equation- or an itemize-environment in the first line. How do I make them align?

See this pdf for a visualisation of the problem: http://www.scribd.com/doc/36184235/Titlesec-Paragraph-Left-Margin

Code:

\documentclass[]{article}

\usepackage{geometry}
\geometry{a4paper,left=9cm,right=3cm, top=2cm, bottom=3cm}

\usepackage{titlesec}
\titleformat{\paragraph}[leftmargin]{\normalfont\vspace{14pt}\sffamily
\filleft}{\theparagraph}{0em}{}[]
\titlespacing{\paragraph}{15pc}{-0.5pc}{1pc}

\begin{document}
\paragraph{Was versteht man unter einer Draisine bzw. einer
Laufmaschine?}
Die Draisine oder Laufmaschine (so auch der vom Erfinder verwendete
Name) ist ein einspuriges, von Menschenkraft betriebenes Fahrzeug ohne
Pedale, das als Urform des heutigen Fahrrads gilt.
\paragraph{Wie viel ist dreizehn mal acht?}
\begin{equation}
7\times8=8+8+8+8+8+8+8+8+8+8+8+8+8=56
\end{equation}

\paragraph{Aus welchen Zutaten besteht Schokolade?}
\begin{itemize}
\item Kakao
\item Milch
\item Zucker
\end{itemize}

\end{document}

Thanks for any ideas, Mcforgi

A: 

Hey, I didn't get it working nicely, but if you are looking for a quick way to do it and then just throw it away, you can use the following hack:

Equations:

\paragraph{Wie viel ist dreizehn mal acht?}
\abovedisplayskip=-12pt     % these two lines control
\abovedisplayshortskip=0pt  % the spacing before equations
\begin{equation}
7\times8=8+8+8+8+8+8+8+8+8+8+8+8+8=56
\end{equation}

Itemize:

\paragraph{Aus welchen Zutaten besteht Schokolade?}
\begin{itemize}
\vspace{-2em}   % this line moves the folling things up (hack)
\item Kakao
\item Milch
\item Zucker
\end{itemize}
Now I continue with text.

I think the first thing (equations) is applicable and holds for the whole document, but the second (for itemize) has to be declared in each itemize.

There seem to be variables that control the space between itemize and rest of the text, however these do not accept to have nevative values.

phimuemue