Giới thiệu trình soạn thảo văn bản Latex

×

Error message

  • User warning: The following module is missing from the file system: standard. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/vimaru/web/includes/bootstrap.inc).
  • Warning: chmod(): Operation not permitted in _event_css_add() (line 272 of /var/www/html/vimaru/web/sites/all/modules/event_calendar/event_calendar_colors/event_calendar_colors.module).

(English below)

 

Hiện nay, giới học thuật quốc tế đang rất ưa chuộng một chương trình soạn thảo văn bản cấp cao mang tên là Latex. Nó được sử dụng rộng rãi để viết sách, viết báo cho các tòa soạn và tạp chí lớn trên thế giới có lẽ cũng vì tính tiện ích và mỹ thuật. Chúng ta hãy cùng tìm hiểu vẻ đẹp của chương trình soạn thảo này.

I. Phân biệt hai thuật ngữ TEX  và LATEX

·  TeX: có thể xem là một ngôn ngữ lập trình, TeX do Donald Knuth phát minh được dùng để chỉ thị cho máy tính làm một công việc mà người dùng muốn. Công việc đó chính là sắp chữ sao cho đẹp và nhất quán.

·  LaTeX: là một dẫn xuất của TeX, do ông Lamport tạo ra (chữ La là viết tắt tên ông). LaTeX được thiết kế sao cho thuận tiện hơn với mọi người. Nếu TeX dùng 10 dòng lệnh để trình bày một đoạn văn bản sao cho đẹp mắt thì LaTeX chỉ dùng 1 hoặc 3 dòng lệnh. LATEX cho ra bản in chất lượng cực cao cùng cấu trúc văn bản rất logic và đồng bộ, tự động hóa.

II. Các yếu tố cần thiết để có thể soạn thảo văn bản bằng LATEX

Để có thể soạn thảo thành công một văn bản theo ý muốn bằng LATEX  phải cần dùng đến hai yếu tố đó là các bản phân phối phần mềmtrình biên soạn.

· Bản phân phối phần mềm phổ biến hiện nay:  MikTeX và TeX Live. Bản phân phối phần mềm (software distribution) được phát hành miễn phí. Mỗi bản phân phối gồm nhiều thành phần, trong đó có 2 thành phần chính là: TeX (và dẫn xuất của nó) và một mô-đun dùng để tạo ra các file PDF, DVI.

Sau đây là một số so sánh giữa MikTeX và TeX Live

- MikTeX

  o Chỉ dùng trên Windows. Cài đặt đơn giản. Dung lượng nhẹ

  o Có trình Package Manager để quản lí (thêm/bớt) các packages

- TeX Live

  o Dùng được trên tất cả platform. Cài đặt trên Unix đơn giản hơn cài đặt trên Windows

  o Package Manager: không có

· Trình biên soạn TeX (TeX editor) hiện nay có: TeX Maker, TeX Studio, WinEdt, VietTeX, TeXpad, Texiteasy..Trình biên soạn cung cấp các công cụ giúp người dùng biên soạn file *.tex một cách thuận tiện. Có thể hình dung như sau: ta hoàn toàn có thể tạo file *.tex bằng Notepad, nhưng để biên dịch ra cho máy tính hiểu và tạo ra các file pdf, ta phải gõ rất nhiều câu lệnh trong Command Windows, như thế mất thời gian. Trong khi dùng trình biên soạn ta chỉ cần nhấn F6 để biên dịch và F7 để xem file pdf. Hơn nữa,  trình biên soạn còn giúp gợi ý các câu lệnh ta đang gõ và cung cấp danh sách các ký hiệu toán học thường dùng, rất thuận tiện.

