Text FormattingAlign-environment

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

Align-environment

Post by Seanshine »

Dear readers,

I am working within the, much appreciated, MastersDoctoralThesis class-file. However, LaTex is unable to compile after the usage of

Code: Select all

\begin{align} \end{align}
. Is this meant to be? Is there an alternative comment?

Thanks!

Best,
Sean

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

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

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Align-environment

Post by Johannes_B »

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

Align-environment

Post by Seanshine »

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

Code: Select all

\usepackage{mathtools}
\usepackage{amsthm,amsmath,amssymb,amsfonts,exscale,latexsym,float,eucal}
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Align-environment

Post by Johannes_B »

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: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Align-environment

Post by Stefan Kottwitz »

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

Align-environment

Post by Seanshine »

Hi Stefan and Johannes,

The code that brings the error:

Code: Select all

\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

Code: Select all

\begin{document}
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Align-environment

Post by Johannes_B »

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

Code: Select all

\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: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Align-environment

Post by Johannes_B »

Code: Select all

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 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

Align-environment

Post by Seanshine »

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
Post Reply