ubuntuusers.de

LateX Fehlermeldung: ! Missing $ inserted.

Status: Gelöst | Ubuntu-Version: Kein Ubuntu
Antworten |

Chroman

Anmeldungsdatum:
1. Juli 2006

Beiträge: 568

Hi,

ich hab ein Problem, ich muss etwas mit LateX schreiben allerdings jedesmal wenn ich folgende Zeile einfüge:

Min D = \sum{i}^{} \sum{j}^{} d_{ij} x_{ij}

Lässt sich das Dokument nicht mehr kompilieren und es kommt eine Fehlermeldung. Ohne diese Zeile funktioniert es ohne Probleme!

% !TEX TS-program = pdflatex
% !TEX encoding = UTF-8 Unicode

% This is a simple template for a LaTeX document using the "article" class.
% See "book", "report", "letter" for other types of document.

\documentclass[11pt]{article} % use larger type; default would be 10pt


\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amstext}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{german}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% tiefere Inhaltsebenen  
%% Simon Nov. 2010 übernommen von:
%% http://www.asselmeyer.com/latex-gliederung-4ter-ordnung
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setcounter{secnumdepth}{5}
\setcounter{tocdepth}{5}

\usepackage[noindentafter]{titlesec}

% paragraphs sehen aus wie subsubsubsections
\titleformat{\paragraph}[hang]{\bf}{\thetitle\quad}{0pt}{}						
\titlespacing{\paragraph}{0pt}{1em}{0.5em} 

% subparagraphs sehen aus wie vorher paragraphs
\titleformat{\subparagraph}[runin]{\bf}{}{0.5em}{}
\titlespacing{\subparagraph}{0pt}{1em}{1em}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\usepackage[utf8]{inputenc} % set input encoding (not needed with XeLaTeX)

%%% Examples of Article customizations
% These packages are optional, depending whether you want the features they provide.
% See the LaTeX Companion or other references for full information.

%%% PAGE DIMENSIONS
\usepackage{geometry} % to change the page dimensions
\geometry{a4paper} % or letterpaper (US) or a5paper or....
% \geometry{margins=2in} % for example, change the margins to 2 inches all round
% \geometry{landscape} % set up the page for landscape
%   read geometry.pdf for detailed page layout information

\usepackage{graphicx} % support the \includegraphics command and options

% \usepackage[parfill]{parskip} % Activate to begin paragraphs with an empty line rather than an indent

%%% PACKAGES
\usepackage{booktabs} % for much better looking tables
\usepackage{array} % for better arrays (eg matrices) in maths
\usepackage{paralist} % very flexible & customisable lists (eg. enumerate/itemize, etc.)
\usepackage{verbatim} % adds environment for commenting out blocks of text & for better verbatim
\usepackage{subfig} % make it possible to include more than one captioned figure/table in a single float
% These packages are all incorporated in the memoir class to one degree or another...

%%% HEADERS & FOOTERS
\usepackage{fancyhdr} % This should be set AFTER setting up the page geometry
\pagestyle{fancy} % options: empty , plain , fancy
\renewcommand{\headrulewidth}{0pt} % customise the layout...
\lhead{}\chead{}\rhead{}
\lfoot{}\cfoot{\thepage}\rfoot{}

%%% SECTION TITLE APPEARANCE
\usepackage{sectsty}
\allsectionsfont{\sffamily\mdseries\upshape} % (See the fntguide.pdf for font help)
% (This matches ConTeXt defaults)

%%% ToC (table of contents) APPEARANCE
\usepackage[nottoc,notlof,notlot]{tocbibind} % Put the bibliography in the ToC
\usepackage[titles,subfigure]{tocloft} % Alter the style of the Table of Contents
\renewcommand{\cftsecfont}{\rmfamily\mdseries\upshape}
\renewcommand{\cftsecpagefont}{\rmfamily\mdseries\upshape} % No bold!

%%% END Article customizations

%%% The "real" document content comes below...
\renewcommand{\baselinestretch}{1.50}


\begin{document}

