I am attempting to create a document-wide definition for my Master's Thesis:
\DeclareSIUnit\micron{\micro\meter} which uses the SIunitx package. I am not able to place this definition at the head of Ch. 1, and can't find a suitable place for it in the main.tex, or Thesis.cls files. According to the SIunitx documentation the \DeclareSIUnit command must be placed in the preamble of the document.
I am using the \DeclareSIUnit because the \def command doesn't allow for variable spacing. For example, if I use \def \mu {\micro m} and then type '5 \mu diameter', the output is '5 mudiameter'. Conversely, if I use \def \mu {\micro m{}} and then type '5\mu.' the output is '5 mu .'
Theses, Books, Title pages ⇒ Where to define document-wide definitions
-
- Posts: 5
- Joined: Thu Oct 15, 2015 5:26 pm
- Stefan Kottwitz
- Site Admin
- Posts: 10308
- Joined: Mon Mar 10, 2008 9:44 pm
Where to define document-wide definitions
Welcome to the forum!
A .cls file should never be changed, except if you are the author. One reason is, that there's immediately incompatibility to the original class. Find the preamble and use it. Sometimes a preamble inputs a file with settings, such as
Stefan
It should not be in a chapter, neither at its beginning. You said it should go to the preamble, which is correct. This means, it comes beforeCorned Beef Hash wrote:I am not able to place this definition at the head of Ch. 1, and can't find a suitable place for it in the main.tex, or Thesis.cls files.
\begin{document}
. Furthermore, it should be after the siunitx
package has been loaded. So it could be written right after \usepackage{siunitx}
.A .cls file should never be changed, except if you are the author. One reason is, that there's immediately incompatibility to the original class. Find the preamble and use it. Sometimes a preamble inputs a file with settings, such as
\input{macros}
, then this file can be used for changes.Stefan
LaTeX.org admin
-
- Posts: 5
- Joined: Thu Oct 15, 2015 5:26 pm
Re: Where to define document-wide definitions
That did the trick, thanks. I had a lot of packages in the .sty file for some reason, as soon as I moved them over to the main.tex file everything worked.