ubuntu latex 中文

sudo apt-get install texlive-xetex latex-cjk-all texstudio
change texstudio Options/Configure TeXstudio/Build/Default Compiler to XeLaTex
in the document add: \usepackage{ctex}