With help from egreg, I have the following collection of packages and macros in the file standardopsaetning.sty:
\NeedsTeXFormat{LaTeX2e}[2014/05/01]
\ProvidesPackage{standardopsaetning}[2015/01/04 Standardopsætning]
\RequirePackage[utf8]{inputenc}
\RequirePackage[T1]{fontenc}
\RequirePackage{lmodern}
\RequirePackage{babel}
\RequirePackage[
hmargin = 2.4cm,
vmargin = 3cm
]{geometry}
\RequirePackage{mathtools}
\RequirePackage[
bottom,
hang,
stable
]{footmisc}
\RequirePackage{fancyhdr}
\RequirePackage{caption}
\RequirePackage{siunitx}
\RequirePackage{pstricks-add}
\RequirePackage{booktabs}
\RequirePackage{enumitem}
\RequirePackage{upgreek}
\RequirePackage[
lastpage
]{zref}
\RequirePackage{microtype}
\mathtoolsset{
showonlyrefs
}
\DeclareCaptionLabelSeparator{tilpasning}{:\quad}
\captionsetup{
labelsep = tilpasning,
figureposition = bottom,
tableposition = top,
font = small,
labelfont = sc
}
\sisetup{
locale = DE,
per-mode = symbol-or-fraction,
range-phrase = --
}
\psset{
dimen = m
}
\newif\ifprint
\newif\ifsubscript
\addto\extrasdanish{
\renewcommand*\pageautorefname{side}
\renewcommand*\figureautorefname{\textsc{Figur}}
\renewcommand*\tableautorefname{\textsc{Tabel}}
}
\providecommand*\setfloatlocations[2]{\@namedef{fps@#1}{#2}}
\setfloatlocations{figure}{htbp}
\setfloatlocations{table}{htbp}
\DisableLigatures[f]{encoding = T1}
\setlength\footnotemargin{6pt}
\pagestyle{fancy}
\renewcommand*\headrulewidth{0pt}
\setlength\headheight{14.5pt}
\zref@newprop*{numpage}{\the\value{page}}
\zref@addprop{main}{numpage}
\fancyhf{}
\fancyfoot[C]{%
\ifnum \zref@extractdefault{LastPage}{numpage}{0} > 1
\thepage
\fi
}
\begingroup\lccode`\~=`\_
\lowercase{\endgroup
\protected\def~{\@ifnextchar|\subtextup\sb}%
}
\def\subtextup|#1|{\sb{\textup{#1}}}%
\AtBeginDocument{\catcode`\_=12 \mathcode`\_=\string"8000 }
\ExplSyntaxOn
\cs_new_eq:NN \calc \fp_eval:n
\NewDocumentCommand\SIexpr{ O{,} m m }
{
\SIextension_siexpr:nnn { #1 } { #2 } { #3 }
}
\cs_new_protected:Npn \SIextension_siexpr:nnn #1 #2 #3
{
\seq_set_split:Nnn \l_SIextension_siexpr_input_seq { #1 } { #2 }
\seq_pop_left:NN \l_SIextension_siexpr_input_seq \l_SIextension_siexpr_first_tl
\seq_clear:N \l_SIextension_siexpr_output_seq
\seq_put_right:Nx \l_SIextension_siexpr_output_seq
{
\fp_compare:nTF { \l_SIextension_siexpr_first_tl > 0 }
{ \num { \l_SIextension_siexpr_first_tl } }
{ - \num { \tl_tail:V \l_SIextension_siexpr_first_tl } }
}
\seq_map_inline:Nn \l_SIextension_siexpr_input_seq
{
\seq_put_right:Nx \l_SIextension_siexpr_output_seq
{
\fp_compare:nTF { ##1 > 0 }
{ + \num { ##1 } }
{ - \num { \tl_tail:n { ##1 } } }
}
}
\SI[
parse-numbers = false,
quotient-mode = fraction,
input-product = *,
output-product = \cdot
]
{
\sisetup{parse-numbers}
\left( \seq_use:Nn \l_SIextension_siexpr_output_seq { } \right)
}
{ #3 }
}
\ExplSyntaxOff
\endinput
I then start a .tex file with the following:
\RequirePackage{fixltx2e}
\documentclass[
a4paper,
12pt,
danish
]{article}
\usepackage{standardopsaetning}
...
Question: Is this 'correct' or is there a better loading order or should I change something else? (As an example, I'm not sure if lmodern is loaded in the best place.)
lmodernis loaded at some optimal stage, I'd be tempted to ask iflmodernis the most suitable font family and if12ptis the optimal font size for your typesetting needs. Finally, I strongly recommend inserting loads more comments into the file. You may know right now why certain packages are being loaded and why others are not, but I can guarantee you that in six months you'll be much less sure about these things. – Mico Jan 04 '15 at 21:22standardopsaetning.styin. I have a lot of notes/comments in the 'real' style file but they are in Danish so I removed them here. – Svend Tveskæg Jan 04 '15 at 21:28\DisableLigatures[f]{encoding = T1}immediately after\RequirePackage{microtype}. Similarly, it might make sense to place the instruction\setlength\footnotemargin{6pt}immediately after the loading of thefootmiscpackage. – Mico Jan 04 '15 at 21:29:)– Svend Tveskæg Jan 04 '15 at 21:32lmodernrather than the alternative at all... ;). But if you insist, I would also loadtextcomp. – cfr Jan 04 '15 at 23:22:)– Svend Tveskæg Jan 04 '15 at 23:23cfr-lm. [I'm joking about loadinglmodernbeing a mistake.cfr-lmis an alternative, though.] I think there's another one, butcfr-lmis better or I wouldn't have bothered to write it. – cfr Jan 04 '15 at 23:24\RequirePackage{pkgloader}:-) – Martin Schröder Jan 05 '15 at 10:22hyperrefin this.styfile because I sometimes have packages which should be loaded after hyperref. Sometimes I have a few more table packages in my documents (together withbooktabsbut I've never experienced any problems in this regard). – Svend Tveskæg Jan 05 '15 at 18:28:(– Svend Tveskæg Jan 05 '15 at 21:41