> For the complete documentation index, see [llms.txt](https://overleaf-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://overleaf-pro.ayaka.space/latex/zh-cn/shen-ru-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}

%% 2015年6月
\monthCalendar{2015}{06}
\clearpage

%% 2015年7月
\monthCalendar{2015}{07}
\end{document}
```

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

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

对于那些对技术细节感兴趣的人：日历是用 `tikz`渲染的，而 2-up 或 4-up 排版则通过 `pgfpages`.

### 添加插图

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

```latex
\usepackage{graphicx}

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

图片将添加到当前页面的左上方。原始比例会被保留，因此你必须选择一个比例合适的插图，以适配空白区域。

### 添加/标记事件

你可以使用 `\event` 命令设置为特定值：

```latex
\event{2015-10-25}{夏令时结束}
```

来在每个月中标记事件。该事件将列在月历上方，日期则会在日历中圈出。事件必须给出 *后添加浮动位置修饰符* 相关的 `\monthCalendar` 并且位于同一页上。

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

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

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

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

这两种命令形式都会产生相同的输出。

如果一个事件跨越两个月，例如 `\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) 来编译你的项目，如果它是 `法语`——它与 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://overleaf-pro.ayaka.space/latex/zh-cn/shen-ru-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.