Tùy thuộc vào sở thích của bạn mà mỗi người chọn dùng một trình soạn thảo cho mình. TeX Maker có dung lượng nhẹ, giao diện đơn giản, thân thiện và hoàn toàn có thể thêm các lệnh gợi ý do chính bạn định nghĩa vào đây. TeX Studio lại hỗ trợ rất chi tiết các gợi ý lệnh và nút lệnh. VietTex là trình soạn thảo thuộc bản quyền của thầy Nguyễn Hữu Điển – giảng viên trường Đại học khoa học Tự nhiên Hà Nội, đây là phiên bản Việt hóa, thường xuyên cập nhật đáp ứng theo nhu cầu giảng dạy tại Việt Nam và hiện có hỗ trợ sinh và tạo đề trắc nghiệm rất tốt.

Bạn sẽ phải cài đặt hai thành tố này vào máy của mình. Hướng dẫn sử dụng và cài đặt có ở rất nhiều website và diễn đàn. Chúng tôi sẽ đề cập đến vấn đề này ở những bài viết sau.

III. Dùng LaTeX có gì hay?

· Văn bản nhất quán: khoảng cách dòng, kích cỡ chữ, màu sắc, cách trình bày,… cho dù qua văn bản khác nó cũng như vậy.

· Hoàn toàn tự động: đánh số chương, tiêu đề mẹ, tiêu đề con, đánh số phương trình, bảng, hình ảnh, tham chiếu,… hoàn toàn tự động.

· Trích dẫn tài liệu tham khảo: tự động và nhất quán, style rất đẹp.

· Tự động sắp xếp hình ảnh, table sao cho phù hợp nhất với văn bản.

· Làm việc với một dự án lớn: cả trăm, cả ngàn trang trong một file .tex dung lượng rất nhỏ, dễ quản lý và điều khiển.

· Tích hợp công thức toán học: công thức toán học tích hợp rất hài hòa với văn bản, đẹp và rõ nét.

· Vẽ hình đẹp: hình vẽ và chữ chú thích trên hình vẽ rất hài hòa với văn bản (cỡ chữ, ko bị vỡ nét khi zoom,…).

· Tạo phông chữ nghệ thuật.

Tuy nhiên bên cạnh đó có một số nhược điểm

· Cách học và tiếp cận tốn nhiều thời gian hơn.

· Làm việc chỉ nhờ vào dòng lệnh, giống như lập trình nên thường xảy ra lỗi nhỏ nhặt và tốn thời gian sửa. Những gì bạn thấy không phải là những gì bạn có.

IV. Làm gì khi gặp một lỗi?

Trước nhất ta đọc xem trình biên soạn thông báo gì? Trình biên soạn nhắc ta quên dấu ngoặc } ở dòng 1234 nào đó, hoặc là quên \end{...} ở đâu đó, hoặc thiếu package nào đó. Chỉ việc kiểm tra kĩ đoạn bị lỗi và sửa lại. Nếu trình biên soạn thông báo rõ là thiếu package nào đó thì search ngay từ khóa trên Package Manager và tải ngay những package liên quan (đối với MikTeX). Khi trình soạn thảo thông báo rất nhiều lỗi, nếu để ý thấy các dòng thông báo lỗi trông giống giống nhau thì nhiều khả năng bạn thiếu package đấy.

Đối với những lỗi ta chưa gặp bao giờ, search Google. Nhưng hãy nên đọc hiểu thông báo lỗi, tức là hiểu lỗi này thuộc về package, về syntax hay Runtime Error.

V. Các địa chỉ trang web hỗ trợ soạn thảo văn bản bằng LATEX

http://math2it.com: Bài viết và phong cách trình bày rất dễ hiểu

https://nhdien.wordpress.com/: Rất thiết thực và cập nhật liên tục.

https://osshcmup.wordpress.com: Đa dạng các tiện dụng của LATEX

https://tex.stackexchange.com: Mọi thắc mắc đều được giải thích cặn cẽ bởi các chuyên gia

https://www.ctan.org/ : Chứa mọi tài nguyên của TEX

https://en.wikipedia.org/wiki/LaTeX: Từ điển tra cứu mọi thứ về TEX

 

 

AN INTRODUCTION OF LATEX

Currently, international academics prefer using a text editor called Latex. It is used extensively in writing books and magazines for major publishers and magazines around the world, perhaps for its convenience and fine art. Let's explore the beauty of this editorial program.

I. Distinguish TEX and LATEX

TeX: Can be considered as a programming language, TeX was invented by Donald Knuth and it is used to instruct the computer to do what users want. The product is really beautiful and consistent.

• LaTeX: is a derivative of TeX, which is created by Mr. Lamport (La is his initial name). LaTeX is designed to be more convenient to everyone. If TeX uses 10 lines to display beautiful text, LaTeX only uses one or three lines of code. LATEX delivers high quality prints with very logical and synchronous text structure, automation.

II. Elements needed to compose documents using LATEX

In order to successfully edit a text with LATEX, two components are needed: software distributions and compilers.

• Current popular software distributions: MikTeX and TeX Live. The software distribution is free. Each distribution consists of several components, two of which are TeX (and its derivatives) and one module for creating PDFs, DVIs.

Here are some comparisons between MikTeX and TeX Live

- MikTeX

o Use only on Windows. Simple installation. Lightweight

o Package Manager to manage (add / remove) packages

- TeX Live

o Can be used on all platforms. Installing on Unix is ​​simpler than installing on Windows

o Package Manager: none

• Popular TeX editor includes TeX Maker, TeX Studio, WinEdt, VietTeX, TeXpad, Texiteasy ... The editor provides tools to help users compile * .tex files conveniently. It is possible to create a * .tex file with Notepad, but to compile for the computer to understand and generate the pdf file, we must type a lot of commands in the Windows Command, so it is a waste of time. While using the editor, just press F6 to compile and F7 to view the pdf file. In addition, the editor helps to suggest the commands we are typing and provides a list of commonly used mathematical symbols, which are very convenient.

Depending on your preference, each person chooses to use an editor for himself or herself. TeX Maker is lightweight, simple and user-friendly interface, and you can add the custom commands you define here. TeX Studio supports very detailed command prompt and command buttons. VietTex is a text editor under the copyright of Nguyen Huu Dien, a lecturer at Hanoi University of Science. This is a Vietnamese version that is regularly updated to meet the needs of teaching in Vietnam. It is very cool to make multichoice questions.

You must install these two components into your machine. Manuals and installations are available in many websites and forums. We will cover this in the following articles.

III. How good is LaTeX?

• Text consistency: line spacing, text size, color, layout, etc., though it's the same text.

• Fully automatic: chapter numbering, parent titles, subheadings, equation numbering, tables, images, references,  ... fully automatic.

• Quote of reference: automatic and consistent, very nice style.

• Automatically arrange images and tables to best fit the text.

• Work with a large project: hundreds, thousands of pages in a very small *.tex file, easy to manage and control.

• Integrated math formulas: the mathematical formula integrates very well with the text, beautiful and clear.

• Draw beautiful pictures: drawings and text on the drawing are very harmonious with the text (font size, not broken when zoomed,  ...).

• Create art fonts.

However, there are some downsides

• Learning and approaching are very time-consuming.

• Working with the command line, just like programming, so it's a little buggy and time-consuming to fix. What you see is not what you have.

IV. What to do when you encounter an error?

First, we read what the editor says. The compiler forgot to put brackets in line 1234, either forgot \ end {...} somewhere, or missing some package. Just check the error and fix it. If the editor informs you that there is a missing package, then search for the package manager and download the corresponding package (for MikTeX). When the editor reports a lot of errors, if you notice that the error message lines look the same, you likely miss the package.

For the error we have never met, search Google. But read the error message to know the error is package or syntax or Runtime Error.

V. Website addresses that support text editing with LATEX

http://math2it.com: Article and presentation style is very easy to understand

https://nhdien.wordpress.com/: Very practical and constantly updated.

https://osshcmup.wordpress.com: Diverse utility of LATEX

https://tex.stackexchange.com: All inquiries are thoroughly explained by experts

https://www.ctan.org/: Contains all of TEX's resources

https://en.wikipedia.org/wiki/LaTeX: Dictionary of all things about TEX