Text FormattingProblem with special characters

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
frodojedi
Posts: 20
Joined: Fri Feb 18, 2011 1:23 am

Problem with special characters

Post by frodojedi »

Hello,
I want to type in latex the character ø without writing \o in order to get
the correct formatting. How can I do this?
My attempt is in the following code. What is wrong?

Please enlighten me ;-)

Thanks in advance

Code: Select all

\documentclass[11pt,a4paper,onecolumn]{report}

\usepackage[francais,german,danish,english]{babel}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}


\title{LaTeX}
\author{Johnny Cash}
\date{February}

\begin{document}

\maketitle


\chapter{Example}

\section{Special characters}

\selectlanguage{danish}
 
I want to print this character ø without writing \o

\end{document}
Last edited by frodojedi on Tue Feb 22, 2011 9:54 pm, edited 1 time in total.

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Problem with special characters

Post by meho_r »

Then try with:

Code: Select all

\usepackage[utf8]{inputenc}
frodojedi
Posts: 20
Joined: Fri Feb 18, 2011 1:23 am

Problem with special characters

Post by frodojedi »

Hi,
I knew it, I tried before but I got this error:

Code: Select all

! Package inputenc Error: Keyboard character used is undefined
(inputenc)                in inputencoding `utf8'.

Any suggestion?
User avatar
svend_tveskaeg
Posts: 478
Joined: Sun Jul 12, 2009 5:31 am

Problem with special characters

Post by svend_tveskaeg »

I remember another user having more or less the same problem on the Danish TeX mailing list some time ago. I believe his problem was that he had ``recycled'' an old (Plain TeX) document which wasn't saved with UFT8 encoding.

This could be your problem, too, but I am fare from sure.

Try with a ``fresh'' document and see if it helps.
``In the game of chess, you can never let your adversary see your pieces.''
-- Zapp Brannigan, Futurama (season 1, episode 4)
frodojedi
Posts: 20
Joined: Fri Feb 18, 2011 1:23 am

Re: Problem with special characters

Post by frodojedi »

Yes!!
It works!!

Thanks a lot
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Problem with special characters

Post by localghost »

frodojedi wrote:[…] It works!! […]
Then please mark the topic (not the last post) accordingly as written in Section 3 of the Board Rules (to be read before posting).
Post Reply