Theses, Books, Title pages ⇒ Where to define document-wide definitions
-
- Posts: 5
- Joined: Thu Oct 15, 2015 5:26 pm
Where to define document-wide definitions
\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 .'
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- Stefan Kottwitz
- Site Admin
- Posts: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
Where to define document-wide definitions
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
-
- Posts: 5
- Joined: Thu Oct 15, 2015 5:26 pm