TransWikia.com

Argument of begin has an extra } when trying to use cases

TeX - LaTeX Asked by Elan Mehl on October 5, 2021

I’ve just moved to compiling LaTeX on my desktop instead of using Overleaf and all’s going fine, but I can’t seem to be able to use the cases environment. Here’s my code (some lines removed for brevity):

documentclass[12pt]{report}

usepackage{polski}

usepackage{amsmath,amsfonts,amssymb}
usepackage{tikz-cd}

%wieksze marginesy
usepackage[margin=1in]{geometry}

begin{document}

%(...............)

Oczywiście $(1, ldots, 1) in W^perp$. Gdy $mathrm{char}kmid n$, to również $(1, ldots, 1) in W$, a zatem $W cup W^perp neq {0}$ i $W, W^perp$ są podprzestrzeniami zdegenerowanymi. Niech $mathrm{char}k nmid n$. Załóżmy, że $(a_1, ldots, a_n) notin mathrm{lin}{(1, ldots, 1)}, (a_1, ldots, a_n) in W^perp$. Istnieją $i, j in {1, ldots, n}$ takie, że $a_i neq 0$, $a_j neq a_i$. Załóżmy dla wygody, że $i = 1$, $j = 2$. Rozważmy układ równań

$$
begin{cases}
    x_1 + ldots + x_n & = 0 
    a_1x_1 + ldots + a_nx_n & = 0
end{cases}
xrightarrow
begin{cases}
    x_1 + ldots + x_n & = 0 
    (frac{a_2}{a_1} - 1)x_2 + ldots + (frac{a_n}{a_1} - 1)x_n & = frac{1}{a_1}
end{cases}
$$

end{document}

Compiling with pdflatex gives

Underfull hbox (badness 10000) in paragraph at lines 26--28

! Argument of begin  has an extra }.
<inserted text> 
                par 
l.37 begin
           {cases}
? 
Runaway argument?
! Paragraph ended before begin  was complete.
<to be read again> 
                   par 
l.37 begin
           {cases}
? 
! Missing $ inserted.
<inserted text> 
                $
l.37 begin
           {cases}
? 
! Missing } inserted.
<inserted text> 
                }
l.37 begin
           {cases}
? 
! Missing $ inserted.
<inserted text> 
                $
l.37 begin
           {cases}
? 
! Limit controls must follow a math operator.
ext@arrow ...x towd tw@ {unhbox z@ }}limits 
                                                  @ifnotempty {#7}{^{if 0#...
l.37 begin
           {cases}
? 
! Missing endcsname inserted.
<to be read again> 
                   def 
l.37 begin
           {cases}
? 
)
! Incomplete ifx; all text was ignored after line 37.
<inserted text> 
                fi 
<*> birula.tex

I’ve tried a couple of things but to me, my use of cases just seems completely inoffensive. What could be the problem?

One Answer

You're misusing xrightarrow which has a mandatory argument (the text to be placed above the extensible arrow).

As a consequence of the parsing rules of TeX, it scans the next token as the mandatory argument, which happens to be begin. Chaos ensues.

What you need is rightarrow.

Answered by egreg on October 5, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP