Posts tagged ‘LaTeX’

Ordner beschriften mit LaTeX, Teil 2: Schmale Ordner

Hier noch eine Erweiterung zum Beitrag von gestern, angepasst auf schmale Ordner und mit der Möglichkeit, das jeweilige Label individuell zu skalieren. Dazu wurde der \mylabel Befehl einfach um einen Parameter erweitert, der den übergebenen Labeltext mittels \scalebox aus dem graphicx Paket skaliert.

\documentclass[a4paper,12pt]{scrartcl}
\usepackage[total={210mm,297mm},top=0mm,left=0mm,bottom=0mm,includefoot]{geometry}
\usepackage[schmal]{ticket}
\usepackage{graphicx}
\usepackage{filecontents}
 
\IfFileExists{plex-sans.sty}{%
\usepackage[sfdefault]{plex-sans}%
}{
\usepackage{palatino}%
}
 
\begin{filecontents*}{schmal.tdf}
\unitlength=1mm
\hoffset=-13mm
\voffset=-15mm
\ticketNumbers{1}{10}
\ticketSize{185}{32} % Breite und Höhe der Labels in mm
\ticketDistance{0}{0} % Abstand der Labels
\end{filecontents*}
 
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{xcolor}
 
\renewcommand{\ticketdefault}{}%
\makeatletter
\@boxedtrue % Rahmen um Ticket
\@emptycrossmarkfalse % Falzmarken
\@cutmarktrue % Schnittmarken
\makeatother
 
