Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Background

Created a custom command for rendering quotations (epigraphs).

Problem

The text in the following image has no space at the border:

enter image description here

The word "and" is flush with the right margin.

Code

% Double-line for start and end of epigraph.
\newcommand{\epiline}{\hrule \vskip -.2em \hrule}
% Massively humongous opening quotation mark.
\newcommand{\hugequote}{%
  \fontsize{42}{48}\selectfont\color{quotationmarkcolour}\textbf{``}%
  \vskip -.5em%
}

% Make the box around quotations fit snugly to the epilines.
\setlength\fboxrule{0pt}
\setlength\fboxsep{0pt}

% Beautify quotations.
\newcommand{\epigraph}[2]{%
  \vskip -1.5em%
  \colorbox{quotationcolour}{%
    \begin{minipage}{\linewidth}%
    \hangindent 1.1em%
    \epiline \vskip 1em {\hugequote} \vskip -.5em%
    \parindent 2.2em%
    \setlength\marginparsep{-1.1em}%
    #1\begin{flushright}\color{quotationmarkcolour}\textsc{#2}\hspace*{1em} ~\end{flushright}%
    \epiline%
    \end{minipage}%
  }%
  \bigskip
}

Question

How would you fix the above code to adjust the inner margins of the minipage so that the word "and" (and the quotation marks) is no longer flush with the edge of its containing box, but inset by, say, 1.1em?

Ideas

  • Used \begin{quotation}#1\end{quotation}; it added too much left and right padding.
  • \addtolength\rightmargin{-1.1em}%.
  • Various \begin{minipage}{\linewidth}% settings.
share|improve this question

1 Answer 1

up vote 5 down vote accepted

I got something by enclosing the quoted text inside another box, this time a \parbox. The width of the parbox is 2.2em less than the width of the entire box. Then just make the left offset.

\newcommand{\epigraph}[2]{%
  \vskip -1.5em%
  \colorbox{quotationcolour}{%
    \begin{minipage}{\linewidth}%
    \dimen0\linewidth
    \advance\dimen0 by -3.3em
    \hangindent 1.1em%
    \epiline \vskip 1em \hspace{1.1em}{\hugequote} \vskip -.5em%
    \hspace{1.1em}
    \parbox{\the\dimen0}{
        \parindent 2.2em%
        \setlength\marginparsep{-1.1em}%
        #1}%
    \begin{flushright}\color{quotationmarkcolour}\textsc{#2}\hspace*{1em} ~\end{flushright}%
    \epiline%
    \end{minipage}%
  }%
  \bigskip
}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.