# Greek theta instead of lower case þ (Icelandic) in TexStudio

I am trying to use Icelandic characters in TexStudio. My preamble looks like this:

\documentclass[12pt,a4paper]{article}
\usepackage{geometry,float}
\usepackage[icelandic]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{natbib}
\usepackage{gb4e}


I can get both upper and lower case ð Ð, but only upper case thorn (Þ). When I type lower case þ, TexStudio returns it as the Greek letter theta.

This is peculiar. Any ideas?

• Welcome to TeX.SX! The culprit is gb4e. I'm looking at the code. – egreg May 17 at 12:39

For reasons that cannot really be known, the gb4e package has a line that says

\def\th{\ifmmode\theta\else$\theta$\fi}


Probably for historical reasons when the code was ported years ago: looking at the code, it really seems a straight port from a plain TeX macro package.

The \th command is defined by the LaTeX kernel (precisely it is in the LaTeX Internal Character Representation, LICR) and should never be redefined.

You can fix the issue by saving and restoring the meaning of \th.

\documentclass[12pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[icelandic]{babel}
\usepackage{geometry,float}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{natbib}

\let\LATEXth\th
\usepackage{gb4e}
\let\gbth\th
\let\th\LATEXth

\usepackage{hyperref}

\begin{document}

ð Ð Þ þ

\end{document}


I redefined the gb4e provided \th to \gbth in case you need it.