PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Probleme mit UTF8 bzw. Sonderzeichen



superflused
02-01-2008, 17:38
Hallo zusammen,

ich bin neu im Thema Latex und habe ein Problem mit UTF8. Ich möchte UTF8 sonderzeichen (z.b. Arabisch, usw.) darstellen, bekomme allerdings immer einen Compiler Fehler.

Mein Test-Tex sieht wie folgt aus:

\documentclass[a4paper,10pt]{scrartcl}[2008/01/02]
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\title{Test}
\author{Max Mustermännchen}
\date{\copyright\today}
%
% set font
\renewcommand\familydefault{phv}
\begin{document}
\maketitle
% Hier kommen die Sonderzeichen vor:
Text mit UTF-8 Sonderzeichen...
\end{document}

Aber der Compiler steigt immer mit der folgenden Log-Datei aus:

This is pdfeTeXk, Version 3.141592-1.30.5-2.2 (Web2C 7.5.5) (format=pdfetex 2007.11.19) 2 JAN 2008 16:56
entering extended mode
file:line:error style messages enabled.
**\nonstopmode \input /test/test.tex
(/test/test.tex
/test/test.tex:1
: Undefined control sequence.
l.1 \documentclass
[a4paper,10pt]{scrartcl}[2008/01/02]
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

/test/test.tex:2
: Undefined control sequence.
l.2 \usepackage
[T1]{fontenc}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

/test/test.tex:3
: Undefined control sequence.
l.3 \usepackage
[utf8]{inputenc}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

/test/test.tex:4
: Undefined control sequence.
l.4 \title
{Beispiel für ein einfaches \LaTeX-Dokument}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

Missing character: There is no ü in font cmr10!
/test/test.tex:4
: Undefined control sequence.
l.4 \title{Beispiel für ein einfaches \LaTeX
-Dokument}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

/test/test.tex:5
: Undefined control sequence.
l.5 \author
{Max Mustermännchen}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

Missing character: There is no ä in font cmr10!
/test/test.tex:6
: Undefined control sequence.
l.6 \date
{\copyright\today}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

/test/test.tex:6
: Undefined control sequence.
l.6 \date{\copyright\today
}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

/test/test.tex:9
: Undefined control sequence.
l.9 \renewcommand
\familydefault{phv}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

/test/test.tex:9
: Undefined control sequence.
l.9 \renewcommand\familydefault
{phv}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

/test/test.tex:1
0: Undefined control sequence.
l.10 \begin
{document}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

/test/test.tex:1
1: Undefined control sequence.
l.11 \maketitle

The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

[1{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] )</usr/share/texmf-texli
ve/fonts/type1/bluesky/cm/cmsy10.pfb></usr/share/texmf-texlive/fonts/type1/blue
sky/cm/cmr10.pfb>
Output written on test.pdf (1 page, 12385 bytes).


Die Datei ist in UTF8 codiert.

Hat jemand eine Idee warum das schiefläuft?
Bin für jeden Rat dankbar.

Viele Grüße,

André

jonnyx
02-01-2008, 18:53
Hallöchen,

leider hilft Dein Minimalbeispiel nicht wirklch weiter, da Du den Teil mit den utf8-Sonderzeichen geschickt übergangen hast! Ohne diese läßt sich der Quelltext natürlich ohne weiteres mit pdflatex kompilieren!

Hast Du schonmal XeLaTeX ausprobiert? Es soll wohl ohne Probleme mit utf8 umgehen können! (Siehe Beispiele unter http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=xetex

localghost
02-01-2008, 19:28
An der Zeichencodierung sollte es eigentlich nicht liegen. Die Schwierigkeiten treten ja schon gleich zu Beginn auf. Der Log-Datei ist zu entnehmen, dass Du mit TeXLive arbeitest. Ist denn auch die Version vom 2008/01/02 von KOMA Script (http://dante.ctan.org/CTAN/help/Catalogue/entries/koma-script.html) auf dem System installiert. Lass die Datumsangabe doch mal weg.


MfG und einem herzlichen Willkommen an Board
Thorsten

sommerfee
02-01-2008, 19:29
Hier ist der Fehler:



(format=pdfetex 2007.11.19) 2 JAN 2008 16:56

In dem Formatnamen muß "latex" vorkommen, ansonsten wird der Quelltext nicht mit LaTeX übersetzt. Kein Wunder also, daß er schon \documentclass nicht kennt:



: Undefined control sequence.
l.1 \documentclass


Gruß,
Axel

superflused
11-01-2008, 13:58
Hi,

sorry, dass ich erst jetzt wieder zum antworten komme.

Also ich habe mein Beispiel nun mal etwas vereinfacht:

% layout, kind of paper, kind of document
\documentclass[10pt,oneside,a4paper]{scrartcl}

% used packages
\usepackage{ucs}
\usepackage[utf8x]{inputenc}
\usepackage[OT1]{fontenc}
\usepackage[ngerman, english]{babel}
\usepackage{helvet}

% begin of document
\begin{document}

\section{Test}
\textbf{Tricky Test Мировая}

% end of report
\end{document}

Sobald ich aus

\textbf{Tricky Test Мировая}
die Sonderzeichen rausnehme, also so:

\textbf{Tricky Test}
wird es problemlos interpretiert.

Der entsprechende Eintrag in dem Logfile lautet wie folgt:


LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 12.
LaTeX Font Info: ... okay on input line 12.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 12.
LaTeX Font Info: ... okay on input line 12.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 12.
LaTeX Font Info: ... okay on input line 12.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 12.
LaTeX Font Info: ... okay on input line 12.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 12.
LaTeX Font Info: ... okay on input line 12.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 12.
LaTeX Font Info: ... okay on input line 12.
(/usr/share/texmf-texlive/tex/latex/ucs/ucsencs.def
File: ucsencs.def 2003/11/29 Fixes to fontencodings LGR, T3
)
LaTeX Font Info: Try loading font information for OT1+phv on input line 14.

(/usr/share/texmf-texlive/tex/latex/psnfss/ot1phv.fd
File: ot1phv.fd 2001/06/04 scalable font definitions for OT1/phv.
)
LaTeX Font Info: Font shape `OT1/phv/bx/n' in size <10> not available
(Font) Font shape `OT1/phv/b/n' tried instead on input line 14.
LaTeX Font Info: Font shape `OT1/phv/bx/n' in size <14.4> not available
(Font) Font shape `OT1/phv/b/n' tried instead on input line 14.

(/usr/share/texmf-texlive/tex/latex/ucs/data/uni-4.def
File: uni-4.def 2004/10/17 UCS: Unicode data U+0400..U+04FF
)
/var/www/intern/develop/workspace/portal/writable/tmp/478773c809a4f/pAylUp.tex:15: Undefined control sequence.
\u-default-1052 #1->\CYRM

l.15 \textbf{Tricky Test Ð~\иÑ~@оваÑ~O}

The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,and I'll forget about whatever was undefined.

/var/www/intern/develop/workspace/portal/writable/tmp/478773c809a4f/pAylUp.tex:15: Undefined control sequence.
\u-default-1080 #1->\cyri

l.15 \textbf{Tricky Test Ð~\иÑ~@оваÑ~O}

The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

/var/www/intern/develop/workspace/portal/writable/tmp/478773c809a4f/pAylUp.tex:15: Undefined control sequence.
\u-default-1088 #1->\cyrr

l.15 \textbf{Tricky Test Ð~\иÑ~@оваÑ~O}

The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

/var/www/intern/develop/workspace/portal/writable/tmp/47
8773c809a4f/pAylUp.tex:15: Undefined control sequence.
\u-default-1086 #1->\cyro

l.15 \textbf{Tricky Test Ð~\иÑ~@оваÑ~O}

The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
[...]


Das geht so noch ein paar Mal weiter mit der gleichen Meldung, die habe ich mal lieber rausgekürzt.

@jonnyx: Danke, hier ein komplettes übersichtliches Sample inklusive der Sonderzeichen.

@localghost: Danke, die aktuelle Version vom KOMA Script ist eigentlich installiert. Ich überprüfe das aber auch nochmal! Vielen lieben Dank für die herzliche Begrüßung!

@sommerfee: Ja ich hab mein Sample mal komplett überarbeitet und übersichtlicher gestaltet. Ich hoffe das hilft nun besser!

Generelle Info: Ich arbeite mit texi2pdf unter Debian Linux. Ich möchte Latex Dateien dynamisch mit PHP generieren und per texi2pdf in PDF umwandeln. Das klappt generell auch hervorragend. Allerdings gibts halt die probleme wenn die oben genannten Zeichen irgendwo in den Daten vorkommen :(

Vielen Dank für Eure Mühe!

Gruß,

André