Generalďťżaaas at the begining of imported code

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
happik
Posts: 2
Joined: Sun Sep 28, 2014 12:37 pm

ďťżaaas at the begining of imported code

Post by happik »

Dear all.
Would you be so kind and help me.
I am using TexMaker. I have imported a code from Python to my thesis

Code: Select all

\lstinputlisting[language=Python]{./Agros2D/model_nom027v050p.py}
This is only one row of the code in my file nomogrCode.tex. There is a string "ďťżaaas" in the first row in the pdf file that I can't get rid of. I have red that it is a consequence of the UTF-8.

Anz suggestions? Thanks.

General settings of my main file:

Code: Select all

\documentclass[12pt,a4paper,oneside]{report} %http://en.wikibooks.org/wiki/LaTeX/Title_Creation
\usepackage[czech]{babel}
\usepackage[T1]{fontenc}
\usepackage[latin2]{inputenc}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

ďťżaaas at the begining of imported code

Post by Johannes_B »

Hi and welcome within our little community.

Several suggestions: Do not use non-ascii charackters in your code (guess that's not what you want)
Use a modern unicode-aware engine like Xe(La)TeX or Lua(La)TeX
Use package listingsutf8 which does some magic and converts the files
Or define literates as described in this answer (sorry, it is in german).

Personally, i have switched to LuaLaTeX because of the unicode support and many other advantages.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
happik
Posts: 2
Joined: Sun Sep 28, 2014 12:37 pm

ďťżaaas at the begining of imported code

Post by happik »

Hi! Thanks for welcoming, I appreciate your answer. Now I am almost finished. Thats why I dont want to change environment and anything else. If there is any way to get rid of this characters, so please tell me.

Thanks

Johannes_B wrote:Hi and welcome within our little community.

Several suggestions: Do not use non-ascii charackters in your code (guess that's not what you want)
Use a modern unicode-aware engine like Xe(La)TeX or Lua(La)TeX
Use package listingsutf8 which does some magic and converts the files
Or define literates as described in this answer (sorry, it is in german).

Personally, i have switched to LuaLaTeX because of the unicode support and many other advantages.
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

ďťżaaas at the begining of imported code

Post by Johannes_B »

Seems i missunderstood your question.
You got that string in the pdf-output and don't know where it comes from?

Hard to say so many miles apart. Try to hack down your document by commenting parts out. The reason will be obvious at some time. This is called preparing a minimal working example and leads to the solution. If it won't be obvious for you, it will be for us.

How is your importet file encoded?

Hint: Remember to make a backup first, just in case ;-)
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply