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.

Please help me to figure out how to produce with that:

I have the following code:

\epigraph{«Теперь нам ясно, что вся структура теории чисел держится на одном
основании, а именно, на алгоритме для нахождения наибольшего общего делителя двух 
чисел. Все последующие теоремы — это только элементарные заключения из этого 
изначального открытия...» }{\itshape — Лежён Дирихле, Лекции по теории чисел.}

Here is all properties I have changed related to epigraphs.

\renewcommand{\epigraphrule}{0pt}
\setlength{\epigraphwidth}{.6\textwidth}
\renewcommand{\textflush}{flushepinormal}

This is what I want to see (please open it with right click in new windows for full view):

Image

Actually, I would like to have two things:

  • to add some indent to the epigraph

  • to remove the default rule and the "vertical space" as well

I found the way how to remove the default line but the space is still exist. I think there are plenty of ways to remove the empty line as well, (i.e. by adding \vskip -10pt before the author line) but I looking for the most elegant way, just to have it in mind for future uses with other modules.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

In \epigraph{<text>}{<source>}, <text> is set in a minipage with a fixed gap of 1ex between the <text> and <source> easiest would be to copy the code that typesets <text>, contained in \@epitext and modify it to your requirements. Using etoolbox to patch it is also a possibility:

enter image description here

\documentclass{article}
\usepackage{epigraph}% http://ctan.org/pkg/epigraph
\renewcommand{\epigraphrule}{0pt}
\setlength{\epigraphwidth}{.6\textwidth}
\renewcommand{\textflush}{flushepinormal}
\makeatletter
% Taken and updated from http://mirrors.ctan.org/macros/latex/contrib/epigraph/epigraph.dtx
\renewcommand{\@epitext}[1]{%
  \begin{minipage}{\epigraphwidth}\begin{\textflush} \hspace*{20pt}#1\\
    \ifdim\epigraphrule>\z@ \@epirule \else \vspace*{-.5\baselineskip} \fi
  \end{\textflush}\end{minipage}}
\makeatother
\begin{document}
\epigraph{%
  \indent Lorem ipsum dolor sit amet, consectetur adipiscing elit. 
  Duis sodales venenatis dapibus. Maecenas malesuada luctus 
  felis quis suscipit. Vestibulum tristique ipsum id nulla 
  pharetra feugiat. Etiam nec rhoncus ipsum. Mauris suscipit 
  egestas mauris, nec malesuada eros bibendum feugiat.}
  {Lorem Ipsum}
\end{document}

The default paragraph indent is 20pt, but is removed when inside a minipage. So, using \hspace*{20pt} helps obtain that intended \parindent. Also, I've updated the \vspace, which is set to 1ex by default, to something else. Again, change this to your required liking.

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.