27

I'm revising my thesis. I'm in a U.S.A university (American English).

My Prof asks me to change "Naive Bayes" to "Naïve Bayes" in my thesis. However, things are not easy.

First thing is that how to add two dots above i. I solved this issue by using Microsoft Word, where "Naive" can be automatically converted to "Naïve". Then I copy it and paste to the Texmaker and run the LaTeX.

enter image description here

But the result is not what I want

enter image description here

CarLaTeX
  • 62,716
Alex
  • 603
  • 15
    Use Na\"ive and it should go well. – egreg Apr 23 '17 at 15:05
  • 4
    If you're curious, the reason you got the weird output when putting "Naïve" into your document directly: in Unicode the character ï is U+00EF LATIN SMALL LETTER I WITH DIAERESIS, which in the UTF-8 encoding is encoded by a sequence of two bytes: C3 (195) followed by AF (175). Without \usepackage[utf8]{inputenc} this gets interpreted as two 8-bit characters. In the T1 font encoding (Wikipedia), C3 is à and AF is ŕ. – ShreevatsaR Apr 23 '17 at 19:47
  • And I think the first question was not answered, Naive Bayes is correct not Naïve Bayes. – Chamberlain Mbah Jan 26 '18 at 19:46
  • @samcarter I'm so sorry because I was so busy writing my graduate dissertation during that time, and I traveled for a long time after graduation. I would like to express my gratitude and appreciation to all the people who had helped me and I have accepted all my questions now. Thank you for reminding me. – Alex Jan 27 '18 at 05:50

1 Answers1

43

Either use

Na\"ive

or add

\usepackage[utf8]{inputenc}

to your preamble, which will allow you to type

Naïve

Note that the longer Na\"{\i}ve is not required, unless your output encoding is T2A or similar that doesn't fully support the Latin alphabet.

Example

\documentclass{article}
\usepackage[utf8]{inputenc}

\begin{document}

Na\"ive

Na\"{\i}ve

Naïve

\end{document}

enter image description here

egreg
  • 1,121,712
  • 1
    The first proposal did not work for me. “na"{\i}ve” produces a correct “naïve”, while “na"{i}ve” in text mode yields i with 3 dots above the stick! See http://hevea.inria.fr/examples/test/sym.html – Yaroslav Nikitenko Nov 28 '17 at 01:25
  • @YaroslavNikitenko What TeX distribution are you running? – egreg Nov 28 '17 at 09:09
  • I use the up-to-date TUG distribution. – Yaroslav Nikitenko Nov 28 '17 at 20:39
  • @YaroslavNikitenko Your edit was unnecessary; and now I added an explicit example that shows Na\"ive works as stated. If it doesn't work in your setup, please ask a question with the necessary details. But you probably have \usepackage[T2A]{fontenc}. – egreg Nov 28 '17 at 21:13
  • With LaTeX release 2018-04-01 or later, \usepackage[utf8]{inputenc} is not necessary any longer (when, of course, the document is UTF-8 encoded). – egreg Aug 26 '18 at 17:42
  • I get a chktex warning (7) when I use na\"ive. See http://ftp.math.purdue.edu/mirrors/ctan.org/systems/doc/chktex/ChkTeX.pdf – khatchad Jun 17 '20 at 15:28
  • @RaffiKhatchadourian Complain with chktex developers; the syntax \"i has been in use for more than 25 years, is correct and way simpler than \"{\i}. – egreg Jun 17 '20 at 15:36