## What's wrong with my file ?

Hello,

when I open the file below, SW closed abnormally with a serious error program. If open before a subdocument, I can manage to open the main file but then, strange things happen. Have a look ;) !

Vincent

AttachmentSize
AlgebreLineaire.tex3.66 KB

### Hello, If you remove the

Hello,

If you remove the code

\makeatletter
\def\tableofcontents{\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn
\fi\chapter*{Tables des Mati\{e}res\@mkboth{Tables des Mati\{e}res}{Tables des Mati\{e}res}}
\@starttoc{toc}\if@restonecol\twocolumn\fi}
\makeatother

from the preamble, the file opens in SW. I am not sure what the above code does so I do not know what is causing the error. Are the \if statements you use defined?

You have considerable information in your preamble. I normally place macros in a separate style, say “myformatting” and then place \usepackage{myformatting} in the preamble.

I hope this heps.

--Tom Price

### This looks like the normal

This looks like the normal definition for \tableofcontents except instead of using \contentsname the title for the table of contents is hard coded.  The default French babel setting only captializes the first word.  A better solution is to replace the code identified by Tom with:

\renewcommand{\contentsname}{Tables des Mati\{e}res}

However, after trying this I notice that the document includes svmult2e.sty that doesn't use \contentsname.  So Tom's suggestion of creating a new package file is necessary.  See the last section at http://www.mackichan.com/techtalk/419.htm for some additional information.

SW does try to expand macros defined in the document preamble and this particular macro expansion causes a problem.  Version 5.5 doesn't crash, but it also doesn't open the document.

### Hello, I really need help for

Hello,

I really need help for that. The code

\makeatletter
\def\@crosshairs{\vbox to0pt{}}
\makeatother
\makeatletter
\def\tableofcontents{\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn
\fi\chapter*{Tables des Mati\{e}res\@mkboth{Tables des Mati\{e}res}{Tables des Mati\`{e}res}}
\@starttoc{toc}\if@restonecol\twocolumn\fi}
\makeatother

causes too, many crashes. Is there a way to symplify that code. I don't how too modify or create a package.

### Make a backup copy of your

Make a backup copy of your file and Try this:

Place the attached file in the same folder as your main file. Then add this style to your main document by typing "{myStyle}" (without quotes) in the Native LaTeX Packages dialog under the Options and Packages dialog in the Typeset pull-down menu.

Tom

### Thank you very much !! It

Thank you very much !! It works and does not crash swp when opening the tex file.

### You are welcome. Tom

You are welcome.

Tom