\newcommand{\mylabel}[2]{
\ticket{%
\put(5,6){\scalebox{#1}{\bfseries #2}}
}}
 
\begin{document}
\mylabel{6}{Versicherung}
\mylabel{6}{Versicherung}
\mylabel{6}{Versicherung}
\mylabel{6}{Versicherung}
\mylabel{6}{Versicherung}
\mylabel{6}{Versicherung}
\mylabel{6}{Versicherung}
\mylabel{6}{Versicherung}
\end{document}

Abbildung Ordner-Label

Uwe

Uwe Ziegenhagen mag LaTeX und Python, auch gern in Kombination. Hat Dir dieser Beitrag geholfen und möchtest Du Dich dafür bedanken? Dann unterstütze doch vielleicht die Dingfabrik Köln e.V. mit einem kleinen Beitrag. Details zur Bezahlung findest Du unter Spenden für die Dingfabrik.

More Posts - Website

Ordner beschriften mit LaTeX

Hier ein Beispiel, wie man mit LaTeX einfach Ordnerrücken beschriften kann. Es nutzt das Paket ticket.sty, das ich auch schon für Wahlkarten im Verein oder Namensschilder genutzt habe.

Hinweise:

  • Beim ersten Kompilieren gibt es eine Fehlermeldung, da die Datei Ordner.tdf noch geschrieben werden muss.
  • Nach Anpassungen innerhalb von filecontents* muss zweimal übersetzt werden. Das erste Übersetzen schreibt die TDF Datei, das zweite Übersetzen nutzt dann diese Datei.
  • Als Schriftart nutze ich die IBM Plex Sans, die in TeX Live 2018 standardmäßig dabei ist,
    in TeX Live 2017 nicht. Die Datei wird aber auch so übersetzt, nutzt dann aber die Palatino.
\documentclass[a4paper,12pt]{scrartcl}
\usepackage[total={210mm,297mm},top=0mm,left=0mm,bottom=0mm,includefoot,landscape]{geometry}
\usepackage[Ordner]{ticket}
\usepackage{graphicx}
\usepackage{filecontents}
 
\IfFileExists{plex-sans.sty}{%
\usepackage[sfdefault]{plex-sans}%
}{
\usepackage{palatino}%
}
 
\begin{filecontents*}{Ordner.tdf}
\unitlength=1mm
\hoffset=10mm
\voffset=-15mm
\ticketNumbers{1}{3}
\ticketSize{190}{58} % Breite und Höhe der Labels in mm
\ticketDistance{0}{0} % Abstand der Labels
\end{filecontents*}
 
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{xcolor}
 
\renewcommand{\ticketdefault}{}%
\makeatletter
\@boxedtrue % Rahmen um Ticket
\@emptycrossmarkfalse % Falzmarken
\@cutmarktrue % Schnittmarken
\makeatother
 
\newcommand{\mylabel}[1]{
\ticket{%
\put(15,15){\scalebox{7}{\bfseries #1}}
}}
 
\begin{document}
\mylabel{Ausbildung}
\mylabel{Steuern}
\mylabel{Rente}
\end{document}

Beispiel Ordnerrücken

Uwe

Uwe Ziegenhagen mag LaTeX und Python, auch gern in Kombination. Hat Dir dieser Beitrag geholfen und möchtest Du Dich dafür bedanken? Dann unterstütze doch vielleicht die Dingfabrik Köln e.V. mit einem kleinen Beitrag. Details zur Bezahlung findest Du unter Spenden für die Dingfabrik.

More Posts - Website

Jahreskalender mit LaTeX & TikZ

Hier ein zusammengefrickeltes Beispiel für einen TikZ-basierten Jahreskalender. „Zusammengefrickelt“ deshalb, weil es bestimmt über die TikZ- und pgf-Kalenderfunktionen viel einfacher und eleganter geht. Letzlich tut es aber 😉

Kalender_2018 (auch wenn das PDF im Namen „2017“ trägt)

\documentclass[fontsize=6pt]{scrartcl}
\usepackage[a4paper,landscape,left=0.5cm,right=0.5cm,top=0.5cm,bottom=0.5cm]{geometry}
 
\usepackage[]{ifdraft}
\usepackage[]{attachfile}
\usepackage[]{eso-pic}
 
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
 
\renewcommand{\familydefault}{\sfdefault}
\RequirePackage[scaled=0.9]{helvet}
\usepackage{tikz}
\usepackage[right]{showlabels}
\usetikzlibrary{positioning}
\pagestyle{empty}
 
\usepackage{xcolor}
 
\usepackage{hyperref}
\usepackage{url}
 
\definecolor{weekendday}{RGB}{220,220,220}
\newcommand{\file}[1]{\textattachfile{#1}{\textcolor{blue}{\LaTeX\ Sourcecode}}}
 
\begin{document}  
 
\AddToShipoutPictureFG*{
  \put(35,10){\footnotesize Uwe Ziegenhagen, ziegenhagen@gmail.com, \file{\jobname.tex}	
}
}
 
\begin{center}
\begin{tikzpicture}
[
    x=23mm,y=6mm,
    mybox/.style={rectangle,rounded corners,minimum width=23mm, minimum height=6mm},
	month/.style={mybox,align=center,draw=black,fill=yellow,thick,font=\bfseries\Large},
    date/.style={mybox,draw=gray,fill=yellow,align=left,thick,minimum width=5mm,font=\bfseries\Large},
    day/.style={mybox,draw=black,align=left},
    weekendday/.style={mybox,draw=black,align=left,fill=weekendday}
]
\node at (0,0) [month] {Januar};
\node at (1,0) [month] {Februar};
\node at (2,0) [month] {März};
\node at (3,0) [month] {April};
\node at (4,0) [month] {Mai};
\node at (5,0) [month] {Juni};
\node at (6,0) [month] {Juli};
\node at (7,0) [month] {August};
\node at (8,0) [month] {September};
\node at (9,0) [month] {Oktober};
\node at (10,0) [month] {November};
\node at (11,0) [month] {Dezember};
 
\node at (-0.6,-1) [date] {01};
\node at (-0.6,-2) [date] {02};
\node at (-0.6,-3) [date] {03};
\node at (-0.6,-4) [date] {04};
\node at (-0.6,-5) [date] {05};
\node at (-0.6,-6) [date] {06};
\node at (-0.6,-7) [date] {07};
\node at (-0.6,-8) [date] {08};
\node at (-0.6,-9) [date] {09};
\node at (-0.6,-10) [date] {10};
\node at (-0.6,-11) [date] {11};
\node at (-0.6,-12) [date] {12};
\node at (-0.6,-13) [date] {13};
\node at (-0.6,-14) [date] {14};
\node at (-0.6,-15) [date] {15};
\node at (-0.6,-16) [date] {16};
\node at (-0.6,-17) [date] {17};
\node at (-0.6,-18) [date] {18};
\node at (-0.6,-19) [date] {19};
\node at (-0.6,-20) [date] {20};
\node at (-0.6,-21) [date] {21};
\node at (-0.6,-22) [date] {22};
\node at (-0.6,-23) [date] {23};
\node at (-0.6,-24) [date] {24};
\node at (-0.6,-25) [date] {25};
\node at (-0.6,-26) [date] {26};
\node at (-0.6,-27) [date] {27};
\node at (-0.6,-28) [date] {28};
\node at (-0.6,-29) [date] {29};
\node at (-0.6,-30) [date] {30};
\node at (-0.6,-31) [date] {31};
 
\node at (0,-1) [day] {};
\node at (0,-2) [day] {};
\node at (0,-3) [day] {};
\node at (0,-4) [day] {};
\node at (0,-5) [day] {};
\node at (0,-6) [weekendday] {};
\node at (0,-7) [weekendday] {};
\node at (0,-8) [day] {};
\node at (0,-9) [day] {};
\node at (0,-10) [day] {};
\node at (0,-11) [day] {};
\node at (0,-12) [day] {};
\node at (0,-13) [weekendday] {};
\node at (0,-14) [weekendday] {};
\node at (0,-15) [day] {};
\node at (0,-16) [day] {};
\node at (0,-17) [day] {};
\node at (0,-18) [day] {};
\node at (0,-19) [day] {};
\node at (0,-20) [weekendday] {};
\node at (0,-21) [weekendday] {};
\node at (0,-22) [day] {};
\node at (0,-23) [day] {};
\node at (0,-24) [day] {};
\node at (0,-25) [day] {};
\node at (0,-26) [day] {};
\node at (0,-27) [weekendday] {};
\node at (0,-28) [weekendday] {};
\node at (0,-29) [day] {};
\node at (0,-30) [day] {};
\node at (0,-31) [day] {};
 
 
\node at (1,-1) [day] {};
\node at (1,-2) [day] {};
\node at (1,-3) [weekendday] {};
\node at (1,-4) [weekendday] {};
\node at (1,-5) [day] {};
\node at (1,-6) [day] {};
\node at (1,-7) [day] {};
\node at (1,-8) [day] {};
\node at (1,-9) [day] {};
\node at (1,-10) [weekendday] {};
\node at (1,-11) [weekendday] {};
\node at (1,-12) [day] {};
\node at (1,-13) [day] {};
\node at (1,-14) [day] {};
\node at (1,-15) [day] {};
\node at (1,-16) [day] {};
\node at (1,-17) [weekendday] {};
\node at (1,-18) [weekendday] {};
\node at (1,-19) [day] {};
\node at (1,-20) [day] {};
\node at (1,-21) [day] {};
\node at (1,-22) [day] {};
\node at (1,-23) [day] {};
\node at (1,-24) [weekendday] {};
\node at (1,-25) [weekendday] {};
\node at (1,-26) [day] {};
\node at (1,-27) [day] {};
\node at (1,-28) [day] {};
 
 
 
\node at (2,-1) [day] {};
\node at (2,-2) [day] {};
\node at (2,-3) [weekendday] {};
\node at (2,-4) [weekendday] {};
\node at (2,-5) [day] {};
\node at (2,-6) [day] {};
\node at (2,-7) [day] {};
\node at (2,-8) [day] {};
\node at (2,-9) [day] {};
\node at (2,-10) [weekendday] {};
\node at (2,-11) [weekendday] {};
\node at (2,-12) [day] {};
\node at (2,-13) [day] {};
\node at (2,-14) [day] {};
\node at (2,-15) [day] {};
\node at (2,-16) [day] {};
\node at (2,-17) [weekendday] {};
\node at (2,-18) [weekendday] {};
\node at (2,-19) [day] {};
\node at (2,-20) [day] {};
\node at (2,-21) [day] {};
\node at (2,-22) [day] {};
\node at (2,-23) [day] {};
\node at (2,-24) [weekendday] {};
\node at (2,-25) [weekendday] {};
\node at (2,-26) [day] {};
\node at (2,-27) [day] {};
\node at (2,-28) [day] {};
\node at (2,-29) [day] {};
\node at (2,-30) [day] {};
\node at (2,-31) [weekendday] {};
 
\node at (3,-1) [weekendday] {};
\node at (3,-2) [day] {};
\node at (3,-3) [day] {};
\node at (3,-4) [day] {};
\node at (3,-5) [day] {};
\node at (3,-6) [day] {};
\node at (3,-7) [weekendday] {};
\node at (3,-8) [weekendday] {};
\node at (3,-9) [day] {};
\node at (3,-10) [day] {};
\node at (3,-11) [day] {};
\node at (3,-12) [day] {};
\node at (3,-13) [day] {};
\node at (3,-14) [weekendday] {};
\node at (3,-15) [weekendday] {};
\node at (3,-16) [day] {};
\node at (3,-17) [day] {};
\node at (3,-18) [day] {};
\node at (3,-19) [day] {};
\node at (3,-20) [day] {};
\node at (3,-21) [weekendday] {};
\node at (3,-22) [weekendday] {};
\node at (3,-23) [day] {};
\node at (3,-24) [day] {};
\node at (3,-25) [day] {};
\node at (3,-26) [day] {};
\node at (3,-27) [day] {};
\node at (3,-28) [weekendday] {};
\node at (3,-29) [weekendday] {};
\node at (3,-30) [day] {};
 
\node at (4,-1) [day] {};
\node at (4,-2) [day] {};
\node at (4,-3) [day] {};
\node at (4,-4) [day] {};
\node at (4,-5) [weekendday] {};
\node at (4,-6) [weekendday] {};
\node at (4,-7) [day] {};
\node at (4,-8) [day] {};
\node at (4,-9) [day] {};
\node at (4,-10) [day] {};
\node at (4,-11) [day] {};
\node at (4,-12) [weekendday] {};
\node at (4,-13) [weekendday] {};
\node at (4,-14) [day] {};
\node at (4,-15) [day] {};
\node at (4,-16) [day] {};
\node at (4,-17) [day] {};
\node at (4,-18) [day] {};
\node at (4,-19) [weekendday] {};
\node at (4,-20) [weekendday] {};
\node at (4,-21) [day] {};
\node at (4,-22) [day] {};
\node at (4,-23) [day] {};
\node at (4,-24) [day] {};
\node at (4,-25) [day] {};
\node at (4,-26) [weekendday] {};
\node at (4,-27) [weekendday] {};
\node at (4,-28) [day] {};
\node at (4,-29) [day] {};
\node at (4,-30) [day] {};
\node at (4,-31) [day] {};
 
\node at (5,-1) [day] {};
\node at (5,-2) [weekendday] {};
\node at (5,-3) [weekendday] {};
\node at (5,-4) [day] {};
\node at (5,-5) [day] {};
\node at (5,-6) [day] {};
\node at (5,-7) [day] {};
\node at (5,-8) [day] {};
\node at (5,-9) [weekendday] {};
\node at (5,-10) [weekendday] {};
\node at (5,-11) [day] {};
\node at (5,-12) [day] {};
\node at (5,-13) [day] {};
\node at (5,-14) [day] {};
\node at (5,-15) [day] {};
\node at (5,-16) [weekendday] {};
\node at (5,-17) [weekendday] {};
\node at (5,-18) [day] {};
\node at (5,-19) [day] {};
\node at (5,-20) [day] {};
\node at (5,-21) [day] {};
\node at (5,-22) [day] {};
\node at (5,-23) [weekendday] {};
\node at (5,-24) [weekendday] {};
\node at (5,-25) [day] {};
\node at (5,-26) [day] {};
\node at (5,-27) [day] {};
\node at (5,-28) [day] {};
\node at (5,-29) [day] {};
\node at (5,-30) [weekendday] {};
 
 
\node at (6,-1) [weekendday] {};
\node at (6,-2) [day] {};
\node at (6,-3) [day] {};
\node at (6,-4) [day] {};
\node at (6,-5) [day] {};
\node at (6,-6) [day] {};
\node at (6,-7) [weekendday] {};
\node at (6,-8) [weekendday] {};
\node at (6,-9) [day] {};
\node at (6,-10) [day] {};
\node at (6,-11) [day] {};
\node at (6,-12) [day] {};
\node at (6,-13) [day] {};
\node at (6,-14) [weekendday] {};
\node at (6,-15) [weekendday] {};
\node at (6,-16) [day] {};
\node at (6,-17) [day] {};
\node at (6,-18) [day] {};
\node at (6,-19) [day] {};
\node at (6,-20) [day] {};
\node at (6,-21) [weekendday] {};
\node at (6,-22) [weekendday] {};
\node at (6,-23) [day] {};
\node at (6,-24) [day] {};
\node at (6,-25) [day] {};
\node at (6,-26) [day] {};
\node at (6,-27) [day] {};
\node at (6,-28) [weekendday] {};
\node at (6,-29) [weekendday] {};
\node at (6,-30) [day] {};
\node at (6,-31) [day] {};
 
\node at (7,-1) [day] {};
\node at (7,-2) [day] {};
\node at (7,-3) [day] {};
\node at (7,-4) [weekendday] {};
\node at (7,-5) [weekendday] {};
\node at (7,-6) [day] {};
\node at (7,-7) [day] {};
\node at (7,-8) [day] {};
\node at (7,-9) [day] {};
\node at (7,-10) [day] {};
\node at (7,-11) [weekendday] {};
\node at (7,-12) [weekendday] {};
\node at (7,-13) [day] {};
\node at (7,-14) [day] {};
\node at (7,-15) [day] {};
\node at (7,-16) [day] {};
\node at (7,-17) [day] {};
\node at (7,-18) [weekendday] {};
\node at (7,-19) [weekendday] {};
\node at (7,-20) [day] {};
\node at (7,-21) [day] {};
\node at (7,-22) [day] {};
\node at (7,-23) [day] {};
\node at (7,-24) [day] {};
\node at (7,-25) [weekendday] {};
\node at (7,-26) [weekendday] {};
\node at (7,-27) [day] {};
\node at (7,-28) [day] {};
\node at (7,-29) [day] {};
\node at (7,-30) [day] {};
 
 
\node at (8,-1) [day] {};
\node at (8,-2) [weekendday] {};
\node at (8,-3) [weekendday] {};
\node at (8,-4) [day] {};
\node at (8,-5) [day] {};
\node at (8,-6) [day] {};
\node at (8,-7) [day] {};
\node at (8,-8) [day] {};
\node at (8,-9) [weekendday] {};
\node at (8,-10) [weekendday] {};
\node at (8,-11) [day] {};
\node at (8,-12) [day] {};
\node at (8,-13) [day] {};
\node at (8,-14) [day] {};
\node at (8,-15) [day] {};
\node at (8,-16) [weekendday] {};
\node at (8,-17) [weekendday] {};
\node at (8,-18) [day] {};
\node at (8,-19) [day] {};
\node at (8,-20) [day] {};
\node at (8,-21) [day] {};
\node at (8,-22) [day] {};
\node at (8,-23) [weekendday] {};
\node at (8,-24) [weekendday] {};
\node at (8,-25) [day] {};
\node at (8,-26) [day] {};
\node at (8,-27) [day] {};
\node at (8,-28) [day] {};
\node at (8,-29) [day] {};
\node at (8,-30) [weekendday] {};
\node at (8,-31) [weekendday] {};
 
 
\node at (9,-1) [day] {};
\node at (9,-2) [day] {};
\node at (9,-3) [day] {};
\node at (9,-4) [day] {};
\node at (9,-5) [day] {};
\node at (9,-6) [weekendday] {};
\node at (9,-7) [weekendday] {};
\node at (9,-8) [day] {};
\node at (9,-9) [day] {};
\node at (9,-10) [day] {};
\node at (9,-11) [day] {};
\node at (9,-12) [day] {};
\node at (9,-13) [weekendday] {};
\node at (9,-14) [weekendday] {};
\node at (9,-15) [day] {};
\node at (9,-16) [day] {};
\node at (9,-17) [day] {};
\node at (9,-18) [day] {};
\node at (9,-19) [day] {};
\node at (9,-20) [weekendday] {};
\node at (9,-21) [weekendday] {};
\node at (9,-22) [day] {};
\node at (9,-23) [day] {};
\node at (9,-24) [day] {};
\node at (9,-25) [day] {};
\node at (9,-26) [day] {};
\node at (9,-27) [weekendday] {};
\node at (9,-28) [weekendday] {};
\node at (9,-29) [day] {};
\node at (9,-30) [day] {};
\node at (9,-31) [day] {};
 
\node at (10,-1) [day] {};
\node at (10,-2) [day] {};
\node at (10,-3) [weekendday] {};
\node at (10,-4) [weekendday] {};
\node at (10,-5) [day] {};
\node at (10,-6) [day] {};
\node at (10,-7) [day] {};
\node at (10,-8) [day] {};
\node at (10,-9) [day] {};
\node at (10,-10) [weekendday] {};
\node at (10,-11) [weekendday] {};
\node at (10,-12) [day] {};
\node at (10,-13) [day] {};
\node at (10,-14) [day] {};
\node at (10,-15) [day] {};
\node at (10,-16) [day] {};
\node at (10,-17) [weekendday] {};
\node at (10,-18) [weekendday] {};
\node at (10,-19) [day] {};
\node at (10,-20) [day] {};
\node at (10,-21) [day] {};
\node at (10,-22) [day] {};
\node at (10,-23) [day] {};
\node at (10,-24) [weekendday] {};
\node at (10,-25) [weekendday] {};
\node at (10,-26) [day] {};
\node at (10,-27) [day] {};
\node at (10,-28) [day] {};
\node at (10,-29) [day] {};
\node at (10,-30) [day] {};
 
 
\node at (11,-1) [weekendday] {};
\node at (11,-2) [weekendday] {};
\node at (11,-3) [day] {};
\node at (11,-4) [day] {};
\node at (11,-5) [day] {};
\node at (11,-6) [day] {};
\node at (11,-7) [day] {};
\node at (11,-8) [weekendday] {};
\node at (11,-9) [weekendday] {};
\node at (11,-10) [day] {};
\node at (11,-11) [day] {};
\node at (11,-12) [day] {};
\node at (11,-13) [day] {};
\node at (11,-14) [day] {};
\node at (11,-15) [weekendday] {};
\node at (11,-16) [weekendday] {};
\node at (11,-17) [day] {};
\node at (11,-18) [day] {};
\node at (11,-19) [day] {};
\node at (11,-20) [day] {};
\node at (11,-21) [day] {};
\node at (11,-22) [weekendday] {};
\node at (11,-23) [weekendday] {};
\node at (11,-24) [day] {};
\node at (11,-25) [day] {};
\node at (11,-26) [day] {};
\node at (11,-27) [day] {};
\node at (11,-28) [day] {};
\node at (11,-29) [weekendday] {};
\node at (11,-30) [weekendday] {};
\node at (11,-31) [day] {};
 
\end{tikzpicture}
\end{center}
 
\end{document}

Uwe

Uwe Ziegenhagen mag LaTeX und Python, auch gern in Kombination. Hat Dir dieser Beitrag geholfen und möchtest Du Dich dafür bedanken? Dann unterstütze doch vielleicht die Dingfabrik Köln e.V. mit einem kleinen Beitrag. Details zur Bezahlung findest Du unter Spenden für die Dingfabrik.

More Posts - Website

Beispiel für Diagramme mit TikZ

Hier ein Beispiel für Diagramme mit TikZ:

\documentclass[12pt,ngerman]{scrartcl}
 
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{babel}
 
\usepackage{tikz}
 
\begin{document}
 
\begin{tikzpicture}
[
    mybox/.style={rectangle,rounded corners,xshift=1cm,yshift=1cm,minimum width=20mm, minimum height=5mm},
    lang/.style={mybox,black,align=center,draw=black,fill=yellow,very thick,font=\bfseries},
]
 
\node at (5,-1) {\bfseries\large imperativ/prozedural};
\node at (13,-1) {\bfseries\large objektorientiert};
 
\node at (1,12) {\textbf{1950}};
\node at (1,10) {\textbf{1960}};
\node at (1,8) {\textbf{1970}};
\node at (1,6) {\textbf{1980}};
\node at (1,4) {\textbf{1990}};
\node at (1,2) {\textbf{2000}};
\node at (1,0) {\textbf{2010}};
 
\draw (2,0) -- (15,0);
\draw (2,2) -- (15,2);
\draw (2,4) -- (15,4);
\draw (2,6) -- (15,6);
\draw (2,8) -- (15,8);
\draw (2,10) -- (15,10);
\draw (2,12) -- (15,12);
 
\node at (10,2.5) [lang] {Python};
\node at (4,10.5) [lang] {Fortran};
\end{tikzpicture}
 
\end{document}

Uwe

Uwe Ziegenhagen mag LaTeX und Python, auch gern in Kombination. Hat Dir dieser Beitrag geholfen und möchtest Du Dich dafür bedanken? Dann unterstütze doch vielleicht die Dingfabrik Köln e.V. mit einem kleinen Beitrag. Details zur Bezahlung findest Du unter Spenden für die Dingfabrik.

More Posts - Website

PDFs anonymisieren mit dem pdfprivacy Paket

pdflatex packt einiges an Meta-Daten in eine PDF-Datei:

Mit dem pdfprivacy (http://mirror.ctan.org/macros/latex/contrib/pdfprivacy) Paket von Laurens Sion lassen sich diese Informationen unterdrücken.

Aus der Dokumentation:

„Creating pdfs with pdfLATEX populates several pdf meta-data fields such as date/time of creation/modification, information about the latex instal-
lation (e.g., pdfTEX version), and the relative paths of included pdfs. The pdfprivacy package provides support for emptying several of these pdf meta-
data fields as well as suppressing some pdfTEX meta-data entries in the resulting pdf.“

Die Optionen stehen dabei für:

nodocdata
Specify whether document meta-data should be removed from the PDF. Document meta-data includes: (i) Title, (ii) Subject, (iii) Author, and (iv) Keywords.
noproducerdata
Specify whether meta-data on the PDF-producing application should be removed. This includes: (i) Creator, and (ii) Producer.
noeditdata
Specify whether meta-data on the edit and creation dates should be removed. This includes: (i) creation date, and (ii) modification date.
noptexdata
Specify whether the PTEX meta-data entries should be suppressed. This includes: (i) PTEX.Fullbanner, (ii) PTEX.FileName, (iii) PTEX.PageNumber, and (iv) PTEX.InfoDict.
nopdftrailerid
Specify whether the pdfrailerid should be omitted.

Diese letzte Option zur pdftrailerid sagt mir nichts, die anderen Optionen sind sicherlich selbsterklärend. Hier ein Beispiel:

\documentclass[12pt,ngerman]{scrartcl}
 
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{booktabs}
\usepackage{babel}
\usepackage{graphicx}
\usepackage{csquotes}
\usepackage{paralist}
\usepackage{xcolor}
 
\usepackage[nodocdata=false,noeditdata=true,noproducerdata=true,noptexdata=true,nopdftrailerid=false]{pdfprivacy}
 
\begin{document}
 
Hallo Welt!
 
\end{document}

Uwe

Uwe Ziegenhagen mag LaTeX und Python, auch gern in Kombination. Hat Dir dieser Beitrag geholfen und möchtest Du Dich dafür bedanken? Dann unterstütze doch vielleicht die Dingfabrik Köln e.V. mit einem kleinen Beitrag. Details zur Bezahlung findest Du unter Spenden für die Dingfabrik.

More Posts - Website

Referenzen, Varioref und Prettyref

Hier ein Beispiel, wie man mit varioref und prettyref Referenzen in LaTeX aufpeppen kann:

\documentclass[ngerman]{scrartcl}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{xcolor}
 
% sinnloser Text 
\usepackage{blindtext}
 
\usepackage{varioref}
\usepackage{prettyref}
 
% for prettyref
\newrefformat{eq}{\textup{(\ref{#1})}}
\newrefformat{cha}{Kapitel \ref{#1}}
\newrefformat{sec}{Abschnitt \ref{#1}}
\newrefformat{tab}{Tabelle \ref{#1} auf Seite \pageref{#1}}
\newrefformat{fig}{Abbildung \ref{#1} auf Seite \pageref{#1}}
 
\usepackage{showlabels}
 
\begin{document}
 
\section{Erster Abschnitt}\label{sec:erst}
 
\blindtext[3]
 
\begin{figure}[h]%
\rule{\columnwidth}{5cm}
\caption{Hallo Welt!}%
\label{fig:test1}%
\end{figure}
 
\blindtext[1]
 
\section{Zweiter Abschnitt}
 
\blindtext[5]
 
\begin{figure}%
\rule{\columnwidth}{5cm}
\caption{Hallo Welt!}%
\label{fig:test2}%
\end{figure}
 
\blindtext[4]
 
\begin{itemize}
	\item Ohne Paket: Siehe Abbildung \textcolor{red}{\ref{fig:test1}} auf Seite \textcolor{red}{\pageref{fig:test1}}
	\item Varioref: Siehe Abbildung \textcolor{red}{\vref{fig:test1}}
	\item Varioref: Siehe die Abbildung \textcolor{red}{\vpageref{fig:test1}}
	\item Ohne Paket: Siehe Abbildung \textcolor{red}{\ref{fig:test2}} auf Seite \textcolor{red}{\pageref{fig:test2}}
	\item Varioref: Siehe Abbildung \textcolor{red}{\vpageref{fig:test2}}
	\item Varioref: Siehe Abbildung \textcolor{red}{\vref{fig:test2}}
	\item Varioref: Siehe Abbildungen \textcolor{red}{\vrefrange{fig:test1}{fig:test2}}
	\item Varioref: Siehe die Abbildungen \textcolor{red}{\vpagerefrange{fig:test1}{fig:test2}}
	\item Prettyref: \textcolor{red}{\prettyref{fig:test1}}
	\item Prettyref: \textcolor{red}{\prettyref{sec:erst}}
	\item Varioref: Siehe Abbildung \textcolor{red}{\vref{fig:test3}}
	\item Varioref: Siehe Abbildung \textcolor{red}{\vref{fig:test4}}
\end{itemize}
 
\clearpage 
 
\begin{figure}%
\rule{\columnwidth}{5cm}
\caption{Hallo Welt!}%
\label{fig:test3}%
\end{figure}
 
\clearpage 
 
\begin{figure}%
\rule{\columnwidth}{5cm}
\caption{Hallo Welt!}%
\label{fig:test4}%
\end{figure}
 
\end{document}

Hier die Ausgabe der Referenzen auf der letzten Seite. Alles, was in rot gesetzt wird, wird so über das entsprechende TeX gesteuert.

Uwe

Uwe Ziegenhagen mag LaTeX und Python, auch gern in Kombination. Hat Dir dieser Beitrag geholfen und möchtest Du Dich dafür bedanken? Dann unterstütze doch vielleicht die Dingfabrik Köln e.V. mit einem kleinen Beitrag. Details zur Bezahlung findest Du unter Spenden für die Dingfabrik.

More Posts - Website

Creating sparklines with LaTeX

Sparklines, invented by Edward Tufte (check out his awesome books!), are an interesting way of visualizing information inside the text. For more information on the theoretical background check Prof. Tufte’s page https://www.edwardtufte.com/bboard/q-and-a-fetch-msg?msg_id=0001OR.

For LaTeX users there are a few ways of using them inside LaTeX which we will briefly introduce in this article.

1. Using the sparklines package.

Examples taken from the package documentation.

\documentclass[12pt]{article}
 
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{sparklines}
 
\begin{document}
 
Hello, I am a 
\begin{sparkline}{10}
\sparkrectangle 0.0 1.1
\sparkdot 0.25 0.62 blue
\sparkdot 1 0.2 red
\spark 0.1 0.95  0.2 0.8  0.3 0.3  0.4 0.52  0.5 0.62
0.6 0.7   0.7 0.5  0.8 0.4  0.9 0.25  1 0.2 /
\end{sparkline}
sparkline in a document.
 
You can also 
\begin{sparkline}{5}
\sparkspike .083 .18
\sparkspike .25 .55
\sparkspike .417 1
\sparkspike .583 .62
\sparkspike .75 .42
\sparkspike .917 .5
\end{sparkline}
use sparkbars.
 
Both types can
\begin{sparkline}{5}
\sparkspike .083 .18
\sparkspike .25 .55
\sparkspike .417 1
\sparkspike .583 .62
\sparkspike .75 .42
\sparkspike .917 .5
\spark 0.1 0.95  0.2 0.8  0.3 0.3  0.4 0.52  0.5 0.62
0.6 0.7   0.7 0.5  0.8 0.4  0.9 0.25  1 0.2 /
\sparkdot 1 0.2 blue
\end{sparkline} also be combined.
 
\end{document}

2. Using the AfterTheFlood OTF font with the spark-OTF package by Herbert Voß

A few days ago I found information about a sparklines OTF font on Twitter which I then shared with the German TeX community. Herbert Voß created a few commands to use these fonts inside documents and packaged them.

When you update your TeX Live 2017 you should automatically get this package. In addition you need to install the fonts from After the Flood which are available from github.

Remark: as of 2017-09-24 the spark-otf package seems to have issues when compiled with xeLaTeX (at least with Windows). Use luaLaTeX to compile this. Update: With version 0.04 of the package xelatex is working fine.

\documentclass[12pt]{article}
 
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{sparklines}
 
\begin{document}
 
Hello, I am a 
\begin{sparkline}{10}
\sparkrectangle 0.0 1.1
\sparkdot 0.25 0.62 blue
\sparkdot 1 0.2 red
\spark 0.1 0.95  0.2 0.8  0.3 0.3  0.4 0.52  0.5 0.62
0.6 0.7   0.7 0.5  0.8 0.4  0.9 0.25  1 0.2 /
\end{sparkline}
sparkline in a document.
 
You can also 
\begin{sparkline}{5}
\sparkspike .083 .18
\sparkspike .25 .55
\sparkspike .417 1
\sparkspike .583 .62
\sparkspike .75 .42
\sparkspike .917 .5
\end{sparkline}
use sparkbars.
 
 
Both types can
\begin{sparkline}{5}
\sparkspike .083 .18
\sparkspike .25 .55
\sparkspike .417 1
\sparkspike .583 .62
\sparkspike .75 .42
\sparkspike .917 .5
\spark 0.1 0.95  0.2 0.8  0.3 0.3  0.4 0.52  0.5 0.62
0.6 0.7   0.7 0.5  0.8 0.4  0.9 0.25  1 0.2 /
\sparkdot 1 0.2 blue
\end{sparkline} also be combined.
 
\end{document}

Uwe

Uwe Ziegenhagen mag LaTeX und Python, auch gern in Kombination. Hat Dir dieser Beitrag geholfen und möchtest Du Dich dafür bedanken? Dann unterstütze doch vielleicht die Dingfabrik Köln e.V. mit einem kleinen Beitrag. Details zur Bezahlung findest Du unter Spenden für die Dingfabrik.

More Posts - Website

Neue Version des varsfromjobname Pakets

Letzten Montag habe ich die neue Version meines varsfromjobname Pakets auf CTAN hochgeladen, es gibt auch ein Github Repo dazu: https://github.com/UweZiegenhagen/VarsFromJobname

What does this package do?

Using varsfromjobname.sty one can easily extract information from the filename, if it follows a certain form.

The standard LaTeX command \jobname returns the name of the LaTeX (master) file. If the filename consists of tokens separated by hyphen we can easily extract certain tokens that can be used inside the document.

The package expects the filename to be of the form one-two-three-four-five-six-seven-eight-nine.tex and offers the following commands:


\getfromjobname{param}, with param in the range of 1 to 9 (a highlevel interface to the following commands)

\getonefromjobname
\gettwofromjobname
\getthreefromjobname
\getfourfromjobname
\getfivefromjobname
\getsixfromjobname
\getsevenfromjobname
\geteightfromjobname
\getninefromjobname

Why can it be useful?

You can use this package for example to define the date of the document in the filename, personally I use it e.g. for scrlttr2 letters.

Change History

  • Version 0.5, as of January 11th 2009: Initial version published
  • Version 1.0, to be published May 2017: Added various commands which extract necessary information also from included documents. Modified code as suggested by egreg

Shortcomings

  • \getfromjobname is not fully expandable, use one of the other commands if you need expansion
  • Version 1.0 cannot extract information from included sub-documents
  • The package cannot handle more than nine tokens, see the reference to egreg’s answer on TSX below for an updated version

Uwe

Uwe Ziegenhagen mag LaTeX und Python, auch gern in Kombination. Hat Dir dieser Beitrag geholfen und möchtest Du Dich dafür bedanken? Dann unterstütze doch vielleicht die Dingfabrik Köln e.V. mit einem kleinen Beitrag. Details zur Bezahlung findest Du unter Spenden für die Dingfabrik.

More Posts - Website

Generating a normal distribution table with SciPy

Here’s a simple example how one can generate a normal distribution table with Python and scipy so that it can be imported into LaTeX.

Example-03.zip

# -*- coding: utf-8 -*-
"""
Created on Mon Mar 13 21:14:17 2017
@author: Uwe Ziegenhagen, ziegenhagen@gmail.com
 
Creates a CDF table for the standard normal distribution
 
use booktabs package in the preamble and put 
the generated numbers inside (use only one backslash!)
 
\\begin{tabular}{r|cccccccccc} \\toprule
<output here>
\\end{tabular}
"""
 
from scipy.stats import norm
 
print(norm.pdf(0))
print(norm.cdf(0),'\r\n')
 
horizontal = range(0,10,1)
vertikal = range(0,37)
 
header = ''
for i in horizontal:
    header = header + '& ' + str(i/100)
 
print(header, '\\\\ \\midrule')
 
for j in vertikal:  
    x = j/10
    print('\\\\', x)
    for i in horizontal:
        y = x + i/100
        print('& ', "{:10.4f}".format(norm.cdf(y),4))
 
 
print('\\\\ \\bottomrule \r\n')

Uwe

Uwe Ziegenhagen mag LaTeX und Python, auch gern in Kombination. Hat Dir dieser Beitrag geholfen und möchtest Du Dich dafür bedanken? Dann unterstütze doch vielleicht die Dingfabrik Köln e.V. mit einem kleinen Beitrag. Details zur Bezahlung findest Du unter Spenden für die Dingfabrik.

More Posts - Website

LaTeX-Dateien vergleich mit latexdiff

latexdiff ist Bestandteil von TeX Live und erlaubt es, die Unterschiede zwischen zwei LaTeX-Dateien hervorzuheben. Hier ein Beispiel mit einem kurzen Textschnipsel aus der Wikipedia:

Das Original (Giraffe1.tex)

\documentclass[12pt,ngerman]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{csquotes}
\begin{document}
 
Die Giraffen (Giraffa) sind eine Gattung der Säugetiere aus der Ordnung der Paarhufer. Ursprünglich wurden ihr mit Giraffa camelopardalis und der Trivialbezeichnung \enquote{Giraffe} nur eine einzige Art zugewiesen. Molekulargenetische Untersuchungen aus dem Jahr 2016 zeigen jedoch, dass die Gattung wenigstens vier Arten mit sieben eigenständigen Populationen umfasst. Die Giraffen stellen die höchsten landlebenden Tiere der Welt. Zur Unterscheidung vom verwandten Okapi (sogenannte \enquote{Waldgiraffe}) werden sie auch als Steppengiraffen bezeichnet.
 
\end{document}

Eine Version mit leichten Änderungen (Giraffe2.tex)

\documentclass[12pt,ngerman]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{csquotes}
\begin{document}
 
Die Giraffen (Giraffa) sind eine Gattung der Säugetiere aus der Ordnung der Paarhufer. Ursprünglich wurden ihr mit Giraffa camelopardalis und der Trivialbezeichnung \enquote{Giraffe} nur eine einzige Art zugewiesen. Untersuchungen aus dem Jahr 2016 zeigten jedoch, dass die Gattung wenigstens 4 Arten mit 7 eigenständigen Populationen umfasst. Die Giraffen stellen die höchsten landlebenden Tiere der Welt. Zur Unterscheidung vom verwandten Okapi (der sogenannten \enquote{Waldgiraffe}) werden sie auch als Steppengiraffen bezeichnet.
 
\end{document}

Auf der Kommandozeile ruft man jetzt auf latexdiff Giraffe1.tex Giraffe2.tex > Giraffediff.tex und übersetzt die neu erzeugte Datei nach PDF, das dann wie folgt aussieht:

Uwe

Uwe Ziegenhagen mag LaTeX und Python, auch gern in Kombination. Hat Dir dieser Beitrag geholfen und möchtest Du Dich dafür bedanken? Dann unterstütze doch vielleicht die Dingfabrik Köln e.V. mit einem kleinen Beitrag. Details zur Bezahlung findest Du unter Spenden für die Dingfabrik.

More Posts - Website