Erste Versuche mit LaTeX - wer kann mir helfen?

Fragen und Probleme, die nicht den obigen Kategorien zugeordnet werden können


soeren36
Forum-Newbie
Forum-Newbie
Beiträge: 5
Registriert: Mi 1. Jun 2016, 17:29

Erste Versuche mit LaTeX - wer kann mir helfen?

Beitrag von soeren36 »

Hallo Forum!
Ich versuche derzeit mir selbst LaTeX beizubringen und verwende dazu ein Skript der LMU München (http://www.statistik.lmu.de/~carolin/te ... 07kurs.pdf).
Vorerst soll es dabei natürlich nur um Grundlagen gehen.
% Das ist mein LaTeX-Dokument.

\documentclass [a4paper, oneside, 10pt] {book} 
\usepackage [german] {babel}
\usepackage [latin1] {inputenc}
\usepackage {amsmath}
\usepackage {dsfont}

\title {Lineare Algebra I}
\author {Sören Krüger}
\date {2016} 

\begin {document}

\maketitle 

\tableofcontents

\section {Vorwort}

Das folgende Skript ist verfasst von
\begin {center}
\framebox {
\begin {minipage} [tt] {3.0cm} 
Sören Krüger
\end {minipage} 
}
\end {center}
.

\section {Kapitel 1}

So sieht die Maschinenschrift aus: \texttt {int quadrat (int x)} 

Ich schreibe mal etwas Mathematisches, z.B. $x^2, X_2 \; oder \; X_{1-\alpha}$ oder ähnliches.

Ich liebe die reellen Zahlen $\mathds{R}$.

\section {Kapitel 2}

Jetzt kommt die Determinante einer Matrix.

\begin {displaymath}
\left |
	\begin {array} {cccc} 
	4 & 4 & 6 & -1 //
	-1 & 4 & 1 & 0 //
	5 & 0 & 0 & 1 //
	0 & 3 & 4 & 6 //
	\end {array}
\right |
\end {displaymath} 
\end {document}

% Ende des Dokuments 
Der Inhalt dieses Dokuments sei mal dahingestellt, das dient zunächst nur zum Kennenlernen der Funktionen... ;-)

LaTeXiT gibt mir einige Fehlermeldungen, die ich nicht so recht verstehe.
Z. B. "LaTeX Error Can be used only in preamble." für den gesamten Part:
 
\documentclass [a4paper, oneside, 10pt] {book} 
\usepackage [german] {babel}
\usepackage [latin1] {inputenc}
\usepackage {amsmath}
\usepackage {dsfont}
Ich dachte, alles was vor "\begin {document}" steht, ist die Präambel?!

Außerdem kommt als Fehlermeldung zu den Zeilen
 
	4 & 4 & 6 & -1 //
	-1 & 4 & 1 & 0 //
	5 & 0 & 0 & 1 //
	0 & 3 & 4 & 6 //
"Extra alignment tab has been changed to \cr.".
Was heißt das genau?
Was ist noch falsch oder unstimmig an meinem ersten Versuch?
Danke für jede Hilfe und liebe Grüße,
Sören[/code]

DADABBI

Beitrag von DADABBI »

Das erste Problem ist nicht nachvollziehbar. Das zweite Problem kommt von den falschen Zeilenenden. Folgendes funktioniert im Online-Editor:
\documentclass [a4paper, oneside, 10pt] {book} 
\usepackage [german] {babel}% german ist für die veraltete Rechtschreibung, verm. willst du eher ngerman
\usepackage [utf8] {inputenc}% Codierung im Online-Editor und Voreinstellung fast aller LaTeX-Editoren
\usepackage {amsmath}
\usepackage {dsfont}

\title {Lineare Algebra I}
\author {Sören Krüger}
\date {2016} 

\begin {document}

\maketitle 

\tableofcontents

\section {Vorwort}

Das folgende Skript ist verfasst von
\begin {center}
\framebox {
\begin {minipage} [tt] {3.0cm} 
Sören Krüger
\end {minipage} 
}
\end {center}
.

\section {Kapitel 1}

So sieht die Maschinenschrift aus: \texttt {int quadrat (int x)} 

Ich schreibe mal etwas Mathematisches, z.B. $x^2, X_2 \; oder \; X_{1-\alpha}$ oder ähnliches.

Ich liebe die reellen Zahlen $\mathds{R}$.

\section {Kapitel 2}

Jetzt kommt die Determinante einer Matrix.

