Tangent can be written in two ways, one is Tan and the other is tg. Tan is commonly used now, and TG is the writing method of the old textbook.
In the old textbooks, tg was often used to represent tangent function and ctg was used to represent cotangent function. In the new textbooks, the tangent function is represented by tan, and the cotangent function is represented by cot.