von eld » Di 11. Sep 2018, 09:20
Moin moin,
ich habe ein Problem mit listing.
das möchte ich als listing darstellen:
@Component({
selector: ‘app’,
templateUrl: ‘app.component.html’
})
class AppComponent {
public title = ‘Hello World’;
}
das ist meine tex datei:
\documentclass[
a4paper, % DIN A4
DIV=10, % Schriftgröße und Satzspiegel
oneside, % einseitiger Druck
BCOR=5mm, % Bindungskorrektur
parskip=half, % Halber Abstand zwischen Absätzen
numbers=noenddot % Kein Punkt hinter Kapitelnummern
]{scrreprt}
\usepackage{../style/thesisstyle}
\usepackage{graphicx}
\usepackage{listings}
\usepackage{glossaries}
\usepackage{booktabs}
\lstset
{ %Formatting for code in appendix
% language=Matlab,
basicstyle=\footnotesize,
numbers=left,
stepnumber=1,
showstringspaces=false,
tabsize=1,
breaklines=true,
breakatwhitespace=false,
}
\makeglossaries % create all glossary entries (remember: run makeglossaries manually)
\loadglsentries{thesisglossaries.tex} % load acronym, symbol and glossarie entries
\begin{document}
\input{configuration/configuration} % load all settings
\setcounter{secnumdepth}{4}
\setcounter{tocdepth}{5}
\hyphenation{Ba-che-lor-the-sis Mas-ter-the-sis}
\def\signed #1{{\leavevmode\unskip\nobreak\hfil\penalty50\hskip2em
\hbox{}\nobreak\hfil(#1)%
\parfillskip=0pt \finalhyphendemerits=0 \endgraf}}
\newsavebox\mybox
\newenvironment{aquote}[1]
{\savebox\mybox{#1}\begin{quote}}
{\signed{\usebox\mybox}\end{quote}}
% Cover page here, no page number
\input{../style/coverpage}
% Titlepage is page one even if the number is not shown.
\pagenumbering{roman}
% Title page here
\input{../style/titlepage}
% Abstract page here
\input{../style/abstractpage}
% Table of contents here
\tableofcontents
% List of figures here
\IListOfFigures
% List of tables here
\IListOfTables
% List of accronyms here
\IListOfAccronyms
% List of symbols here
\IListOfSymbols
% Uncomment if list of source code is needed (rarely).
\lstlistoflistings % requires package listings, needs to uncommenting of usepackage
% path to the chapters folder is set to find the images used there
\graphicspath{ {./chapters/} }
% Chapters
\clearpage
\pagenumbering{arabic}
\input{chapters/einleitung_chapter}
\input{chapters/grundlagen_chapter}
\input{chapters/anforderungsspezifikation_chapter}
\input{chapters/systementwurf_chapter}
\input{chapters/implementierung_chapter}
\input{chapters/test_chapter}
\input{chapters/schluss_chapter}
% Add additional chapters here
%\bibliographystyle{plain}
\bibliographystyle{dinat}
\bibliography{literature}
% Appendix
\appendix
\input{appendix/example_appendix}
\IGlossary
\Istatement
\end{document}
und so sieht mein Aufruf an der Stelle aus, an der ich das listing ahben möchte:
\lstinputlisting{./chapters/code/test.txt}
ich lese den Quellcode aus einer Datei.
nun bekomme ich allerdings den Fehler:
Package inputenc Error: Invalid UTF-8 byte sequence. selector: ‘app’,
Package inputenc Error: Invalid UTF-8 byte 152. selector: ‘app’,
Package inputenc Error: Invalid UTF-8 byte sequence. selector: ‘app’,
Package inputenc Error: Invalid UTF-8 byte sequence. templateUrl: ‘app.
usw.
Ich habe noch mal geguckt, die Text Datei ist uTF8 codiert.
Was mache ich falsch?
Moin moin,
ich habe ein Problem mit listing.
das möchte ich als listing darstellen:
[code]@Component({
selector: ‘app’,
templateUrl: ‘app.component.html’
})
class AppComponent {
public title = ‘Hello World’;
}[/code]
das ist meine tex datei:
[code]\documentclass[
a4paper, % DIN A4
DIV=10, % Schriftgröße und Satzspiegel
oneside, % einseitiger Druck
BCOR=5mm, % Bindungskorrektur
parskip=half, % Halber Abstand zwischen Absätzen
numbers=noenddot % Kein Punkt hinter Kapitelnummern
]{scrreprt}
\usepackage{../style/thesisstyle}
\usepackage{graphicx}
\usepackage{listings}
\usepackage{glossaries}
\usepackage{booktabs}
\lstset
{ %Formatting for code in appendix
% language=Matlab,
basicstyle=\footnotesize,
numbers=left,
stepnumber=1,
showstringspaces=false,
tabsize=1,
breaklines=true,
breakatwhitespace=false,
}
\makeglossaries % create all glossary entries (remember: run makeglossaries manually)
\loadglsentries{thesisglossaries.tex} % load acronym, symbol and glossarie entries
\begin{document}
\input{configuration/configuration} % load all settings
\setcounter{secnumdepth}{4}
\setcounter{tocdepth}{5}
\hyphenation{Ba-che-lor-the-sis Mas-ter-the-sis}
\def\signed #1{{\leavevmode\unskip\nobreak\hfil\penalty50\hskip2em
\hbox{}\nobreak\hfil(#1)%
\parfillskip=0pt \finalhyphendemerits=0 \endgraf}}
\newsavebox\mybox
\newenvironment{aquote}[1]
{\savebox\mybox{#1}\begin{quote}}
{\signed{\usebox\mybox}\end{quote}}
% Cover page here, no page number
\input{../style/coverpage}
% Titlepage is page one even if the number is not shown.
\pagenumbering{roman}
% Title page here
\input{../style/titlepage}
% Abstract page here
\input{../style/abstractpage}
% Table of contents here
\tableofcontents
% List of figures here
\IListOfFigures
% List of tables here
\IListOfTables
% List of accronyms here
\IListOfAccronyms
% List of symbols here
\IListOfSymbols
% Uncomment if list of source code is needed (rarely).
\lstlistoflistings % requires package listings, needs to uncommenting of usepackage
% path to the chapters folder is set to find the images used there
\graphicspath{ {./chapters/} }
% Chapters
\clearpage
\pagenumbering{arabic}
\input{chapters/einleitung_chapter}
\input{chapters/grundlagen_chapter}
\input{chapters/anforderungsspezifikation_chapter}
\input{chapters/systementwurf_chapter}
\input{chapters/implementierung_chapter}
\input{chapters/test_chapter}
\input{chapters/schluss_chapter}
% Add additional chapters here
%\bibliographystyle{plain}
\bibliographystyle{dinat}
\bibliography{literature}
% Appendix
\appendix
\input{appendix/example_appendix}
\IGlossary
\Istatement
\end{document}
[/code]
und so sieht mein Aufruf an der Stelle aus, an der ich das listing ahben möchte:
[code]\lstinputlisting{./chapters/code/test.txt}[/code]
ich lese den Quellcode aus einer Datei.
nun bekomme ich allerdings den Fehler:
[code]Package inputenc Error: Invalid UTF-8 byte sequence. selector: ‘app’,
Package inputenc Error: Invalid UTF-8 byte 152. selector: ‘app’,
Package inputenc Error: Invalid UTF-8 byte sequence. selector: ‘app’,
Package inputenc Error: Invalid UTF-8 byte sequence. templateUrl: ‘app.
usw.[/code]
Ich habe noch mal geguckt, die Text Datei ist uTF8 codiert.
Was mache ich falsch?