## 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
\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):

\usepackage{mathtools}\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: 9444
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:

\begin{align*}    \textbf{y}_{t} &= \textbf{A'} \cdot \textbf{x}_{t} + \textbf{H'} \cdot \textbf{\xi_{t}} + \textbf{v}_{t},\\    \textbf{\xi_{t}} &= \textbf{F} \cdot \textbf{\xi_{t-1}} + \textbf{\varepsilon}_{t},\end{align*} 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: \begin{align*}    \textbf{v_{t}} & \sim \mathcal{N}(0, \textbf{R})    \textbf{\varepsilon_{t}} & \sim \mathcal{N}(0, \textbf{Q})\end{align*}

The error:

https://imgur.com/1XH1j5r

'Undefined control sequence' pointing me towards
\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.

\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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Masters/Doctoral Thesis % LaTeX Template% Version 2.5 (27/8/17)%% This template was downloaded from:% <!-- m --><a class="postlink" href="http://www.LaTeXTemplates.com">http://www.LaTeXTemplates.com</a><!-- m -->%% Version 2.x major modifications by:% Vel (vel@latextemplates.com)%% This template is based on a template by:% Steve Gunn (http://users.ecs.soton.ac.uk/srg/softwaretools/document/templates/)% Sunil Patel (http://www.sunilpatel.co.uk/thesis-template/)%% Template license:% CC BY-NC-SA 3.0 (http://creativecommons.org/licenses/by-nc-sa/3.0/)%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\documentclass[english, % ngerman for Germanchapterinoneline, % Uncomment to place the chapter title next to the number on one line]{MastersDoctoralThesis} % The class file specifying the document structure\usepackage{blindtext}\usepackage{mathtools}\begin{document} \begin{align*}y_{t} &= A' \cdot x_{t} + H' \cdot \xi_{t} + v_{t},\\\xi_{t} &= F \cdot \xi_{t-1} + \varepsilon_{t},\end{align*} 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: \begin{align*}v_{t} & \sim \mathcal{N}(0, {R})\varepsilon_{t} & \sim \mathcal{N}(0, {Q})\end{align*}\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