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
Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \begin{align} \end{align}
. Is this meant to be? Is there an alternative comment?

Thanks!

Best,
Sean

User avatar
Johannes_B
Site Moderator
Posts: 4078
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):

Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \usepackage{mathtools}
  2. \usepackage{amsthm,amsmath,amssymb,amsfonts,exscale,latexsym,float,eucal}

User avatar
Johannes_B
Site Moderator
Posts: 4078
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: 9504
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
Site 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:

Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  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
Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \begin{document}

User avatar
Johannes_B
Site Moderator
Posts: 4078
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.

Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \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: 4078
Joined: Thu Nov 01, 2012 4:08 pm

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

Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2. % Masters/Doctoral Thesis
  3. % LaTeX Template
  4. % Version 2.5 (27/8/17)
  5. %
  6. % This template was downloaded from:
  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. %
  16. % Template license:
  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

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 4 guests