Tex and PDF

Source: Internet
Author: User

Tex. Web, developed by knuth Donald, generates a DVI file. DVI is also a file format implemented by knuth itself (although proposed by others), with the goal of being unrelated to devices.

The dvips program can be used to convert the DVI format into the postscript format. The postscript format is a product developed by Adobe and is also the predecessor of the PDF format. Even the current painting mechanism of PDF is similar to that of postscript.

You can use ps2pdf to convert a postscript file into a PDF file.

 

The Tex mechanism is basically described in this way.

Due to the early generation of Tex, postscript was just a prototype at that time, so it was reasonable that Tex did not directly output the postscript file format. However, knuth was really far-sighted, A method similar to the PDF portable is selected to generate the DVI format. Then, the next thing is also taken for granted. As a matter of course, postscript and PDF have become industry standards, Tex is constantly moving closer to PDF until the final emergence of vertex Tex.

The main difference between Tex and effectex is that whereas Tex outputs dvifiles, effectex can output PDF files directly.

 

Pdftex can directly output the Tex program into PDF format.

 

The development of things has been perfect, but the problem lies in the Tex script language itself. It is too self-limited, difficult to expand or be compatible with other languages, so luatex emerged.

The main objective of the project is to provide a version of Tex where all internals are accessible from Lua.

Lua is a language that is easily embedded into other languages.So it can be a bridge between Tex and other languages.

For details about how to combine luatex, refer to programming in luatex.

There are two main ways to execute Lua code in a context document: the command\ Ctxlua, And the Environment\ Startluacode... \ stopluacode. Both are wrappers around the luatex primitive\ Directlua, Which you shoshould never need to use. In general, you will define a function inside\ StartluacodeBlock, and then define a Tex command that callthe function using\ Ctxlua, Especially because\ CtxluaHas a few idiosyncracies.

 

Most commands that you wowould type with a backslash in plain context, you can access from LuaContext.Command. Unadorned strings end up in tex as arguments in curly braces; Lua tables end up in tex as paramater blocks in square brackets.

However, it seems that Lua is only embedded in Tex. After all, Lua has only a small core and basically cannot survive independently.

Therefore, luatex is only an improvement of Tex itself, rather than an open interface to the outside world.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.