Math & ScienceCommand for Tangens Function fails

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
asianese
Posts: 2
Joined: Sat Apr 21, 2012 10:03 am

Command for Tangens Function fails

Post by asianese »

Hi guys,

I started to learn/use LaTeX for the past few days. I have tried math input such as

Code: Select all

$$\int{\frac{1}{\sqrt{x^2\pm a^2}}}\,dx = \ln{(x+ \sqrt{x^2 \pm a^2})}+C$$
with much success...until I tried to install CJK fonts and something went wrong (so I think). I had a \tan in the document somewhere before, and it was fine, but now...

It doesn't like my \tan function, with the console

Code: Select all

! Missing number, treated as zero.
<to be read again> 
                   x
l.49 \frac{\tan x}{x}
                     =1
? 
All other functions such as \ln, even \tanh works...but it hates \tan. I have no idea why...Please help!

Thankyou

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Command for Tangens Function fails

Post by Stefan Kottwitz »

Hi,

welcome to the board!

The editor is not the problem, as in most cases. Also, the code which you showed is ok. Some code is missing, such as your preamble with document class, packages and settings. Perhaps a package modified \tan or \frac.

This example works:

Code: Select all

\documentclass{article}
\begin{document}
 $\frac{\tan x}{x}$
\end{document}
Perhaps post a compilable Infominimal working example, which shows the problem. For this, you could make a copy of your document and hack it down, as much reduced as possible.

Once we can test it and verify the problem, we can fix it.

Stefan
LaTeX.org admin
asianese
Posts: 2
Joined: Sat Apr 21, 2012 10:03 am

Re: Command for Tangens Function fails

Post by asianese »

Thanks for the speedy reply, Stefan!

I think I have found the problem by eliminating unnecessary packages. It is the \usepackage{pinyin}...which does not appear in my MikTex package installer list... I was having trouble with CJK before and tried \usepackage{pinyin}. Anyway, I do not need CJK at the moment so I will kill off those packages so that at least \tan will work! lols.

Thanks for the help!
Post Reply