LaTeX forum ⇒ Text Formatting ⇒ Align-environment

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Seanshine
Posts: 52
Joined: Sat Apr 28, 2018 9:59 pm

Align-environment

I am working within the, much appreciated, MastersDoctoralThesis class-file. However, LaTex is unable to compile after the usage of
1. \begin{align} \end{align}
. Is this meant to be? Is there an alternative comment?

Thanks!

Best,
Sean

Johannes_B
Site Moderator
Posts: 4044
Joined: Thu Nov 01, 2012 4:08 pm
The template loads only a few basic packages.

\usepackage{mathtools} needs to be added to the preamble.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

Seanshine
Posts: 52
Joined: Sat Apr 28, 2018 9:59 pm
I have added the package to the preamble, but the document still comes into trouble compiling. Do I need any other packages?

Note that the preamble already contains the following packages (amongst others):

1. \usepackage{mathtools}
2. \usepackage{amsthm,amsmath,amssymb,amsfonts,exscale,latexsym,float,eucal}

Johannes_B
Site Moderator
Posts: 4044
Joined: Thu Nov 01, 2012 4:08 pm
Please post a compilable minimal working example.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

Stefan Kottwitz
Posts: 9440
Joined: Mon Mar 10, 2008 9:44 pm
What is the error message?
You could also post the .log file, as attachment.

Stefan

Seanshine
Posts: 52
Joined: Sat Apr 28, 2018 9:59 pm
Hi Stefan and Johannes,

The code that brings the error:

1. \begin{align*}
2. \textbf{y}_{t} &= \textbf{A'} \cdot \textbf{x}_{t} + \textbf{H'} \cdot \textbf{\xi_{t}} + \textbf{v}_{t},\\
3. \textbf{\xi_{t}} &= \textbf{F} \cdot \textbf{\xi_{t-1}} + \textbf{\varepsilon}_{t},
4. \end{align*}
5.
6. Here, $\textbf{y}_{t}$ is a vector of observed contemporaneous variables; $\textbf{x}_{t}$ is a vector of observed exogenous and lagged exogenous variables, and $\textbf{\xi_{t}}$ is the vector of unobserved states. The vectors of stochastic disturbances are assumed to be Gaussian and mutually uncorrelated, with mean zero and covariance matrices $\textbf{R}$ and $\textbf{Q}$, respectively:
7.
8. \begin{align*}
9. \textbf{v_{t}} & \sim \mathcal{N}(0, \textbf{R})
10. \textbf{\varepsilon_{t}} & \sim \mathcal{N}(0, \textbf{Q})
11. \end{align*}

The error:

https://imgur.com/1XH1j5r

'Undefined control sequence' pointing me towards
1. \begin{document}

Johannes_B
Site Moderator
Posts: 4044
Joined: Thu Nov 01, 2012 4:08 pm
You really should have read an introduction. And learn how to read the log file.

1. \thesistitle{Thesis Title}

EDIT: Your equations are all wrong from an input point of view. You will get errors.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

Johannes_B
Site Moderator
Posts: 4044
Joined: Thu Nov 01, 2012 4:08 pm
1. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2. % Masters/Doctoral Thesis
3. % LaTeX Template
4. % Version 2.5 (27/8/17)
5. %
7. % <!-- m --><a class="postlink" href="http://www.LaTeXTemplates.com">http://www.LaTeXTemplates.com</a><!-- m -->
8. %
9. % Version 2.x major modifications by:
10. % Vel (vel@latextemplates.com)
11. %
12. % This template is based on a template by:
13. % Steve Gunn (http://users.ecs.soton.ac.uk/srg/softwaretools/document/templates/)
14. % Sunil Patel (http://www.sunilpatel.co.uk/thesis-template/)
15. %
17. % CC BY-NC-SA 3.0 (http://creativecommons.org/licenses/by-nc-sa/3.0/)
18. %
19. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
20. \documentclass[
21. english, % ngerman for German
22. chapterinoneline, % Uncomment to place the chapter title next to the number on one line
23. ]{MastersDoctoralThesis} % The class file specifying the document structure
24. \usepackage{blindtext}
25. \usepackage{mathtools}
26. \begin{document}
27.
28. \begin{align*}
29. y_{t} &= A' \cdot x_{t} + H' \cdot \xi_{t} + v_{t},\\
30. \xi_{t} &= F \cdot \xi_{t-1} + \varepsilon_{t},
31. \end{align*}
32.
33. Here, $y_{t}$ is a vector of observed contemporaneous variables; $x_{t}$ is a vector of observed exogenous and lagged exogenous variables, and $\xi_{t}$ is the vector of unobserved states. The vectors of stochastic disturbances are assumed to be Gaussian and mutually uncorrelated, with mean zero and covariance matrices $R$ and $Q$, respectively:
34.
35. \begin{align*}
36. v_{t} & \sim \mathcal{N}(0, {R})
37. \varepsilon_{t} & \sim \mathcal{N}(0, {Q})
38. \end{align*}
39. \end{document}

Maybe you are looking for \mathbf?
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

Seanshine
Posts: 52
Joined: Sat Apr 28, 2018 9:59 pm
Yes, I replaced it with matbf or boldsymbol.

Also, the error has magically disappeared, in the sense that the document compiles again. Could be due the mis-use of textbf in the align-environment, not sure.

\thesistitle is being used after \begin{document}.

Thanks Johannes