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.

How can we make First letter Capital while using trigonometric functions. eg: \cos (60^\circ) gives simple cos (all in small). What is needed is 'Cos' (with initial capital). For italics in mactex i used \it but it didn't italicized 'cos' only the number '60'. So how to do that?

share|improve this question
1  
Welcome to TeX.SE. For future reference, it would be helpful if you composed a fully compilable MWE including \documentclass and the appropriate packages that sets up the problem. I don't understand the second part of your question and a MWE would clarify that. –  Peter Grill May 13 at 3:24
    
@PeterGrill ya sure. I will take care of it next time. –  ronpatel May 13 at 4:35
    
Hey, what happened to your other question? Also, see How do you accept an answer?. –  Peter Grill May 13 at 6:49
    
@PeterGrill. I figured out the problem. I had used the \begin{equation} twice. It took 2 hrs approx. but solved so deleted. –  ronpatel May 13 at 7:09
    
Ok, glad that you figured out your issue. But the point of this site is not just to help you with your specific issue, but so that it becomes a source of information for others. If you made that mistake then perhaps others might make a similar mistake in the future so a self answer would have been preferred rather than deletion. –  Peter Grill May 13 at 7:11

1 Answer 1

up vote 6 down vote accepted

I would highly recommend you not do this, but you can use \DeclareMathOperator to change how the operators are typeset:

\DeclareMathOperator{\cos}{Cos}
\DeclareMathOperator{\sin}{Sin}

enter image description here

If you want the operator name in italics you can instead use:

\DeclareMathOperator{\cos}{\mathit{Cos}}
\DeclareMathOperator{\sin}{\mathit{Sin}}

enter image description here

Again, I would advice you to not do this. It is not consistent with the normal conventions.

Notes:

  • The \let were necessary as we are redefining existing macros, so \let the existing definition to \relax eliminates the error message.

Code:

\documentclass{article}
\usepackage{amsmath}

\let\cos\relax
\let\sin\relax
\DeclareMathOperator{\cos}{Cos}
\DeclareMathOperator{\sin}{Sin}

\begin{document}
$\cos^2 \theta + \sin^2 \theta = 1$
\end{document}
share|improve this answer
    
@PeterBrill Exactly, since its not consist what could be the other option. My Report is of 70 pages and i have to use trigonometric relations repeatedly. And as per what you have indicated here, i have to use \DeclareMathOperator{\trigfn}{trigfn} for all the trig. functions i use inreport . Right? –  ronpatel May 13 at 4:40
    
@ron: Simply use the existing \cos and \sin. Do not make the first letter capital, and do not use italics for the operator name. Yes, define any new operators that you need using \DeclareMathOperator. If you are redefining an existing operator use the \let\ExistingName\relax as in the MWE. –  Peter Grill May 13 at 4:50

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.