\begin {displaymath}
\left |
   \begin {array} {cccc} 
   4 & 4 & 6 & -1 \\% Zeilenende korrigiert
   -1 & 4 & 1 & 0 \\% Zeilenende korrigiert
   5 & 0 & 0 & 1 \\% Zeilenende korrigiert
   0 & 3 & 4 & 6 \\% Zeilenende korrigiert
   \end {array}
\right |
\end {displaymath} 
\end {document}
Wenn in dem Tutorium (ich habe es nicht gelesen) wirklich // und german und latin1 verwendet wird, würde ich es nur mit größter Vorsicht verwenden.

Benutzeravatar
u_fischer
Forum-Meister
Forum-Meister
Beiträge: 4300
Registriert: Do 22. Nov 2012, 11:09
Kontaktdaten:

Beitrag von u_fischer »

"Extra alignment tab has been changed to \cr.".
Was heißt das genau?
Dass du zuviele Zellen hast. Die Zeile wird mit \\ nicht mit // beendet.
"LaTeX Error Can be used only in preamble."
Kann ich nicht nachvollziehen. Zeige lieber die log-Datei.

soeren36
Forum-Newbie
Forum-Newbie
Beiträge: 5
Registriert: Mi 1. Jun 2016, 17:29

Beitrag von soeren36 »

Danke für die Antworten. Das es "\\" statt "//" an den Zeilenenden dieser Matrixkoeffizienten heißen muss, steht so auch im Skript. Das habe ich schlichtweg falsch gelesen... Asche über mein Haupt!
Bleibt noch zu klären, warum das mit der Präambel nicht stimmt...

Was genau ist denn überhaupt die log-Datei? (nicht antworten, ich google es gleich ;-))
Auf jeden Fall sieht diese so aus:

