Your first document
あなたの最初のLaTeX文書
- LaTeX を使えば美しい文書(レポート、書籍、特に数学関連)を作れます。
- コマンド付きの plain text を書き、コンピュータがそれを洗練された PDF に変換します。
- LaTeXは当社のサーバーでコンパイルされます — Run を押すと、コードの横にPDFが表示されます。
文書の構造
- 文書には2つの部分があります — preamble と body:
\documentclass{article}
\begin{document}
Hello, world!
\end{document}
\documentclass{article}は preamble です — 文書の種類を設定します。\begin{document}と\end{document}の間にあるすべてが body です — PDFに実際に表示される部分です。
あなたも試してみよう
- 以下に文書の骨子を示します。bodyに挨拶を追加してください。
- Run を押してコンパイルしPDFを確認し、正しいと思ったら Check を押してください。
よくあるミス
-
\begin{document}の前のテキスト。 プアアンブルームには設定のみを含めます。LaTeX は! LaTeX Error: Missing \begin{document}.で停止します。 -
本文内の裸の
&または%。&は! Misplaced alignment tab character &.を生成します。%はエラーを出ませんが、コメントを開始するため行の残りを隠してしまいます。\&と\%を書いてください。 -
最初のエラーから読み始める。 一つのミスが多数のメッセージを引き起こすことがあります。
!で始まる 最初 の行を修正してから、再度実行します。 -
Check は指定されたソース構文を検索する。Run はドキュメントをコンパイルしてプレビューします。TeX エラーの検出と結果の確認には Run を使用してください。
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
The skeleton below is a complete LaTeX document. Replace the comment in the 本体 with a greeting (any text containing the word Hello), then click Run to compile it and see the PDF.
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
Options in square brackets change the whole document. Make the text bigger by adding the [12pt] option: \documentclass[12pt]{article}. Run and see every letter grow.
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
Some characters are commands in LaTeX. % starts a comment, so the rest of this line vanishes. Escape the two special characters with a backslash: write 50\% かつ \&.