它能证明 fancychap 的合理性吗?

它能证明 fancychap 的合理性吗?

向许多 LaTeX 专家问好!我正在使用 fncychap (Bjornstrup)。我想知道是否可以将标题名称在方框内对齐(附有说明性照片)。由于我的章节标题很长(3-4 行),我希望通过对齐(对齐)它来使其看起来更好。这可行吗?有人可以教我如何操作它吗?

在此处输入图片描述

提前非常感谢!

\usepackage[b5paper, right=25mm, left=25mm, top=30mm, bottom=35mm]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[Bjornstrup]{fncychap}

\begin{document}

\chapter{this is a loooooooong title, this is a test, this is a test. this is a test. this is a test. this is a test. thisisatest. this is a test, thisisatest, this is a test, this is a longtitle}

\end{document}


答案1

您可以minipage在章节命令中放置适当宽度的:

小页面

根据您想要的效果,您可能需要调整宽度,和/或使用手动换行符来调整任何连字符。

平均能量损失

\documentclass{book}
\usepackage[b5paper, right=25mm, left=25mm, top=30mm, bottom=35mm]{geometry}
%\usepackage[T1]{fontenc}
%\usepackage[utf8]{inputenc}
\usepackage[Bjornstrup]{fncychap}

\begin{document}


\chapter{\begin{minipage}{4in}this is a loooooooong title, this is a test, this is a test. this is a test. this is a test. this is a test. thisisatest. this is a test, thisisatest, this is a test, this is a longtitle\end{minipage}}

\end{document}

答案2

在如此大的字体尺寸下,对齐看起来会很糟糕。你会得到太大的单词间距,而且章节标题中的连字符通常看起来也很奇怪。最好的方法是手动分割行,这样它就符合含义并给出好看的结果。

\documentclass{book}
\usepackage[b5paper, right=25mm, left=25mm, top=30mm, bottom=35mm]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[Bjornstrup]{fncychap}

\begin{document}

\chapter[text for the table of contents]
{this is a loooooooong title, this is a test, \\
 this is a test. this is a test. this is a test. \\ 
 this is a test. thisisatest. this is a test,\\ 
 thisisatest, this is a test, this is a longtitle!}

\end{document}

在此处输入图片描述

相关内容