Skip to content
Snippets Groups Projects
Commit e350a35b authored by Peter Gerwinski's avatar Peter Gerwinski
Browse files

Initial commit: Übernahme Skript u.a. von ainf; erste Beispiel-Programme

parents
No related branches found
No related tags found
No related merge requests found
Showing
with 963 additions and 0 deletions
#include <stdio.h>
int main (void)
{
return
printf ("Hello, world!\n"),
0;
}
#include <stdio.h>
int main (void)
{
int a = 137;
int b = 13 * a;
if (b = 42)
printf ("Die Antwort lautet: %d\n", b);
else
printf ("Die Antwort lautet: keine Ahnung\n");
return 0;
}
#include <stdio.h>
int main (void)
{
int a = 42;
printf ("Die Antwort lautet: ");
printf (a);
return 0;
}
#include <stdio.h>
int main (void)
{
printf ("Hello, world!\n" + 4);
return 0;
}
#include <stdio.h>
int main (void)
{
printf ("Die Antwort lautet: %x.\n", 'B');
return 0;
}
README 0 → 100644
Hardwarenahe Programmierung
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lehrveranstaltung im Wintersemester 2016/17
Hochschule Bochum, Campus Velbert/Heiligenhaus
Prof. Dr. rer. nat. Peter Gerwinski
Copyright (C) 2012-2016 Peter Gerwinski
common - gemeinsame Dateien für Skript und Vortragsfolien
script - Skript zur Lehrveranstaltung
201????? - Vortragsfolien und Beispiele
Diese Lehrmaterialien sind freie Software. Sie dürfen diese
gemäß den jeweils angegebenen Lizenzen (CC-BY-SA 3.0, GNU GPL 3+,
modified BSD License) studieren, kopieren, modifizieren und/oder
weitergeben. Für Details siehe common/README.
Low-Level Programming
~~~~~~~~~~~~~~~~~~~~~
Course in winter semester 2016-17
Bochum University of Applied Sciences, Campus Velbert/Heiligenhaus
Prof. Dr. rer. nat. Peter Gerwinski
Copyright (C) 2012-2016 Peter Gerwinski
common - common files for lecture notes and slides
script - lecture notes
201????? - slides and examples
This teaching materials are Free Software. You may study, copy,
modify, and/or distribute them according to their respective
licences (CC-BY-SA 3.0, GNU GPL 3+, modified BSD License).
See the file common/README for details.
Modified BSD License
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials
provided with the distribution.
3. The name of the author may not be used to endorse or promote
products derived from this software without specific prior
written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This diff is collapsed.
This diff is collapsed.
Lecture Notes and Examples on Low-Level Programming
Copyright (C) 2012, 2013, 2014, 2015, 2016 Peter Gerwinski <peter@gerwinski.de>
These documents are free software; you can redistribute them and/or
modify them under the terms and conditions of the following licenses:
*.tex: scripts and slides
- either the GNU General Public License, version 3
or, at your option, any later version,
- or the Creative Commons Attribution-ShareAlike 3.0
Unported License
*.c, *.h, Makefile*: programming examples
- either the Modified BSD License,
- or the Creative Commons Attribution-ShareAlike 3.0
Unported License
* The textures of the Earth and the Moon (the files
Land_ocean_ice_cloud_1024.jpg, Clementine_albedo_simp750.jpg,
earth-texture.rgb, and moon-texture.rgb) have been created by
the National Aeronautics and Space Administration (NASA), USA,
and released into the public domain.
* sfmath.sty is subject to the LaTeX Project Public License,
version 1.3 or later. See that file for details.
* The script uses some other free media files; see the script
for their individual licenses.
These documents are distributed in the hope that they will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
licenses for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file GNU-GPL-3. If not, see
<http://www.gnu.org/licenses/>.
You should have received a copy of the Modified BSD License
along with this document; see the file BSD-MODIFIED. If not,
see <http://www.xfree86.org/3.3.6/COPYRIGHT2.html#5>.
You should have received a copy of the Creative Commons
Attribution-ShareAlike 3.0 Unported License along with
this document; see the file CC-BY-SA-3.0. If not, see
<http://creativecommons.org/licenses/>.
common/Tower_of_Hanoi.jpeg

123 KiB

