initial commit

This commit is contained in:
Marius Melzer 2013-05-20 22:39:32 +02:00
commit 0534894d9f
12 changed files with 419 additions and 0 deletions

21
Makefile Normal file
View File

@ -0,0 +1,21 @@
# License: GNU Free Documentation License (GFDL) http://www.gnu.org/copyleft/fdl.html
LATEX=latex
DVIPDF=dvipdf
PDFLATEX=pdflatex
TOCCONVERTER=openfm/bin/convert-toc-10-16.sh # use this for hex-pagenumbers
TARGETS := main
all: clean $(TARGETS)
$(TARGETS):
@echo "[PDFLATEX]\r\t\t\b\b\b$@.tex"
@$(PDFLATEX) $@.tex >/dev/null
@echo "[TOCHEX]\r\t\t\b\b\b$@.toc"
@$(TOCCONVERTER) $@.toc
@echo "[PDFLATEX]\r\t\t\b\b\b$@.tex"
@$(PDFLATEX) $@.tex >/dev/null
clean:
@echo [CLEAN]
@find . -maxdepth 1 -mindepth 1 -type f -not -name "*.tex" -not -name "*.sty" -not -name "Makefile" -not -name "*.dtx" -not -name "*.drv" | xargs rm -f

8
content/editorial.tex Normal file
View File

@ -0,0 +1,8 @@
% License: GNU Free Documentation License (GFDL) http://www.gnu.org/copyleft/fdl.html
\begin{FMEditorial}{Hello World}{Allgemeines}{Editorial}
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
Eure Redaktion
\end{FMEditorial}

View File

@ -0,0 +1,12 @@
% License: GNU Free Documentation License (GFDL) http://www.gnu.org/copyleft/fdl.html
\begin{FMArticle}{Akamentorfahrt ins Zuseum}{CC-BY-ND Johannes Lötzsch}{Uni}{Bildungsstreik}{bildungsstreik}
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
\FMImage[1.0]{img/example.jpg}{This is an example picture!}
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
\end{FMArticle}

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 KiB

26
content/impressum.tex Normal file
View File

@ -0,0 +1,26 @@
% License: GNU Free Documentation License (GFDL) http://www.gnu.org/copyleft/fdl.html
\begin{FMImpressum}
\FMSection{Chefredakteur}
Marius Melzer
\FMSection{Redaktion und Autoren}
Aljoscha Fernández, Frank Hedecke, Jan Lelis, Alexander Matthes, Martin Reiß, Gilbert Röhrbein, Stephan Thamm, Kilian Ulbrich
\FMSection{Layout/Latex}
Marius Melzer, Mathias Kaufmann
\FMSection{Cover}
Sten Anderßen
\FMSection{Anschrift}
Technische Universität Dresden\\
Fakultät Informatik\\
Fachschaftsrat\\
D-01062 Dresden
\FMSection{Kontakt}
offline@ifsr.de
\end{FMImpressum}

20
main.tex Normal file
View File

@ -0,0 +1,20 @@
% License: GNU Free Documentation License (GFDL) http://www.gnu.org/copyleft/fdl.html
\documentclass[10pt,pdftex,a5paper]{scrreprt}
\usepackage{import}
\import{openfm/}{packages}
\import{openfm/}{layout}
\import{openfm/}{commands}
\begin{document}
\input{content/editorial}
\vspace{4cm}
\input{content/impressum}
\newpage
\FMTOC{General}{Table of contents!}
\newpage
\input{content/example/article}
\end{document}

22
openfm/bin/convert-toc-10-16.sh Executable file
View File

@ -0,0 +1,22 @@
# License: GNU Free Documentation License (GFDL) http://www.gnu.org/copyleft/fdl.html
#!/bin/sh
TOCFILE=$1
[ -f "$TOCFILE" ] || exit 0
if [ ! -f "$BC_ENV_ARGS" ]; then
export BC_ENV_ARGS=""
fi
cat $TOCFILE | while read line; do
PAGENUMBER_DEC="$(echo $line | rev | cut -f3 -d"}" | rev |cut -b2-)"
PAGENUMBER_HEX="$(echo "obase=16; ibase=10; $PAGENUMBER_DEC" | bc)"
PAGENUMBER_HEX_SIZE="$(echo $PAGENUMBER_HEX | wc -c)"
FORMATTED_PAGE_NUMBER="0x"
[ $PAGENUMBER_HEX_SIZE -lt 3 ] && FORMATTED_PAGE_NUMBER="${FORMATTED_PAGE_NUMBER}0"
FORMATTED_PAGE_NUMBER="${FORMATTED_PAGE_NUMBER}${PAGENUMBER_HEX}"
THELINE="$(echo $line | rev | cut -f-2 -d"}")}$(echo "$FORMATTED_PAGE_NUMBER" |rev){}$(echo $line | rev | cut -f4- -d"}")\\"
echo $THELINE |rev >> $1.tmp
done
mv $1.tmp $1

