\jot ทำให้ได้ระยะที่ห่างขึ้นอึดอัดน้อยลง\documentclass[12pt]{article}
\usepackage[margin=1in,a4paper]{geometry}
\usepackage{amsmath,amssymb}
\begin{document}
\begingroup
\addtolength{\jot}{5mm}
\begin{align}
\textit{CPU time}
&= \textit{CPU clock cycles}\times\textit{Clock cycle time}\\
&= \frac{\textit{CPU clock cycles}}{\textit{Clock rate}}\\
&= \frac{\textit{Instruction count}\times\textit{CPI}}{\textit{Clock rate}}\\
&= \frac{\sum_{i=1}^{n}(\textit{Inst count}_i\times\textit{CPI}_i)}
{\textit{Clock rate}}
\end{align}
\endgroup
\begin{align}
\textit{CPU time}
&= \textit{CPU clock cycles}\times\textit{Clock cycle time}\\
&= \frac{\textit{CPU clock cycles}}{\textit{Clock rate}}\\
&= \frac{\textit{Instruction count}\times\textit{CPI}}{\textit{Clock rate}}\\
&= \frac{\sum_{i=1}^{n}(\textit{Inst count}_i\times\textit{CPI}_i)}
{\textit{Clock rate}}
\end{align}
\end{document}
จะได้ผลตามรูปข้างล่าง จะเห็นว่าระยะห่างดูดีขึ้น ไม่อึดอัด
คำสั่ง \begingroup และ \endgroup ใช้กำหนดให้การเพิ่มระยะ มีผลเฉพาะในส่วนนี้เท่านั้น ไม่กระทบกับส่วนอื่นของเอกสาร
ที่มา: http://tex.stackexchange.com/questions/14679/amsmath-align-environment-row-spacing

2 comments:
สงสัยว่าทำไมต้องจงใจใส่ \textit ครับ ผมว่ามันน่าจะเอียงอยู่แล้ว ปกติเวลาพิมพ์คำยาวๆใน math environment ผมทำกลับกันคือใช้ \text ทำให้มันตรง
ผมใช้ \textit เพราะต้องการไปมันแสดงตัวอักษรต่อกันเหมือนเป็นคำเดียวกัน และเว้นวรรคได้ด้วย ถ้าไม่ใช้ \textit ตัวอักษรมันจะห่างๆ กัน เหมือนเป็นตัวแปรหลายๆ ตัวที่มาคูณกันน่ะ
Post a Comment