[latexusersgroup] Minimal (La)TeX installation

482 views
Skip to first unread message

Limited_Atonement

unread,
May 12, 2010, 12:56:44 PM5/12/10
to LaTeX Users Group
Dear Sirs,

I'm looking for a minimal Latex installation. I'm a programmer,
and I want to ship a program that has a 'print' function. I would
like to use the LaTeX engine to generate such an output, so when the
user hits print, a .tex document is generated (with some tables and
that's about it...maybe some margin commands) and output to PDF. So,
what I really need is a pdfLatex.exe and all its dependencies, and
really small so that I can ship it with my program without the user
saying, "Hey, why is your program 800 MB?" and me saying, "well, um,
you see, beautiful documents are hard to come by... without lots
of ... well, the print function creates... um, er....".
If you know where to go to get such an artifact, please let me
know. Thanks!

Aaron

--
You received this message because you are subscribed to the Google Groups "LaTeX Users Group" group.
To post to this group, send email to latexus...@googlegroups.com.
To unsubscribe from this group, send email to latexusersgro...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/latexusersgroup?hl=en.

Peter Flynn

unread,
May 12, 2010, 6:05:40 PM5/12/10
to latexus...@googlegroups.com
On Wed, May 12, 2010 at 5:56 PM, Limited_Atonement <dar...@live.com> wrote:
I'm looking for a minimal Latex installation.

They are rare.
 
I'm a programmer,
and I want to ship a program that has a 'print' function.  I would
like to use the LaTeX engine to generate such an output, so when the
user hits print, a .tex document is generated (with some tables and
that's about it...maybe some margin commands) and output to PDF.  

Do you mean marginal comments, or commands to change the margins?
 
what I really need is a pdfLatex.exe and all its dependencies, and
really small so that I can ship it with my program without the user
saying, "Hey, why is your program 800 MB?"  and me saying, "well, um,
you see, beautiful documents are hard to come by... without lots
of  ... well, the print function creates... um, er....".
 If you know where to go to get such an artifact, please let me
know.  Thanks!

It's certainly possible. Back in the days when desktop computers were small and limited (MS-DOS), the distributions of TeX were indeed quite small. The earlier versions of TeX Live (I think) came with a small/medium/full installation option. Unfortunately, nowadays, almost everyone has plenty of disk space, so it's easier for the distributors to bundle everything in.

However...this question comes up fairly regularly on comp.text.tex, so an Advanced Search in Google Groups on that newsgroup, for "minimal tex" or "small tex installation" will probably find some threads. This may be a starting-point: http://groups.google.ie/group/comp.text.tex/browse_thread/thread/82d6443c4ec48152/e85b95900ed7e753?hl=en&ie=UTF-8&q=minimal+tex+system+group%3Acomp.text.tex&pli=1

Someone was asking last year about "squeezing" TeX onto a USB stick, but it was pointed out that the price has come down so much now that it's not worth doing: you can fit the whole thing onto a 2Gb stick now.

Last year I installed TeX onto my Nokia N800 PDA. It was a slightly cut-down version someone did a few years ago, and at the time I didn't check the size because I had a new 4Gb SD card. The guy who did it isn't contactable any more, but I just checked it, and it takes a fraction over 300Mb and it's a pretty complete distribution (and it is only pdflatex, not standard LaTeX).

Other places to look:
  • the PCTeX distribution seemed to be very compact last time I installed it (a test a couple of years ago) -- see www.pctex.com, but it's a commercial product, so you'd have to license it. I haven't looked at the other commercial versions for a little while, so I can't speak to their size.
  • MiKTeX is about 1Gb, according to my local copy.
  • There are some old but still working MS-DOS and Win-32 systems at http://ctan.org/tex-archive/obsolete/systems/ which might be useful to examine (but they probably don't have pdflatex: you'd either have to compile it, or use standard LaTeX and convert the DVI output to PDF with dvips and ps2pdf).
Next: things to consider
  1. What typeface[s] do you need or want? TeX comes with Computer Modern Roman by default. LaTeX can use any of the standard Adobe "35", so you can have Times, Helvetica, Century Schoolbook, Avant Garde, etc; but extra fonts means extra space. Unless you want to use the cutting-edge XeTeX, you won't be able to access the Windows-installed TrueType fonts without a lot of extra work. Either way you'll probably need input and font encoding packages with their dependencies.
  2. What is essential? The pdflatex binary, for sure, and the texmf.cnf configuration file. The latex.fmt file, whatever class file you're using (article, book, report...) and the relevant size option file. The TFM files for the typeface you choose, and the PFB files to make the PDF output. There are probably a dozen or more small files which are essential to crank it into action. TeX is composed of hundreds of small files, so while it's easy to cut them away, you have to make sure that you keep the right ones.
  3. What class file are you going to use? When you say "and all its dependencies", there isn't a fixed set: some of them only get used when you typeset certain categories of text (math, for example), or if you need support for the UTF8 character repertoire.
  4. If you need tables, how complex are they? Will you need the extra alignment smarts provided by the array or the dcolumn packages?
  5. Do you need colour? That involves the xcolor package and a bunch of support files.
  6. "Marginal commands"...if this means commands to change the margins, you'll need the geometry package; if it means marginal comments, then you'll need the marginnote package or similar.
  7. How complex is the text your users will want printed? Will there be URLs to format, for example?
If you could give some specific examples of the type of text you need to handle, it's not hard to specify the support files required. Then it's a case of starting with a full installation of (say) MiKTeX, and cutting away the stuff you don't think you need (by moving the files into some other folder out of reach, until it complains) until you reach a minimal subset. As a guess there's probably a week's work to do the research and generate a working subset that can be relied upon — but you'd need to specify very tightly up front exactly what it is you want to typeset.

///Peter


Limited_Atonement

unread,
May 17, 2010, 12:24:20 PM5/17/10
to LaTeX Users Group
Dear Sir,

Thanks for your robust reply. By Margin commands I mean commands to
change the margins. I think you may be making some optimistic
mistakes (from the link):
"Nowadays, I think, MikTeX uses a DLL. So you'll need that. And not
much else, I hope. May a dummy config file or two. Should come in
under 2 megabytes."
I get the feeling that these are your sentiments, too. I did what you
suggested: "start with a full installation of (say) MiKTeX, and
cutting away the stuff you don't think you need". I have a spare,
clean machine on which to test, so instead of messing with my current
MikTex installation, I'm moving it in small parts to the other
computer, one file at a time. I started testing and the executables
(including dlls) are a very extensive and intricate network. I
stopped after including tons of files that seemed extraneous. Many,
many MikTex dlls were required which makes me wonder at your
statement:
"2. What is essential? The pdflatex binary..."
Which pdflatex binary? I used to think that there was *A* pdflatex
binary that various installations used, but now I think they're
compiled for use with various installations. So, to use the
pdflatex.exe that comes with MikTex, I have to use everything they
compiled it to work with, namely (now that I've deleted all my
previous work, I have to go on memory) kpathsea (?), and all its
dependencies, which are numerous. Now that I've thought about it a
bit, I'm using Dependency Walker (http://www.dependencywalker.com/), a
wonderful tool, and it shows that pdflatex.exe depends on Miktex207-
pdf.dll which depends on a whole host of miktex modules...here's a
standard 'profile' of the program:


00:00:00.000: Started "PDFLATEX.EXE" (process 0x9BC) at address
0x00400000 by thread 1. Successfully hooked module.
00:00:00.000: Loaded "NTDLL.DLL" at address 0x7C900000 by thread 1.
Successfully hooked module.
00:00:00.032: Loaded "KERNEL32.DLL" at address 0x7C800000 by thread
1. Successfully hooked module.
00:00:00.047: Loaded "MIKTEX207-PDFTEX.DLL" at address 0x66FC0000 by
thread 1. Successfully hooked module.
00:00:00.047: Loaded "MIKTEX207-APP.DLL" at address 0x60000000 by
thread 1. Successfully hooked module.
00:00:00.063: Loaded "MIKTEX207-CORE.DLL" at address 0x601B0000 by
thread 1. Successfully hooked module.
00:00:00.078: Loaded "MIKTEX207-MD5.DLL" at address 0x61E90000 by
thread 1. Successfully hooked module.
00:00:00.094: Loaded "MSVCR90.DLL" at address 0x78520000 by thread 1.
Successfully hooked module.
00:00:00.110: Loaded "USER32.DLL" at address 0x7E410000 by thread 1.
Successfully hooked module.
00:00:00.125: Loaded "GDI32.DLL" at address 0x77F10000 by thread 1.
Successfully hooked module.
00:00:00.141: Loaded "WINSPOOL.DRV" at address 0x73000000 by thread
1. Successfully hooked module.
00:00:00.157: Loaded "ADVAPI32.DLL" at address 0x77DD0000 by thread
1. Successfully hooked module.
00:00:00.172: Loaded "RPCRT4.DLL" at address 0x77E70000 by thread 1.
Successfully hooked module.
00:00:00.188: Loaded "SECUR32.DLL" at address 0x77FE0000 by thread 1.
Successfully hooked module.
00:00:00.203: Loaded "MSVCRT.DLL" at address 0x77C10000 by thread 1.
Successfully hooked module.
00:00:00.219: Loaded "SHELL32.DLL" at address 0x7C9C0000 by thread 1.
Successfully hooked module.
00:00:00.250: Loaded "SHLWAPI.DLL" at address 0x77F60000 by thread 1.
Successfully hooked module.
00:00:00.266: Loaded "OLE32.DLL" at address 0x774E0000 by thread 1.
Successfully hooked module.
00:00:00.282: Loaded "OLEAUT32.DLL" at address 0x77120000 by thread
1. Successfully hooked module.
00:00:00.297: Loaded "MSVCP90.DLL" at address 0x78480000 by thread 1.
Successfully hooked module.
00:00:00.297: Loaded "MIKTEX207-POPT.DLL" at address 0x67440000 by
thread 1. Successfully hooked module.
00:00:00.313: Loaded "MIKTEX207-TEXMF.DLL" at address 0x678E0000 by
thread 1. Successfully hooked module.
00:00:00.313: Loaded "MIKTEX207-KPSEWEB2CEMU.DLL" at address
0x61E40000 by thread 1. Successfully hooked module.
00:00:00.328: Loaded "MIKTEX207-ZLIB.DLL" at address 0x6D320000 by
thread 1. Successfully hooked module.
00:00:00.360: Loaded "IMM32.DLL" at address 0x76390000 by thread 1.
Successfully hooked module.
00:00:00.422: Loaded "COMCTL32.DLL" at address 0x773D0000 by thread
1. Successfully hooked module.
00:00:00.469: Loaded "SHFOLDER.DLL" at address 0x76780000 by thread
1. Successfully hooked module.

Anyway...this path of discovery leads me to one conclusion, either
find a small working install (like what you suggested at PCTex), or
rebuild the binaries for a working set. I am a programmer, after all,
so rebuilding ought not be TOO difficult...heh.



Okay, I'll answer your questions now.
Only the standard, Computer Modern (CM) typeface. I like it very
much.
The class could be article or report...probably not book, but I may
even be able to make the latter work. See the example below.
The tables won't be complex. No color. No arrays. No extra
alignment stuff. No urls, no complex text.
"you'd need to specify very tightly up front exactly what it is you
want to typeset."
Not a problem. Since it's all generated programmatically, I can't add
features without recompiling! (well, that's the plan right now
anyway). I don't want flexibility, just beautiful output. Okay,
here's an example:

\documentclass{article}
\begin{document}
\section*{Output Document}
\begin{tabular}{|c|c|}\hline
Physicist & Jose Carrera\\\hline
Beam Name & Left Lateral\\\hline
Compensator Name & Lt Lat\\\hline
Aperture Name & lTLat\\\hline
SOBP Width & 5.0 \\\hline
Field Size & 7.82\\\hline
\end{tabular}
\end{document}

Thanks again for your help. I'll keep working, and wait eagerly for
your (or anyone else's) response.

Aaron

Peter Flynn

unread,
May 18, 2010, 4:16:30 AM5/18/10
to latexus...@googlegroups.com
On Mon, May 17, 2010 at 5:24 PM, Limited_Atonement <dar...@live.com> wrote:
Dear Sir,

 Thanks for your robust reply.  By Margin commands I mean commands to
change the margins.  

That one's easy: the geometry package.

[...] I started testing and the executables

(including dlls) are a very extensive and intricate network.  I
stopped after including tons of files that seemed extraneous.  Many,
many MikTex dlls were required which makes me wonder at your
statement:

I'm not a Windows user, so I wasn't aware of that.
 
"2. What is essential? The pdflatex binary..."
Which pdflatex binary?  I used to think that there was *A* pdflatex
binary that various installations used, but now I think they're
compiled for use with various installations.  

Yes, each platform has to be compiled separately.
 
So, to use the
pdflatex.exe that comes with MikTex, I have to use everything they
compiled it to work with, namely (now that I've deleted all my
previous work, I have to go on memory) kpathsea (?), and all its
dependencies, which are numerous.  

You could possibly ask the author to compile you a statically-linked copy. This wouldn't save much space, but it would mean a single pdflatex.exe program with no external dependencies.
 
Anyway...this path of discovery leads me to one conclusion, either
find a small working install (like what you suggested at PCTex), or
rebuild the binaries for a working set.  I am a programmer, after all,
so rebuilding ought not be TOO difficult...heh.

Another one occurred to me: if you can find the TeX installation package for the Sharp Zaurus PDA (which I used for a couple of years), this was very small, and may indicate how to do it (but that too was Linux, not Windows).
 
Only the standard, Computer Modern (CM) typeface.  I like it very
much. The class could be article or report...probably not book, but I may
even be able to make the latter work.  See the example below.
The tables won't be complex.  No color.  No arrays.  No extra
alignment stuff.  No urls, no complex text.

That helps enormously. If you use \listfiles (http://www.tex.ac.uk/cgi-bin/texfaq2html?label=filesused) it will list out all the packages and files needed (except fonts).
 
\documentclass{article}
\listfiles
\begin{document}
       \section*{Output Document}
               \begin{tabular}{|c|c|}\hline
                       Physicist & Jose Carrera\\\hline
                       Beam Name & Left Lateral\\\hline
                       Compensator Name & Lt Lat\\\hline
                       Aperture Name & lTLat\\\hline
                       SOBP Width & 5.0 \\\hline
                       Field Size & 7.82\\\hline
               \end{tabular}
\end{document}

This says that all you need is article.cls and size10.clo.

I think you're on the right track. But do have a look at the TeX Live installation as well as MiKTeX: it may be that the arrangement of programs and DLLs is much simpler. Bear in mind that very few developers read this list: they are all on comp.text.tex, so you might want to ask the programming-level questions thetre too.

///Peter

Reply all
Reply to author
Forward
0 new messages