[Tex/LaTex] Capital Omega problem, I can not renewcommand it

symbols

I want to change all the \Omega in my paper into \varOmega, but always receive an error information. Here is the details.

I have add the line in the preamble \renewcommand{\Omega}{\varOmega} when I compile the TeX file, it said that

Command `\Omega' already defined. \begin{document}

Because there are too many \Omega, it is almost impossible to change them one by one. Therefore I want to use \renewcommand{\Omega}{\varOmega} to realize my purpose. What is wrong with my method?

This is my MWE:

\documentclass{article} 
\usepackage{amsmath,amssymb} 
\renewcommand{\Omega}{\varOmega}
\usepackage{xeCJK} 
\begin{document} 
$\Omega$ 
\end{document} 

Best Answer

Redefine \Omega at the beginning of the document, that is replace

\renewcommand{\Omega}{\varOmega}

with

\AtBeginDocument{\renewcommand{\Omega}{\varOmega}}

MWE:

\documentclass{article} 
\usepackage{amsmath,amssymb} 
\usepackage{xeCJK} 
\AtBeginDocument{\renewcommand{\Omega}{\varOmega}}

\begin{document} 
$\Omega$ 
\end{document} 

enter image description here

Related Question