-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.tex
120 lines (94 loc) · 3.7 KB
/
main.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
\documentclass{article}
\usepackage{amsmath}
\usepackage[toc,nopostdot,nonumberlist,acronym,automake]{glossaries-extra}
\usepackage{array}
\usepackage{textgreek} %for greek alphabet symbols
\usepackage{siunitx}
\usepackage{tabularx}
\usepackage{longtable}
\usepackage{xcolor}
\glssetnoexpandfield{unit} %necessary for using siunitx macros in the glossary
%The height of each row is set to 1.3 relative to its default height.
\renewcommand{\arraystretch}{1.3}
% create new glossarylist named symbolslist
\newglossary[slg]{symbolslist}{syi}{syg}{List of symbols}
% declare unit field for glossarylist of symbols
\glsaddkey{unit}{\glsentrytext{\glslabel}}{\glsentryunit}{\GLsentryunit}{\glsunit}{\Glsunit}{\GLSunit}
% widths used in the parameter definitions
\newcommand{\widtheqparameter}{0.45\columnwidth}
\newcommand{\widtheqwhitespace}{0.1\columnwidth}
\makeglossaries
% Load external file named glsSymbolListDefinitions.tex with symbol list definitions
\loadglsentries{glsSymbolListDefinitions}
% define glossary style for the symbol list, based on https://tex.stackexchange.com/questions/269565/glossaries-how-to-customize-list-of-symbols-with-additional-column-for-units
\newglossarystyle{symbunitlong}{%
\setglossarystyle{long3col}% base this style on the list style
\renewenvironment{theglossary}{
\begin{longtable}[l]{ >{\raggedright}p{0.1\textwidth} >{\raggedright}p{0.6\textwidth} >{\raggedright}p{0.1\textwidth} l }} %the third column with width=1,5 cm is for whitespace
{\end{longtable}}
\renewcommand*{\glossaryheader}{% Change the table header
& \bfseries Description & & \bfseries Unit \\
\endhead}
\renewcommand*{\glossentry}[2]{% Change the displayed items
\glstarget{##1}{\glossentryname{##1}} %
& \glossentrydesc{##1}% Description
& %whitespace column
& \glsunit{##1} \tabularnewline
}
}
\makeatletter
%adding a dot between the units that's lifted
\sisetup{inter-unit-product=\ensuremath{{}\cdot{}}}
%declaring shorthand unit macros, for use in Symbol list, equations parameters and everywhere else.
\input{unitdeclarations.tex}
%as described on https://tex.stackexchange.com/questions/166580/writing-an-equation-with-the-units-positioned-off-right
\providecommand\add@text{}
\newcommand\equationunit[1]{%
\gdef\add@text{#1\gdef\add@text{}}}%
\renewcommand\tagform@[1]{%
\maketag@@@{\llap{\add@text\quad}(\ignorespaces#1\unskip\@@italiccorr)}%
}
%as described on https://tex.stackexchange.com/questions/95838/how-to-write-a-perfect-equation-parameters-description
\newenvironment{definitions}[1][where:]
{
\begin{center}
#1 \begin{tabular}[t]{>{$}l<{$} @{${}={}$} l}}
{\end{tabular}\\[\belowdisplayskip]
\end{center}
\bigskip{}
}
%macros for defining symbol descriptions, used in Symbol List and in parameter description, see below
\input{symboldefinitions.tex}
%macros for parameter descriptions under equation
\input{parameterdefinitions.tex}
\input{acronymdefinitions.tex}
\input{glossarydefinitions.tex}
\begin{document}
\glsaddall
\printglossary[type=symbolslist,style=symbunitlong,title=List of symbols] % list of symbols
\clearpage{}
\section{Examples for equations}
Reynolds number (Re) is defined as follows:
\begin{equation}
\text{Re}=\frac{{\rho_\ell} {u}{L}}{\mu}\equationunit{[\si{\nodimension}]}
\end{equation}
\begin{definitions}
\rho_\ell & \Erholiquid \\
u & \Eu \\
L & \EL \\
\mu & \Emu \\
\end{definitions}
\noindent
Archimedes number (Ar) is defined as follows:
\begin{equation}
\text{Ar} = \frac {{g}{L}^{3}{\rho_\ell}\left({\rho_b}-{\rho_\ell}\right)}{{\mu}^{2}}
\equationunit{[\si{\nodimension}]}
\end{equation}
\begin{definitions}
\rho_\ell & \Erholiquid \\
L & \EL \\
\mu & \Emu \\
\rho_b & \Erhobody \\
g & \Eg \\
\end{definitions}
\end{document}