> 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/ja/xiang-xi-ji-shi/02-a-quick-visual-guide-to-creating-table-cells-with-diagonal-lines-in-latex.md).

# LaTeXで斜線入りの表セルを作成するための簡単なビジュアルガイド

LaTeX には表の作成を助ける多くのパッケージがあります— [booktabs](https://www.ctan.org/pkg/booktabs) はよく知られた例です。また、オンラインで利用できる自動表生成ツールも増えてきており（たとえば [こちら](https://www.tablesgenerator.com/)）を使えば、表の LaTeX コードを手入力せずに作成できて便利です。さらに、 [とても長い表](https://www.overleaf.com/read/xxwzfxkxxjmc) の作成を助けるパッケージさえあります！ では、表の特定のセルに追加のスタイルや書式を加えたい場合はどうすればよいのでしょうか？

簡単に言うと、たいていはそのためのパッケージがあります！ ここではセル書式の一種である、対角線入りの表セルを作成する方法に注目します。これらの対角線は、表の左上隅でよく使われ、行見出しと列見出しの両方を同じセルに配置できるようにします。これを実現するために使える似たパッケージが 2 つあります： `slashbox` と `diagbox`.

実際に試せるように、 [短い例](https://www.overleaf.com/read/zrnpkbmzvtk) を追加しました。これらのパッケージを使って表セルに対角線を作成する方法を示しています。中には `diagbox` を使う人もいます。というのも、 `slashbox` で生成される線はよりギザギザになることがある一方で、 `diagbox` の線はより滑らかだからです。とはいえ、例には両方のオプションを含めているので、ご自身で選べます！

さらに、ファイルを追加する方法を示したアニメーション GIF も用意しました。 `slashbox.sty` を CTAN リポジトリから直接プロジェクトに追加します。

![Overleaf で表に slashbox と diagbox の LaTeX パッケージを使う](/files/94eb99af5c3834d9bd30a895379cc77f945acaa0)

お役に立てば幸いです。さらにアニメーション GIF のチュートリアルをご覧になりたい場合は、ぜひ [お知らせください](https://www.overleaf.com/contact).


---

# 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/ja/xiang-xi-ji-shi/02-a-quick-visual-guide-to-creating-table-cells-with-diagonal-lines-in-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.
