The purpose of this book is to give a systematic approach to conformal field theory with gauge symmetry, the so-called Wess-Zumino-Witten-Novikov model, from the viewpoint of complex algebraic geometry. After a concise introduction to the theory of Riemann surfaces and representation theory of affine Lie algebras in Chapters 1 and 2, respectively, the conformal blocks for stable pointed curves with coordinates are constructed in Chapter 3. Chapter 4 presents a sheafified version of conformal blocks coming from the family of stable pointed curves with coordinates. Chapter 5 describes a projectively flat connection on the sheaf of conformal blocks. Finally, Chapter 6 is devoted to the example of a particular family parameterized by a projective line. The book covers basic material needed for construction of the modular functor from conformal field theory to topological quantum field theory.