代码如下:
\documentclass[11pt]{book}
%%%%********************************************************************
\usepackage{microtype}
\usepackage{times}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{lipsum}
%%%%********************************************************************
% fancy quotes
\definecolor{quotemark}{gray}{0.7}
\makeatletter
\def\fquote{%
\@ifnextchar[{\fquote@i}{\fquote@i[]}%]
}%
\def\fquote@i[#1]{%
\def\tempa{#1}%
\@ifnextchar[{\fquote@ii}{\fquote@ii[]}%]
}%
\def\fquote@ii[#1]{%
\def\tempb{#1}%
\@ifnextchar[{\fquote@iii}{\fquote@iii[]}%]
}%
\def\fquote@iii[#1]{%
\def\tempc{#1}%
\vspace{1em}%
\noindent%
\begin{list}{}{%
\setlength{\leftmargin}{0.1\textwidth}%
\setlength{\rightmargin}{0.1\textwidth}%
}%
\item[]%
\begin{picture}(0,0)%
\put(-15,-5){\makebox(0,0){\scalebox{3}{\textcolor{quotemark}{``}}}}%
\end{picture}%
\begingroup\itshape}%
%%%%********************************************************************
\def\endfquote{%
\endgroup\par%
\makebox[0pt][l]{%
\hspace{0.8\textwidth}%
\begin{picture}(0,0)(0,0)%
\put(15,15){\makebox(0,0){%
\scalebox{3}{\color{quotemark}''}}}%
\end{picture}}%
\ifx\tempa\empty%
\else%
\ifx\tempc\empty%
\hfill\rule{100pt}{0.5pt}\\\mbox{}\hfill\tempa,\ \emph{\tempb}%
\else%
\hfill\rule{100pt}{0.5pt}\\\mbox{}\hfill\tempa,\ \emph{\tempb},\ \tempc%
\fi\fi\par%
\vspace{0.5em}%
\end{list}%
}%
\makeatother
%%%%********************************************************************
\begin{document}
\chapter{Graph theory}
\begin{fquote}[Lewis Carroll][Alice in Wonderland][1899]Begin at the beginning,'' the King said, gravely, ``and go on till you come to an end; then stop.
\end{fquote}
\lipsum[2]
\begin{fquote}[Lewis Carroll][Alice in Wonderland][1899]Begin at the beginning,'' the King said, gravely, ``and go on till you come to an end; then stop.
\end{fquote}
\lipsum[2]
\end{document}效果图:


发表评论 取消回复