Page layout and margins · การจัดหน้าและขอบกระดาษ
Controlling the page
- LaTeX's default page has generous, book-like margins. Sometimes you want more space.
- The
geometrypackage lets you set margins in one line:
- That gives a one-inch margin on all four sides. Try
2cm,1.5in, and see the text reflow.
การควบคุมหน้ากระดาษ
- หน้ากระดาษเริ่มต้นของ LaTeX มีขอบกว้างเหมือนหนังสือ บางครั้งคุณอาจต้องการพื้นที่มากขึ้น
- แพ็กเกจ
geometryช่วยให้คุณกำหนดขอบกระดาษได้ในบรรทัดเดียว:
\usepackage[margin=1in]{geometry}
- สิ่งนี้จะให้ขอบขนาด 1 นิ้ว ทั้งสี่ด้าน ลองใช้
2cm,1.5inและสังเกตการจัดเรียงข้อความใหม่
Fine control
- You can set sides separately:
- Useful when a binding needs extra room on the left, for example.
การปรับแต่งละเอียด
- คุณสามารถกำหนดแต่ละด้านแยกต่างหากได้:
\usepackage[top=2cm, bottom=2cm, left=3cm, right=2cm]{geometry}
- เป็นประโยชน์เมื่อมีการเย็บเล่มที่ต้องการพื้นที่เสริมทางซ้าย为例
Other handy commands
\newpageforces a page break;\todayprints the current date.\begin{center} ... \end{center}centres a block of text or an image.- These small tools let you shape a document to look exactly how you want.
คำสั่งที่มีประโยชน์อื่นๆ
\newpageบังคับให้ขึ้นหน้าใหม่;\todayแสดงวันที่ปัจจุบัน\begin{center} ... \end{center}จัดกึ่งกลางบล็อคข้อความหรือรูปภาพ- เครื่องมือเล็กๆ เหล่านี้ช่วยให้คุณสามารถปรับรูปแบบเอกสารให้ดูตามที่ต้องการได้อย่างสมบูรณ์
Common mistakes
- Load the
geometrypackage to change the margins. - Let LaTeX handle spacing — avoid forcing it with manual blank lines.
ข้อผิดพลาดที่พบบ่อย
- โหลดแพ็กเกจ
geometryเพื่อเปลี่ยนขนาดขอบกระดาษ - ปล่อยให้ LaTeX จัดการช่องว่าง — หลีกเลี่ยงการใช้บรรทัดว่างเพื่อบังคับเอง
The default margins are wide. Load the geometry package in the preamble with a one-inch margin: \usepackage[margin=1in]{geometry}. Run and watch the text spread out. · ขอบกระดาษเริ่มต้นมีความกว้าง ให้โหลดแพ็กเกจ geometry ในส่วนหัวด้วยขอบขนาดหนึ่งนิ้ว: \usepackage[margin=1in]{geometry}. รันโปรแกรมแล้วดูข้อความกระจายออก
Control the flow of pages. Force the second section onto a fresh page with \newpage, and centre the title line with a center environment. · ควบคุมการไหลของหน้า บังคับให้ส่วนที่สองขึ้นหน้าใหม่ด้วย \newpage และจัดกึ่งกลางบรรทัดหัวข้อด้วยเอนไวรอนเมนต์ center