如何在章节标题下添加作者副标题?

发布于 2024-08-06 11:58:36 字数 1459 浏览 2 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

倾城泪 2024-08-13 11:58:36

除了 titlesec(带有 explicit 选项)之外,您还可以使用 substr 包来创建将作者放入标题的语义方式。

然后,您可以这样编写章节:

\chapter{About random things on Internet, and another
procrastination issues. Alice Marigold}

在这种情况下,标题和作者用“.”分隔(如果您在标题之一中使用句点,则可以使用另一个分隔符)。然后你可以用titlesec修改\chapter格式。使用explicit选项,您可以使用#1直接访问标题内容。然后,您可以分别使用 substr 包中的命令 \BeforeSubString\BehindSubString 将标题和作者分开。它们有两个参数:分隔符标记(在本例中为“.”)和字符串(标题.作者)。

举个简单的例子:

\titleformat{\chapter}[hang]{}{%
   \Huge \thechapter.
}{1cm}{%
   \LARGE \scshape \BeforeSubString{. }{#1}\\
   {\Large \itshape ---\BehindSubString{. }{#1}---}%
}

结果与此类似。

可以制作不同形式的地点标题和作者,包括将其放在左侧。这是我在 LaTeX 演示中使用的示例,带有 calc 包:

\titleformat{\chapter}[hang]{}{%
   \Huge \thechapter.
}{1cm}{%
   \LARGE \scshape \BeforeSubString{. }{#1}\\
   \makebox[\textwidth - (1cm + \widthof{\Huge \thechapter.})][r]{\Large \itshape \BehindSubString{. }{#1}}%
}

关于目录,您可以忽略它,将没有作者的标题放在 \chapter 中可选参数,或使用 titletoc 修改它。

并且用这两个包编写多信息标题有无限的可能性...

PD:抱歉,但由于某种原因我无法将 CTAN 链接放到包中。

You can use the substr package in addition of titlesec (with explicit option) for create a semantic way of putting authors in titles.

Then, you can write your chapter on this way:

\chapter{About random things on Internet, and another
procrastination issues. Alice Marigold}

In this case the title and the author are separated for a ". " (You can use another separator if you use periods in one of your titles). Then you can modify the \chapter format with titlesec. With the explicit option you can access directly to the title content with #1. Then you can separate the title and the author with the commands \BeforeSubString and \BehindSubString of the substr package, respectively. They have two arguments: the separator token (in this case is ". ") and the string (the title. author).

For a simple example:

\titleformat{\chapter}[hang]{}{%
   \Huge \thechapter.
}{1cm}{%
   \LARGE \scshape \BeforeSubString{. }{#1}\\
   {\Large \itshape ---\BehindSubString{. }{#1}---}%
}

The result is similar to this.

You can make very different forms of place titles and authors, including putting it on the left. This is a example I used in a LaTeX demonstration, with the calc package:

\titleformat{\chapter}[hang]{}{%
   \Huge \thechapter.
}{1cm}{%
   \LARGE \scshape \BeforeSubString{. }{#1}\\
   \makebox[\textwidth - (1cm + \widthof{\Huge \thechapter.})][r]{\Large \itshape \BehindSubString{. }{#1}}%
}

About the table of contents, you can ignore it putting the title without the author in the \chapter optional argument, or modify it with titletoc.

And there are infinite possibilities of writing multi-information titles with these two packages...

PD: Sorry, but for some reason I can't put the CTAN links to the packages.

倾城月光淡如水﹏ 2024-08-13 11:58:36

为什么不使用专为会议记录等设计的包,例如 这个?

Why not use a package designed for things like conference proceedings, such as this one?

荭秂 2024-08-13 11:58:36

CTAN 上搜索了一下,我找到了 bits 包似乎完全符合您的要求。从描述来看:

一个 LaTeX 包,为称为“位”的新想法提供程序员界面,它类似于一个环境,但具有标题、作者和其他通常仅与文档环境相关联的属性。

请注意,该软件包声称“不受支持”。

还有组合

组合类允许您将各个文档捆绑到一个文档中,例如在准备会议记录时。辅助组合包将 \maketitle 命令中的标题和作者放入主文档的目录中。该包与摘要和标题包配合。

可能还有其他的,但正如你所说,寻找起来并不容易。

Grubbing around on CTAN a bit brought me to the bits package which appears to do exactly what you want. From the description:

A LaTeX package that provides a programmer's interface for a new idea called a “bit”, which is like an environment but has a title, author, and other attributes usually only associated with the document environment.

Be warned that the package claims to be "unsupported".

There is also combine:

The combine class lets you bundle individual documents into a single document, such as when preparing a conference proceedings. The auxiliary combinet package puts the titles and authors from \maketitle commands into the main document's Table of Contents. The package cooperates with the abstract and titling packages.

and there may be others, but as you say, it is not easy to search for.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文