I want to know if I can compile raw TeX code with the
Texinfo is yet another macro package which defines its own markup language, which may be processed by TeX to produce dvi (texi2dvi) or pdf (texi2pdf). You may include arbitrary (roughly, plain) TeX code inside the
@end iftex commands; but then, anything within this conditional will be ignored in conversion to other formats (html, info, etc.).
texi2[dvi|pdf] are shell scripts that automate the processing of Texinfo files to produce documentation for printing, analogous to
makeinfo, a program which processes the same documentation to produce online documentation in info or html formats, for instance.
texi2pdf may also process automatically LaTeX files, by checking the filename extension. Thus,
texi2pdf filename.tex automatically processes
filename.tex as a LaTeX file, with its main byproducts (bibtex and makeindex).
You may trick
texi2pdf into processing Plain TeX files with the strategies suggested by Fran; but then you would be only forcing the
texi2pdf script to use the
pdftex engine with the
pdftex format on the Plain TeX file, and the result would be the same as using the command
Your question is not terribly clear. As I understand it, you are asking whether you can compile raw
.tex code using
texi2pdf without installing a TeX distribution.
The answer to that question is that you cannot because
texi2pdf just acts as a wrapper which depends on the availability of compilation commands provided by a TeX distribution.
Note that my reason for interpreting your question in this way, rather than the way everyone else is interpreting it, is that I cannot currently imagine any other motivation for it. That is, if you have a TeX distribution installed, you might just as soon use
pdflatex to compile a
.tex file: the only reason to use the wrappers provided by
texinfo is that you are dealing with a
.texi file rather than a
So while it is presumably possible to use
texi2pdf to compile
.tex files, it is hard to see why anybody would do that.
The base wrapper is
texi2pdf is a shorthand enabling the use of the pdfTeX engine in place of the standard TeX one.
texi2dvi on a
.texi file is equivalent to the following 5 steps, according to the documentation:
Run 'tex' on your Texinfo file. This generates a DVI file (with undefined cross-references and no indices), and the raw index files (with two letter extensions).
Run 'texindex' on the raw index files. This creates the corresponding sorted index files (with three letter extensions).
Run 'tex' again on your Texinfo file. This regenerates the DVI file, this time with indices and defined cross-references, but with page numbers for the cross-references from the previous run, generally incorrect.
Sort the indices again, with 'texindex'.
Run 'tex' one last time. This time the correct page numbers are written for the cross-references.
Steps 1, 3 and 5 require at least a minimal installation of TeX to be available. (If you are dealing with a
.tex file, I assume steps 2 and 4 don't apply.)
man texi2pdf to process (e)plain TeX files, one must set the environment variable
LATEX=tex. This is true for the DVI ouput with
texi2pdf --dvi, to use the
etex engine instead of
latex, but for a PDF output the setting really should be
PDFLATEX=pdftex to change the
pdflatex engine by
pdftex. Thus, in a Linux system with a plain TeX file as
test.tex, the procedure could be:
$ PDFLATEX=pdftex ; export PDFLATEX ; texi2pdf test.tex
Or alternatively, inform to the program that the source code is a TeXinfo file, in spite of the
$ texi2pdf --language=texinfo test.tex
Or more tricky, change the extension. Not necessarily must be that of the texinfo files (
.texi) since names without
.tex, not being recognized as LaTeX files, will be treated as texinfo files, in spite of any other suffix (or even if there are not any suffix). So you can name it, for instance,
In Linux, one can use hard links to maintain several names for the same file, so you can maintain the original file name
test.tex but use
test.foo to be compiled with
$ ln test.tex test.foo $ texi2pdf test.foo
As explained in another answer, deceiving the program in this way work since TeXinfo files are based in plain TeX, and thus using the same engines, but you run the risk of deceiving yourself with a misleading or non standard suffix.