1

How can I compile a document with enctex enabled ? Documentation on the net seems so horrible that right now I want to throw myself out the window! (Fortunately, soft grass is on the other side!)

As far as I understood, I need do somehow arrive at an .ini file from my .tex file, which I can then process by e.g. pdflatex using the -enc command. But if I try to generate my .ini file with tex -ini. file.tex, tex complains, that it doesn't understand my code, which uses enctex primitives, like \mubyte.
So I can't compile to .ini because enctex primitives are being used, but I can only compile .ini files with enctex. Seems like a circular deadlock, no ?

l7ll7
  • 2,267
  • enctex isn't really supported with latex (although it probably works if you enable it the same way at initex and for documents) but why make a latex format incompatible with latex everywhere else? – David Carlisle Sep 07 '15 at 14:18
  • @DavidCarlisle I couldn't understand your comment, because unfortunately I don't know what a latex format really is. The reason I asked, has a very practical background: All I want is to get this answer http://tex.stackexchange.com/a/264105/6671 to work, which apperently needs enctex. – l7ll7 Sep 07 '15 at 14:22
  • @DavidCarlisle Would you think, it is a bad idea to use that answer, as activating enctex would somehow "mess up" the rest of my latex ? BTW, I'm usind texlive if this information makes any difference. – l7ll7 Sep 07 '15 at 14:24
  • If it is just for personal use you could experiment with enctex but don't use an enctex based format for any latex documents that you want to share with other people as they will not be compatible with standard latex installations. – David Carlisle Sep 07 '15 at 14:55
  • @DavidCarlisle Ok, good to know. If enctex has such an experimental character, why is it then even included as a package (but not activated) in TeXLive or MikTex ? I'd be very glad, if you could tell me, if the Disclaimer in the answer below, concerning the risk of enabling enctex, is valid. – l7ll7 Sep 07 '15 at 15:26
  • It's not experimental it has been available as an extension to TeX since 1990 or so, some formats in texlive are based on it (eg csplain) but latex encoding support is based on inputenc not the enctex extension. Making a new format will never do any harm, the reason for not doing it is not that it will do damage but that your documents will not be usable anywhere else (unless you get the other site to build a similar non standard latex) – David Carlisle Sep 07 '15 at 15:37

2 Answers2

3

If you want to try you can do this (on texlive 2015):

Create in e.g. texmf-local/web2c a file fmtutil.cnf with the content

encpdflatex pdftex language.dat -enc -translate-file=cp227.tcx *pdflatex.ini

If necessary run mktexlsr to update the file database.

Then run on a command line

fmtutil-sys --byfmt encpdflatex

or

fmtutil --byfmt encpdflatex

(It shouldn't much matter which, they simply put the format in different locations).

This should create the encpdflatex format. You can then use it with

pdftex --fmt=encpdflatex file

Disclaimer: I never used enctex and have no idea what it will do with latex. But as the format has its own name it should do no harm to try it.

Ulrike Fischer
  • 327,261
  • Ok, I definitely hope you meant it should do no harm. But as I'm afraid this may mess up my installation (even though seemingly unlikely), I'm cautiously going to wait for some (enctex) expert to confirm in the comments that this solution indeed won't break anything. – l7ll7 Sep 07 '15 at 15:25
  • Sorry I naturally meant, "it will do no harm". It will simply create an "encpdflatex.fmt" and as long as you don't use it explicitly with the --fmt switch it will do nothing. For more informations about how to handle formats see http://www.preining.info/blog/2015/04/tex-live-the-new-multi-fmtutil/ – Ulrike Fischer Sep 07 '15 at 15:29
  • Ok, I'll try it. Can I create the file also in the texmf folder, where a web2c folder also is ? I don't have a texmf-local folder. (I also texlive 2009 as just saw - I was a bit shocked myself - but I hope that won't make any difference. I don't plan on updating, if its not absolutely absolutely necessary because my system is set up perfectly right now, and updating would take a lot of time.) – l7ll7 Sep 07 '15 at 15:47
  • My method with an additional fmtutil.cnf will not work on older texlive. See the link I sent. – Ulrike Fischer Sep 07 '15 at 15:50
  • Yes, I saw the link - that was the reason I even looked, which version of texlive I had running. Is there any other "version-independent" way of getting enctex to work ? – l7ll7 Sep 07 '15 at 16:06
  • Check your main fmtutil.cnf, it should contain some info how you can add more format declarations. This was possible in 2009 too. But don't expect that I try to find it out -- this is not something useful to know. 2009 is really old. – Ulrike Fischer Sep 07 '15 at 16:12
  • Ok, I'll try and do that. It would really be a shame to not find any use of your carefully written answer. – l7ll7 Sep 09 '15 at 09:42
  • The fmtutil-sys line gives fmtutil [INFO]: Did not find entry for byfmt=encpdflatex skipped if I run it with sudo, the fmtutil --byfmt encpdflatex line gives Either -sys or -user mode is required., but otherwise the first compilation will compile the format anyway. ■ Side note refer to https://tex.stackexchange.com/a/12708/250119 to find where texmf-local is. – user202729 Apr 19 '23 at 02:21
3

EncTeX is a TeX extension similar like eTeX. Roughly speaking, it adds new primitives to TeX. Both these extensions are built in the pdftex binary.

LaTeX or plain TeX are collections of macros used as format of TeX. There are two steps for use this: first you must generate a format (by pdftex -ini ... or something similar) and second, the format can be used (by pdftex -fmt format document.tex or something similar, typical short-cuts are latex document or pdflatex document). Users typically don't care about the format generating because this is done by TeX distribution automatically (when TeX distribution is installed). Unfortunately, it is very dangerous to present some notes about manual format generation because these facts vary in different TeX distributions and in time. There are user depended or system provided formats, configuration files, distribution utilities etc.

The pdftex binary includes eTeX and EncTeX extensions but they are disabled by default. They can be enabled during format generation. It means that the availability of new primitives from these extensions depends on format used. LaTeX developers decided that eTeX is enabled and EncTeX is disabled in standard LaTeX. Note that LaTeX is generated by the line where -etex or star before the file name is used. This is switch for enabling eTeX.

EncTeX could be enabled when LaTeX format is generated without any harm. If you don't use the new enabled primitives (like \mubyte) then the document will be exactly the same as with normal LaTeX. Why LaTeX developers decided not to enable encTeX by default? Because if people use new primitives then they will be confused with the standard inputenc way for re-encoding. So LaTeX document nor any LaTeX package must not use EncTeX primitives.

If you want to use EncTeX, you can forget to LaTeX and use csplain format. This format enables EncTeX as default in typical TeX distributions. I strongly recommend to don't use LaTeX.

wipet
  • 74,238
  • You recommend to not use LaTeX in this case or to not use it at all? – Ruben Sep 07 '15 at 17:48
  • @wipet @wipet Could you help me trying to compile with csplain ? Already after your answer on my other question I had installed it, but couldn't manage to compile my documents with it (like your previous answer to my other question). If I save the document, for example, as a.tex and run csplain -enc a.tex it stop with an error saying Undefined control sequence. – l7ll7 Sep 09 '15 at 09:40
  • @user10324 Maybe, you are using some LaTeX macro in your document which isn't defined in plain TeX. Normally, plain TeX users don't use LaTeX macros but they define their own macros. – wipet Sep 09 '15 at 09:45
  • @user10324 You can try to create a file example.tex from my example in the thread "Automatically removing, after compilation..." without adding any more text. Then you can try to run csplain example.tex. I hope that this works. – wipet Sep 09 '15 at 09:51