170
openfm/commands.tex Normal file
View File

@ -0,0 +1,170 @@
% License: GNU Free Documentation License (GFDL) http://www.gnu.org/copyleft/fdl.html
%==============
% Custom Colors
%==============
\definecolor{darkgray}{gray}{0.35}
\definecolor{mediumgray}{gray}{0.85}
\definecolor{lightgray}{gray}{0.93}
\definecolor{link}{rgb}{0.7,0.28,0.0}
\definecolor{url}{gray}{0.35}
%===========================================
% Counters/Variables and their getter/setter
%===========================================
% neuer Zähler für Links in einem Artikel
\newcounter{linkcounter}
% Zähler zurücksetzen
\newcommand{\resetcounter}{\setcounter{linkcounter}{1}\setcounter{lstlisting}{0}\SetListingSize{\normalsize}}
% Umstellen der Schriftgröße in Listing- und Befehlsumgebungen.
\newcommand{\SetListingSize}[1]{\renewcommand{\ListingSize}{#1}}
% Definition für die Schriftgröße in den Listing- und Befehlsumgebungen.
\newcommand{\ListingSize}{\normalsize}
% Festes Leerzeichen (non breaking space), wird benötigt für \BildabsatzV, wenn es am Anfang der Zeile steht.
% Benutzung: \nbsp
\newcommand{\nbsp}{~}
\setcounter{tocdepth}{1}
% is being renewed in each article (see below)
\newcommand{\currentArticle}{}
%====================
% Structural commands
%====================
% Sections of an article/impressum
% Usage: \FMSection{TITLE}
\newcommand{\FMSection}[1]{\subsection*{#1}}
% Creates an editorial page
% Usage: \begin{fm_editorial}{TITLE}{SECTION}{SHORT_TITLE}
\newenvironment{FMEditorial}[3]{\FMPageHeader{#2}{#3}\vspace{2cm}{\Large #1}}{}
\newcommand{\FMTOC}[2]{\FMPageHeader{#1}{#2}\tableofcontents}
% Article without entry in table of contents and without page header (e.g. for the impressum)
% Usage: \begin{FMStrippedArticle}{TITLE}{AUTHOR}{TAG} ... \end{FMStrippedArticle}
% Usually NOT to be used directly, use FMImpressum or FMArticle instead
\newenvironment{FMStrippedArticle}[3]{\renewcommand{\currentArticle}{#3}\begin{multicols}{2}[\FMArticleHeadline{#1}{#2}{#3}]}{\end{multicols}}
% Creates an impressum (2 columns, no author, no page header)
% Usage: \FMImpressum{TITLE}
\newenvironment{FMImpressum}[0]{\begin{FMStrippedArticle}{Impressum}{}{impressum}}{\end{FMStrippedArticle}}
% Defines an article
% Usage: \begin{FMArticle}{TITLE}{AUTHOR}{SECTION}{SHORT_TITLE}{TAG} ... \end{Artikel}
% TAG is the name of the article directory. It is also being used as PDFTAG
% SECTION and SHORT_TITLE are used for the page header (\FMPageHeader)
\newenvironment{FMArticle}[5]{\addcontentsline{toc}{section}{#1}\FMPageHeader{#3}{#4}\begin{FMStrippedArticle}{#1}{#2}{#5}}{\end{FMStrippedArticle}}
% Shows all sources (usually at the end of an article)
% Usage: \begin{FMSources} ... \end{FMSources}
\newenvironment{FMSources}
{\nbsp\\[-10mm]
\begin{tabular}{@{}p{\columnwidth}}
\hfill \textcolor{black}{\normalfont\large\scshape Links} \\[-2ex]
\end{tabular}
\renewcommand*\labelenumi{[\theenumi]}
\begin{small}
\begin{FMItemize}}
{\end{FMItemize}
\end{small}
\renewcommand*\labelenumi{\theenumi.}}
% Shows a single Source (intended to be used in the FMSources environment)
% Benutzung: \FMSource{URL}
\newcommand{\FMSource}[1]{\item \url{#1}}
%==================================
% Commands to be used inside an article
%==================================
% Inserts an image
% Usage: \Bild[WIDTH]{FILEPATH}{SUBTITLE}
% WIDTH (optional) is a relative number between 0 and 1
% FILEPATH is relative to the directory of the current article
\newcommand{\FMImage}[4][.95]
{\begin{minipage}[t]{1\linewidth}
\centering
\href{\currentArticle/#2}{\includegraphics[width=#1\textwidth]{content/#2}}\\
\emph{#4}~\href{\currentArticle/#2}{}
\end{minipage}}
% Itemize with parameters
\newenvironment{FMItemize}
{\begin{enumerate}[topsep=-2mm,parsep=1mm,itemsep=0mm,leftmargin=*]}
{\end{enumerate}}
% Insert a link
% Usage: \FMLink{URL}
\newcommand{\FMLink}[2][\arabic{linkcounter}\stepcounter{linkcounter}]{~\href{#2}{[#1]}}
%===========================
% Helpers (for internal use)
%===========================
% Überschrift für jeden Abschnitt
% Benutzung: \Headline{ÜBERSCHRIFT}{PDFMARKE}
% Dies wird nur in der befehle.tex verwendet!
\newcommand{\FMHeadline}[2]{\resetcounter\pdfbookmark[2]{#1}{#2}\textcolor{darkgray}{\textbf{{\Large \hypertarget{#2}{#1}\label{#2}}}}\\[-6px] \FMLine}
% Headline für Artikel
% Benutzung: \FMArticleHeadline{TITEL}{AUTOR}{PDFMARKE}
\newcommand{\FMArticleHeadline}[3]{\resetcounter\pdfbookmark[2]{#1}{#3}\textcolor{darkgray}{\textbf{{\Large \hypertarget{#3}{#1}\label{#3}} \hspace*{4mm}#2}}\\[-
6px] \FMLine}
% Textbox, e.q. for quotes
% Benutzung: \begin{Textbox}[WIDTH] ... \end{BefehlUmg}
\lstnewenvironment{FMTextbox}[1][1]
{\lstset{style=FMTextBoxStyle,linewidth=#1\linewidth}}
{}
% Textbox fuer Programmcode
% Benutzung: \begin{BefehlUmgS}[BREITE] ... \end{BefehlUmg}
\lstnewenvironment{FMListing}[1][1]
{\lstset{style=FMListingStyle,linewidth=#1\linewidth}}
{}
% Textbox fuer Programmcode ohne Zeilennummern
% Benutzung: \begin{FMListingWithoutNumbers}[BREITE] ... \end{FMListingWithoutNumbers}
\lstnewenvironment{FMListingWithoutNumbers}[1][1]
{\lstset{style=FMListingWithoutNumbersStyle,linewidth=#1\linewidth}}
{}
% Arrow, e.g. for listings
\newcommand{\FMArrow}{$\curvearrowright$}
% Page header
% Usage: \FMPageHeader{SECTION}{SHORT_TITLE}
\newcommand{\FMPageHeader}[2]{
\lhead{
\begin{textblock}{1}(58,1)
\vspace{2px}
\end{textblock}
\begin{textblock}{30}[1.025,0](44,1)
\vspace{4px}
\hfill\textcolor{darkgray}{\textsc{\Large cat #1 | grep #2}}\\[-0.4cm]
\end{textblock}
\begin{textblock}{60}(0,0)
\vspace{10px}
\includegraphics[width=\textwidth,height=36px]{img/titellinie-oben.png}
\end{textblock}
}
}
% Produces a line with shadow
% Usage: \FMLine[WIDTH]
% WIDTH (optional) is a relative number between 0 and 1
\newcommand{\FMLine}[1][.67]{
\hspace*{2px}\textcolor{mediumgray}{\rule{#1\textwidth}{3px}}\\[-16px]
\textcolor{darkgray}{\rule{#1\textwidth}{3px}\\[-20px]}
}
\makeindex

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 B

83
openfm/layout.tex Normal file
View File

@ -0,0 +1,83 @@
% License: GNU Free Documentation License (GFDL) http://www.gnu.org/copyleft/fdl.html
% Seitenränder
\setlength{\hoffset}{-1.5cm}
\setlength{\voffset}{-0.4cm}
\setlength{\textwidth}{13cm}
\setlength{\textheight}{16cm}
\setlength{\footskip}{1.4cm}
\setlength{\headheight}{1.2cm}
\setlength{\headsep}{0.6cm}
\renewcommand{\headrulewidth}{0pt}
% Grid einstellen
\textblockorigin{1.5cm}{0.4mm}
\TPGrid{60}{42}
% Fuß- und Kopfzeile
\pagestyle{fancy}
\lfoot{
\begin{textblock}{60}(0,40)
\vspace{3px}
\includegraphics[width=\textwidth,height=36px]{img/titellinie-unten.png}
\end{textblock}
}
\cfoot{\sf{\textcolor{darkgray}{0x\ifthenelse{\value{page}>15}{}{0}\Hexadecimal{page}}}}
% Ueberschriften
\titlespacing{\section}{0mm}{0mm}{-3mm}
\titlespacing{\subsection}{0mm}{0mm}{-4mm}
\titlespacing{\subsubsection}{0mm}{0mm}{-2.2ex}
\titleformat{\section}{\color{darkgray}\normalfont\large\bfseries}{}{0mm}{}
\titleformat{\subsection}{\normalfont\bfseries}{}{0mm}{}
\titleformat{\subsubsection}{\color{darkgray}\normalfont\bfseries}{}{0mm}{}
\setlength{\parindent}{0cm}
\setlength{\columnsep}{0.6cm} % space between text columns
\setlength{\parskip}{0.4cm} % space between paragraphs
\setlength{\fboxrule}{1pt} % border width for boxes
\hbadness=10000 % suppresses unimportant error messages
\clubpenalty = 10000
\widowpenalty = 10000
\displaywidowpenalty = 10000
% Serifenschrift als Standard
\renewcommand{\familydefault}{\sfdefault}
% TXTT als Typewriter-Standard
\renewcommand{\ttdefault}{txtt}
% URLs als Normaltext
\renewcommand*\UrlFont{\normalfont}
% Listingdefinitionen
\lstdefinestyle{FMTextBoxStyle}{
language={},
backgroundcolor=\color{mediumgray},
breaklines=true,
tabsize=2,
breakindent=0pt,
basicstyle=\small\ttfamily,
showspaces=false,
showstringspaces=false,
aboveskip=2\medskipamount,
belowskip=-\medskipamount,
framexleftmargin=5pt,
}
\lstdefinestyle{FMListingWithoutNumbersStyle}{
style=TextBoxStyle,
prebreak=\mbox{\FMArrow},
breakindent=10pt,
framexleftmargin=0pt,
}
\lstdefinestyle{FMListingStyle}{
style=ListingWithoutNumbersStyle,
numbers=left,
numberstyle=\small\ttfamily,
xleftmargin=0.8cm,
framexleftmargin= 0.1\linewidth,
}

57
openfm/packages.tex Normal file
View File

@ -0,0 +1,57 @@
% Author: Marius Melzer. Based on the latex sources of "Freies Magazin" (a german magazine for free software)
% License: GNU Free Documentation License (GFDL) http://www.gnu.org/copyleft/fdl.html
%\usepackage[%
%a4paper,%
%left=20mm%
%,right=20mm%
%,top=3mm%
%,bottom=3mm%
%,includeheadfoot%
%]{geometry}
\usepackage{fmtcount}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{ngerman}
\usepackage{amssymb} % math symbols
\usepackage{amsmath} % math commands
\usepackage[math]{iwona} % math font
\usepackage{bbm} % "blackboard-style" cm fonts.
\usepackage{textcomp}
\usepackage{graphicx}
\usepackage{eurosym}
\usepackage{ifthen}
\usepackage{pifont}
\usepackage{calc}
\usepackage{wrapfig} % multicolumn images
\usepackage{array} % needed by colortbl
\usepackage{colortbl} % colored tables
\usepackage{listings}
\usepackage[hyphens]{url}
\usepackage[expansion=false]{microtype}
\usepackage[scaled]{helvet} % Helvetica
\usepackage{lettrine}
\usepackage{titlesec}
\usepackage{color}
\usepackage[table]{xcolor} % alternating colors in table
\usepackage{framed}
\usepackage{multicol}
\usepackage{fancyhdr}
\usepackage{enumitem}
\usepackage{fancybox}
\usepackage{fancyvrb}
\usepackage[absolute]{textpos}
\usepackage{makeidx}
\usepackage{tocloft}
\usepackage[
bookmarks=true,
bookmarksopen=true,
pdfborder=false,
pdfpagemode=UseNone,
colorlinks=true,
linkcolor=link,
urlcolor=url,
raiselinks=true,
pdfhighlight={/P}]{hyperref} % hyperlinks and internal pdf links