File added
File added
% pgscript.sty - LaTeX Settings for Lecture Notes
% Copyright (C) 2012, 2015 Peter Gerwinski
%
% This document is free software: you can redistribute it and/or
% modify it either under the terms of the Creative Commons
% Attribution-ShareAlike 3.0 License, or under the terms of the
% GNU General Public License as published by the Free Software
% Foundation, either version 3 of the License, or (at your option)
% any later version.
%
% This document is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with this document. If not, see <http://www.gnu.org/licenses/>.
%
% You should have received a copy of the Creative Commons
% Attribution-ShareAlike 3.0 Unported License along with this
% document. If not, see <http://creativecommons.org/licenses/>.
\usepackage{amsfonts}
\usepackage[colorlinks,allcolors=blue]{hyperref}
\usepackage[british,german]{babel} % Yes, really "german" and not "ngerman".
\usepackage[utf8]{luainputenc} % Without this, umlauts are broken. Weird.
\usepackage{microtype}
\usepackage[T1]{fontenc}
\usepackage{times}
\usepackage{helvet}
\renewcommand*\familydefault{\sfdefault}
\usepackage{graphicx}
\usepackage{pstricks}
\usepackage{ifluatex}
%% Repair kerning: Automatically insert "\kern{-0.15em}" between "//" % (in URLs).
%% PG20151206: This seems unnecessary here. Maybe due to \sf?
%\ifluatex
%\directlua{
% local glyph = node.id ("glyph")
% local function my_kerning (head)
% for t in node.traverse (head) do
% if t.id == glyph and t.char == 47 then
% if t.next
% and t.next.next
% and t.next.next.id == glyph
% and t.next.next.char == 47 then
% local k = node.new ("kern")
% k.kern = tex.sp ("-0.15em")
% k.next = t.next
% k.prev = t
% t.next.prev = k
% t.next = k
% end
% end
% end
% node.kerning (head)
% end
% luatexbase.add_to_callback ("kerning", my_kerning, "URL kerning")
%}
%\fi
\definecolor{blendedblue}{rgb}{0.2,0.2,0.7}
\definecolor{darkgreen}{rgb}{0.0,0.3,0.0}
\definecolor{darkred}{rgb}{0.7,0.0,0.0}
\definecolor{darkgrey}{rgb}{0.4,0.4,0.4}
\newcommand{\breath}{\bigskip\goodbreak}
\newcommand{\subsubsubsection}[1]{\breath\par\textbf{#1}\nopagebreak\par}
\newenvironment{experts}{\color{darkgrey}}{}
\newenvironment{whiteout}{\definecolor{darkgreen}{rgb}{1.0,1.0,1.0}%
\definecolor{darkred}{rgb}{1.0,1.0,1.0}%
\color{white}}{}
\urlstyle{sf}
\newcommand{\file}[1]{{\color{blendedblue}#1}}
\newcommand{\textarrow}{{\boldmath $\longrightarrow$}}
\newcommand{\arrowitem}{\item[\textarrow]}
\newcommand{\newterm}[1]{\emph{\color{darkgreen}#1}}
\usepackage{listings}
\lstset{basicstyle=\color{blendedblue},
language=C,
captionpos=b,
gobble=4,
xleftmargin=1em,
columns=fullflexible,
moredelim=**[is][\color{red}]{¡}{¿}}
\lstdefinestyle{numbered}{xleftmargin=2em,
numbers=left,
numberstyle=\footnotesize\color{gray}}
\lstdefinestyle{terminal}{basicstyle=\ttfamily\color{darkgreen},
language={},
columns=fixed,
moredelim=**[is][\color{darkred}]{¡}{¿},
moredelim=**[is][\color{blendedblue}]{°}{¿},
moredelim=**[is][\sffamily\it\lstset{columns=fullflexible}]{²}{¿}}
\lstdefinestyle{cmd}{basicstyle=\ttfamily\color{darkred},
language={},
columns=fixed,
moredelim=**[is][\color{darkgreen}]{¡}{¿},
moredelim=**[is][\color{blendedblue}]{°}{¿},
moredelim=**[is][\sffamily\it\lstset{columns=fullflexible}]{²}{¿}}
\setlength{\textwidth}{16.5cm}
\setlength{\textheight}{26.0cm}
\setlength{\hoffset}{-1.5cm}
\setlength{\voffset}{-3.0cm}
\setlength{\parindent}{0pt}
\setlength{\parskip}{\medskipamount}
\setlength{\unitlength}{1cm}
% pgslides.sty - LaTeX Settings for Lecture Slides
% Copyright (C) 2012, 2013 Peter Gerwinski
%
% This document is free software: you can redistribute it and/or
% modify it either under the terms of the Creative Commons
% Attribution-ShareAlike 3.0 License, or under the terms of the
% GNU General Public License as published by the Free Software
% Foundation, either version 3 of the License, or (at your option)
% any later version.
%
% This document is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with this document. If not, see <http://www.gnu.org/licenses/>.
%
% You should have received a copy of the Creative Commons
% Attribution-ShareAlike 3.0 Unported License along with this
% document. If not, see <http://creativecommons.org/licenses/>.
\usepackage{amsfonts}
\usepackage[british,german]{babel} % Yes, really "german" and not "ngerman".
\usepackage[utf8]{luainputenc} % Without this, umlauts are broken. Weird.
\usepackage{microtype}
\usepackage[T1]{fontenc}
\usepackage{times}
\usepackage{helvet}
\renewcommand*\familydefault{\sfdefault}
\usepackage{graphicx}
\usepackage{pstricks}
\hypersetup{colorlinks,allcolors=blue}
%% @@@ Not necessary for slides. Why???
%% Repair kerning: Automatically insert "\kern{-0.15em}" between "//" % (in URLs).
%\directlua{
% local glyph = node.id ("glyph")
% local function my_kerning (head)
% for t in node.traverse (head) do
% if t.id == glyph and t.char == 47 then
% if t.next
% and t.next.next
% and t.next.next.id == glyph
% and t.next.next.char == 47 then
% local k = node.new ("kern")
% k.kern = tex.sp ("-0.15em")
% k.next = t.next
% k.prev = t
% t.next.prev = k
% t.next = k
% end
% end
% end
% node.kerning (head)
% end
% luatexbase.add_to_callback ("kerning", my_kerning, "URL kerning")
%}
\usetheme{default}
\usefonttheme{structurebold}
\setbeamertemplate{navigation symbols}{}
\setbeamersize{text margin left = 0.3cm, text margin right = 0.2cm}
\setbeamertemplate{itemize item}{$\bullet$}
\setbeamertemplate{itemize subitem}{--}
\setbeamerfont{itemize/enumerate subbody}{size=\normalsize}
\setbeamerfont{itemize/enumerate subsubbody}{size=\normalsize}
\setbeamercolor{footline}{fg=gray}
\newcommand{\sep}{~$\cdot$~}
\newif\ifminimalistic
\minimalistictrue
\institute[Hochschule Bochum\sep CVH]{%
\makebox(0,0)[tl]{\includegraphics[scale=0.57]{logo-hochschule-bochum-cvh-text.pdf}}\hfill
\makebox(0,0)[tr]{\includegraphics[scale=0.5]{logo-hochschule-bochum.pdf}}%
}
\setbeamertemplate{headline}{%
\leavevmode
\hbox to \textwidth{%
\ifminimalistic
\strut\hfill
\else
\rule{0pt}{5.7pt}%
\hspace*{8.55pt}\insertinstitute\hspace*{5.7pt}%
\raisebox{-30pt}{\rule{0pt}{1pt}}%
\fi
}%
\vskip0pt%
}
\iffalse
\setbeamertemplate{footline}{}
\else
\setbeamertemplate{footline}{%
\leavevmode
\hbox to \textwidth{%
\usebeamercolor{footline}%
\usebeamerfont{footline}%
\ifminimalistic
\strut\hfill
\else
\,\insertshorttitle\sep
\insertshortauthor\sep
\insertshortinstitute\sep
\insertshortdate\hfill
\fi
\insertframenumber/\inserttotalframenumber
%Folie\,\insertframenumber\sep Seite\,\insertpagenumber\,
}%
\vskip0pt%
}
\fi
\newcommand{\maketitleframe}{%
\ifminimalistic
\begin{frame}[t,plain]
\insertinstitute
\par\vfill
\begin{center}
{\LARGE\color{structure}\inserttitle\par}\bigskip\bigskip
{\large \insertauthor\par}\bigskip\medskip
\insertdate
\end{center}
\end{frame}
\else
\begin{frame}
\vfill
\begin{center}
{\LARGE\color{structure}\inserttitle\par}\bigskip\bigskip
{\large \insertauthor\par}\bigskip\medskip
\insertdate
\end{center}
\vfill
\end{frame}
\fi
}
\usepackage{pstricks}
\newrgbcolor{medgreen}{0.0 0.5 0.0}
\newrgbcolor{darkgreen}{0.0 0.3 0.0}
\newrgbcolor{lightred}{1.0 0.7 0.7}
\newrgbcolor{medred}{0.5 0.0 0.0}
\newrgbcolor{bored}{0.89 0.0 0.098}
\newrgbcolor{lightgray}{0.85 0.85 0.85}
\definecolor{darkgray}{rgb}{0.4,0.4,0.4}
\newenvironment{experts}{\color{darkgray}}{}
\usepackage{listings}
\lstset{basicstyle=\color{structure},
language=C,
captionpos=b,
gobble=4,
columns=fullflexible,
aboveskip=0pt,
belowskip=0pt,
moredelim=**[is][\color{structure}]{¡}{¿},
moredelim=**[is][\only<2->{\color{structure}}]{²}{¿},
moredelim=**[is][\only<3->{\color{structure}}]{³}{¿},
moredelim=**[is][\only<4->{\color{structure}}]{°}{¿},
moredelim=**[is][\only<5->{\color{structure}}]{¤}{¿},
moredelim=**[is][\only<6->{\color{structure}}]{¢}{¿},
moredelim=**[is][\only<7->{\color{structure}}]{æ}{¿},
moredelim=**[is][\only<8->{\color{structure}}]{ø}{¿}}
\lstdefinestyle{terminal}{basicstyle=\ttfamily\color{darkgreen},
language={},
columns=fixed,
moredelim=**[is][\color{red}]{¡}{¿},
moredelim=**[is][\color{blendedblue}]{°}{¿},
moredelim=**[is][\sffamily\it\lstset{columns=fullflexible}]{²}{¿}}
\lstdefinestyle{cmd}{basicstyle=\ttfamily\color{red},
language={},
gobble=2,
columns=fixed,
moredelim=**[is][\color{darkgreen}]{¡}{¿},
moredelim=**[is][\color{structure}]{°}{¿},
moredelim=**[is][\sffamily\it\lstset{columns=fullflexible}]{²}{¿}}
\lstdefinestyle{shy}{basicstyle=\color{lightgray}}
\setcounter{topnumber}{3}
\renewcommand\topfraction{0.7}
\setcounter{bottomnumber}{3}
\renewcommand\bottomfraction{0.7}
\setcounter{totalnumber}{5}
\renewcommand\textfraction{0.1}
\renewcommand\floatpagefraction{0.9}
\setlength{\unitlength}{1cm}
\newcommand{\protectfile}[1]{#1}
\urlstyle{sf}
\newcommand{\file}[1]{{\color{structure}\protectfile{#1}}}
\newcommand{\textarrow}{{\boldmath $\longrightarrow$}}
\newcommand{\arrowitem}{\item[\textarrow]}
\newcommand{\newterm}[1]{\emph{\color{darkgreen}#1}}
\newcommand{\BIGskip}{\vspace{1cm}}
\newcommand{\shy}{\color{lightgray}}
\newcommand{\hot}{\color{red}}
\newcommand{\shyhot}{\color{lightred}}
\newcommand{\sectionnonumber}[1]{\section{#1}\addtocounter{section}{-1}}
\def\showsectionnonumber{\hbox{\Large\color{structure}\bf
\vtop{\secname}\par}\bigskip}
\def\showsection{\hbox{\Large\color{structure}\bf
\vtop{\hbox{\arabic{section}}}\kern1em%
\vtop{\secname}\par}\bigskip}
\newcommand{\subsectionnonumber}[1]{\subsection{#1}\addtocounter{subsection}{-1}}
\def\showsubsectionnonumber{{\large\color{structure}\bf\subsecname\par}\bigskip}
\def\showsubsection{\hbox{\large\color{structure}\bf
\vtop{\hbox{\arabic{section}.\arabic{subsection}}}\kern1em%
\vtop{\subsecname}\par}\bigskip}
\newcommand{\subsubsectionnonumber}[1]{\subsubsection{#1}\addtocounter{subsubsection}{-1}}
\def\showsubsubsectionnonumber{{\normalsize\color{structure}\bf\subsubsecname\par}\bigskip}
\def\showsubsubsection{\hbox{\normalsize\color{structure}\bf
\vtop{\hbox{\arabic{section}.\arabic{subsection}.\arabic{subsubsection}}}\kern1em%
\vtop{\subsubsecname}\par}\bigskip}
% sfmath.sty, copyright 2001-2007 by Olaf Dietrich (olaf@dtrx.de)
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
% http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
%
% This work has the LPPL maintenance status `maintained'.
%
% The Current Maintainer of this work is Olaf Dietrich.
%
% This work consists of the file sfmath.sty.
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{sfmath}[2007/08/27 v0.8 sans serif maths]
% This is a simple package for sans serif maths in documents.
%
% Usage: \usepackage{sfmath} or \usepackage[OPTIONS]{sfmath}
%
% After including the package sfmath.sty, all maths of the current
% document is displayed with sans serif fonts; there is no way to
% switch back to the original behavior.
%
% The default sans serif font for maths is the sans serif font
% selected for sans serif text (i.e., \sfdefault) when sfmath.sty
% is loaded. Therefore, you must include sfmath.sty after having
% changed \sfdefault, e.g., by a package such as helvet.sty or
% manually. Alternatively, use one of the font options described
% below (cm, helvet, cmbright, tx, px, or lm) in order to override
% the default sans serif font.
%
% Package OPTIONS (options marked with (+) are experimental):
%
% * slantedGreek: for slanted uppercase Greek letters
%
% * cm: use Computer Modern (cmss) for maths (explicitly)
% * helvet: use Postscript Helvetica (phv) for maths (explicitly)
% * cmbright: use CM-Bright fonts (cmbr) for maths (explicitely)
% * tx: use Postscript txfonts (tx) for maths (explicitly)
% * px: use Postscript pxfonts (tx) for maths (explicitly)
% * lm: use Latin Modern (lmss) for maths (explicitly) (+)
%
% * T1experimental: use T1 font encoding for standard maths (+)
% * AlphT1experimental: use T1 font encoding for \math*{...} commands (+)
%
% * mathrmOrig: do not change the behavior of the \mathrm command
% * mathbfOrig: do not change the behavior of the \mathbf command
% * mathitOrig: do not change the behavior of the \mathit command
% * mathsfOrig: do not change the behavior of the \mathsf command
%
% (+): Known limitations of experimental options:
% T1experimental produces a warning about the encoding of the
% operators font.
% AlphT1experimental DOES NOT WORK with uppercase Greek letters
% within the \math*{...} command!
% These options should only be used with the ec fonts.
%
% lm includes T1experimental and AlphT1experimental with the
% limitations mentioned above.
%
% RECOMMENDATION:
% use the fix-cm package instead of the experimental
% T1 options: with fix-cm.sty, the chosen ec fonts
% harmonize much better with the cm sans serif math fonts.
% Add \RequirePackage{fix-cm} _before_ \documentclass{...}.
%
%
% Some new macros are defined by sfmath.sty:
%
% * \mathsl{...}: A new math alphabet that is by default identical
% with \mathit{...}; useful in combination with the option mathitOrig.
%
% * \upOmega, \upDelta: upright versions of \Omega and \Delta;
% useful when the option slantedGreek is selected.
%
%
% More documentation can currently be found at:
% <URL:http://dtrx.de/od/tex/sfmath.html>
% CHANGES:
%
% v0.8:
%
% * Update documentation and add license details for CTAN upload.
%
%
% v0.7:
%
% * Add (experimental) support for latin modern (lmodern) fonts.
%
%
% v0.6:
%
% * Add some artificial intelligence to use slanted bold letters
% if available (e.g., for phv, txfonts, or pxfonts).
% Add options to select txfonts, pxfonts, and cmbright (probably
% not very useful) explicitely.
% (Thanks to Alberto Lusiani who asked for slanted bold letters.)
%
%
% v0.5:
%
% * Add experimental options for T1 font encoding of maths fonts.
% Using these options can be useful with ec fonts which look
% slightly different from the standard cm maths fonts (especially
% at large font size). About limitations see above.
%
%
% v0.4:
%
% * Add \upDelta, \upOmega command (to be a little more compatible
% with other packages that provide the slantedGreek option)
%
%
% v0.3:
%
% * Add sans serif shapes for "," and ".", "\ldotp"
%
% * Modified documentation
%
%
% v0.2:
%
% * New option slantedGreek for slanted greek capitals
%
% * Options helvet and cm to select explicitly the sans serif font
% for maths. Without any of these options, the current \sfdefault
% is chosen.
%
% * Options mathxxOrig: don't change the alphabet command \mathxx;
% available for \mathrm, \mathbf, \mathit, and \mathsf
%
% * Provide dotlessi and dotlessj (if available)
%
% BUGS/LIMITATIONS/PROBLEMS:
%
% * Functionality is limited by the intention to work without
% additionally defined (virtual) fonts; instead, only standard
% fonts are used.
%
% * The font metrics are not adjusted to maths usage (this may
% result in typographically unsatisfying results).
%
% * In many constellations with Postscript fonts (helvet.sty,
% pslatex.sty, ...) the upper-case greek letters are not chosen
% correctly within \mathrm, \mathbf, \mathit, ... (because
% they should be part of OT1-encoded fonts but are not included
% in these standard postscript fonts).
%
% * Bold math symbols are not always available (e.g. with pslatex.sty)
% or at least not slanted (e.g. with cmss fonts), so better don't
% use bold maths with this package. (This has been partially improved
% in version 0.6.)
%
% * There is a visual difference between the ec sans serif text fonts
% and the cm sans serif maths fonts, especially at larger font sizes.
% The fix-cm package might help to reduce the ugliness of the ec
% sans serif fonts and the differences between the ec text fonts
% and the cm math fonts.
% Alternatively, the experimental options T1experimental and
% AlphT1Experimental might help by using the ec fonts for maths as well.
%
% * The txfonts and pxfonts are reported to have several deficiencies
% with respect to font metrics and macro implementation; using
% these fonts is not recommended by the package author.
%
% * The set symbols \mathbb{N} or \mathbbm{N} (from bbm.sty) are not
% changed. You might like to use \mathbbmss{N} (from bbm.sty).
%
% * Some symbols have serifish shapes (\sum, \prod, probably more) and
% are not changed.
%
% * Lower-case greek letters are not available in sans serif shape
% (they don't have real serifs, but cannot be expected to harmonize
% with the sans serif latin letters).
%
%
% TODO:
%
% * Improve documentation.
%
% * Provide LaTeX .ins/.dtx files instead of naked .sty file.
%
% HERE WE GO:
% Declare options and defaults and process options
\DeclareOption{slantedGreek}{%
\renewcommand{\greek@shape}{sl}%
\renewcommand{\greek@bold@shape}{\greek@bold@sl}%
}
\DeclareOption{cm}{\renewcommand{\math@sfdefault}{cmss}}
\DeclareOption{lm}{\renewcommand{\math@sfdefault}{lmss}}
\DeclareOption{helvet}{\renewcommand{\math@sfdefault}{phv}}
\DeclareOption{cmbright}{\renewcommand{\math@sfdefault}{cmbr}}
\DeclareOption{tx}{\renewcommand{\math@sfdefault}{txss}}
\DeclareOption{px}{\renewcommand{\math@sfdefault}{pxss}}
\DeclareOption{T1experimental}{\renewcommand{\math@encoding}{T1}}
\DeclareOption{AlphT1experimental}{\renewcommand{\math@lph@encoding}{T1}}
\DeclareOption{mathrmOrig}{\renewcommand{\mathrm@lph}{cmr}}
\DeclareOption{mathbfOrig}{\renewcommand{\mathbf@lph}{cmr}}
\DeclareOption{mathitOrig}{\renewcommand{\mathit@lph}{cmr}}
\DeclareOption{mathsfOrig}{\renewcommand{\mathsf@lph}{cmss}}
\newcommand{\math@sfdefault}{\sfdefault}
\newcommand{\math@encoding}{OT1}
\newcommand{\math@lph@encoding}{OT1}
\newcommand{\mathrm@lph}{\math@sfdefault}
\newcommand{\mathbf@lph}{\math@sfdefault}
\newcommand{\mathit@lph}{\math@sfdefault}
\newcommand{\mathsf@lph}{\math@sfdefault}
% \math@sfGreek: Font for capital greeks: cmss or other?
% \greek@shape: Capital greeks: normal or slanted? [slantedGreek]
% \greek@bold@shape: Bold capital greeks: normal or slanted? [slantedGreek]
% \greek@bold@sl: Bold capital greeks: "sl" if slanted possible
%
% \mathnormal@bold@shape: Bold letters: normal or slanted? (always bold)
% \mathit@bold@series: Bold \mathit (\mathsl): medium or bold? (always slanted)
\newcommand{\math@sfGreek}{cmss}
\newcommand{\greek@shape}{n}
\newcommand{\greek@bold@shape}{n}
\newcommand{\greek@bold@sl}{n}
\newcommand{\mathnormal@bold@shape}{n}
\newcommand{\mathit@bold@series}{m}
\ProcessOptions
% check the current value of \math@sfdefault
\edef\tmp@sfdefault{\math@sfdefault}
\def\tmp@compare{cmss}
\ifx\tmp@sfdefault\tmp@compare
% \sfdefault is cmss
% no slanted bold letters
% no slanted bold capital Greeks
\renewcommand{\math@sfGreek}{cmss}
\renewcommand{\greek@bold@sl}{n}
\renewcommand{\mathnormal@bold@shape}{n}
\renewcommand{\mathit@bold@series}{m}
\fi
\def\tmp@compare{phv}
\ifx\tmp@sfdefault\tmp@compare
% \sfdefault is phv (helvet.sty)
% slanted bold letters
% no capital Greeks
\renewcommand{\math@sfGreek}{cmss}
\renewcommand{\greek@bold@sl}{n}
\renewcommand{\mathnormal@bold@shape}{sl}
\renewcommand{\mathit@bold@series}{bx}
\fi
\def\tmp@compare{txss}
\ifx\tmp@sfdefault\tmp@compare
% \sfdefault is txss (txfonts.sty)
% slanted bold letters
% slanted bold capital Greeks
\renewcommand{\math@sfGreek}{txss}
\renewcommand{\greek@bold@sl}{sl}
\renewcommand{\mathnormal@bold@shape}{sl}
\renewcommand{\mathit@bold@series}{bx}
\fi
\def\tmp@compare{pxss}
\ifx\tmp@sfdefault\tmp@compare
% \sfdefault is pxss (pxfonts.sty)
% slanted bold letters
% slanted bold capital Greeks
\renewcommand{\math@sfGreek}{pxss}
\renewcommand{\greek@bold@sl}{sl}
\renewcommand{\mathnormal@bold@shape}{sl}
\renewcommand{\mathit@bold@series}{bx}
\fi
\def\tmp@compare{cmbr}
\ifx\tmp@sfdefault\tmp@compare
% \sfdefault is cmbr (cmbright.sty)
% no slanted bold letters
% no slanted bold capital Greeks
\renewcommand{\math@sfGreek}{cmbr}
\renewcommand{\greek@bold@sl}{n}
\renewcommand{\mathnormal@bold@shape}{n}
\renewcommand{\mathit@bold@series}{m}
\fi
\def\tmp@compare{lmss}
\ifx\tmp@sfdefault\tmp@compare
% \sfdefault is lmss (lmodern.sty sans serif)
% T1 encoding only
% slanted bold letters
% no slanted bold capital Greeks
\renewcommand{\math@encoding}{T1}
\renewcommand{\math@lph@encoding}{T1}
\renewcommand{\math@sfGreek}{cmss}
\renewcommand{\greek@bold@sl}{n}
\renewcommand{\mathnormal@bold@shape}{sl}
\renewcommand{\mathit@bold@series}{bx}
\fi
% Change font for digits and "operators" (\sin, \exp, ...)
% to default sans serif font
\SetSymbolFont{operators}{normal}{\math@encoding}{\math@sfdefault}{m}{n}
\SetSymbolFont{operators}{bold}{\math@encoding}{\math@sfdefault}{bx}{n}
% Most special math symbols remain unmodified (and many of those
% don't have serifs); however all letters (A-Z, a-z) are
% explicitely changed to the sans serif version (again
% default sans serif font).
%
% Unfortunately, there is no standard slanted+bold sans serif font
% available (as Postscript Type 1 font), so try an upright
% version (may be better than nothing).
\DeclareSymbolFont{SFMath}{\math@encoding}{\math@sfdefault}{m}{sl}
\SetSymbolFont{SFMath}{normal}{\math@encoding}{\math@sfdefault}{m}{sl}
\SetSymbolFont{SFMath}{bold}{\math@encoding}{\math@sfdefault}{bx}{\mathnormal@bold@shape}
\DeclareMathSymbol{A}{\mathalpha}{SFMath}{`A}
\DeclareMathSymbol{B}{\mathalpha}{SFMath}{`B}
\DeclareMathSymbol{C}{\mathalpha}{SFMath}{`C}
\DeclareMathSymbol{D}{\mathalpha}{SFMath}{`D}
\DeclareMathSymbol{E}{\mathalpha}{SFMath}{`E}
\DeclareMathSymbol{F}{\mathalpha}{SFMath}{`F}
\DeclareMathSymbol{G}{\mathalpha}{SFMath}{`G}
\DeclareMathSymbol{H}{\mathalpha}{SFMath}{`H}
\DeclareMathSymbol{I}{\mathalpha}{SFMath}{`I}
\DeclareMathSymbol{J}{\mathalpha}{SFMath}{`J}
\DeclareMathSymbol{K}{\mathalpha}{SFMath}{`K}
\DeclareMathSymbol{L}{\mathalpha}{SFMath}{`L}
\DeclareMathSymbol{M}{\mathalpha}{SFMath}{`M}
\DeclareMathSymbol{N}{\mathalpha}{SFMath}{`N}
\DeclareMathSymbol{O}{\mathalpha}{SFMath}{`O}
\DeclareMathSymbol{P}{\mathalpha}{SFMath}{`P}
\DeclareMathSymbol{Q}{\mathalpha}{SFMath}{`Q}
\DeclareMathSymbol{R}{\mathalpha}{SFMath}{`R}
\DeclareMathSymbol{S}{\mathalpha}{SFMath}{`S}
\DeclareMathSymbol{T}{\mathalpha}{SFMath}{`T}
\DeclareMathSymbol{U}{\mathalpha}{SFMath}{`U}
\DeclareMathSymbol{V}{\mathalpha}{SFMath}{`V}
\DeclareMathSymbol{W}{\mathalpha}{SFMath}{`W}
\DeclareMathSymbol{X}{\mathalpha}{SFMath}{`X}
\DeclareMathSymbol{Y}{\mathalpha}{SFMath}{`Y}
\DeclareMathSymbol{Z}{\mathalpha}{SFMath}{`Z}
\DeclareMathSymbol{a}{\mathalpha}{SFMath}{`a}
\DeclareMathSymbol{b}{\mathalpha}{SFMath}{`b}
\DeclareMathSymbol{c}{\mathalpha}{SFMath}{`c}
\DeclareMathSymbol{d}{\mathalpha}{SFMath}{`d}
\DeclareMathSymbol{e}{\mathalpha}{SFMath}{`e}
\DeclareMathSymbol{f}{\mathalpha}{SFMath}{`f}
\DeclareMathSymbol{g}{\mathalpha}{SFMath}{`g}
\DeclareMathSymbol{h}{\mathalpha}{SFMath}{`h}
\DeclareMathSymbol{i}{\mathalpha}{SFMath}{`i}
\DeclareMathSymbol{j}{\mathalpha}{SFMath}{`j}
\DeclareMathSymbol{k}{\mathalpha}{SFMath}{`k}
\DeclareMathSymbol{l}{\mathalpha}{SFMath}{`l}
\DeclareMathSymbol{m}{\mathalpha}{SFMath}{`m}
\DeclareMathSymbol{n}{\mathalpha}{SFMath}{`n}
\DeclareMathSymbol{o}{\mathalpha}{SFMath}{`o}
\DeclareMathSymbol{p}{\mathalpha}{SFMath}{`p}
\DeclareMathSymbol{q}{\mathalpha}{SFMath}{`q}
\DeclareMathSymbol{r}{\mathalpha}{SFMath}{`r}
\DeclareMathSymbol{s}{\mathalpha}{SFMath}{`s}
\DeclareMathSymbol{t}{\mathalpha}{SFMath}{`t}
\DeclareMathSymbol{u}{\mathalpha}{SFMath}{`u}
\DeclareMathSymbol{v}{\mathalpha}{SFMath}{`v}
\DeclareMathSymbol{w}{\mathalpha}{SFMath}{`w}
\DeclareMathSymbol{x}{\mathalpha}{SFMath}{`x}
\DeclareMathSymbol{y}{\mathalpha}{SFMath}{`y}
\DeclareMathSymbol{z}{\mathalpha}{SFMath}{`z}
\DeclareMathSymbol{\imath}{\mathalpha}{SFMath}{"10}
\DeclareMathSymbol{\jmath}{\mathalpha}{SFMath}{"11}
% The symbols ",", ".", and "\ldotp" should be sans serif
% but upright.
\DeclareSymbolFont{SFMathUp}{\math@encoding}{\math@sfdefault}{m}{n}
\SetSymbolFont{SFMathUp}{normal}{\math@encoding}{\math@sfdefault}{m}{n}
\SetSymbolFont{SFMathUp}{bold}{\math@encoding}{\math@sfdefault}{bx}{n}
\DeclareMathSymbol{,}{\mathpunct}{SFMathUp}{`,}
\DeclareMathSymbol{.}{\mathord}{SFMathUp}{`.}
\DeclareMathSymbol{\ldotp}{\mathord}{SFMathUp}{`.}
% Take capital greek letters from cmss or [tp]xss; other sans serif fonts
% like helvetica don't have capital greeks, so here cmss is
% taken instead of \sfdefault. Unfortunately, this does not work
% within the alphabet commands \mathrm, \mathsf, ...
\DeclareSymbolFont{SFMathGreek}{OT1}{\math@sfGreek}{m}{\greek@shape}
\SetSymbolFont{SFMathGreek}{normal}{OT1}{\math@sfGreek}{m}{\greek@shape}
\SetSymbolFont{SFMathGreek}{bold}{OT1}{\math@sfGreek}{bx}{\greek@bold@shape}
\DeclareMathSymbol{\Gamma}{\mathalpha}{SFMathGreek}{"00}
\DeclareMathSymbol{\Delta}{\mathalpha}{SFMathGreek}{"01}
\DeclareMathSymbol{\Theta}{\mathalpha}{SFMathGreek}{"02}
\DeclareMathSymbol{\Lambda}{\mathalpha}{SFMathGreek}{"03}
\DeclareMathSymbol{\Xi}{\mathalpha}{SFMathGreek}{"04}
\DeclareMathSymbol{\Pi}{\mathalpha}{SFMathGreek}{"05}
\DeclareMathSymbol{\Sigma}{\mathalpha}{SFMathGreek}{"06}
\DeclareMathSymbol{\Upsilon}{\mathalpha}{SFMathGreek}{"07}
\DeclareMathSymbol{\Phi}{\mathalpha}{SFMathGreek}{"08}
\DeclareMathSymbol{\Psi}{\mathalpha}{SFMathGreek}{"09}
\DeclareMathSymbol{\Omega}{\mathalpha}{SFMathGreek}{"0A}
\DeclareSymbolFont{SFMathUpGreek}{OT1}{\math@sfGreek}{m}{n}
\SetSymbolFont{SFMathUpGreek}{normal}{OT1}{\math@sfGreek}{m}{n}
\SetSymbolFont{SFMathUpGreek}{bold}{OT1}{\math@sfGreek}{bx}{n}
\DeclareMathSymbol{\upDelta}{\mathalpha}{SFMathUpGreek}{"01}
\DeclareMathSymbol{\upOmega}{\mathalpha}{SFMathUpGreek}{"0A}
% Define new behavior for math alphabet commands
\SetMathAlphabet{\mathnormal}{normal}{\math@lph@encoding}{\math@sfdefault}{m}{sl}
\SetMathAlphabet{\mathnormal}{bold}{\math@lph@encoding}{\math@sfdefault}{bx}{\mathnormal@bold@shape}
\SetMathAlphabet{\mathrm}{normal}{\math@lph@encoding}{\mathrm@lph}{m}{n}
\SetMathAlphabet{\mathrm}{bold}{\math@lph@encoding}{\mathrm@lph}{bx}{n}
\SetMathAlphabet{\mathbf}{normal}{\math@lph@encoding}{\mathbf@lph}{bx}{n}
\SetMathAlphabet{\mathbf}{bold}{\math@lph@encoding}{\mathbf@lph}{bx}{n}
\SetMathAlphabet{\mathit}{normal}{\math@lph@encoding}{\mathit@lph}{m}{sl}
\SetMathAlphabet{\mathit}{bold}{\math@lph@encoding}{\mathit@lph}{\mathit@bold@series}{sl}
\SetMathAlphabet{\mathsf}{normal}{\math@lph@encoding}{\mathsf@lph}{m}{n}
\SetMathAlphabet{\mathsf}{bold}{\math@lph@encoding}{\mathsf@lph}{bx}{n}
% Define new math alphabet command \mathsl
\DeclareMathAlphabet{\mathsl}{\math@lph@encoding}{\math@sfdefault}{m}{sl}
\SetMathAlphabet{\mathsl}{bold}{\math@lph@encoding}{\math@sfdefault}{\mathit@bold@series}{sl}
\endinput
../common/Tower_of_Hanoi.jpeg
\ No newline at end of file
File added
This diff is collapsed.
../common/logo-hochschule-bochum-cvh-text.pdf
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment