Verwendete Umgebung: sharelatex.com Minimalbeispiel:

Open in Online-Editor
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{listings}
\begin{document}

\begin{verbatim}
 apt-get install software-properties-common
apt‑key adv ‑‑keyserver keyserver.ubuntu.com ‑‑recv‑keys E084DAB9
add-apt-repository ppa:marutter/rrutter
apt-get update
apt-get upgrade
\end{verbatim}

\begin{lstlisting}
 [caption={ein paar Zeilen code}\label{lst:test123},captionpos=t] 
apt-get install software-properties-common
apt‑key adv ‑‑keyserver keyserver.ubuntu.com ‑‑recv‑keys E084DAB9
add-apt-repository ppa:marutter/rrutter
apt-get update
apt-get upgrade
\end{lstlisting}
\end{document}

Problem: Ich möchte die Befehle in ein Dokument einfügen.

Beim kompilieren kommen jetzt ganz viele Fehlermeldungen:

Open in Online-Editor
Package inputenc Error: Unicode char \u8:‑ not set up for use with LaTeX.

See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.12 \end{verbatim} Your command was ignored. Type I <command> <return> to replace it with another command, or <return> to continue without it.
main.tex, line 17

Package inputenc Error: Unicode char \u8:�\expandafter\lst@FillFixed@ not set up for use with LaTeX.

See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.17 apt‑key adv ‑‑keyserver keyserver.ubuntu.com ‑‑recv‑keys E0... Your command was ignored. Type I <command> <return> to replace it with another command, or <return> to continue without it.
main.tex, line 17

Package inputenc Error: Keyboard character used is undefined

(inputenc) in inputencoding `utf8'. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.17 apt‑key adv ‑‑keyserver keyserver.ubuntu.com ‑‑recv‑keys E0... You need to provide a definition with \DeclareInputText or \DeclareInputMath before using this key.
main.tex, line 17

Package inputenc Error: Unicode char \u8:�\lst@FillFixed@\lst@EC� not set up for use with LaTeX.

See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.17 apt‑key adv ‑‑keyserver keyserver.ubuntu.com ‑‑recv‑keys E0... Your command was ignored. Type I <command> <return> to replace it with another command, or <return> to continue without it.
main.tex, line 17

Package inputenc Error: Keyboard character used is undefined

(inputenc) in inputencoding `utf8'. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.17 apt‑key adv ‑‑keyserver keyserver.ubuntu.com ‑‑recv‑keys E0... You need to provide a definition with \DeclareInputText or \DeclareInputMath before using this key.
main.tex, line 17

Package inputenc Error: Unicode char \u8:�\lst@EC�\lst@EC� not set up for use with LaTeX.

See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.17 apt‑key adv ‑‑keyserver keyserver.ubuntu.com ‑‑recv‑keys E0... Your command was ignored. Type I <command> <return> to replace it with another command, or <return> to continue without it.
main.tex, line 17

Package inputenc Error: Unicode char \u8:�\lst@FillFixed@\lst@EC� not set up for use with LaTeX.

See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.17 ...er keyserver.ubuntu.com ‑‑recv‑keys E084DAB9 Your command was ignored. Type I <command> <return> to replace it with another command, or <return> to continue without it.
main.tex, line 17

Package inputenc Error: Keyboard character used is undefined

(inputenc) in inputencoding `utf8'. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.17 ...er keyserver.ubuntu.com ‑‑recv‑keys E084DAB9 You need to provide a definition with \DeclareInputText or \DeclareInputMath before using this key.
main.tex, line 17

Package inputenc Error: Unicode char \u8:�\lst@EC�\lst@EC� not set up for use with LaTeX.

See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.17 ...er keyserver.ubuntu.com ‑‑recv‑keys E084DAB9 Your command was ignored. Type I <command> <return> to replace it with another command, or <return> to continue without it.

: Einen Hinweis habe ich hier gefunden, kann ihn nur nicht auf mein Problem übertragen: http://texwelt.de/wissen/fragen/3013/package-inputenc-error-unicode-char-u8-not-set-up-for-use-with-latex-warum-zeigt-das-literaturverzeichnis-keine-umlaute

Wie kann ich das Problem lösen? Es fehlen alle '--' komplett Ausgabe:

alt text

gefragt 13 Feb '15, 13:45

joerg_reuter's gravatar image

joerg_reuter
20112
Akzeptiert-Rate: 0%

bearbeitet 13 Feb '15, 15:31

cgnieder's gravatar image

cgnieder
22.1k243463

Willkommen auf der TeXwelt!

(13 Feb '15, 14:08) cgnieder

Die Zeile

Open in Online-Editor
apt‑key adv ‑‑keyserver keyserver.ubuntu.com ‑‑recv‑keys E084DAB9

in beiden Listings enthält nicht »normale« Bindestriche - (U+002D) sondern geschützte Bindestriche (U+2011).

Herausgefunden habe ich das folgendermaßen:

  • Dein Beispiel kompiliert
  • in der log-Datei die Zeile ! Package inputenc Error: Unicode char \u8:‑ not set up for use with LaTeX gefunden

Damit war der Schuldige gefunden: das Zeichen nach \u8:, nämlich . Dieses habe ich kopiert und unter http://unicode-table.com/de/ nachgeschaut, was es ist.

Lösung: in der betreffenden Zeile alle Bindestriche durch »normale« Bindestriche ersetzen, zum Beispiel durch Search & Replace.

Übrigens: das optionale Argument der lstlisting-Umgebung muss in der gleichen Zeile wie \begin{lstlisting} beginnen, sonst wird es einfach Teil des Codes.

Open in Online-Editor
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{listings}
\begin{document}

\begin{verbatim}
apt-get install software-properties-common
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9
add-apt-repository ppa:marutter/rrutter
apt-get update
apt-get upgrade
\end{verbatim}

\begin{lstlisting}[caption={ein paar Zeilen code}\label{lst:test123},captionpos=t] 
apt-get install software-properties-common
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9
add-apt-repository ppa:marutter/rrutter
apt-get update
apt-get upgrade
\end{lstlisting}

\end{document}

alt text

Permanenter link

beantwortet 13 Feb '15, 14:01

cgnieder's gravatar image

cgnieder
22.1k243463
Akzeptiert-Rate: 60%

bearbeitet 13 Feb '15, 19:50

Vielen Dank. Da wäre ich mein Lebtag nicht drauf gekommen.

(13 Feb '15, 16:06) joerg_reuter
Deine Antwort
Vorschau umschalten

Folgen dieser Frage

Per E-Mail:

Wenn sie sich anmelden, kommen Sie für alle Updates hier in Frage

Per RSS:

Antworten

Antworten und Kommentare

Markdown-Grundlagen

  • *kursiv* oder _kursiv_
  • **Fett** oder __Fett__
  • Link:[Text](http://url.com/ "Titel")
  • Bild?![alt Text](/path/img.jpg "Titel")
  • nummerierte Liste: 1. Foo 2. Bar
  • zum Hinzufügen ein Zeilenumbruchs fügen Sie einfach zwei Leerzeichen an die Stelle an der die neue Linie sein soll.
  • grundlegende HTML-Tags werden ebenfalls unterstützt

Frage-Themen:

×21
×11
×5

gestellte Frage: 13 Feb '15, 13:45

Frage wurde gesehen: 10,133 Mal

zuletzt geändert: 13 Feb '15, 19:50