為什麼我收到“\dictumrule undefined”。或“未定義的控制序列。\dictumrule”錯誤?

為什麼我收到“\dictumrule undefined”。或“未定義的控制序列。\dictumrule”錯誤?

我意識到這有點具體,但這是唯一一個始終產生錯誤的 KOMA-Script 命令,它讓我發瘋,因為我在任何地方都找不到解決方案(而且我通常非常徹底)。我使用 Windows 上的 TeXstudio 作為我的環境,它內建了 KOMA。


[最終更新]請參閱 touhami 發布的答案。


這是直接從這個問題中提取的一些程式碼http://tex.stackexchange.com/questions/193178/specific-epigraph-style

\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}

這是編譯時的錯誤訊息:

\dictumrule undefined. \renewcommand*\dictumrule

如果我只是將其放在\dictumrule文件中的某個位置,則會出現更常見的錯誤形式:

Undefined control sequence. \dictumrule

就與具體相關的錯誤而言\dictumrule,我在搜尋中發現的唯一錯誤是來自 LyX 幫助網站的此問題的錯誤http://t101479.editors-lyx-general.editortalk.info/changing-the-dictum-style-in-koma-script-t101479.html

command \dictumrule already defined

這幾乎與我的問題完全相反,所以不是特別有幫助。

我的目的是在文章開頭的標題和正文之間引用一段引文。我完全意識到我可以使用它來實現相同的結果\epigraph(如果在這裡無法獲得有效的解決方案,我會這樣做),但是我投入了太多的精力來解決這個問題,以至於在沒有發現某種解決方案的情況下放棄它。

[更新]回應 touhami 的回答:我很抱歉我沒有提供更多關於我想要完成的任務的細節。

epigraph這是使用大致模仿先前程式碼的輸出的套件的程式碼。

\documentclass{scrbook}
\usepackage{epigraph}
\setlength{\epigraphwidth}{0.75\textwidth}

\begin{document}

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

\end{document}

我真正想要的是消除引用和作者之間的規則。對於epigraph包,我只需添加

\setlength{\epigraphrule}{0pt}

到序言得到

劉易斯卡羅爾名言 理論上,要進行相同的更改,\dictum我將替換

\renewcommand*\dictumrule{}

\newcommand*{\dictumrule}{\vskip-1ex\hrulefill\par}
\renewcommand*\dictumrule{0pt}

然而,這會產生

劉易斯卡羅爾名言

我最初沒有這麼說,因為我認為這只是潛在錯誤的症狀。

[更新2]@圖哈米

這正是我遵循@egreg的建議後在編輯器中得到的內容:

\documentclass{scrbook}

\setkomafont{dictumtext}{\itshape\small}
\setkomafont{dictumauthor}{\normalfont}
\renewcommand*\dictumwidth{.75\linewidth}
\renewcommand*\dictumauthorformat[1]{--- #1}
\providecommand\dictumrule{}
\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}

我得到的輸出與輸出完全相同上面的規則。

我該如何擺脫規則?

答案1

更新Koma 腳本文檔

在此輸入影像描述

\newcommand*{\dictumrule}{\vskip-1ex\hrulefill\par}

所以更新套件就可以解決這個問題。

相關內容