[TxMt] Re: Speedier LaTeX bundles issues

Hans Taktmann hans.taktmann at gmail.com
Sun Nov 4 18:18:12 UTC 2012


Dear Max, list,

thank you, Max, very much for your help and patience.

I can report that I now manage to workaround my problem. However, I still don’t understand what’s going on; and what the problem could be.

(To get the terminology issue out of the way: by "bundles" I mean .tmbundle files, i.e. TextMate bundles, like the LaTeX bundles, standard or "speedier"; these files live in

~/Library/Application\ Support/TextMate/Bundles, and

~/Library/Application\ Support/TextMate/Pristine\ Copy/Bundles .

By "packages" I refer to LaTeX-packages whose functionality is made available to LaTeX by adding a line like

\usepackage{...}

in the source.
I think this terminology is pretty standard.)

As regards the encoding issue: Thanks to your post I made sure that I only deal with UTF8-files (TextMate defaults to UTF8, anyways). However, my problem appears not to be encoding related. At least, UTF8 across the board doesn’t help so far.


Now, in order to nail down my problem I looked at two versions of a very simple tex-file, one of which the speedier TM-bundle manages to tex, whereas it fails with the other. The only difference between the two files is a commented out line at the very beginning.
(Again, the standard TM LaTeX bundle succeeds with both versions of the file, as with any other reasonable tex file I throw at it.)

Since the only difference is one commented out line it is really hard to fathom how a problem could arise.

Here’s the first version of the file, that the speedier LaTeX bundle fails to tex:


\input{preamble}
\input{hyphenation}

\selectlanguage{ngerman}


\begin{document}
\thispagestyle{empty}

\blindtext

\end{document}


Here’s the important part of the log-file:


(/Users/katonah/Library/texmf/tex/latex/misc/preamble.tex

/Users/katonah/Library/texmf/tex/latex/misc/preamble.tex:1: LaTeX Error: Two \documentclass or \documentstyle commands.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.1 \documentclass[a4paper]{
                            report} 


The whole log-file, foo_failing.log, is here:
http://pastie.org/5181491


This is what the (not really verbose, not very helpful) typesetting window says:


Using precompiled format tmdefault.pdflatex.fmt…

Typesetting foo_failing.tex…

preamble.tex:1: \documentclass[a4paper]{


There are definitely NOT two \documentclass or \documentstyle commands involved; the only \documentclass command is in line 1 of preamble.tex, which reads:

\documentclass[a4paper]{report} .




And now, by adding an apparently useless commented out line at the beginning of the source, TeXing succeeds with this version (I discovered this more or less by coincidence):


% \documentclass[a4paper]{report}
\input{preamble}
\input{hyphenation}

\selectlanguage{ngerman}


\begin{document}
\thispagestyle{empty}

\blindtext

\end{document}


Here’s the log-file, foo_succeeding.log, when everything runs smoothly:
http://pastie.org/5181422

For reference, these are the preamble- and hyphenation files (separated to make things more transparent), which get linked into the file to be TeXed:

preamble.tex:
http://pastie.org/pastes/5181411/text

hyphenation.tex:
http://pastie.org/5181417

Some may say, preamble.tex is a bit of a mess, but I cannot see that it is too bad. I added stuff over the years, and I really need all these list environments, etc.

Bottom line: I enjoy much faster TeXing when adding the apparently superfluous extra-line at the beginning. For principal reasons I would like to get rid of this extra line, and understand what is going on.

A final remark: Is there a way to adjust some preferences of the speedier LaTeX bundle? For instance: I would like to have the typesetting window not to be kept open (very annoying); I would like not to have activated the reading bar in Skim.

Anyways, sorry for being lengthy and thanks for your patience and help.

Best,
--Hans




On 31.10.2012, at 14:19, Max Lein wrote:

> Dear Hans, 
> 
> I have a hard time following your explanation, especially of the word »bundle«, because I'm not certain whether that refers to LaTeX packages or one of TextMate's LaTeX bundles. The initial problem you describe has *nothing* to do with TextMate: it appears your file was saved in the wrong encoding (not applemac), so latex cannot decipher non-ASCII characters such as umlaute or accented characters. By default, TextMate and pretty much all other editors use UTF8, hence my advice to *change* the argument for when you load the inputenc LaTeX package to UTF8: 
> 
> \usepackage[utf8]{inputenc}
> 
> If you comment out this usepackage command, pdflatex will not be able to correctly render non-ASCII characters (e. g. ä, ö and ü). 
> 
> Unfortunately the problem with the example code you've included is that it cannot be used to detect problems with file encodings. But the mail you've sent indicates that it's just a file encoding problem that's easy to solve (e. g. the umlaut for »für« was not copied correctly from your text editor). I think what you've been missing is Step 2 below. 
> 
> I recommend you the following: 
> (0) Open the problematic .tex file in TextMate
> (1) Change \usepackage[applemac]{inputenc} to \usepackage[utf8]{inputenc}. 
> (2) Select Save As from the File menu and make sure that UTF8 as file encoding is selected. Then proceed to save the file as text.tex someplace else. This way any experiment with LaTeX will not destroy work. 
> (3) Try to compile the document. 
> 
> Note that if you load other LaTeX files via \include{filename.tex} or \input{filename.tex}, check that the other files are also all saved in the correct encoding, UTF8! 
> 
> 
> If it doesn't work out, please include the content of test.log (in general: [document name].log) in your next post. 
> 
> Max



More information about the textmate mailing list