LaTeX forum ⇒ Text FormattingAlign-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

Postby Seanshine » Sat Jun 02, 2018 1:13 pm

Dear readers,

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

User avatar
Johannes_B
Site Moderator
Posts: 4185
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Sat Jun 02, 2018 2:37 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

Postby Seanshine » Sat Jun 02, 2018 3:20 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}

User avatar
Johannes_B
Site Moderator
Posts: 4185
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Sat Jun 02, 2018 4:19 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.

User avatar
Stefan Kottwitz
Site Admin
Posts: 9732
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Sat Jun 02, 2018 4:34 pm

What is the error message?
You could also post the .log file, as attachment.

Stefan
LaTeX.org admin

Seanshine
Posts: 52
Joined: Sat Apr 28, 2018 9:59 pm

Postby Seanshine » Sun Jun 03, 2018 11:04 am

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}

User avatar
Johannes_B
Site Moderator
Posts: 4185
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Sun Jun 03, 2018 12:17 pm

You really should have read an introduction. And learn how to read the log file.

\thesistitle{Thesis Title}

Replace with your own 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.

User avatar
Johannes_B
Site Moderator
Posts: 4185
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Sun Jun 03, 2018 12:24 pm

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Masters/Doctoral Thesis 
% LaTeX Template
% Version 2.5 (27/8/17)
%
% This template was downloaded from:
% http://www.LaTeXTemplates.com
%
% 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 German
chapterinoneline, % 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

Postby Seanshine » Sun Jun 03, 2018 12:31 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


Return to “Text Formatting”

Who is online

Users browsing this forum: No registered users and 7 guests