I have created a LaTeX document. I have used the following setting:

\documentclass[11pt,a4paper, oneside]{article}


\lstset{basicstyle=\footnotesize, keywordstyle=\color{blue}}




%TikZ package

\author{name }


Now I am trying to transfer my document into a Template. The Template uses the following settings:


Now, I have simply transferred my chapters to this new Template and added my packages. But there are a couple of errors that occur.

As far as I understand some of these errors occur, because my packages don't go along with packages used in the Template. For example subcation doesn't seem to go along with subfig. Also in the ihf-package, there are a couple of packages ... I don't know defined? The siunitx for example seems to be included in the ihf package and a TikZ package as well.

I think I am using the siunitx package wrong, I simply write the units like this: \GHz, \dBm, for example. I have tried \si{GHz} as well.

  • 1
    just showing your preamble makes it hard for anyone to help, you do not show your document nor show what errors you get. Try to make a small document that generates an error and fix your example above so that it generates the error that you are asking for help with. Feb 28 '17 at 9:23
  • Why do you want/need to use that template?
    – Johannes_B
    Feb 28 '17 at 9:45
  • 1
    Not an answer, but you loaded the caption package twice. Also, do you need both subcaption and subfig at the same time?
    – Troy
    Feb 28 '17 at 9:45
  • Yes, you're using siunitx considerably wrong. See Manuel Weinkauf's answer below, please!
    – user31729
    Feb 28 '17 at 12:40

As far as the siunitx use is concerned. You should always use macros instead of handwritten abbreviations, because in this way you always get the spacing right even for more complex constructions, can globally change abbreviations, and can also globally change how "x per y" is formatted (i.e. "x/y" or "x y^(-1)").

Many units are predefined, see the siunitx documentation for this. You can also define your own units using the \DeclareSIUnit command. Here is an example:



Test no.~1 is \SI{10}{\giga\hertz} in the unit \si{\giga\hertz}.

Test no.~2 is \SI{10}{\DecibelMilliwatts} in the unit \si{\DecibelMilliwatts}.

You can then easily work with your own units like (nonsensical) \SI{10}{\giga\DecibelMilliwatts\per\metre\squared}.


EDIT: Made the spacing statement more clear. Thanks to samcarter for pointing that out.

  • The spacing is equally right for handwritten units, compare e.g. \SI{10}{\giga\hertz} \SI{10}{GHz} Feb 28 '17 at 12:58
  • @samcarter But the spacing is only correct if instead of using macros you stick to other input requirements, which are another error source. Compare the results of \SI{10}{km s^{-1}} vs. \SI{10}{km.s^{-1}} vs. \SI{10}{\kilo\metre\per\second}. Further, as I said, using hand-written units prevents you from globally switching from "km s^(-1)" to "km/s". Additionally, using macros you can quickly and globally redefine abbreviations. You want to abbreviate "litre" with "L" instead of "l" without searching for every occasion you used it in the entire document. Just \DeclareSIUnit\litre{L}. Feb 28 '17 at 13:33
  • 1
    I totally agree with you that macros makes it easier to do global changes and of course one has to use . for the inter-unit spacing in handwritten units, but handwritten units don't lead to wrong spacing per se -- this is how your answer sounded to me. Feb 28 '17 at 13:49
  • thx Manuel, this definitely helps!
    – user123551
    Mar 2 '17 at 7:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy