Caách căn đều hai bên đoạn văn trong latex năm 2024

_Hello! This is a simple example that shows how easy it is to create a LATEX file. Note that the page is automatically numbered at the bottom. Anything following a percent sign (%) is ignored up to the end of the line. Today’s date is Ngày 26 tháng 10 năm 2015.

This is the start of the second paragraph. Footnotes are easy 1 ._

Yêu cầu: Gõ đoạn thứ nhất thành font sans serif lớn, giữa đoạn văn thứ 2 font Roman thường. Sau đó nhấn mạnh chữ Footnotes, rồi thay đổi toàn bộ font của đoạn thứ 2 thành nghiêng.

Bài làm:

\documentclass[a4paper,12pt]{article}
\begin{document}
{\sffamily \large Hello!
This is a simple example that shows how easy it is to create a \LaTeX\ file.
Note that the page is automatically numbered at the bottom. Anything following a percent
sign (\%) is ignored up to the end of the line.
Today’s date is \today.}
{\itshape This is the start of the second paragraph.
{\em Footnotes} are easy\footnote{Here is a footnote}}
\end{document}

Kết quả hiển thị:

Caách căn đều hai bên đoạn văn trong latex năm 2024

Nhận xét: Trong văn bản trên, khi chuyển đoạn 2 sang chữ in nghiêng thì phần nhấn mạnh lại chuyển về font thường.

2. Ký hiệu, các dấu và trọng âm

  • Trong LaTex có nhiều ký hiệu đặc biệt và các ký tự không có trên bàn phím. Để hiển hị chúng trên văn bản, ta cần sử dụng các lệnh. Bảng Symbols:
    Caách căn đều hai bên đoạn văn trong latex năm 2024
  • Các ký hiệu ngăn cách thông thường được nhập bình thường:

    {\centering This paragraph here is fully jusstified, but note how we have}\linebreak forced the end of the line to occur before the word “forced”.\par {\centering These lines\are centred.\par} {\raggedleft Here we have some\left justified\text.\par} {\raggedright Here we have some\right jusstified\text.\par} \centerline{This text is centered.}

    5,

    {\centering This paragraph here is fully jusstified, but note how we have}\linebreak forced the end of the line to occur before the word “forced”.\par {\centering These lines\are centred.\par} {\raggedleft Here we have some\left justified\text.\par} {\raggedright Here we have some\right jusstified\text.\par} \centerline{This text is centered.}

    6,

    {\centering This paragraph here is fully jusstified, but note how we have}\linebreak forced the end of the line to occur before the word “forced”.\par {\centering These lines\are centred.\par} {\raggedleft Here we have some\left justified\text.\par} {\raggedright Here we have some\right jusstified\text.\par} \centerline{This text is centered.}

    7,

    {\centering This paragraph here is fully jusstified, but note how we have}\linebreak forced the end of the line to occur before the word “forced”.\par {\centering These lines\are centred.\par} {\raggedleft Here we have some\left justified\text.\par} {\raggedright Here we have some\right jusstified\text.\par} \centerline{This text is centered.}

    8,

    {\centering This paragraph here is fully jusstified, but note how we have}\linebreak forced the end of the line to occur before the word “forced”.\par {\centering These lines\are centred.\par} {\raggedleft Here we have some\left justified\text.\par} {\raggedright Here we have some\right jusstified\text.\par} \centerline{This text is centered.}

    9,

    Đầu tiên là tạo một danh sách đơn giản: \begin{enumerate} \item Animal \item Vegetable \item Mineral \end{enumerate}

    0.
  • Dấu trích dẫn: không nên sử dụng

    Đầu tiên là tạo một danh sách đơn giản: \begin{enumerate} \item Animal \item Vegetable \item Mineral \end{enumerate}

    1 làm trích dẫn. Để in ấn được đẹp hơn, trong LaTex thường dùng 2 dấu

    Đầu tiên là tạo một danh sách đơn giản: \begin{enumerate} \item Animal \item Vegetable \item Mineral \end{enumerate}

    2(dấu huyền) để mở ngoặc và dấu

    Đầu tiên là tạo một danh sách đơn giản: \begin{enumerate} \item Animal \item Vegetable \item Mineral \end{enumerate}

    2(dấu lược) để đóng ngoặc.
  • Dấu gạch và dấu ngắt quãng: LaTex cung cấp 4 kiểu dấu gạch. Đó là

    Đầu tiên là tạo một danh sách đơn giản: \begin{enumerate} \item Animal \item Vegetable \item Mineral \end{enumerate}

    4 hyphen, endash, emdash, minus(dấu trừ).
  • Các dấu trọng âm: Các lệnh trọng âm cho phép đặt các dấu lên trên các ký hiệu. Bảng trọng âm:
    Caách căn đều hai bên đoạn văn trong latex năm 2024
  • Các chữ ghép:
    Caách căn đều hai bên đoạn văn trong latex năm 2024
  • Đơn vị tiền tệ:
    Caách căn đều hai bên đoạn văn trong latex năm 2024

Thực hành luyện tập:

Bài tập: Tạo ra văn bản LaTeX có nội dung theo yêu cầu.

Bài làm:

\documentclass[a4paper,12pt]{report}
\begin{document}
Na\"{\i}ve people who eat fluffy p\^{a}t\’{e} end up man\oe uvring themselves towards
the bathroom, resulting in an \ae ger.
“The fa\c{c}ade is my {\em pi\’{e}ce de resistance}, do you like it? It cost \pounds
1000.00 — 10\% under budget.“
”It‘s a bit {\em pass\’{e}}.”
He had a feeling of {em d\’{e}j\‘{a} vu} on seeing Chl\"{o}e M\"{u}ller, n\’{e}e
H\v{r}eb\’{i}\v{c}ek, wearing a fine n\’{e}glig\’{e} to the matin\’{e}e.
“?‘D\’{o}nde esta el cuarto de ba\~{n}o?’\,”
\end{document}

Kết quả thu được:

Caách căn đều hai bên đoạn văn trong latex năm 2024

3. Kiểu tài liệu và section

  • Kiểu tài liệu được định nghĩa bằng câu lệnh:

    Đầu tiên là tạo một danh sách đơn giản: \begin{enumerate} \item Animal \item Vegetable \item Mineral \end{enumerate}

    5
  • Có nhiều kiểu tài liệu. Các kiểu cơ bản là:

    Đầu tiên là tạo một danh sách đơn giản: \begin{enumerate} \item Animal \item Vegetable \item Mineral \end{enumerate}

    6,

    Đầu tiên là tạo một danh sách đơn giản: \begin{enumerate} \item Animal \item Vegetable \item Mineral \end{enumerate}

    7,

    Đầu tiên là tạo một danh sách đơn giản: \begin{enumerate} \item Animal \item Vegetable \item Mineral \end{enumerate}

    8,

    Đầu tiên là tạo một danh sách đơn giản: \begin{enumerate} \item Animal \item Vegetable \item Mineral \end{enumerate}

    9 và

    \begin{tabular}{lcccc} & Year1 & Year2 & Year3 & Total \ & (\pounds) & (\pounds) & (\pounds) & (\pounds)\ Books & 100.00 & 150.00 & 200.00 & 450.00 \ Stationary & 50.00 & 45.00 & 55.00 & 150.00 \ Software & 500.00 & 600.00 & 300.00 & 1400.00 \ US Conference & 2000.00 & 2500.00 & 3000.00 & 7500.00 \ EU Conference & 500.00 & 500.00 & 500.00 & 1500.00 \ Total & 3150.00 & 3795.00 & 4055.00 & 11000.00 \ \end{tabular}

    0.
  • Các section cơ bản của tài liệu:

    \begin{tabular}{lcccc} & Year1 & Year2 & Year3 & Total \ & (\pounds) & (\pounds) & (\pounds) & (\pounds)\ Books & 100.00 & 150.00 & 200.00 & 450.00 \ Stationary & 50.00 & 45.00 & 55.00 & 150.00 \ Software & 500.00 & 600.00 & 300.00 & 1400.00 \ US Conference & 2000.00 & 2500.00 & 3000.00 & 7500.00 \ EU Conference & 500.00 & 500.00 & 500.00 & 1500.00 \ Total & 3150.00 & 3795.00 & 4055.00 & 11000.00 \ \end{tabular}

    1,

    \begin{tabular}{lcccc} & Year1 & Year2 & Year3 & Total \ & (\pounds) & (\pounds) & (\pounds) & (\pounds)\ Books & 100.00 & 150.00 & 200.00 & 450.00 \ Stationary & 50.00 & 45.00 & 55.00 & 150.00 \ Software & 500.00 & 600.00 & 300.00 & 1400.00 \ US Conference & 2000.00 & 2500.00 & 3000.00 & 7500.00 \ EU Conference & 500.00 & 500.00 & 500.00 & 1500.00 \ Total & 3150.00 & 3795.00 & 4055.00 & 11000.00 \ \end{tabular}

    2,

    \begin{tabular}{lcccc} & Year1 & Year2 & Year3 & Total \ & (\pounds) & (\pounds) & (\pounds) & (\pounds)\ Books & 100.00 & 150.00 & 200.00 & 450.00 \ Stationary & 50.00 & 45.00 & 55.00 & 150.00 \ Software & 500.00 & 600.00 & 300.00 & 1400.00 \ US Conference & 2000.00 & 2500.00 & 3000.00 & 7500.00 \ EU Conference & 500.00 & 500.00 & 500.00 & 1500.00 \ Total & 3150.00 & 3795.00 & 4055.00 & 11000.00 \ \end{tabular}

    3,

    \begin{tabular}{lcccc} & Year1 & Year2 & Year3 & Total \ & (\pounds) & (\pounds) & (\pounds) & (\pounds)\ Books & 100.00 & 150.00 & 200.00 & 450.00 \ Stationary & 50.00 & 45.00 & 55.00 & 150.00 \ Software & 500.00 & 600.00 & 300.00 & 1400.00 \ US Conference & 2000.00 & 2500.00 & 3000.00 & 7500.00 \ EU Conference & 500.00 & 500.00 & 500.00 & 1500.00 \ Total & 3150.00 & 3795.00 & 4055.00 & 11000.00 \ \end{tabular}

    4,

    \begin{tabular}{lcccc} & Year1 & Year2 & Year3 & Total \ & (\pounds) & (\pounds) & (\pounds) & (\pounds)\ Books & 100.00 & 150.00 & 200.00 & 450.00 \ Stationary & 50.00 & 45.00 & 55.00 & 150.00 \ Software & 500.00 & 600.00 & 300.00 & 1400.00 \ US Conference & 2000.00 & 2500.00 & 3000.00 & 7500.00 \ EU Conference & 500.00 & 500.00 & 500.00 & 1500.00 \ Total & 3150.00 & 3795.00 & 4055.00 & 11000.00 \ \end{tabular}

    5,

    \begin{tabular}{lcccc} & Year1 & Year2 & Year3 & Total \ & (\pounds) & (\pounds) & (\pounds) & (\pounds)\ Books & 100.00 & 150.00 & 200.00 & 450.00 \ Stationary & 50.00 & 45.00 & 55.00 & 150.00 \ Software & 500.00 & 600.00 & 300.00 & 1400.00 \ US Conference & 2000.00 & 2500.00 & 3000.00 & 7500.00 \ EU Conference & 500.00 & 500.00 & 500.00 & 1500.00 \ Total & 3150.00 & 3795.00 & 4055.00 & 11000.00 \ \end{tabular}

    6,

    \begin{tabular}{lcccc} & Year1 & Year2 & Year3 & Total \ & (\pounds) & (\pounds) & (\pounds) & (\pounds)\ Books & 100.00 & 150.00 & 200.00 & 450.00 \ Stationary & 50.00 & 45.00 & 55.00 & 150.00 \ Software & 500.00 & 600.00 & 300.00 & 1400.00 \ US Conference & 2000.00 & 2500.00 & 3000.00 & 7500.00 \ EU Conference & 500.00 & 500.00 & 500.00 & 1500.00 \ Total & 3150.00 & 3795.00 & 4055.00 & 11000.00 \ \end{tabular}

    7.
  • Một vài kiểu không có hết các section(Ví dụ

    \begin{tabular}{lcccc} & Year1 & Year2 & Year3 & Total \ & (\pounds) & (\pounds) & (\pounds) & (\pounds)\ Books & 100.00 & 150.00 & 200.00 & 450.00 \ Stationary & 50.00 & 45.00 & 55.00 & 150.00 \ Software & 500.00 & 600.00 & 300.00 & 1400.00 \ US Conference & 2000.00 & 2500.00 & 3000.00 & 7500.00 \ EU Conference & 500.00 & 500.00 & 500.00 & 1500.00 \ Total & 3150.00 & 3795.00 & 4055.00 & 11000.00 \ \end{tabular}

    8 không có

    \begin{tabular}{lcccc} & Year1 & Year2 & Year3 & Total \ & (\pounds) & (\pounds) & (\pounds) & (\pounds)\ Books & 100.00 & 150.00 & 200.00 & 450.00 \ Stationary & 50.00 & 45.00 & 55.00 & 150.00 \ Software & 500.00 & 600.00 & 300.00 & 1400.00 \ US Conference & 2000.00 & 2500.00 & 3000.00 & 7500.00 \ EU Conference & 500.00 & 500.00 & 500.00 & 1500.00 \ Total & 3150.00 & 3795.00 & 4055.00 & 11000.00 \ \end{tabular}

    9)
  • Các phần được đánh số tự động. Việc đánh số có thể được bỏ qua bằng dấu sao cuối lệnh.
  • Tóm tắt được đặt trong môi trường abstract.
  • Tiêu đề của tài liệu được khai báo và hiển thị dùng các lệnh:\tiny`0, \tiny`1, `\tiny`2.
  • Để bắt đầu viết một phụ lục, sử dụng lệnh \tiny`3. Sau đó có thể dùng tiếp

    \begin{tabular}{lcccc} & Year1 & Year2 & Year3 & Total \ & (\pounds) & (\pounds) & (\pounds) & (\pounds)\ Books & 100.00 & 150.00 & 200.00 & 450.00 \ Stationary & 50.00 & 45.00 & 55.00 & 150.00 \ Software & 500.00 & 600.00 & 300.00 & 1400.00 \ US Conference & 2000.00 & 2500.00 & 3000.00 & 7500.00 \ EU Conference & 500.00 & 500.00 & 500.00 & 1500.00 \ Total & 3150.00 & 3795.00 & 4055.00 & 11000.00 \ \end{tabular}

    ` 9, `\tiny`5.
  • Để tạo mục lục, sử dụng lệnh `\tiny`6.
  • Số trang được đánh số tự động. Dùng lệnh \tiny`7 để thay đổi kiểu trang từ trang hiện tại trở về sau, hoặc dùng lệnh \tiny`8 để thay đổi mình kiểu trang hiện tại. Các kiểu thường dùng \tiny`9, \scriptsize`0, `\scriptsize`1.
  • Thay đổi kiểu đánh số trang, dùng lệnh \scriptsize`2 đồng thời trang hiện tại được đánh số là 1. Trong đó: \scriptsize`3 là các kiểu chuẩn \scriptsize`4, \scriptsize`5, \scriptsize`6, \scriptsize`7 và `\scriptsize`8.

Thực hành luyện tập:

Bài tập: Tạo ra tiêu đề, mục lục, chương và các mục trong chương; dùng môi trường `\scriptsize`9 tạo ra tóm tắt của một tài liệu cho trước.

4. Định dạng đoạn văn

  • Các đoạn văn được tự động canh lề đều mặc định, tuy nhiên có thể thay đổi bằng lệnh khai báo hoặc môi trường. Khai báo \footnotesize`0 \footnotesize`1 \footnotesize`2 Môi trường \footnotesize`3 \footnotesize`4 \footnotesize`5
  • Canh giữa một dòng text bằng lệnh: `\footnotesize`6.
  • Tạo dòng mới dùng lệnh: \footnotesize`7 hoặc \footnotesize`8.
  • Ngắt dòng, giữ nguyên canh lề, dùng lệnh: `\footnotesize`9.
  • Chống ngắt dòng, dùng lệnh: `\small`0. n là số nguyên từ 0 đến 4.
  • Để có một dấu cách mà không bị cách dòng tại dấu cách đó, dùng `\small`1.

Để cách trang dùng lệnh \small`2 hoặc \small`3. Cách trang và hiển thị tất cả các ảnh treo, dùng lệnh \small`4. Để chống cách trang, dùng lệnh \small`5.