# Hanging indentation in psalm-like verses

Working on psalm indentation with macro

\def\par{\ifvmode\noindent\else\endgraf\fi}
\obeylines


given by David Carlisle here I came across next problem of verses which doesn't fit in a single line.

I tried to put there additional indentation with \hangindent but didn't succeed.

Here is some MWE:

\documentclass[12pt,a4paper]{article}
\usepackage[
left=4cm,
right=4cm,
showframe]{geometry}

\begin{document}

\begingroup
\setlength{\parskip}{0pt}
\def\par{\ifvmode\noindent\else\endgraf\fi}
\obeylines
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor
\endgroup
\end{document}


I aim at something like that:

Something like this?

\documentclass[12pt,a4paper]{article}
\usepackage[
left=4cm,
right=4cm,
showframe]{geometry}

\begin{document}

\begingroup
\setlength{\parskip}{0pt}
\def\par{\ifvmode\hangindent40pt\noindent\else\endgraf\hangindent40pt\fi}
\obeylines
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor
\endgroup
\end{document}

• That's it! Thanks again. I was trying to put \hangindent somewhere in "preamble" of the group but didn't think of editing the conditional. – Precluch Mar 24 '17 at 21:17

This answer is a little redundant, since David Carlisle has provided a beautiful answer. But I'm so impressed at how this will help me typeset Bible quotes that I want to provide a fuller example of how I'd use this method to typeset biblical poetry. It's so much better than me previous efforts built around the list environment. Any suggestions for improvement welcome.

\documentclass[twocolumn]{article}
\usepackage[b5paper,margin=2cm]{geometry}
\usepackage{lettrine}
\pagestyle{empty}
\setlength\parindent{1em}
\renewcommand*{\thefootnote}{\emph{\alph{footnote}}}
\def\vs#1{\textsuperscript{#1}}
\def\ch#1{\lettrine[findent=0.5em,nindent=0em]{#1}{}}
\newlength\psalmleftskip
\setlength\psalmleftskip{1em}
\newlength\psalmindent
\setlength\psalmindent{1em}
\newenvironment{psalm}
{\raggedright
\leftskip\psalmleftskip
\parskip 0pt
\parindent\psalmindent
\def\vs##1{\llap{\textsuperscript{##1}}}
\def\par{%
\ifvmode
\def\vs####1{\llap{\textsuperscript{####1}}}
\noindent
\else
\def\vs####1{\hspace{-\psalmindent}\llap{\textsuperscript{####1}}\hspace{\psalmindent}}
\endgraf
\fi
\hangindent=3\psalmindent}
\obeylines}
{}
\begin{document}
\section*{Job}

\subsubsection*{Elihu}

\ch{32}So these three men stopped answering Job, because he was righteous in
his own eyes. \vs{2}But Elihu son of Barakel the Buzite, of the family of Ram,
became very angry with Job for justifying himself rather than God. \vs{3}He
was also angry with the three friends, because they had found no way to refute
Job, and yet had condemned him.\footnote{\emph{3} Masoretic Text; an ancient
had waited before speaking to Job because they were older than he. \vs{5}But
when he saw that the three men had nothing more to say, his anger was aroused.

\vs{6}So Elihu son of Barakel the Buzite said:\medskip

\begin{psalm}
I am young in years,
and you are old;

that is why I was fearful,
not daring to tell you what I know.

\vs{7}I thought, Age should speak;

\vs{8}But it is the spirit\footnote{\emph{8} Or \emph{Spirit}; also in verse 18} in a person,
the breath of the Almighty, that gives them understanding.

\vs{9}It is not only the old\footnote{\emph{9} Or \emph{many}; or \emph{great}} who are wise,
not only the aged who understand what is right.\medskip

\vs{10}Therefore I say: Listen to me;
I too will tell you what I know.

\vs{11}I waited while you spoke,

while you were searching for words,
\vs{12}I gave you my full attention.

But not one of you has proved Job wrong;
none of you has answered his arguments.

\vs{13}Do not say, We have found wisdom;
let God, not a man, refute him.'

\vs{14}But Job has not marshaled his words against me,
\end{psalm}

\newpage

\section*{Psalms}

\subsubsection*{\centering Psalm 63\footnote{In Hebrew texts 63:1--11 is
numbered 63:2--12.}}

\begin{center}
\emph{A psalm of David. When he was in the Desert of Judah.}
\end{center}

\begin{psalm}
\vs{1}You, God, are my God,
earnestly I seek you;

I thirst for you,
my whole being longs for you,

in a dry and parched land
where there is no water.\medskip

\vs{2}I have seen you in the sanctuary

\vs{3}Because your love is better than life,
my lips will glorify you.

\vs{4}I will praise you as long as I live,
and in your name I will lift up my hands.

\vs{5}I will be fully satisfied as with the richest of foods;
with singing lips my mouth will praise you.\medskip

\vs{6}On my bed I remember you;
I think of you through the watches of the night.

\vs{7}Because you are my help,

\vs{8}I cling to you;