0

Our department's template for letters requires that they be compiled using XeTeX. I am writing a letter in which I would like to include an inset quotation. In LaTeX I would write

\begin{quotation}
The quoted text
\end{quotation}

My thought was to try replacing this with the plain TeX code that sets a quotation, but I'm not sure how to find this.

How can I replicate the quotation environment in XeTeX?

Edit Minimal working example:

\newif\ifuserfont \userfontfalse
\def\SetLetterFont#1{\userfonttrue\font\userfont=#1} % so the user can set it.

\newdimen\indentation \indentation=2em\relax
\newdimen\betweenpar \betweenpar=\medskipamount\relax
\raggedbottom
\interlinepenalty=100
\hsize=6.25 true in
\voffset=24pt
\advance\vsize by -\voffset
\parindent=0pt
\parskip=0pt
\nopagenumbers

\def\beginlinemode{\endmode
    \begingroup\parindent=0pt%
    \obeylines
    \frenchspacing
    \def\endmode{\par\endgroup}}
\def\beginparmode{\endmode
    \begingroup
    \parskip=\betweenpar
    \def\endmode{\par\endgroup}}
\let\endmode=\par
\def\endletter{\endmode\vfill\supereject\end}

\def\body{%
    \ifuserfont\global\userfont\fi
        \global\parindent=\indentation
        \smallskip
        \beginparmode
}%

\def\narrower{%
  \advance\leftskip 1cm
  \advance\rightskip 1cm }

\indentation=0pt

\body


Body text 1,  blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah

{ \narrower
    Quote paragraph 1, blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah 

    Quote paragraph 2 blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
}

Body text 2, blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah


\endletter
4
  • @Werner Not that I can tell. I see definitions for date, address, opening, body, closing, postscript, and letterhead. Sep 12, 2019 at 23:57
  • do they really mandate plain tex rather than mean you should use xelatex??? That makes no sense. Sep 13, 2019 at 8:20
  • @DavidCarlisle Yeah, it doesn't compile in XeLaTeX. Sep 13, 2019 at 18:37
  • @AnnieCarter: It would be better if you could share your letter template, so one can see what works best specific to your setup.
    – Werner
    Sep 13, 2019 at 19:49

2 Answers 2

1

In plain TeX you can use

zzzz

{\narrower
hmmmm zzzzz

}

The definition of \narrower is

\def\narrower{%
  \advance\leftskip\parindent
  \advance\rightskip\parindent}

you have since clarified that you have \parindent set to 0pt so this isn't quite what you want but you can redefine it for example by

\def\narrower{%
  \advance\leftskip 2cm
  \advance\rightskip 2cm }

To bring the margins in by 2cm or whatever amount you want.

Note that it is very weird to set both \parindent and \parskip to zero as it makes paragraphs hard (or in some cases impossible) to spot if there is no horizontal or vertical space to mark the start.

zzzz
7
  • Compiles, but doesn't seem to have any effect in my case. Sep 13, 2019 at 22:12
  • @AnnieCarter you had not shown any information about your case. You have now shown that you have the (slightly bizarre) setting of \parindent and \parskip both zero, as \narrower indents by \parindent it does nothing here, but it is only a couple of lines, I will add something to my answer. Sep 14, 2019 at 15:09
  • @AnnieCarter answer updated Sep 14, 2019 at 15:12
  • Yeah, sorry about that. I thought this would be more trivial than it was (which I guess it would have been if the style file hadn't been redefining things). Sep 14, 2019 at 22:57
  • 1
    @AnnieCarter in the version you added to the question you have missed out the blank line after the second paragraph so \narrower finishes before the second paragraph ends, put a blank line before the } as I have in my answer Sep 14, 2019 at 23:03
1

You can search any of the default document classes and retrieve the definition of the quotation environment. See

  • book.cls:

    \newenvironment{quotation}
                   {\list{}{\listparindent 1.5em%
                            \itemindent    \listparindent
                            \rightmargin   \leftmargin
                            \parsep        \z@ \@plus\p@}%
                    \item\relax}
                   {\endlist}
    
  • report.cls:

    \newenvironment{quotation}
                   {\list{}{\listparindent 1.5em%
                            \itemindent    \listparindent
                            \rightmargin   \leftmargin
                            \parsep        \z@ \@plus\p@}%
                    \item\relax}
                   {\endlist}
    
  • article.cls:

    \newenvironment{quotation}
                   {\list{}{\listparindent 1.5em%
                            \itemindent    \listparindent
                            \rightmargin   \leftmargin
                            \parsep        \z@ \@plus\p@}%
                    \item\relax}
                   {\endlist}
    
  • letter.cls:

    \newenvironment{quotation}
                   {\list{}{\setlength\listparindent{1.5em}%
                            \setlength\itemindent{\listparindent}%
                            \setlength\rightmargin{\leftmargin}}%
                    \item[]}
                   {\endlist}
    

They're very similar across the classes.

You could also consider using the csquotes package which provides a comprehensive set of quotation functionality.

3
  • This is what I was looking for! Unfortunately, \list returns an undefined control sequence error. How would I include the csquotes package into my XeTeX file? Copy-paste the whole style file into my source? Sep 13, 2019 at 0:05
  • @AnnieCarter: You can view latex.ltx and extract any missing content there, including \list.
    – Werner
    Sep 13, 2019 at 16:02
  • 1
    @Werner really, you can't well you can, but \list is so deeply embedded in latex, you would have to include (or be able to remove) dependencies on almost all of latex including the latex output routine Sep 13, 2019 at 19:20

You must log in to answer this question.

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