2

I found an old book with a quite interesting feature: the paragraph indentation varied, when it started with a quotation mark. I wonder how this could be achieved in LaTeX.

This is just a sentence to simulate the last line of a paragraph.
   This is a short new paragraph with regular indentation.
  "This has a reduced indentation (width of a quotation mark). How to do that?"
   And here the next paragraph starts with regular indentation again. I put some more words into it. This is another sentence to lengthen the paragraph. This is another sentence to lengthen the paragraph.

I think the protrusion feature of the microtype package wouldn't help here: it would squeeze a quotation mark in the margins in inline dialogues.

Is there a package or command I don't know about of to achive that? Sorry there is no MWE, but I don't even know where to start.

3
  • This is called “hanging punctuation” and has been discussed before. This is a good start: tex.stackexchange.com/questions/126520/…
    – Ingmar
    Mar 15, 2021 at 9:20
  • @Ingmar I think, hanging punctuation only works on margins, not on indented lines, does it? Mar 15, 2021 at 9:47
  • 1
    Sorry, I have never tried it myself, but the principle should be the same, depending on how your margins are defined? That said, take a look at my answer for another (quick & dirty) approach.
    – Ingmar
    Mar 15, 2021 at 10:20

2 Answers 2

2

You can always manually move back, of course (or, as the case may be, suppress the indentation at the beginning of your paragraph and move less than usual):

\documentclass{article}
\usepackage{calc}

%\setlength{\parindent}{2em}
\newcommand\hangquote{\noindent\hspace{\parindent-\widthof{“}}“}

\begin{document}

\noindent Sed ut perspiciatis unde omnis iste natus error sit voluptatem 
accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo 
inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo 
enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia 
consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. 

   This is a short new paragraph with regular indentation.

   \hangquote This has a reduced indentation (width of a quotation mark). How to do that?”
 
 And here the next paragraph starts with regular indentation again. I put some 
more words into it. This is another sentence to lengthen the paragraph. This is 
another sentence to lengthen the paragraph.

\end{document}

enter image description here

There are probably better solutions than this, but it's quick and easy :-)

ETA: Modified to calculate the required offset automatically (using calc)

1
  • Thank you. This is actually a quite nice solution. Maybe one could combine it with a check if a par starts with "? Something like "if par starts with ", use hangquote command. Mar 15, 2021 at 14:06
2

I have had some problems when trying to formulate an answer, although I eventually succeeded. My attempts and results are shown below.

% paraprob.tex  SE 587406
\documentclass{article}
\usepackage{hanging}
\newcommand{\quoted}[1]{\begin{hangpunct}``#1\end{hangpunct}}
\newcommand{\lllap}[1]{\makebox[0pt][r]{#1}}

\begin{document}
\noindent some text at the end of a paragraph.

Regular indented paragraph.

\llap{``}Quoted (llap) indented paragraph.

\lllap{``}Quoted (lllap) indented paragraph.

\begin{hangpunct}
``Quoted (hangpunct) indented paragraph.
\end{hangpunct}

\quoted{Quoted} (quoted) indented paragraph.

Regular indented paragraph. \llap{``}Quote

Regular indented paragraph. Quote

\end{document}

enter image description here

I thought that Knuth's \llap macro (which typesets its argument to the left) would do the trick but it didn't start a paragraph. The \hanging package helped with its hangpunct environment (in this case hanging the punctuation to the left) would be useful but its use was clumsy. I eventually came up with the \lllap (latex version of \llap) macro which seemed to fit the bill. This was based on https://stackexchange.com/questions/146098 with thanks.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .