Skip to content

Commit 14b4132

Browse files
committed
move to new figure spacing commands
1 parent 0bebb93 commit 14b4132

File tree

14 files changed

+97
-97
lines changed

14 files changed

+97
-97
lines changed

text/front/preface/preface.tex

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ \chapter*{Preface}%
2020
This version may change since this book is, well, work in progress.
2121
The book is released under the \emph{Attribution-NonCommercial-ShareAlike~4.0 International license} (\href{http://creativecommons.org/licenses/by-nc-sa/4.0/}{\mbox{CC~BY-NC-SA~4.0}}).
2222
You can freely share it.
23-
You can also copy text or figures, as long as you cite the book as the original source, e.g., by using the following Bib\TeX:%
23+
You can also copy text or figures, as long as you cite the book as the original source~\cite{programmingWithPython}, e.g., by using the following Bib\TeX:%
2424
%
2525
\begin{lstlisting}[style=text_style]
2626
@book{programmingWithPython,

text/main/basics/gettingStarted/examples/examples.tex

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,28 @@
1616
\label{fig:clone01welcomeToPycharm}%
1717
]{\tightbox{\includegraphics[width=0.45\linewidth]{\currentDir/clone01welcomeToPycharm}}}%
1818
%
19-
\strut\hfill\strut%
19+
\floatSep%
2020
%
2121
\subfloat[][%
2222
Selecting \menu{URL:} \expandafter\url{\programmingWithPythonCodeRepo} and a reasonable destination \menu{Directory:} in the next dialog, then click \menu{Clone}.%
2323
\label{fig:clone02selectRepoAndDestination}%
2424
]{\tightbox{\includegraphics[width=0.45\linewidth]{\currentDir/clone02selectRepoAndDestination}}}%
2525
%
26-
\\[10pt]%
26+
\floatRowSep%
2727
%
2828
\subfloat[][%
2929
Wait while \pycharm\ is cloning (downloading) the repository.%
3030
\label{fig:clone03cloning}%
3131
]{\tightbox{\includegraphics[width=0.45\linewidth]{\currentDir/clone03cloning}}}%
3232
%
33-
\strut\hfill\strut%
33+
\floatSep%
3434
%
3535
\subfloat[][%
3636
If asked, click \menu{Trust Project} after confirming that you indeed downloaded the right code and if you trust our code.%
3737
\label{fig:clone04trustProject}%
3838
]{\tightbox{\includegraphics[width=0.45\linewidth]{\currentDir/clone04trustProject}}}%
3939
%
40-
\\[10pt]%
40+
\floatRowSep%
4141
%
4242
\subfloat[][%
4343
The project with all the examples from this book is now downloaded and can be accessed in \pycharm.%

text/main/basics/gettingStarted/firstProgram/firstProgram.tex

+6-6
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,22 @@
1717
\label{fig:firstProgram01createPycharmProject}%
1818
]{\tightbox{\includegraphics[width=0.47\linewidth]{\currentDir/firstProgram01createPycharmProject}}}%
1919
%
20-
\strut\hfill\strut%
20+
\floatSep%
2121
%
2222
\subfloat[][%
2323
Creating a new project in \pycharm, step~2: Make sure that \menu{Pure Python} is selected in the left pane, then select a name for the project (here: \directory{00\_veryFirstProject}), a directory location (some path on my \ubuntu\ machine, you will pick some other directory), and we select the current \python\ installation as \menu{Custom Environment}. %
2424
We finally click \menu{Create}.%
2525
\label{fig:firstProgram02createPycharmProject}%
2626
]{\tightbox{\includegraphics[width=0.47\linewidth]{\currentDir/firstProgram02createPycharmProject}}}%
2727
%
28-
\\[10pt]%
28+
\floatRowSep%
2929
%
3030
\subfloat[][%
3131
The new and empty project has been created.%
3232
\label{fig:firstProgram03pycharmProjectCreated}%
3333
]{\tightbox{\includegraphics[width=0.775\linewidth]{\currentDir/firstProgram03pycharmProjectCreated}}}%
3434
%
35-
\\[10pt]%
35+
\floatRowSep%
3636
%
3737
\subfloat[][%
3838
We create a new \python\ file within this project by right-clicking on the project folder \directory{00\_veryFirstProject} and selecting \menu{New>Python File}.%
@@ -52,14 +52,14 @@
5252
\label{fig:firstProgram05createPythonFile}%
5353
]{\tightbox{\includegraphics[width=0.775\linewidth]{\currentDir/firstProgram05createPythonFile}}}%
5454
%
55-
\\[10pt]%
55+
\floatRowSep%
5656
%
5757
\subfloat[][%
5858
The new and empty file \directory{very\_first\_program.py} has been created in the project \directory{00\_veryFirstProject}.%
5959
\label{fig:firstProgram06pythonFileCreated}%
6060
]{\tightbox{\includegraphics[width=0.775\linewidth]{\currentDir/firstProgram06pythonFileCreated}}}%
6161
%
62-
\\[10pt]%
62+
\floatRowSep%
6363
%
6464
\subfloat[][%
6565
We enter the text from \cref{lst:very_first_program}. \pycharm\ automatically saves it.%
@@ -83,7 +83,7 @@
8383
\label{fig:firstProgram08runProgram}%
8484
]{\tightbox{\includegraphics[width=0.775\linewidth,trim={0 200px 0 0},clip]{\currentDir/firstProgram08runProgram}}}%
8585
%
86-
\\[10pt]%
86+
\floatRowSep%
8787
%
8888
\subfloat[][%
8989
And indeed, in the console pane at the bottom of the \pycharm\ window, the text \inQuotes{Hello World!} appears.%

text/main/basics/gettingStarted/gettingStarted.tex

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
For each \pgls{OS}, the installation steps and software availability may be different, so I cannot possibly cover them all.
2222
Personally, I strongly recommend using \linux~\cite{T1999TLE,B2022ELATCL,H2022LML} for programming, work, and research.
2323
If you are a student of computer science or any related field, then it is my personal opinion that you should get familiar with this operating system.
24-
Maybe you could start with the very easy-to-use \ubuntu\ \linux~\cite{CN2020ULB}.
24+
Maybe you could start with the very easy-to-use \ubuntu\ \linux~\cite{CN2020ULB,H2020ULU2E}.
2525
Either way, in the following, I will try to provide examples and instructions for both \ubuntu\ and the commercial Microsoft \windows~\cite{B2023W1IO} \pgls{OS}.
2626

2727
Once the necessary software is installed, we will here also learn how to write and execute our very first small \python\ program in \cref{sec:ourFirstProgram}%.

text/main/basics/gettingStarted/installingPyCharm/installingPyCharmUbuntu/installingPyCharmUbuntu.tex

+7-7
Original file line numberDiff line numberDiff line change
@@ -4,39 +4,39 @@
44
\centering%
55
%
66
\subfloat[][%
7-
Installing \pycharm\ using the snap install command in a \pgls{terminal} opened with \ubuntuTerminal.%
7+
Installing \pycharm\ using the \bashil{snap install} command in a \pgls{terminal} opened with \ubuntuTerminal.%
88
\label{fig:installingPyCharmUbuntu01snapInstall}%
99
]{\includegraphics[width=0.7\linewidth]{\currentDir/installingPyCharmUbuntu01snapInstall}}%
1010
%
11-
\\[10pt]
11+
\floatRowSep%
1212
%
1313
\subfloat[][%
14-
This command requires the super user password.%
14+
This command requires the super user password, which we type in and then press~\keys{\enter}.%
1515
\label{fig:installingPyCharmUbuntu02sudo}%
1616
]{\includegraphics[width=0.7\linewidth]{\currentDir/installingPyCharmUbuntu02sudo}}%
1717
%
18-
\\[10pt]%
18+
\floatRowSep%
1919
%
2020
\subfloat[][%
2121
The installation begins.%
2222
\label{fig:installingPyCharmUbuntu03snapInstall}%
2323
]{\includegraphics[width=0.7\linewidth]{\currentDir/installingPyCharmUbuntu03snapInstall}}%
2424
%
25-
\\[10pt]%
25+
\floatRowSep%
2626
%
2727
\subfloat[][%
2828
The software package is downloaded.%
2929
\label{fig:installingPyCharmUbuntu04snapInstall}%
3030
]{\includegraphics[width=0.7\linewidth]{\currentDir/installingPyCharmUbuntu04snapInstall}}%
3131
%
32-
\\[10pt]%
32+
\floatRowSep%
3333
%
3434
\subfloat[][%
3535
The package is installed.%
3636
\label{fig:installingPyCharmUbuntu05snapInstallFinished}%
3737
]{\includegraphics[width=0.7\linewidth]{\currentDir/installingPyCharmUbuntu05snapInstallFinished}}%
3838
%
39-
\\[10pt]%
39+
\floatRowSep%
4040
%
4141
\subfloat[][%
4242
Open the launcher by pressing \OSwin\ and type in \bashil{pycharm} to find the \pycharm\ executable, then double-click it.%

text/main/basics/gettingStarted/installingPyCharm/installingPyCharmWindows/installingPyCharmWindows.tex

+11-11
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
\label{fig:installingPyCharmWindows02download}%
1717
]{\tightbox{\includegraphics[width=0.47\linewidth]{\currentDir/installingPyCharmWindows02download}}}%
1818
%
19-
\\[10pt]%
19+
\floatRowSep%
2020
%
2121
\subfloat[][%
2222
Selecting the normal \windows\ installer for the \pycharm\ Community Edition.%
@@ -49,7 +49,7 @@
4949
\label{fig:installingPyCharmWindows06runInstaller}%
5050
]{\tightbox{\includegraphics[width=0.47\linewidth]{\currentDir/installingPyCharmWindows06runInstaller}}}%
5151
%
52-
\\[10pt]%
52+
\floatRowSep%
5353
%
5454
\subfloat[][%
5555
The installer is starting.%
@@ -64,7 +64,7 @@
6464
]{\tightbox{\includegraphics[height=3.75cm]{\currentDir/installingPyCharmWindows08runInstaller}}}%
6565
\hfill\strut%
6666
%
67-
\\[10pt]%
67+
\floatRowSep%
6868
%
6969
\subfloat[][%
7070
The welcome screen of the installer. We click \keys{Next}.%
@@ -85,7 +85,7 @@
8585
\label{fig:installingPyCharmWindows11installation}%
8686
]{\tightbox{\includegraphics[height=4cm]{\currentDir/installingPyCharmWindows11installation}}}%
8787
%
88-
\\[10pt]%
88+
\floatRowSep%
8989
%
9090
\subfloat[][%
9191
The start menu folder choose dialog. We click \keys{Install}.%
@@ -115,35 +115,35 @@
115115
\ContinuedFloat%
116116
\centering%
117117
%
118-
\strut\hfill\strut%
118+
\floatSep%
119119
\subfloat[][%
120120
The welcome screen of \pycharm.%
121121
\label{fig:installingPyCharmWindows15running}%
122122
]{\tightbox{\includegraphics[width=0.4\linewidth]{\currentDir/installingPyCharmWindows15running}}}%
123123
%
124-
\strut\hfill\strut\strut\hfill\strut%%
124+
\floatSep%%
125125
%
126126
\subfloat[][%
127127
We read the user agreement, confirm that we read it, and click \keys{Continue}.%
128128
\label{fig:installingPyCharmWindows16running}%
129129
]{\tightbox{\includegraphics[width=0.4\linewidth]{\currentDir/installingPyCharmWindows16running}}}%
130-
\strut\hfill\strut%
130+
\floatSep%
131131
%
132-
\\[10pt]%
132+
\floatRowSep%
133133
%
134-
\strut\hfill\strut%
134+
\floatSep%
135135
\subfloat[][%
136136
We do not want to send any data and click \keys{Don't Send}.%
137137
\label{fig:installingPyCharmWindows17running}%
138138
]{\tightbox{\includegraphics[width=0.4\linewidth]{\currentDir/installingPyCharmWindows17running}}}%
139139
%
140-
\strut\hfill\strut\strut\hfill\strut%%
140+
\floatSep%%
141141
%
142142
\subfloat[][%
143143
Finally, \pycharm\ is ready to use.%
144144
\label{fig:installingPyCharmWindows18running}%
145145
]{\tightbox{\includegraphics[width=0.4\linewidth]{\currentDir/installingPyCharmWindows18running}}}%
146-
\strut\hfill\strut%
146+
\floatSep%
147147
%
148148
\caption[]{The installation steps of \pycharm\ under \windows~(continued).}%
149149
\label{fig:installingPyCharmWindowsC}%

text/main/basics/gettingStarted/installingPython/installingPythonWindows/installingPythonWindows.tex

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
\tightbox{\includegraphics[height=2.8cm]{\currentDir/installingPythonWindows03python}}%
2121
}%
2222
%
23-
\\[10pt]%
23+
\floatRowSep%
2424
%
2525
\subfloat[][The install screen, where we click \keys{Get}.%
2626
\label{fig:installingPythonWindows04installGet}]{%
@@ -33,7 +33,7 @@
3333
\tightbox{\includegraphics[width=0.485\linewidth]{\currentDir/installingPythonWindows05downloading}}%
3434
}%
3535
%
36-
\\[10pt]%
36+
\floatRowSep%
3737
%
3838
\subfloat[][The installation is finished.%
3939
\label{fig:installingPythonWindows06finished}]{%

text/main/basics/gettingStarted/pythonInTheTerminal/pythonInTheTerminal.tex

+8-8
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111
\label{fig:terminalPython1cd}%
1212
]{\includegraphics[width=0.9\linewidth]{\currentDir/terminalPython1cd}}%
1313
%
14-
\\[10pt]%
14+
\floatRowSep%
1515
%
1616
\subfloat[][%
1717
Execute a \python\ program \inQuotes{program.py} by typing \bashil{python3 program.py} and hit \keys{\enter}. %
1818
In our case, the program is \inQuotes{very\_first\_program.py}.%
1919
\label{fig:terminalPython2python}%
2020
]{\includegraphics[width=0.9\linewidth]{\currentDir/terminalPython2python}}%
2121
%
22-
\\[10pt]%
22+
\floatRowSep%
2323
%
2424
\subfloat[][%
2525
As expected, the text \inQuotes{Hello World!} appears in the \pgls{terminal}.%
@@ -38,7 +38,7 @@
3838
\label{fig:pycharmConsole1consoleButton}%
3939
]{\tightbox{\includegraphics[width=0.76\linewidth]{\currentDir/pycharmConsole1consoleButton}}}%
4040
%
41-
\\[10pt]%
41+
\floatRowSep%
4242
%
4343
\subfloat[][%
4444
The \pycharm\ \python\ console is open.%
@@ -57,7 +57,7 @@
5757
\label{fig:pycharmConsole3writingCode}%
5858
]{\tightbox{\includegraphics[width=0.76\linewidth]{\currentDir/pycharmConsole3writingCode}}}%
5959
%
60-
\\[10pt]%
60+
\floatRowSep%
6161
%
6262
\subfloat[][%
6363
And indeed, the output is \inQuotes{Hello World!}.%
@@ -76,21 +76,21 @@
7676
\label{fig:terminalConsole1python}%
7777
]{\includegraphics[width=0.852\linewidth]{\currentDir/terminalConsole1python}}%
7878
%
79-
\\[10pt]%
79+
\floatRowSep%
8080
%
8181
\subfloat[][%
8282
The \python\ console opens in the \pgls{terminal}.%
8383
\label{fig:terminalConsole2pythonRunning}%
8484
]{\includegraphics[width=0.852\linewidth]{\currentDir/terminalConsole2pythonRunning}}%
8585
%
86-
\\[10pt]%
86+
\floatRowSep%
8787
%
8888
\subfloat[][%
8989
We enter the \inQuotes{Hello World!} program from \cref{lst:very_first_program} and press \keys{\enter}.%
9090
\label{fig:terminalConsole3writingCode}%
9191
]{\includegraphics[width=0.852\linewidth]{\currentDir/terminalConsole3writingCode}}%
9292
%
93-
\\[10pt]%
93+
\floatRowSep%
9494
%
9595
\subfloat[][%
9696
And indeed, the output is \inQuotes{Hello World!}.%
@@ -109,7 +109,7 @@
109109
\label{fig:terminalConsole5exit}%
110110
]{\includegraphics[width=0.852\linewidth]{\currentDir/terminalConsole5exit}}%
111111
%
112-
\\[10pt]%
112+
\floatRowSep%
113113
%
114114
\subfloat[][%
115115
We are back in the normal \pgls{terminal}.%

text/main/basics/simpleDataTypesAndOperations/bool/bool.tex

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
~~~~%
8080
}%
8181
%
82-
\strut\hfill\strut%
82+
\floatSep%
8383
%
8484
\subfloat[][%
8585
The truth table for the logical disjunction\pythonIdx{bool!disjunction} (\emph{logical or})\pythonIdx{or}: \pythonil{a or b}.%
@@ -102,7 +102,7 @@
102102
~~~~%
103103
}%
104104
%
105-
\strut\hfill\strut%
105+
\floatSep%
106106
%
107107
\subfloat[][%
108108
The truth table for the logical negation\pythonIdx{bool!negation} (\emph{logical not}\pythonIdx{not}): \pythonil{not a}.%

text/main/basics/variables/assignment/assignment.tex

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
\includegraphics[width=0.23\linewidth]{\currentDir/assignment1}%
2121
\strut\hspace{1.2cm}\strut}%
2222
%
23-
\strut\hfill\strut%
23+
\floatSep%
2424
%
2525
\subfloat[][%
2626
\pythonil{int_var = (3 * int_var) + 1}%
@@ -40,7 +40,7 @@
4040
\includegraphics[width=0.23\linewidth]{\currentDir/assignment3}%
4141
\strut\hspace{1.2cm}\strut}%
4242
%
43-
\strut\hfill\strut%
43+
\floatSep%
4444
%
4545
\subfloat[][%
4646
\pythonil{new_var = float_var * int_var}%

0 commit comments

Comments
 (0)