English 中文(简体)
Maths in LaTex table of contents
原标题:
  • 时间:2009-11-15 22:02:12
  •  标签:
  • math
  • latex

I am trying to add a table of contents for my LaTex document. The issue I am having is that this line:

    subsubsection{The expectation of (X^2)}

Causes an error in the file that contains the table of contents

contentsline {subsubsection}{
umberline {1.2.3}
The expectation of 
elax $X^2
elax GenericError { }{
LaTeX Error: Bad math environment delimiter}{
    See the LaTeX manual or LaTeX Companion for explanation.}
{Your command was ignored.MessageBreak Type I <command> <return> 
to replace it with another command,MessageBreak or <return> to 
continue without it.}}{5}

Which causes the document not to be generated.

Does anyone have a solution to having maths in sections while still having the table of contents

最佳回答

You should use the Amsmath inline math delimiter $ instead of ( and ). Thus:

subsubsection{The expectation of $X^2$}

Note: be sure to remove the currently generated .toc file first, otherwise the error will not go away.

问题回答

If you wish to continue using (...) as your math delimiters, you can load the (officially supported) fixltx2e package. This is where fixes to LaTeX go that cannot be integrated into the main sources because of the possibility of backwards compatibility problems.

(In short, your problem is that ( and ) by default aren t "robust" and hence can t be used in places like section headings and captions; the fixltx2e package fixes this.)

Could you try again with putting the $ signs around the expression? What error do you get?





相关问题
Maths in LaTex table of contents

I am trying to add a table of contents for my LaTex document. The issue I am having is that this line: subsubsection{The expectation of (X^2)} Causes an error in the file that contains the ...

Math Overflow -- Handling Large Numbers

I am having a problem handling large numbers. I need to calculate the log of a very large number. The number is the product of a series of numbers. For example: log(2x3x66x435x444) though my actual ...

Radial plotting algorithm

I have to write an algorithm in AS3.0 that plots the location of points radially. I d like to input a radius and an angle at which the point should be placed. Obviously I remember from geometry ...

Subsequent weighted algorithm for comparison

I have two rows of numbers ... 1) 2 2 1 0 0 1 2) 1.5 1 0 .5 1 2 Each column is compared to each other. Lower values are better. For example Column 1, row 2 s value (1.5) is more ...

热门标签