> For the complete documentation index, see [llms.txt](https://ayakaleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ayakaleaf-pro.ayaka.space/latex/zh-cn/shen-du-wen-zhang/25-how-to-create-a-multilingual-customisable-cd-disk-jewel-case-calendar-using-latex.md).

# 如何使用 LaTeX 创建一个可定制的多语言 CD 盒日历

LaTeX 的多功能性使它成为一个相当方便（而且免费！）的工具，可用于制作各种实用内容，包括月历。所以这是我尝试制作一个 [LaTeX 类和模板](https://www.overleaf.com/read/vtqtzgbcvmbg) 用于创建可自定义的多语言月历，可放入 CD 或 3.5" 软盘盒中。可以添加图片和事件，而且你可以为日历选择任意月份范围——不必从一月开始，也不必在十二月结束。

[![{{{alt}}}](/files/2c2db6f2177e41083fe38304420d1df99af50945)](https://www.overleaf.com/read/vtqtzgbcvmbg)

你可以把它们用于个人用途，作为特殊活动的礼物或纪念品，例如周年纪念。如果你正好在经营社团或协会，它们也可以用于宣传或作为周边商品。例如，你可以为当地的观鸟俱乐部制作一份展示你所在社区常见鸟类的日历。从工作角度看，你也许会想为你的期刊论文阅读小组制作一份日历，突出显示你所在领域下学期作业和会议投稿的重要日期。

### 月历

该 `cdcalendar` 类会将日历尺寸设置为 [可放入 CD 盒中](https://www.overleaf.com/read/htkctjjgmxjx)，并将其排版在 A4 纸上：

```latex
\documentclass[12pt]{cdcalendar}
\begin{document}

%% June 2015
\monthCalendar{2015}{06}
\clearpage

%% July 2015
\monthCalendar{2015}{07}
\end{document}
```

如果你想制作一个更小的日历，以便 [放入 3.5" 软盘盒中](https://www.overleaf.com/read/vtqtzgbcvmbg) ，那么改为传入 `small` 选项到 `cdcalendar` 类：

```latex
\documentclass[9pt,small]{cdcalendar}
```

对于有兴趣了解技术细节的人：该日历使用 `tikz`进行渲染，而 2 页合一或 4 页合一的排版则通过 `pgfpages`.

### 添加插图

我定义了一个 `\illustration` 用于向日历的每一页添加图形的命令：

```latex
\usepackage{graphicx}

%% syntax: \illustration[caption]{width}{image-file-name}
\illustration[We had fun at the birthday party!]{8.5cm}{Party.jpg}
```

图片会添加到当前页面的左上角。原始比例会被保留，因此你需要选择一个比例合适的插图来填充空白空间。

### 添加/标记事件

你可以使用 `\event` 命令：

```latex
\event{2015-10-25}{Daylight saving time ends}
```

来在每个月中标记事件。该事件会列在月历上方，而日期会在日历中被圈出。事件必须给出 *在* 相关的 `\monthCalendar` ，并且要在同一页上。

如果你的事件持续数天，你可以将持续时间（以天为单位）作为 `\event`:

```latex
\event[5]{2015-07-26}{ACL 2015, Beijing}
```

的选项；或者，你也可以改为提供 *结束日期* 作为选项：

```latex
\event[2015-07-31]{2015-07-26}{ACL 2015, Beijing}
```

这两种命令形式会得到相同的输出。

如果一个事件跨越两个月，例如 `\event[9]{2015-06-27}{Summer Camp}`，那么你必须在这两个月中都发出这条命令，也就是在六月一次、在七月一次：

```latex
\monthCalendar{2015}{06}
\event[9]{2015-06-27}{Summer Camp}
\clearpage

\monthCalendar{2015}{07}
\event[9]{2015-06-27}{Summer Camp}
\clearpage
```

### 多语言日历

日期、月份名称和星期首字母可以本地化为该 `babel`, `translator` 和 `datetime2`.

例如，要获得带有西班牙语日期的日历，只需传入 `西班牙语` 作为类选项：

```latex
\documentclass[12pt,spanish]{cdcalendar}
```

我们已测试以下语言选项： `british, spanish, french, ngerman, italian, portuges, polish, croatian, greek`.

只需记得 [使用 LuaLaTeX](https://www.overleaf.com/blog/167) 来编译你的项目，如果它使用的是 `french`——它与 PDFLaTeX 配合得不太好，而 XeLaTeX 也不太适合这个模板。

### 自定义样式

大多数元素的字体和颜色都可以在日历的任何位置进行自定义；请查看模板以了解一些示例。为了方便起见，还提供了一个 `\makeCover` 命令（以及所需的元数据命令）。

制作它很有趣 [这个模板](https://www.overleaf.com/read/vtqtzgbcvmbg)——我们相信你一定会为这个日历找到更多用途。祝使用愉快！


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://ayakaleaf-pro.ayaka.space/latex/zh-cn/shen-du-wen-zhang/25-how-to-create-a-multilingual-customisable-cd-disk-jewel-case-calendar-using-latex.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
