Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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} 
share|improve this question
2  
That's strange. Can you narrow down the problem in terms of a minimal working example (MWE)? For example, a document with only \Omega in it together with the current preamble? Or even sequentially removing packages from the preamble until the problem goes away? –  Werner Mar 5 at 5:16
1  
the following works fine for me: \documentclass{article} \usepackage{amsmath} \renewcommand{\Omega}{\varOmega} \begin{document} $\Omega$ \end{document} –  cmhughes Mar 5 at 5:21
    
The following works fine for me too: \documentclass{article} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \renewcommand{\Omega}{\varOmega} \begin{document} Here is a test for $\Omega$ \end{document} But when I insert the line \renewcommand{\Omega}{\varOmega} into my previous huge tex-file, it does not work fine anymore. It always give the information below: Command `\Omega' already defined. It is very strange! –  azhi Mar 5 at 5:25
2  
@azhi make a copy of your 'huge' file, add the command, and start stripping it while keeping the error- this will get you close to a MWE that you can post in your question :) –  cmhughes Mar 5 at 5:30
1  
I have found the reason! Here is my MWE, you can check if xeCJK package will conflict with that command line I gave before: \documentclass{article} \usepackage{amsmath,amssymb} \renewcommand{\Omega}{\varOmega} \usepackage{xeCJK} \begin{document} $\Omega$ \end{document} –  azhi Mar 5 at 6:05

2 Answers 2

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

share|improve this answer

You may want to pass the no-math option to fontspec.

\documentclass{article} 
\usepackage{amsmath,amssymb} 
\usepackage[no-math]{xeCJK} 

\setCJKmainfont{SimSun} % this one I have on my machine

\renewcommand{\Omega}{\varOmega}

\begin{document} 
$\Omega$ 
\end{document}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.