Math & Science ⇒ Error Missing $ inserted for my formula
-
- Posts: 13
- Joined: Wed Sep 09, 2009 6:55 am
Error Missing $ inserted for my formula
I know it is a common problem and I found this question been answered before http://www.latex-community.org/forum/vi ... =46&t=4854 But that doesn't help me much.
What I want to do is to write the following formula for lognormal distribution
\[
p(t|a, b) = \frac{1}{{b^a}\Gamma
(a)}{t^{a-1}}{\exp^{\frac{-t}{b}}}
\]
But it kept giving me that annoying error of Missing $. The same error I get for simple $\rho(t|d)$.
Most importantly, I am writing those equation for my PhD thesis and the error only occurs with my PhD thesis compilation. The same equation compiles and I have used them in my published paper.
Looking forward to your help.
cheers
Arif.
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
-
- Site Moderator
- Posts: 814
- Joined: Tue Jul 01, 2008 2:19 pm
Error Missing $ inserted for my formula
Code: Select all
\documentclass{article}
\begin{document}
\[
p(t|a, b) = \frac{1}{{b^a}\Gamma
(a)}{t^{a-1}}{\exp^{\frac{-t}{b}}}
\]
\end{document}
-
- Posts: 13
- Joined: Wed Sep 09, 2009 6:55 am
Re: Error Missing $ inserted for my formula
I think it is same as mine. Yes I tried inside DOCUMENT. By the way, with article as documentclass it works for me. But my document class looks like
\documentclass[11pt,a4paper,titlepage,twoside,openright]{book}
Any help?
Error Missing $ inserted for my formula
Code: Select all
\documentclass[11pt,a4paper,titlepage,twoside,openright]{book}
\begin{document}
\[
p(t|a, b) = \frac{1}{{b^a}\Gamma
(a)}{t^{a-1}}{\exp^{\frac{-t}{b}}}
\]
\end{document}
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Error Missing $ inserted for my formula
You have to reduce the code of your dissertation to a complete and compilable minimal working example (MWE). Depending on how many code you've already written, this can imply very much trouble. But it is the only possible way to get closer to a solution. Everything else would only dwindle into a quiz.jubairarifctg wrote:[…] Most importantly, I am writing those equation for my PhD thesis and the error only occurs with my PhD thesis compilation. […]
Best regards and welcome to the board
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
-
- Posts: 13
- Joined: Wed Sep 09, 2009 6:55 am
Re: Error Missing $ inserted for my formula
Thank you
I don't think I have written too much of the code as I am in my first chapter. Rather I think my problem is something like these links:
http://randomtech.blogspot.com/2004/11/ ... erted.html
http://www.karakas-online.de/mySGML/mis ... erted.html
Now, how do I stop latex to take intelligent decision from adding $ sign to my stuff. As I mentioned before, it works for my article but it does not work for my thesis. Thus, I believe it is something to do with my style file that I am using. How can I share my style file with you? I don't see any option to attach any files here. Can I use any email?
Error Missing $ inserted for my formula
Board Rule 2.1: ...There will be no support via PM, IM or e-Mail!jubairarifctg wrote:...I don't see any option to attach any files here. Can I use any email?
When you reply to a post (or open a new thread) you will see, right after the message window and to the left, a link labeled "Upload attachment". Following that link you can upload files.
-
- Posts: 13
- Joined: Wed Sep 09, 2009 6:55 am
Re: Error Missing $ inserted for my formula
I am attaching my style file.
Plus I got another clue:
\[
p(t|a, b) = \frac{1}{{b^a}\Gamma
(a)}{t^{a-1}}{\exp^{\frac{-t}{b}}}
\]
I get error on things like \frac{}, \Gamma{} etc.
But there is no error for things like:
\begin{eqnarray}
m& = &ab\\
v& = &ab^2
\end{eqnarray}
As the later one does not have any functions such as \Gamma{}.
Looking forward to your help.
- Attachments
-
- uomthesis.sty
- (12.82 KiB) Downloaded 406 times
Error Missing $ inserted for my formula
Code: Select all
\documentclass[11pt,a4paper,titlepage,twoside,openright]{book}
\usepackage{uomthesis}
\begin{document}
\[
p(t|a, b) = \frac{1}{{b^a}\Gamma
(a)}{t^{a-1}}{\exp^{\frac{-t}{b}}}
\]
\end{document}
Try to follow Thorsten's advice, refer to the link he gave about producing a minimal working example, and attach it here, and maybe someone can help -- you just aren't giving enough information to diagnose the problem. If we can't even reproduce your error, there's nothing for us to go on.
Error Missing $ inserted for my formula
I did a simple test with your sty file and the code that you proposed as culprit, but it compiled OK in my system.
Let's try to detect the problem. Please do the following:
1) Copy the following test code (the one that I used) and save it as, for example, test.tex:
2) Save a copy of the file uomthesis.sty in the same folder that contains test.tex.
3) Compile the following document:
Code: Select all
\listfiles
\documentclass{book}
\usepackage{uomthesis}
\begin{document}
\[
p(t|a, b) = \frac{1}{{b^a}\Gamma(a)}{t^{a-1}}{\exp^{\frac{-t}{b}}}
\]
\end{document}