特定的 \epigraph 风格

特定的 \epigraph 风格

我正在尝试创建\epigraph如图所示的内容。我想将其放置在空白页面的右下角,并采用如图所示的样式。我正在使用代码。我该如何修改它才能得到我想要的?我不想在引文和来源之间有一条线……基本上就是下面显示的样式。

在此处输入图片描述

\documentclass{book}
\usepackage{amsmath,amsfonts,mathabx}
\usepackage{epigraph}

\setlength\epigraphwidth{.8\textwidth}

\thispagestyle{empty}

\begin{document}

\vspace*{\fill}
\epigraph{Begin at the beginning, the King said gravely, ``and go on till you come to the end: then stop.''}{Lewis Carroll, \textit{Alice in Wonderland}}

\end{document}

答案1

解决方案包括epigraph使用该包修补一些内部命令,etoolbox以便题词文本的默认字体形状为斜体(在 upshape 上下文中):

    \documentclass[12pt]{book}
    \usepackage[utf8]{inputenc}
    \usepackage[T1]{fontenc}
    \usepackage{amsmath,amsfonts,mathabx}
    \usepackage{ebgaramond}
    \usepackage{epigraph}
    \renewcommand\textflush{flushright}

    \usepackage{etoolbox}
    \makeatletter
    \newlength\epitextskip
    \pretocmd{\@epitext}{\em}{}{}
    \apptocmd{\@epitext}{\em}{}{}
    \patchcmd{\epigraph}{\@epitext{#1}\\}{\@epitext{#1}\\[\epitextskip]}{}{}
    \makeatother

    \setlength\epigraphrule{0pt}
    \setlength\epitextskip{2ex}
    \setlength\epigraphwidth{.8\textwidth}

    \thispagestyle{empty}

    \begin{document}

    \vspace*{\fill}
    \epigraph{For the Snark \emph{was} a Boojum,  you see.}{Lewis Carroll, \emph{The Hunting of the Snark}
    }

    \end{document} 

在此处输入图片描述

答案2

您需要添加到代码中的是

\setlength\epigraphrule{0pt}

完整示例:

\documentclass{book}
\usepackage{epigraph}

\setlength\epigraphwidth{.8\textwidth}
\setlength\epigraphrule{0pt}

\begin{document}

\thispagestyle{empty}
\vspace*{\fill}
\epigraph{\itshape Begin at the beginning, the King said gravely, ``and go on till you come to the end: then stop.''}{---Lewis Carroll, \textit{Alice in Wonderland}}

\end{document}

在此处输入图片描述

答案3

这不是您问题的答案,而是使用 KOMA-Script 的解决方案。

在此处输入图片描述

选项1:

\documentclass{scrbook}

\setkomafont{dictumtext}{\itshape\small}
\setkomafont{dictumauthor}{\normalfont}
\renewcommand*\dictumwidth{.75\linewidth}
\renewcommand*\dictumauthorformat[1]{--- #1}
\renewcommand*\dictumrule{}

\begin{document}

\thispagestyle{empty}
\vspace*{\fill}
\dictum[Lewis Carroll, \emph{Alice in Wonderland}]{Begin at the beginning, the King said gravely, ``and go on till you come to the end: then stop.''}

\end{document}

选项 2:

\documentclass{book}
\usepackage{scrextend}

\setkomafont{dictumtext}{\itshape\small}
\setkomafont{dictumauthor}{\normalfont}
\renewcommand*\dictumwidth{.75\linewidth}
\renewcommand*\dictumauthorformat[1]{--- #1}
\renewcommand*\dictumrule{}

\begin{document}

\thispagestyle{empty}
\vspace*{\fill}
\dictum[Lewis Carroll, \emph{Alice in Wonderland}]{Begin at the beginning, the King said gravely, ``and go on till you come to the end: then stop.''}

\end{document}

选项 3:

\documentclass{book}

\makeatletter
\newcommand{\dictum}[2][]{\par%
  \begingroup
    \raggeddictum\parbox{\dictumwidth}{%
      {\@dictumfont{\raggeddictumtext #2\strut\par}%
        \def\@tempa{#1}\ifx\@tempa\@empty\else%
          {\raggeddictumtext\dictumrule}%
          \raggeddictumauthor\@dictumauthorfont\dictumauthorformat{#1}%
          \strut\par%
        \fi%
      }%
    }\par%
  \endgroup
}

\newcommand*{\dictumrule}{}
\newcommand*{\dictumwidth}{.75\textwidth}
\newcommand*{\raggeddictum}{\raggedleft}
\newcommand*{\dictumauthorformat}[1]{--- #1}
\newcommand*{\raggeddictumtext}{\raggedright}
\newcommand*{\raggeddictumauthor}{\raggedleft}
\newcommand*{\@dictumfont}{\itshape\small}
\newcommand*{\@dictumauthorfont}{\normalfont}
\makeatother

\begin{document}

\thispagestyle{empty}
\vspace*{\fill}
\dictum[Lewis Carroll, \emph{Alice in Wonderland}]{Begin at the beginning, the King said gravely, ``and go on till you come to the end: then stop.''}

\end{document}

相关内容