GeneralHanging indentation

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
daviddoria
Posts: 60
Joined: Tue Sep 30, 2008 9:24 pm

Hanging indentation

Post by daviddoria »

I want the text after the lecture X to be indented so that it is all to the right of X, e.g.

Lecture 1 - Some topic blah blah more text
more text more text

Lecture 2 - Some topic blah blah more text
more text more text

I tried this:

Code: Select all

\documentclass[10pt]{article}

\usepackage{float}

\begin{document}
\textbf{Calendar/Topics}
\hangindent=1cm
\hangafter1

Lecture 1 - System Configuration/General Information: Compiling and linking. Using the build system. Environment setup.

Lecture 2 - Memory management \& Smart Pointers

\end{document}

but the result is not correct. Anyone know how to do this?

Thanks,

Dave

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Hanging indentation

Post by localghost »

I suggest to use an enumerate environment customized by the enumitem package.

Code: Select all

\documentclass[11pt,a4paper,english]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{blindtext}
\usepackage{enumitem}

\begin{document}
  \blindtext
  \begin{enumerate}[label={Lecture \arabic* -- },leftmargin=*]
    \item System Configuration/General Information: Compiling and linking. Using the build system. Environment setup.
    \item Memory management \& Smart Pointers
  \end{enumerate}
\end{document}

Best regards
Thorsten
daviddoria
Posts: 60
Joined: Tue Sep 30, 2008 9:24 pm

Re: Hanging indentation

Post by daviddoria »

Excellent, that is very cool, thanks!
Post Reply