Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I need to display a few extended ASCII characters and this is what I have coded so far.

\documentclass[a4paper , 12pt]{report}


\usepackage[mathletters]{ucs}
\usepackage[utf8x]{inputenc}

\begin{document}
   $½·®½´»ò Í«°°±-» §±«$
\end{document}

The error message that I've got is

Package utf8x Error: Character189appearedalone.

This error message appears for each extended ASCII character between the two $ marks.

Could someone please help me out?

It is not necessary to use math mode. Non math mode suggestions will do as well.

share|improve this question
2  
Well, why would you want these characters in math mode in the first place? –  doncherry Mar 7 '12 at 12:01
    
i just tested them out in math mode to see whether it works, i do not need them in math mode. These characters appear along with other normal ascii characters –  KiloWatt Mar 7 '12 at 12:08
add comment

1 Answer

You should avoid using the ucs package as it hasn't been maintained for a long time - see the question utf8x vs. utf8 (inputenc). Instead you can use T1-encoded fonts and textcomp:

\documentclass[a4paper,12pt]{report}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage[utf8]{inputenc}
\begin{document}
   ½·®½´»ò Í«°°±-» §±«
\end{document}

(Don't forget to save the file encoded in UTF-8.)


If you want to keep your current file encoding, ANSI, you should pass the option ansinew instead of utf8 to inputenc. However, the plus-minus sign (±) doesn't seem to be considered in this encoding by default, so you have to take care of that yourself, like this:

\documentclass[a4paper,12pt]{report}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage[ansinew]{inputenc}
\DeclareTextSymbol{\textplusminus}{TS1}{'261}
\DeclareTextSymbolDefault{\textplusminus}{TS1}
\DeclareInputText{177}{\textplusminus}
\begin{document}
   ½·®½´»ò Í«°°±-» §±«
\end{document}
share|improve this answer
    
nope it doesnt work, i get Package inputenc Error: keyboard character used is undefined. –  KiloWatt Mar 7 '12 at 12:24
1  
@KiloWatt I suspect your file isn't encoded in UTF-8, but e.g. in ANSI - check the settings of your editor and re-encode the input file appropriately. –  diabonas Mar 7 '12 at 12:30
    
isnt there another method, i find it difficult to convert all my tex files to utf-8 –  KiloWatt Mar 7 '12 at 14:53
    
@KiloWatt What input encoding are you using at the moment? –  diabonas Mar 7 '12 at 15:11
    
@KiloWatt BTW: The question How do I change the encoding of my files? might be helpful. –  diabonas Mar 7 '12 at 15:18
show 4 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.