1

Re: ConTeXt và tiếng Việt!

Rất vui mừng được báo tin với các bác là ConTeXt đã có thể nói là support tiếng Việt; dưới đây là nhưng gợi ý để sử dụng ConTeXt cho việc soạn thảo tiếng việt:

đoan này /me dịch nguyên văn từ: http://contextgarden.net/Vietnamese

Đây là một vài gới ý cho việt sử dụng tiếng việt với ConTeXt; Chúng ta sử dụng các bộ font của gói vnTeX, do vậy cần phải tải về và cài đặt gói vnTeX cùng các bộ font vnr (type1) và vnurw (tháo nén các gói này vào thư mục texmf cục bộ hoặc tương đương)

Thêm các dòng sao vào trong mã nguồn ( hoặc  tốt hơn là thêm vào file cont-sys.tex của bạn ), giả định rằng bạn sử dụng bảng mã UTF-8 để nhập liệu:

\enableregime[utf]

Đặt bẳng mã ngầm định là bẳng mã tiếng việt:

\setupencoding[default=t5]

Nạp các tập tin ánh xạ cho bảng mã T5 trong pdfTeX:

\loadmapfile[vnr]
\loadmapfile[urwvn]

Gỡ bỏ cacs  font CRM ngầm định :

\usetypescript[all][computer-modern][t5]
\setupbodyfont[reset]

với các thiết lập này, bạn có thể sử dụng một trong các kịch bản gõ được thiết lập trước (preset typescripts):

\usetypescript[modern-base][t5]
\setupbodyfont[modern]

\usetypescript[modernvariable][t5]
\setupbodyfont[modernvariable]

\usetypescript[berry][t5]
\usetypescript[palatino][t5]
\setupbodyfont[palatino]

\usetypescript[berry][t5]
\usetypescript[times][t5]
\setupbodyfont[times]

\usetypescript[berry][t5]
\usetypescript[postscript][t5]
\setupbodyfont[postscript]

2

Re: ConTeXt và tiếng Việt!

Muốn dùng ConTeXt với tiếng Việt trước hết phải cập nhật pdftex. Xem bài viết này để biết cách cập nhật.

# pdftex
This is pdfTeX, Version 3.141592-1.20b (Web2C 7.5.3)
**

Sau đó tải về gói ConTeXt cont-tmf.zip. Theo hướng dẫn cài đặt của ConTeXt thì chỉ cần giải nén gói đó vào texmf và cập nhật dữ liệu. Nhưng thực tế với phiên bản tetex-2.0.2-21 đi kèm theo FC3 thì có hơi khác một tí về một số thư mục cài đặt.

Thư mục trong ZIP           ---> Thư mục cài đặt
context/config/*                --> context/config/
context/data/*                  --> context/data/
doc/context/base/*              --> NOT NEED !
fonts/enc/dvips/context/*.enc   --> dvips/context/*.enc
fonts/map/pdftex/context/*      --> pdftex/config/context/
fonts/tfm/hoekwater/context/*   --> NOT NEED !
fonts/type1/hoekwater/context/* --> NOT NEED !
metapost/context/base/*         --> metapost/context/base/
scripts/context/perl/*          --> context/perltk/
scripts/context/ruby/*          --> NOT NEED !
tex/context/base/*              --> tex/context/base/
tex/context/config/*            --> tex/context/config/
tex/context/extra/*             --> tex/context/extra/
tex/context/foxet/*             --> tex/context/foxet/
tex/context/interface/*         --> tex/context/interface/
tex/context/sample/*            --> tex/context/sample/
tex/context/user/cont-sys.rme   --> tex/context/user/
tex/generic/context/*           --> tex/generic/context/
tex/latex/context/*             --> tex/latex/context/
web2c/natural.tcx               --> web2c/

Các file cũ của ConTeXt phải được xóa hết khỏi texmf và thay thế bằng các file mới. Không quên cập nhật dữ liệu bằng lệnh :

# texhash

Theo hướng dẫn cài đặt để tạo lại các định dạng:

# fmtutil --all

Trong file /usr/share/texmf/web2c/updmap.cfg thêm

Map context-base.map

Tạo liên kết trong /usr/share/texmf/dvips/config:

context-base.map -> ../../pdftex/config/context/context-base.map

Tạo lại các map file bằng lệnh

# updmap

Thử chạy ConTeXt sẽ thấy cho ra phiên bản mới :

$ texexec 

 TeXExec 5.2.3 - ConTeXt / PRAGMA ADE 1997-2004

                --help   overview of all options and their values
            --help all   all about all options
          --help short   just the main options
   --help mode ... pdf   all about a few options
        --help '*.pdf'   all about options containing 'pdf'

            more info    http://www.pragma-ade.com/general/manuals/mtexexec.pdf
                         http://www.ntg.nl/mailman/listinfo/ntg-context

        total run time : 0 seconds

Sau đó có thể thử với file này: test1.tex
Nếu chạy không lỗi thì sẽ được PDF smile

http://people.vnoss.org/~vnpenguin/context/test1.png

"La photographie est une brève complicité entre la prévoyance et le hasard." John Stuart Mill

3

Re: ConTeXt và tiếng Việt!

From http://contextgarden.net/Vietnamese :

(Quy, all, I strongly recommend not following or propagating the instructions regarding the reorganisation of the directory structure of the cont-tmf.zip file as shown on the above linked page: the Linux directory structure is old, and is superseded by current ConTeXt releases. ConTeXt tracks current changes in tetex and TeXLive, which are more definitive than found in, say, Fedora. --Adam)

Yes, I see. But I can't have the latest tetex now in Fedora distribution, and I haven't time to compile tetex-beta from the source sad So it's the only solution which allows me to have a working system for ConTeXt smile Maybe I'll try TeXLive later. Thanks. -- NguyenDaiQuy

"La photographie est une brève complicité entre la prévoyance et le hasard." John Stuart Mill

4

Re: ConTeXt và tiếng Việt!

Có lẽ không nên cập nhật theo kiểu củ chuối này smile
Tốt nhất là cập nhật luôn cho cả hệ thống teTeX (http://vnoss.org/forum/viewtopic.php?id=515)

"La photographie est une brève complicité entre la prévoyance et le hasard." John Stuart Mill

5

Re: ConTeXt và tiếng Việt!

Eo ôi, sướng thật ! Có lẽ em phải đề nghị Trung ương trao Huân chương Lao động Hạng Nhứt năm nay cho nhóm VnOSS và VnTeX wé. :-)

6

Re: ConTeXt và tiếng Việt!

ConTeXt Việt chạy rồi. Đi học ConTeXt thôi! :-D

Đêm qua mơ dáng em đang ôm đàn tằng tăng tắng tăng