/bok-logik/book-logik

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/bok-logik/book-logik
1 by Gustav Hartvigsson
Initial documents and such.
1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2
% SWEDISH EXTENSION OF THE algorithmicx PACKAGE
3
%
4
% Provides: Swedish notation for algorithms.
5
%
6
% Keywords: Swedish
7
%           Svensk
8
%           Algoritm
9
%           Svenska
10
%           LaTeX
11
%           Programmering
12
%           Programming
13
%
14
% LICENCE: WTF
15
% AUTHOR: Gustav Hartvigsson - 2016
16
%
17
% NO RIGHTS RESERVED
18
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
19
20
%%%% FIX SWEDISH CAPTIONS ON ALGORITHMS
21
% http://tex.stackexchange.com/a/169119
22
\makeatletter
23
\renewcommand*{\ALG@name}{Algoritm}
24
\makeatother
33 by Gustav Hatvigsson
* Added so that swelango.tex has "Algoritmer" in the title of the algo listings.
25
\renewcommand{\listalgorithmname}{Algoritmer}
1 by Gustav Hartvigsson
Initial documents and such.
26
%%%%
27
28
%%%%%%%%%%%%%%%%%
29
% Returnera
30
%%%%%%%%%%%%%%%%%
7 by Gustav Hartvigsson
* cc-by-sa -> cc-by
31
\algnewcommand\Returnera{\textbf{returnera}\ }
32
\algnewcommand\Retur{\textbf{retur}\ }
33
34
%%%%%%%%%%%%%%%%%
35
% I/O
36
%%%%%%%%%%%%%%%%%
37
\algnewcommand\Inmatning{\item[\textbf{Inmatning:}\ ]}
38
\algnewcommand\Utmatning{\item[\textbf{Utmatning:}\ ]}
1 by Gustav Hartvigsson
Initial documents and such.
39
40
%%%%%%%%%%%%%%%%
41
% Krav, Kräv
42
%%%%%%%%%%%%%%%%
43
\algnewcommand\Krav{\item[\textbf{Krav:\ }]}
44
\algnewcommand\Kraev{\item[\textbf{Kräv:\ }]}
45
46
%%%%%%%%%%%%%%%
47
% Garantera
48
%%%%%%%%%%%%%%%
49
\algnewcommand\Garantera{\item[\textbf{Garantera:\ }]}%
50
51
52
%%%%%%%%%%%%%%%%%
53
% Börja - Avsluta
54
%%%%%%%%%%%%%%%%%
55
% declaration of the new block
56
\algblock{Boerja}{Avsluta}
57
% customising the new block
58
\algrenewtext{Boerja}[1]{\textbf{börja}\ #1}
59
\algrenewtext{Avsluta}{\textbf{avsluta}}
60
61
%%%%%%%%%%%%%%%%%
62
% Procedur - Slut Procedur
63
%%%%%%%%%%%%%%%%%
64
% declaration of the new block
65
\algblock{Procedur}{SlutProcedur}
66
% customising the new block
67
\algrenewtext{Procedur}[2]{\textbf{procedur}\ #1 (#2) }
68
\algrenewtext{SlutProcedur}{\textbf{slut\ procedur}}
69
70
%%%%%%%%%%%%%%%%%
71
% Procedur - Slut Procedur
72
%%%%%%%%%%%%%%%%%
73
% declaration of the new block
74
\algblock{Funktion}{SlutFunktion}
75
% customising the new block
7 by Gustav Hartvigsson
* cc-by-sa -> cc-by
76
\algrenewtext{Funktion}[2]{\textbf{funktion}\ #1(#2) }
1 by Gustav Hartvigsson
Initial documents and such.
77
\algrenewtext{SlutFunktion}{\textbf{slut\ funktion}}
78
79
80
%%%%%%%%%%%%%%%%%
81
% För - Slut För
82
%%%%%%%%%%%%%%%%%
83
% declaration of the new block
84
\algblock{Foer}{SlutFoer}
85
% customising the new block
6 by Gustav Hartvigsson
* Färdigställt "För" och "för alla"
86
\algnewcommand\algorithmicfoer{\textbf{för}}
87
\algnewcommand\algorithmicutfoer{\textbf{utför}}
88
\algnewcommand\algorithmictill{\textbf{till}}
1 by Gustav Hartvigsson
Initial documents and such.
89
\algnewcommand\algorithmicslutfoer{\textbf{slut\ för}}
6 by Gustav Hartvigsson
* Färdigställt "För" och "för alla"
90
\algrenewtext{Foer}[1]{\algorithmicfoer\ #1\ \algorithmicutfoer}
1 by Gustav Hartvigsson
Initial documents and such.
91
\algrenewtext{SlutFoer}{\algorithmicslutfoer}
92
93
%%%%%%%%%%%%%%%%%
94
% För Alla - Slut För
95
%%%%%%%%%%%%%%%%%
96
% declaration of the new block
6 by Gustav Hartvigsson
* Färdigställt "För" och "för alla"
97
\algblock{FoerAlla}{SlutFoerAlla}
1 by Gustav Hartvigsson
Initial documents and such.
98
% customising the new block
6 by Gustav Hartvigsson
* Färdigställt "För" och "för alla"
99
\algnewcommand\algorithmicfoeralla{\textbf{för alla}}
100
\algnewcommand\algorithmici{\textbf{i}}
101
\algrenewtext{FoerAlla}[1]{\algorithmicfoeralla\ #1\ \algorithmicutfoer}
102
\algrenewtext{SlutFoerAlla}{\algorithmicslutfoer}
1 by Gustav Hartvigsson
Initial documents and such.
103
104
%%%%%%%%%%%%%%
105
% Medans - Slut Medans
106
%%%%%%%%%%%%%%
107
\algblock{Medans}{SlutMedans}
108
% customising the new block
109
\algnewcommand\algorithmicmedans{\textbf{medans}}
110
\algnewcommand\algorithmicslutmedans{\textbf{slut\ medans}}
111
\algrenewtext{Medans}[1]{\algorithmicmedans\ #1\ \algorithmicutfoer}
112
\algrenewtext{SlutMedans}{\algorithmicslutmedans}
113
114
%%%%%%%%%%%%%%
115
% Upprepa - Tills
116
%%%%%%%%%%%%%%
117
\algblock{Upprepa}{Tills}
118
% customising the new block
119
\algnewcommand\algorithmicupprepa{\textbf{upprepa}}
120
\algnewcommand\algorithmictills{\textbf{tills}}
121
\algrenewtext{Upprepa}{\algorithmicupprepa}
122
\algrenewtext{Tills}[1]{\algorithmictills\ #1}
123
124
125
%%%%%%%%%%%%%%
126
% Utför - Medans
127
%%%%%%%%%%%%%%
128
\algblock{Utfoer}{UtfoerMedans}
129
% customising the new block
130
\algrenewtext{Utfoer}{\algorithmicutfoer\ }
131
\algrenewtext{UtfoerMedans}[1]{\algorithmicmedans\ #1}
132
133
%%%%%%%%%%%%%%
134
% Om - Annars Om - Annars - Slut Om
135
%%%%%%%%%%%%%%
136
% declaration of the new block
137
\algblock[Om]{Om}{SlutOm}
138
\algcblock[Om]{Om}{AnnarsOm}{SlutOm}
139
\algcblock[Annars]{Om}{Annars}{SlutOm}
140
% customising the new block
141
\algnewcommand\algorithmicom{\textbf{om}}
142
\algnewcommand\algorithmicsaa{\textbf{}}
143
\algnewcommand\algorithmicannars{\textbf{annars}}
144
\algnewcommand\algorithmicslutom{\textbf{slut\ om}}
145
\algrenewtext{Om}[1]{\algorithmicom\ #1\ \algorithmicsaa}
146
\algrenewtext{SlutOm}{\algorithmicslutom}
147
\algrenewtext{Annars}{\algorithmicannars}
148
\algrenewtext{AnnarsOm}[1]{\algorithmicannars\ \algorithmicom\ #1\ \algorithmicsaa }