This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015) (preloaded format=pdflatex 2016.6.1) 1 JUN 2016 18:24
entering extended mode
restricted \write18 enabled.
file:line:error style messages enabled.
%&-line parsing enabled.
**"Erster Test.tex"
(./Erster Test.tex
LaTeX2e <2015/01/01>
Babel <3.9l> and hyphenation patterns for 79 languages loaded.
(/usr/local/texlive/2015/texmf-dist/tex/latex/base/book.cls
Document Class: book 2014/09/29 v1.4h Standard LaTeX document class
(/usr/local/texlive/2015/texmf-dist/tex/latex/base/bk10.clo
File: bk10.clo 2014/09/29 v1.4h Standard LaTeX file (size option)
)
\c@part=\count79
\c@chapter=\count80
\c@section=\count81
\c@subsection=\count82
\c@subsubsection=\count83
\c@paragraph=\count84
\c@subparagraph=\count85
\c@figure=\count86
\c@table=\count87
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
)
(/usr/local/texlive/2015/texmf-dist/tex/generic/babel/babel.sty
Package: babel 2014/09/25 3.9l The Babel package

(/usr/local/texlive/2015/texmf-dist/tex/generic/babel-german/ngerman.ldf
Language: ngerman 2013/12/13 v2.7 German support for babel (new orthography)

(/usr/local/texlive/2015/texmf-dist/tex/generic/babel-german/ngermanb.ldf
Language: ngermanb 2013/12/13 v2.7 German support for babel (new orthography)

(/usr/local/texlive/2015/texmf-dist/tex/generic/babel/babel.def
File: babel.def 2014/09/25 3.9l Babel common definitions
\babel@savecnt=\count88
\U@D=\dimen103
)
\l@naustrian = a dialect from \language\l@ngerman
\l@nswissgerman = a dialect from \language\l@ngerman
Package babel Info: Making " an active character on input line 88.
)))
(/usr/local/texlive/2015/texmf-dist/tex/latex/base/inputenc.sty
Package: inputenc 2015/03/17 v1.2c Input encoding file
\inpenc@prehook=\toks14
\inpenc@posthook=\toks15

(/usr/local/texlive/2015/texmf-dist/tex/latex/base/utf8.def
File: utf8.def 2014/09/29 v1.1m UTF-8 support for inputenc
Now handling font encoding OML ...
... no UTF-8 mapping file for font encoding OML
Now handling font encoding T1 ...
... processing UTF-8 mapping file for font encoding T1

(/usr/local/texlive/2015/texmf-dist/tex/latex/base/t1enc.dfu
File: t1enc.dfu 2014/09/29 v1.1m UTF-8 support for inputenc
defining Unicode char U+00A1 (decimal 161)
defining Unicode char U+00A3 (decimal 163)
defining Unicode char U+00AB (decimal 171)
defining Unicode char U+00BB (decimal 187)
defining Unicode char U+00BF (decimal 191)
defining Unicode char U+00C0 (decimal 192)
defining Unicode char U+00C1 (decimal 193)
defining Unicode char U+00C2 (decimal 194)
defining Unicode char U+00C3 (decimal 195)
defining Unicode char U+00C4 (decimal 196)
defining Unicode char U+00C5 (decimal 197)
defining Unicode char U+00C6 (decimal 198)
defining Unicode char U+00C7 (decimal 199)
defining Unicode char U+00C8 (decimal 200)
defining Unicode char U+00C9 (decimal 201)
defining Unicode char U+00CA (decimal 202)
defining Unicode char U+00CB (decimal 203)
defining Unicode char U+00CC (decimal 204)
defining Unicode char U+00CD (decimal 205)
defining Unicode char U+00CE (decimal 206)
defining Unicode char U+00CF (decimal 207)
defining Unicode char U+00D0 (decimal 208)
defining Unicode char U+00D1 (decimal 209)
defining Unicode char U+00D2 (decimal 210)
defining Unicode char U+00D3 (decimal 211)
defining Unicode char U+00D4 (decimal 212)
defining Unicode char U+00D5 (decimal 213)
defining Unicode char U+00D6 (decimal 214)
defining Unicode char U+00D8 (decimal 216)
defining Unicode char U+00D9 (decimal 217)
defining Unicode char U+00DA (decimal 218)
defining Unicode char U+00DB (decimal 219)
defining Unicode char U+00DC (decimal 220)
defining Unicode char U+00DD (decimal 221)
defining Unicode char U+00DE (decimal 222)
defining Unicode char U+00DF (decimal 223)
defining Unicode char U+00E0 (decimal 224)
defining Unicode char U+00E1 (decimal 225)
defining Unicode char U+00E2 (decimal 226)
defining Unicode char U+00E3 (decimal 227)
defining Unicode char U+00E4 (decimal 228)
defining Unicode char U+00E5 (decimal 229)
defining Unicode char U+00E6 (decimal 230)
defining Unicode char U+00E7 (decimal 231)
defining Unicode char U+00E8 (decimal 232)
defining Unicode char U+00E9 (decimal 233)
defining Unicode char U+00EA (decimal 234)
defining Unicode char U+00EB (decimal 235)
defining Unicode char U+00EC (decimal 236)
defining Unicode char U+00ED (decimal 237)
defining Unicode char U+00EE (decimal 238)
defining Unicode char U+00EF (decimal 239)
defining Unicode char U+00F0 (decimal 240)
defining Unicode char U+00F1 (decimal 241)
defining Unicode char U+00F2 (decimal 242)
defining Unicode char U+00F3 (decimal 243)
defining Unicode char U+00F4 (decimal 244)
defining Unicode char U+00F5 (decimal 245)
defining Unicode char U+00F6 (decimal 246)
defining Unicode char U+00F8 (decimal 248)
defining Unicode char U+00F9 (decimal 249)
defining Unicode char U+00FA (decimal 250)
defining Unicode char U+00FB (decimal 251)
defining Unicode char U+00FC (decimal 252)
defining Unicode char U+00FD (decimal 253)
defining Unicode char U+00FE (decimal 254)
defining Unicode char U+00FF (decimal 255)
defining Unicode char U+0102 (decimal 258)
defining Unicode char U+0103 (decimal 259)
defining Unicode char U+0104 (decimal 260)
defining Unicode char U+0105 (decimal 261)
defining Unicode char U+0106 (decimal 262)
defining Unicode char U+0107 (decimal 263)
defining Unicode char U+010C (decimal 268)
defining Unicode char U+010D (decimal 269)
defining Unicode char U+010E (decimal 270)
defining Unicode char U+010F (decimal 271)
defining Unicode char U+0110 (decimal 272)
defining Unicode char U+0111 (decimal 273)
defining Unicode char U+0118 (decimal 280)
defining Unicode char U+0119 (decimal 281)
defining Unicode char U+011A (decimal 282)
defining Unicode char U+011B (decimal 283)
defining Unicode char U+011E (decimal 286)
defining Unicode char U+011F (decimal 287)
defining Unicode char U+0130 (decimal 304)
defining Unicode char U+0131 (decimal 305)
defining Unicode char U+0132 (decimal 306)
defining Unicode char U+0133 (decimal 307)
defining Unicode char U+0139 (decimal 313)
defining Unicode char U+013A (decimal 314)
defining Unicode char U+013D (decimal 317)
defining Unicode char U+013E (decimal 318)
defining Unicode char U+0141 (decimal 321)
defining Unicode char U+0142 (decimal 322)
defining Unicode char U+0143 (decimal 323)
defining Unicode char U+0144 (decimal 324)
defining Unicode char U+0147 (decimal 327)
defining Unicode char U+0148 (decimal 328)
defining Unicode char U+014A (decimal 330)
defining Unicode char U+014B (decimal 331)
defining Unicode char U+0150 (decimal 336)
defining Unicode char U+0151 (decimal 337)
defining Unicode char U+0152 (decimal 338)
defining Unicode char U+0153 (decimal 339)
defining Unicode char U+0154 (decimal 340)
defining Unicode char U+0155 (decimal 341)
defining Unicode char U+0158 (decimal 344)
defining Unicode char U+0159 (decimal 345)
defining Unicode char U+015A (decimal 346)
defining Unicode char U+015B (decimal 347)
defining Unicode char U+015E (decimal 350)
defining Unicode char U+015F (decimal 351)
defining Unicode char U+0160 (decimal 352)
defining Unicode char U+0161 (decimal 353)
defining Unicode char U+0162 (decimal 354)
defining Unicode char U+0163 (decimal 355)
defining Unicode char U+0164 (decimal 356)
defining Unicode char U+0165 (decimal 357)
defining Unicode char U+016E (decimal 366)
defining Unicode char U+016F (decimal 367)
defining Unicode char U+0170 (decimal 368)
defining Unicode char U+0171 (decimal 369)
defining Unicode char U+0178 (decimal 376)
defining Unicode char U+0179 (decimal 377)
defining Unicode char U+017A (decimal 378)
defining Unicode char U+017B (decimal 379)
defining Unicode char U+017C (decimal 380)
defining Unicode char U+017D (decimal 381)
defining Unicode char U+017E (decimal 382)
defining Unicode char U+200C (decimal 8204)
defining Unicode char U+2013 (decimal 8211)
defining Unicode char U+2014 (decimal 8212)
defining Unicode char U+2018 (decimal 8216)
defining Unicode char U+2019 (decimal 8217)
defining Unicode char U+201A (decimal 8218)
defining Unicode char U+201C (decimal 8220)
defining Unicode char U+201D (decimal 8221)
defining Unicode char U+201E (decimal 8222)
defining Unicode char U+2030 (decimal 8240)
defining Unicode char U+2031 (decimal 8241)
defining Unicode char U+2039 (decimal 8249)
defining Unicode char U+203A (decimal 8250)
defining Unicode char U+2423 (decimal 9251)
)
Now handling font encoding OT1 ...
... processing UTF-8 mapping file for font encoding OT1

(/usr/local/texlive/2015/texmf-dist/tex/latex/base/ot1enc.dfu
File: ot1enc.dfu 2014/09/29 v1.1m UTF-8 support for inputenc
defining Unicode char U+00A1 (decimal 161)
defining Unicode char U+00A3 (decimal 163)
defining Unicode char U+00B8 (decimal 184)
defining Unicode char U+00BF (decimal 191)
defining Unicode char U+00C5 (decimal 197)
defining Unicode char U+00C6 (decimal 198)
defining Unicode char U+00D8 (decimal 216)
defining Unicode char U+00DF (decimal 223)
defining Unicode char U+00E6 (decimal 230)
defining Unicode char U+00EC (decimal 236)
defining Unicode char U+00ED (decimal 237)
defining Unicode char U+00EE (decimal 238)
defining Unicode char U+00EF (decimal 239)
defining Unicode char U+00F8 (decimal 248)
defining Unicode char U+0131 (decimal 305)
defining Unicode char U+0141 (decimal 321)
defining Unicode char U+0142 (decimal 322)
defining Unicode char U+0152 (decimal 338)
defining Unicode char U+0153 (decimal 339)
defining Unicode char U+2013 (decimal 8211)
defining Unicode char U+2014 (decimal 8212)
defining Unicode char U+2018 (decimal 8216)
defining Unicode char U+2019 (decimal 8217)
defining Unicode char U+201C (decimal 8220)
defining Unicode char U+201D (decimal 8221)
)
Now handling font encoding OMS ...
... processing UTF-8 mapping file for font encoding OMS

(/usr/local/texlive/2015/texmf-dist/tex/latex/base/omsenc.dfu
File: omsenc.dfu 2014/09/29 v1.1m UTF-8 support for inputenc
defining Unicode char U+00A7 (decimal 167)
defining Unicode char U+00B6 (decimal 182)
defining Unicode char U+00B7 (decimal 183)
defining Unicode char U+2020 (decimal 8224)
defining Unicode char U+2021 (decimal 8225)
defining Unicode char U+2022 (decimal 8226)
)
Now handling font encoding OMX ...
... no UTF-8 mapping file for font encoding OMX
Now handling font encoding U ...
... no UTF-8 mapping file for font encoding U
defining Unicode char U+00A9 (decimal 169)
defining Unicode char U+00AA (decimal 170)
defining Unicode char U+00AE (decimal 174)
defining Unicode char U+00BA (decimal 186)
defining Unicode char U+02C6 (decimal 710)
defining Unicode char U+02DC (decimal 732)
defining Unicode char U+200C (decimal 8204)
defining Unicode char U+2026 (decimal 8230)
defining Unicode char U+2122 (decimal 8482)
defining Unicode char U+2423 (decimal 9251)
))
(/usr/local/texlive/2015/texmf-dist/tex/latex/amsmath/amsmath.sty
Package: amsmath 2013/01/14 v2.14 AMS math features
\@mathmargin=\skip43

For additional information on amsmath, use the `?' option.
(/usr/local/texlive/2015/texmf-dist/tex/latex/amsmath/amstext.sty
Package: amstext 2000/06/29 v2.01

(/usr/local/texlive/2015/texmf-dist/tex/latex/amsmath/amsgen.sty
File: amsgen.sty 1999/11/30 v2.0
\@emptytoks=\toks16
\ex@=\dimen104
))
(/usr/local/texlive/2015/texmf-dist/tex/latex/amsmath/amsbsy.sty
Package: amsbsy 1999/11/29 v1.2d
\pmbraise@=\dimen105
)
(/usr/local/texlive/2015/texmf-dist/tex/latex/amsmath/amsopn.sty
Package: amsopn 1999/12/14 v2.01 operator names
)
\inf@bad=\count89
LaTeX Info: Redefining \frac on input line 210.
\uproot@=\count90
\leftroot@=\count91
LaTeX Info: Redefining \overline on input line 306.
\classnum@=\count92
\DOTSCASE@=\count93
LaTeX Info: Redefining \ldots on input line 378.
LaTeX Info: R

Liebe Grüße,
Sören

Benutzeravatar
Johannes_B
Moderator
Moderator
Beiträge: 5079
Registriert: Do 1. Nov 2012, 14:55
Kontaktdaten:

Beitrag von Johannes_B »

Füge die vollständige Datei als Anhang ein.
TeXwelt - Fragen und Antworten Schaut vorbei und stellt Fragen.
LaTeX-Vorlagen?

Der Weg zum Ziel: Ruhe bewahren und durchatmen, Beiträge und unterstützende Links aufmerksam lesen, Lösungsansätze verstehen und ggf. nachfragen.

soeren36
Forum-Newbie
Forum-Newbie
Beiträge: 5
Registriert: Mi 1. Jun 2016, 17:29

Beitrag von soeren36 »

Dateianhänge
Erster Test.log
(14.74 KiB) 287-mal heruntergeladen

Benutzeravatar
u_fischer
Forum-Meister
Forum-Meister
Beiträge: 4300
Registriert: Do 22. Nov 2012, 11:09
Kontaktdaten:

Beitrag von u_fischer »

In deinem Beispiel hast du doch noch \usepackage [latin1] {inputenc} benutzt. Warum jetzt plötzlich utf8?

Abgesehen davon, würde ich dir empfehlen, keine Leerzeichen und Umlaute in Dateinamen zu verwenden. Auf Dauer wird es dir viel Ärger ersparen.

soeren36
Forum-Newbie
Forum-Newbie
Beiträge: 5
Registriert: Mi 1. Jun 2016, 17:29

Beitrag von soeren36 »

DADABBI (Gast) hatte bemerkt, dass das etwas veraltet ist, also habe ich es aktualisiert. Außer "latin1" -> "utf8" und "german" -> "ngerman" ist alles gleichgeblieben.

Benutzeravatar
u_fischer
Forum-Meister
Forum-Meister
Beiträge: 4300
Registriert: Do 22. Nov 2012, 11:09
Kontaktdaten:

Beitrag von u_fischer »

Nun, wenn deine Datei aber latin1 kodiert ist, wird latex es überhaupt nicht mögen, wenn du es anlügst und behauptest, sie wäre utf8.

soeren36
Forum-Newbie
Forum-Newbie
Beiträge: 5
Registriert: Mi 1. Jun 2016, 17:29

Beitrag von soeren36 »

Da hast du wohl Recht. Hab es wieder geändert und jetzt funktioniert es zumindest insofern, als dass mir ein Dokument als pdf-Datei angezeigt wird, dass bis auf einige kleine Fehler so aussieht, wie ich mir das gedacht hatte. :-)
Danke schonmal!

Antworten