First I want to make clear that I'm a LaTeX beginner, so I'll be detailed because I just have no clue about the origin of my problem. I'm using TeXstudio 2.12.6
I'll provide context: I have been researching how to write greek characters directly in the math mode and having them recognised as so when compiled. I.e., I wanted
α = xy^2 + β
being recognised exactly as
\alpha = xy^2 + \beta
Ι finally figured out here how to achieve it: Type Greek letters in Math Mode using Greek keyboard, just using the preamble indicated there (it's in the accepted answer):
\documentclass[a4paper,10pt]{report}
\usepackage[utf8]{inputenc}
\usepackage[greek,spanish]{babel}
\usepackage{amsmath,amssymb,dsfont,alphabeta}
\usepackage[LGR,T1]{fontenc}
Although there's some differences between the original one given in the answer and mine here:
- the babel package flags were originally
[english, greek]
, while mine here are[greek,spanish]
: Order in the flags matters and this way spanish is the principal language in my code (as I wanted it to be). - I'm using
{amsmath,amssymb,dsfont}
too. - I'm using report instead of article.
Now my problem: Recently I've discovered that in math mode when using commands it's not necessary to use braces to encapsulate arguments. In other words, TeXstudio does identify \binom a b
exactly as \binom{a}{b}
. BUT, when I use a greek letter in an argument given without braces, it won't compile and pops up this two errors:
Package inputenc Error: Unicode char �\endgroup (U+3CE)(inputenc) not set up for use with LaTeX. \binom α
Package inputenc Error: Keyboard character used is undefined(inputenc) in inputencoding `utf8'. \binom α
When writing \binom α b
in math mode.
Another example: It happens a similar thing when writing overbrace β
instead of overbrace{β}
in math mode. (In both cases, overbrace{β}
and binom{α}{b}
do work).
Please help. And thank you in advance.
α
is a multi-byte unicode character. Without the grouping, only the first byte is absorbed as the argument, beforeinputenc
can sort it out as a multi-byte unicode character. Keep in mind the concept of unicode characters was developed long after TeX's argument-absorbing mechanisms were in place\binom{x}{y}
. Then your problem vanishes. Typing\binom x y
as well as\frac 1 2
easily leads to problems.