สีและลิงก์
หน้านี้ต้องใช้เบราว์เซอร์ล่าสุด (รองรับ SharedArrayBuffer) กรุณาอัปเดต Chrome, Edge, Firefox หรือ Safari เป็นเวอร์ชันล่าสุด
English
Adding colour
- The
xcolorpackage lets you colour text. Load it, then wrap words:
\usepackage{xcolor}
...
\textcolor{red}{This is red} and \textcolor{blue}{this is blue}.
- Built-in names include
red,blue,green,orange,gray, and more.
English
Highlights and your own colours
\colorbox{yellow}{text}puts a highlight behind the words.- You can even mix your own:
\textcolor{red!60}{...}is 60% red (lighter).
English
Clickable links
- The
hyperrefpackage turns cross-references and web addresses into clickable links:
\usepackage{hyperref}
...
Visit \href{https://ctan.org}{CTAN} for packages.
- Load
hyperreflast in your preamble — it likes to have the final word.
English
Common mistakes
\textcolorwithoutxcolor. LaTeX stops with! Undefined control sequence.- A misspelt colour name.
\textcolor{rd}{...}gives! Package xcolor Error: Undefined color 'rd'. - Loading
hyperrefearly. Other packages can then break its links. Load it last in the preamble.
ความยาก 2/5 · 140 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
โหลด xcolor จากนั้นทำให้คำ warning เป็นสีแดงด้วย \textcolor{red}{warning} คุณจำเป็นต้องใช้ทั้งแพ็กเกจและคำสั่ง
คลิก Run เพื่อคอมไพล์และดูตัวอย่าง PDF
ความยาก 2/5 · 140 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
ทำ ลิงก์ที่คลิกได้ โหลด hyperref จากนั้นแปลงคำ CTAN ให้เป็นลิงก์ด้วย \href{https://ctan.org}{CTAN} โหลด hyperref เป็นอันสุดท้ายในส่วนหัว
คลิก Run เพื่อคอมไพล์และดูตัวอย่าง PDF
ความยาก 2/5 · 140 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
เน้นคำ Note ด้วยพื้นหลังสีเหลืองโดยใช้ \colorbox{yellow}{Note}. xcolor ถูกโหลดมาแล้ว
คลิก Run เพื่อคอมไพล์และดูตัวอย่าง PDF