\tableofcontents
\newpage

\section{Traveling Salesman Problem (TSP)}

\subsection{Beschreibung des Problems}

\subsection{Mathematische Formulierung des Problems}

Min D = \sum{i}^{} \sum{j}^{} d_{ij} x_{ij}

\end{document}

Fehlermeldung:

This is pdfTeX, Version 3.1415926-1.40.11 (MiKTeX 2.9)
entering extended mode
("C:\Dokumente und Einstellungen\a\Desktop\doc\tsp-Kapitel.tex"
LaTeX2e <2009/09/24>
Babel <v3.8l> and hyphenation patterns for english, afrikaans, ancientgreek, ar
abic, armenian, assamese, basque, bengali, bokmal, bulgarian, catalan, coptic, 
croatian, czech, danish, dutch, esperanto, estonian, farsi, finnish, french, ga
lician, german, german-x-2009-06-19, greek, gujarati, hindi, hungarian, iceland
ic, indonesian, interlingua, irish, italian, kannada, kurmanji, lao, latin, lat
vian, lithuanian, malayalam, marathi, mongolian, mongolianlmc, monogreek, ngerm
an, ngerman-x-2009-06-19, nynorsk, oriya, panjabi, pinyin, polish, portuguese, 
romanian, russian, sanskrit, serbian, slovak, slovenian, spanish, swedish, swis
sgerman, tamil, telugu, turkish, turkmen, ukenglish, ukrainian, uppersorbian, u
senglishmax, welsh, loaded.
("C:\Programme\MiKTeX 2.9\tex\latex\base\article.cls"
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
("C:\Programme\MiKTeX 2.9\tex\latex\base\size11.clo"))
("C:\Programme\MiKTeX 2.9\tex\latex\amsfonts\amssymb.sty"
("C:\Programme\MiKTeX 2.9\tex\latex\amsfonts\amsfonts.sty"))
("C:\Programme\MiKTeX 2.9\tex\latex\ams\math\amsmath.sty"
For additional information on amsmath, use the `?' option.
("C:\Programme\MiKTeX 2.9\tex\latex\ams\math\amstext.sty"
("C:\Programme\MiKTeX 2.9\tex\latex\ams\math\amsgen.sty"))
("C:\Programme\MiKTeX 2.9\tex\latex\ams\math\amsbsy.sty")
("C:\Programme\MiKTeX 2.9\tex\latex\ams\math\amsopn.sty"))
("C:\Programme\MiKTeX 2.9\tex\latex\german\german.sty" v2.5e 1998-07-08)
("C:\Programme\MiKTeX 2.9\tex\latex\titlesec\titlesec.sty")
("C:\Programme\MiKTeX 2.9\tex\latex\base\inputenc.sty"
("C:\Programme\MiKTeX 2.9\tex\latex\base\utf8.def"
("C:\Programme\MiKTeX 2.9\tex\latex\base\t1enc.dfu")
("C:\Programme\MiKTeX 2.9\tex\latex\base\ot1enc.dfu")
("C:\Programme\MiKTeX 2.9\tex\latex\base\omsenc.dfu")))
("C:\Programme\MiKTeX 2.9\tex\latex\geometry\geometry.sty"
("C:\Programme\MiKTeX 2.9\tex\latex\graphics\keyval.sty")
("C:\Programme\MiKTeX 2.9\tex\generic\oberdiek\ifpdf.sty")
("C:\Programme\MiKTeX 2.9\tex\generic\oberdiek\ifvtex.sty")
("C:\Programme\MiKTeX 2.9\tex\generic\ifxetex\ifxetex.sty")
("C:\Programme\MiKTeX 2.9\tex\latex\geometry\geometry.cfg"))
("C:\Programme\MiKTeX 2.9\tex\latex\graphics\graphicx.sty"
("C:\Programme\MiKTeX 2.9\tex\latex\graphics\graphics.sty"
("C:\Programme\MiKTeX 2.9\tex\latex\graphics\trig.sty")
("C:\Programme\MiKTeX 2.9\tex\latex\00miktex\graphics.cfg")
("C:\Programme\MiKTeX 2.9\tex\latex\pdftex-def\pdftex.def")))
("C:\Programme\MiKTeX 2.9\tex\latex\booktabs\booktabs.sty")
("C:\Programme\MiKTeX 2.9\tex\latex\tools\array.sty")
("C:\Programme\MiKTeX 2.9\tex\latex\paralist\paralist.sty")
("C:\Programme\MiKTeX 2.9\tex\latex\tools\verbatim.sty")
("C:\Programme\MiKTeX 2.9\tex\latex\subfig\subfig.sty"
("C:\Programme\MiKTeX 2.9\tex\latex\caption\caption.sty"
("C:\Programme\MiKTeX 2.9\tex\latex\caption\caption3.sty")))
("C:\Programme\MiKTeX 2.9\tex\latex\fancyhdr\fancyhdr.sty")
("C:\Programme\MiKTeX 2.9\tex\latex\sectsty\sectsty.sty")
("C:\Programme\MiKTeX 2.9\tex\latex\tocbibind\tocbibind.sty"

Package tocbibind Note: Using section or other style headings.

) ("C:\Programme\MiKTeX 2.9\tex\latex\tocloft\tocloft.sty")
("C:\Dokumente und Einstellungen\a\Desktop\doc\tsp-Kapitel.aux")
*geometry* driver: auto-detecting
*geometry* detected driver: pdftex
("C:\Programme\MiKTeX 2.9\tex\context\base\supp-pdf.mkii"
[Loading MPS to PDF converter (version 2006.09.02).]
) ("C:\Dokumente und Einstellungen\a\Desktop\doc\tsp-Kapitel.toc") [1{C:/Do
kumente und Einstellungen/All Users/Anwendungsdaten/MiKTeX/2.9/pdftex/config/pd
ftex.map}]
! Missing $ inserted.
<inserted text> 
                $
l.99 Min D = \sum
                 {i}^{} \sum{j}^{} d_{ij} x_{ij}
? 

Skittles

Avatar von Skittles

Anmeldungsdatum:
6. April 2006

Beiträge: 599

Wohnort: Bochum

Hast du mal eine Matheumgebung um die Formel gepackt? Z.B. \begin{equation}formel\end{equation}

^{} müsste man auch weglassen können.

owl102

Anmeldungsdatum:
10. September 2010

Beiträge: 248

Wohnort: Braunschweig

Die eigentliche Frage ist ja schon beantwortet (Kommandos wie \sum funktionieren nur innerhalb einer Mathematik-Umgebung wie $..$ oder \(..\) oder \begin{equation}...\end{equation} oder ...), ich möchte aber noch meinen Senf zu was anderem loswerden:

\renewcommand{\baselinestretch}{1.50}

Wenn man \baselinestretch selber umdefiniert (ohne weitere Anpassungen), dann werden auch so manch' andere Abstände größer, die man gar nicht größer haben möchte, und andere häßliche Nebeneffekte kann es auch noch geben. Verwende daher lieber \usepackage[...]{setspace} mit dem Argument "onehalfspacing" oder "doublespacing". (Eine Websuche nach "LaTeX setspace baselinestretch" sollte ausführlichere Infos darüber liefern.)

Chroman

(Themenstarter)

Anmeldungsdatum:
1. Juli 2006

Beiträge: 568

Hi,

danke für eure Hilfe jetzt funktioniert es!

@Skittles: Das mit der Matheumgebung wusste ich nicht, ich bin davon ausgegangen, dass das auch so funktioniert ☺ (hab mit LateX noch nicht wirklich was gemacht)

@owl102: Das hab ich auch gelesen ☺ da gibt es speziell angepasste Packages die z. B. bei Fußnoten nicht den Zeilenabstand erhöhen. Das was ich da reingeschrieben habe, ist auch keine endgültige Version, ich hab das nur drin, weil ich sehen will, wieviel ich schreiben muss ☺

Antworten |