Why Doesn't My LaTeX Code Compile Correctly?

In summary, the conversation discussed a code written in LaTeX that uses the document class "report" and various packages. The code contains equations and a conditional statement. One person recommended using the LyX front-end for easier editing and avoiding compilation issues. Another person suggested using the amsart document class and specified the error that LaTeX gives when using the align* environment.
  • #1
latentcorpse
1,444
0
hi i wrote the following code. i think it's fairly easy to understand what I am trying to get it to print. but LaTeX really doesn't like it. any advice?

\documentclass[12pt]{report}
\usepackage{float}
\usepackage{multirow}
\usepackage{graphicx}
\usepackage{subfigure}
\usepackage{mathrsfs}


\begin{document}
\begin{subequations}
\begin{equation}
U(\theta,t)=\beta \ln{t} + \gamma + \nu(\theta,t) t^{-\frac{1}{2}}+\kappa(\theta,t)
\end{equation}
where $\beta$ and $\gamma$ are constants, $\nu$ is a bounded solution of the wave equation $\nu''=\ddot{\nu}$ and the remainder, $\kappa$, obeys
\begin{align*}
| \kappa(\theta,t) | &\leqslant C_7 t^{-\frac{3}{2}} \\
| \partial_t \kappa(\theta,t)| &\leqslant C_8 t^{-\frac{3}{2}}
\end{align*}
and
\begin{equation}
A(\theta,t)= \begin{cases}
\alpha + \beta^2 \ln{t} & \quad \text{ if $\nu(\theta,t)=0 \forall \theta,t$} \\
\delta t + \epsilon(\theta,t) & \quad \text{ if $\nu(\theta,t) \neq 0$ for some $\theta$ and $t$}
\end{cases}
\end{equation}
\end{subequations}
\end{document}
 
Physics news on Phys.org
  • #2
My advice is "www.lyx.org"[/URL]. It is a multi-platform LaTeX front-end (also free) that is a WYSIWYM (mean) (opposed to the OOo and MS WYSIWYG (get) ). No more need for $mathstuff$ and no more front matter (you can still add new codes via the Preamble option in the Document menu). I've been using it since version 1.4.2 (now on version 1.6.4).

What is great about it is you can see your work (math-type work I mean) as you are writing so there will be no compiling issues unless your single line of math-code is missing something necessary, like {,}, or something else of that nature.
 
Last edited by a moderator:
  • #3
Use the amsart document class along with the amssymb and latexsym packages.
 
  • #4
What is the error LaTeX gives?
 
  • #5
\begin{align*}
| \kappa(\theta,t) | &\leqslant C_7 t^{-\frac{3}{2}} \\
| \partial_t \kappa(\theta,t)| &\leqslant C_8 t^{-\frac{3}{2}}
\end{align*}

these don't need to be in an equation or $$'s?
 

FAQ: Why Doesn't My LaTeX Code Compile Correctly?

1. What are the most common issues when working with LaTeX code?

The most common issues when working with LaTeX code include syntax errors, missing packages, incorrect document class or settings, and problems with file paths or file encoding.

2. How can I fix syntax errors in my LaTeX code?

To fix syntax errors in LaTeX code, carefully review the error message provided by the compiler. Syntax errors are usually caused by missing brackets, parentheses, or curly braces, or by incorrect formatting of commands or environments.

3. What should I do if I am missing a package in my LaTeX document?

If you encounter an error message indicating that a package is missing, you can install it using the package manager of your LaTeX distribution. Alternatively, you can download the package from a trusted resource and place it in the same directory as your document.

4. How can I troubleshoot issues with file paths or file encoding in my LaTeX document?

If you are having problems with file paths, make sure that all necessary files are in the same directory as your main document. If you are experiencing issues with file encoding, check that all files are using the same encoding, such as UTF-8. You can also try converting your files to a different encoding using a text editor or online tool.

5. What are some best practices for avoiding common issues when working with LaTeX code?

To avoid common issues when working with LaTeX code, it is important to pay attention to detail and carefully proofread your code. You should also regularly update your LaTeX distribution and packages to ensure compatibility and avoid conflicts. It is also helpful to consult resources and forums for guidance and troubleshooting tips.

Similar threads

Replies
3
Views
1K
Replies
8
Views
11K
Replies
4
Views
2K
Replies
1
Views
2K
Replies
7
Views
2K
Replies
11
Views
4K
Back
Top