Archive for the ‘Stackexchange Pearls’ Category.

Using individual glyphs from a OpenType Font in LuaLaTeX

I am currently preparing a tutorial on the Texas Instruments BAII Plus Professional Calculator in LaTeX. TI provides the font for the different keystrokes as TTF and PFB/PFM which makes it way easier to typeset the symbols.

The first step was to convert the font to OTF format. I tried TTF 2 OTF first without luck as the resulting OTF did not have any symbols in it. Using PFB 2 OTF worked better, the generated OTF had supposedly all the keys in it.

In the next step I wanted to generate an LaTeX overview of all symbols. Using the information from https://tex.stackexchange.com/questions/103704/how-to-properly-install-and-use-a-new-font-with-lualatex and https://tex.stackexchange.com/questions/25249/how-do-i-use-a-particular-font-for-a-small-section-of-text-in-my-document/37251 I came up with the following (don’t forget to install the OTF before!):

\documentclass[11pt]{article}
 
\usepackage[left=1cm,right=1cm,landscape,a4paper]{geometry}
\usepackage{fontspec}
 
\newfontfamily\tifont{BA2Plus Symbols}
 
\usepackage{luacode}
\usepackage{longtable,array,xcolor,listings}
\begin{luacode*} 
function print_glyphs(maxCols,maxChars) 
  local id = font.current()         -- geht Font ID
  local fnt = font.getfont(id)
  local col = 1
  local maxU4 = 15*(16^3+16^2+16+1)
  a = {}
  for k, v in pairs(fnt.characters) do
    a [#a + 1] = k
  end
  table.sort(a)
  for i, k in ipairs(a) do
    if i >= maxChars then break end
    if col == 1 then
      if k > maxU4 then
        tex.sprint(string.format("U+%06x", k))
      else
        tex.sprint(string.format("U+%04x", k))
      end
      tex.sprint("&") 
    end
    if (i) then
      tex.sprint(string.format([[\char%i]], k))
    else
     tex.sprint("~")
    end
    if col == maxCols then              -- Line finished?
      tex.sprint([[\\\cline{2-]] .. maxCols+1 .. "} ")  -- Yes
      col = 1                           -- newline
    else
      tex.sprint("&")                   -- no, Print &
      col = col + 1                     -- next column
    end
  end
end
\end{luacode*}
 
 
\begin{document}
 
{\tifont
\begin{longtable}{>{\color{black!50}\ttfamily\footnotesize}r|
                  *{10}{>{\color{black}}p{5em}|}}
\cline{2-11}
\endhead
 
\directlua{print_glyphs(10,65463)} \\ \cline{2-11}
\end{longtable}}
 
\end{document}

PDF

The next step then was to create a logic of how to address the different symbols. Of course TSX was helpful again (https://tex.stackexchange.com/questions/38402/how-to-pick-a-specific-symbol-from-a-specific-font):

\documentclass[twocolumn]{article}
\usepackage{fontspec}
\usepackage[top=4cm,left=2cm,right=2cm,bottom=2cm]{geometry}
\newfontfamily\tifont{BA2Plus Symbols}
\newcommand\tif[1]{{\tifont\symbol{#1}}}
\usepackage{fonttable}
 
\begin{document}
\twocolumn
 
33  >  \tif{33}
 
34  >  \tif{34}
 
...
 
124  >  \tif{124}
 
125  >  \tif{125}
 
\end{document}

PDF

The next step is to come up with a convenient way of addressing the glyphs, e.g. by creating aliases for each glyph.

Uwe

Uwe Ziegenhagen likes LaTeX and Python, sometimes even combined. Do you like my content and would like to thank me for it? Consider making a small donation to my local fablab, the Dingfabrik Köln. Details on how to donate can be found here Spenden für die Dingfabrik.

More Posts - Website

Modifying selected text with Autohotkey

Autohotkey is an amazing tool to define hotkeys such as s# that get automatically expanded to \section{}. On earlier occasions I had already written some blog posts on this topic. Today (encouraged by a question on tex.stackexchange) I managed to compile a short script, which takes some selected text, inserts a specific command and pastes the selected text again. Quite helpful if one want’s to define a shortcut to e.g. make the selected text bold.

F4::
Send ^c
Send \command{{}{}}{LEFT}
Send ^v
Return

Uwe

Uwe Ziegenhagen likes LaTeX and Python, sometimes even combined. Do you like my content and would like to thank me for it? Consider making a small donation to my local fablab, the Dingfabrik Köln. Details on how to donate can be found here Spenden für die Dingfabrik.

More Posts - Website

Creating pgfgantt Calendars for 2013 with Excel

The pgfgantt package is a great tool to create Gantt charts, that are quite useful in the management of projects since one can visualize task dependencies with their help.

To get to know this package a little better I have –with the help of stackexchange— created a calendar for 2013 (PDF), showing the 365 days with SAT & SUN highlighted.

To add an entry to the calendar however I need to calculate the number of the day for the start and end date — a task Excel is quite good at. I played a little and finally came up with an Excel file that allows me to enter the start and end dates plus the name of the Gantt-bar and puts then together the string for the Gantt-bar.

The first columns are pretty self-explaining, the „description“ column is not exported to the LaTeX code. All the magic happens in the final column, let’s look at some example (Excel file):


="\ganttbar" & WENN([@Color]<>"";"[bar/.style={fill=" & [@Color] &"}]";) &"{" &[Name] & "}{"& C3-41274&"}{"&D3-41274&"}" & WENN([@Name]=B4;"";"\\")

pgfgantt_calendar

It is basically just a concatenation of strings with some IF („WENN“ in German) and date calculation. The first WENN is used to determine if the color has been set. If it is set, some brackets need to be printed with the bar/fill stuff. The Name of the bar is printed, then I calculate the differences from the first date and the number 41274 (corresponds to Deember 31st in Excel number format) and the second date and the number 41274. Since I can have more than one bar in one line I check if the line below has the same name. If it has, no „\\“ shall be printed, if it is different I want to finish this line. I can then copy the generated code directly into my LaTeX file:

\documentclass{article}
\usepackage[paperwidth=160cm, paperheight=50cm,
            left=1cm,right=1cm,top=5cm,bottom=5cm]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{pgfgantt}
\usetikzlibrary{calendar}
 
\protected\def\zzz#1{%
\pgfcalendarifdate{2012-12-31+#1}{weekend}% Test if it's a weekend
{\textcolor{red}{\pgfcalendarifdateday}}% Typeset with red color
{\pgfcalendarifdateday}% Or just the number
}
 
\begin{document}
 
\begin{ganttchart}[hgrid, vgrid, x unit=0.425cm]{365}
\gantttitle{Projektplan}{365} \\
\gantttitlelist[
title list options={var=\y, evaluate=\y as \x using {"\zzz{\y}"}}
]{1,...,365}{1} \\
\ganttbar[bar/.style={fill=yellow}]{public holiday}{8}{8}\\
\ganttbar{some conference}{65}{67}\\
\ganttbar[bar/.style={fill=blue}]{some date}{36}{49}
\ganttbar[bar/.style={fill=green}]{some date}{51}{55}\\
\end{ganttchart}
 
\end{document}

Deutsche Zusammenfassung: Die Erstellung von Einträgen für pgfgantt-basierte Kalender kann man deutlich vereinfachen, wenn man in einer Excel-Datei die notwendigen Informationen zusammenbaut.

Uwe

Uwe Ziegenhagen likes LaTeX and Python, sometimes even combined. Do you like my content and would like to thank me for it? Consider making a small donation to my local fablab, the Dingfabrik Köln. Details on how to donate can be found here Spenden für die Dingfabrik.

More Posts - Website

Adobe Source Sans Pro mit xeLaTeX/LuaLaTeX nutzen

Adobe hat die Source Sans Pro veröffentlicht, eine Schrift unter OpenSource Lizenz. Der entsprechende Blog-Eintrag (http://tex.blogoverflow.com/2012/08/a-new-open-font-adobe-source-sans-pro/?cb=1) bei tex.stackexchange.com zeigt auch gleich eine tolle Anwendung dafür.

% !TEX TS-program = XeLaTeX
\documentclass[fontsize=12pt,ngerman]{scrartcl}
\usepackage[a4paper]{geometry}
\usepackage{fontspec,xcolor}
 
\usepackage{xkeyval,polyglossia}
\setmainlanguage[spelling=new]{german}
\usepackage{graphicx}
\usepackage{csquotes}
\usepackage{paralist}
\usepackage[]{blindtext}
 
\setmainfont[ItalicFont={Source Sans Pro Italic},BoldFont={Source Sans Pro Bold},BoldItalicFont={Source Sans Pro Bold Italic}]{Source Sans Pro}
 
\renewcommand{\familydefault}{\sfdefault}
 
\begin{document}
 
\blindtext
 
{\bfseries \blindtext}
 
{\itshape \blindtext}
 
{\itshape \bfseries \blindtext}
 
\end{document}

Und hier noch das entsprechende LuaLaTeX Dokument (mit babel statt polyglossia)

% !TEX TS-program = lualatex
\documentclass[fontsize=12pt,ngerman]{scrartcl}
\usepackage[a4paper]{geometry}
\usepackage{fontspec,xcolor}
\usepackage{xkeyval}
\usepackage[]{babel}
\usepackage{graphicx}
\usepackage{csquotes}
\usepackage{blindtext}
 
\setmainfont[ItalicFont={Source Sans Pro Italic},BoldFont={Source Sans Pro Bold},BoldItalicFont={Source Sans Pro Bold Italic}]{Source Sans Pro}
 
\renewcommand{\familydefault}{\sfdefault}
 
\begin{document}
 
\blindtext
 
{\bfseries \blindtext}
 
{\itshape \blindtext}
 
{\itshape \bfseries \blindtext}
 
\end{document}

Uwe

Uwe Ziegenhagen likes LaTeX and Python, sometimes even combined. Do you like my content and would like to thank me for it? Consider making a small donation to my local fablab, the Dingfabrik Köln. Details on how to donate can be found here Spenden für die Dingfabrik.

More Posts - Website

Description Items rechtsbündig ausrichten

Bei signifikant unterschiedlichen Breiten von Description Items möchte man manchmal die Beschreibungen rechtsbündig setzen, dank des enumitem Pakets ist dies problemlos möglich. Hier eine Antwort zu meiner Frage in tex.stackexchange.net:

\documentclass{article}
\usepackage{calc}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{enumitem}
 
\begin{document}
 
\begin{description}[labelwidth=\widthof{\bfseries September},align=right]
    \item[Januar] some text
    \item[Februar] some more text
    \item[März] and some text
    \item[April] some text
    \item[Mai] some more text
    \item[Juni] and some text
    \item[Juli] some text
    \item[August] some more text
    \item[September] and some text
    \item[Oktober] some text
    \item[November] some more text
    \item[Dezember] and some text
\end{description}
 
\end{document}

Uwe

Uwe Ziegenhagen likes LaTeX and Python, sometimes even combined. Do you like my content and would like to thank me for it? Consider making a small donation to my local fablab, the Dingfabrik Köln. Details on how to donate can be found here Spenden für die Dingfabrik.

More Posts - Website

fontenc und inputenc

Die Frage, wo eigentlich der Unterschied zwischen fontenc und inputenc liegt, wurde sehr ausführlich in einem stackexchange Posting beantwortet. Da ich selbst zwar schon seit Jahren TeXe, diesen Unterschied aber selbst nie ergründet habe, folgt hier die deutsche Übersetzung.

Beide Pakete adressieren vollkommen unterschiedliche Probleme.

  • inputenc erlaubt es dem Nutzer, Nicht-ASCII Zeichen direkt über die Tastatur einzugeben
  • fontenc kümmert sich um die Ausgabe, also darum welches Zeichen genutzt wird, um einen Buchstaben darzustellen

Beide Pakete sind nicht mit einander verbunden, es ist aber besser, fontenc vor inputenc in der Präambel zu laden. Mit \usepackage[T1]{fontenc} wählt man diejenige Codierung des Ausgabefonts so, die die meisten europäischen Sprachen (Deutsch, Französisch, Italienisch, Polnisch, etc.) enthält. Dies ist schon deshalb wichtig, weil TeX sonst Wörter mit akzentuierten Zeichen nicht korrekt trennen könnte.

Durch das Laden von \usepackage["encoding"]{inputenc} kann man direkt akzentuierte (Nicht-ASCII) Zeichen über die Tastatur eingeben. Wichtig ist hier, dass „encoding“ mit der TeX-Datei selbst korrespondiert, dies hängt einerseits von der Maschine und andererseit vom genutzten Editor ab. Das gebräuchlichste Encoding heute ist utf8.

Nutzt man nur \usepackage[T1]{fontenc}, und erhält man scheinbar richtigen Output, so ist die Datei vermutlich mit Latin-1 (ISO 8859-1) kodiert. Ausreichend ist dies jedoch nicht. Tippt man ein ß so erhält man SS in der Ausgabe, was falsch ist. Der richtige Aufruf ist daher


\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}

Wie arbeiten die beiden Pakete? Schauen wir uns dies am Beispiel vom „ä“ an. Zuerst muss man sich bewusst sein, dass TeX nichts über Datei-Encodings weiß, es sieht nur die Zeichenzahl. Wenn man in einem auf latin-1 eingestellten Editor ein „ä“ eintippt, speichert der Rechner die Zahl 228.

TeX liest die Datei, findet das Zeichen Nummer 228, die Makros vom inputenc Paket transformieren dies in ein \“a.

Jetzt schlägt die Stunde von fontenc: Der Befehl \“a steht in einer Tabelle der akzentuierten Zeichen des Zeichensatzes, daraus macht fontenc „Setze Zeichen 228“ im aktuell gewählten Font. Beide Zahlen stimmen hier überein, daher wäre für das „ä“ das fontenc ausreichend.

Für ß stimmt dies nicht: Gespeichert wird die Zeichennummer 223, inputenc wandelt dies zu \ss, fontenc transformiert dies zu „Setze Zeichen 255“, an dieser Stelle sitzt bei T1-codierten Fonts das ß

Uwe

Uwe Ziegenhagen likes LaTeX and Python, sometimes even combined. Do you like my content and would like to thank me for it? Consider making a small donation to my local fablab, the Dingfabrik Köln. Details on how to donate can be found here Spenden für die Dingfabrik.

More Posts - Website

PGFplots und Beamer

Marc van Dongen hat heute bei stackexchange ein schönes Minimal-Beispiel zu PGFplots veröffentlicht (http://tex.stackexchange.com/questions/44923/create-slide-with-graph-in-beamer).

\documentclass{beamer}
\usepackage{pgfplots}
\begin{document}
\begin{frame}[fragile]
   \frametitle{Bar Graphs}
\begin{tikzpicture}[scale=0.85]
\begin{axis}[xbar,tick align=outside,
             width=11cm,
             height=8cm,
             bar width={10pt},
             enlargelimits=0.13,
             nodes near coords,
             nodes near coords align=horizontal,
             point meta=x * 1, % The displayed number.
             xlabel=\textbf{Frequency of Winning the Final},
             xtick={0,5,...,35},
             ytick={1,...,13},
             yticklabels={Kerry,Laois,London,Waterford,Clare,Offaly,
                      Galway,Wexford,Dublin,Limerick,Tipperary,Cork,Kilkenny}
            ]
\addplot
[draw=blue,fill=blue!15]
coordinates
{(1,1) (1,2) (1,3) (2,4) (3,5) (4,6) (4,7) (6,8) (6,9) (7,10) (26,11) (30,12) (33,13)};
\end{axis}
\end{tikzpicture}
\end{frame}
\end{document}

Uwe

Uwe Ziegenhagen likes LaTeX and Python, sometimes even combined. Do you like my content and would like to thank me for it? Consider making a small donation to my local fablab, the Dingfabrik Köln. Details on how to donate can be found here Spenden für die Dingfabrik.

More Posts - Website

Longtable im Querformat

Hier ein Beispiel, wie man sehr breite Tabellen über mehrere Seiten im Querformat setzen kann, siehe dazu tex.stackexchange.com

Ergebnis (PDF)

\documentclass{article}
\usepackage{lscape} % or {pdflscape} to rotate the page as well
\usepackage{longtable}
\usepackage[]{blindtext}
\begin{document}
 
\blindtext
 
\begin{landscape}
\begin{longtable}{lrrrrrrrrr}
\caption{caption} \\
\multicolumn{2}{l}{endhead}\endhead
\multicolumn{10}{c}{endfoot} \endfoot
\multicolumn{2}{l}{endfirsthead} \endfirsthead
\multicolumn{10}{c}{endlastfoot}\endlastfoot
1	&	0,914990351	&	0,298974888	&	0,922097698	&	0,184632358	&	0,203198408	&	0,874739198	&	0,412215328	&	0,420913904	&	0,740320564	\\
2	&	0,108627352	&	0,323950914	&	0,708395	&	0,43757187	&	0,814888014	&	0,611530653	&	0,508016337	&	0,271681395	&	0,417638496	\\
3	&	0,634790064	&	0,4649107	&	0,416387989	&	0,774567224	&	0,500310345	&	0,403707073	&	0,102506908	&	0,263304402	&	0,709506743	\\
4	&	0,362087069	&	0,513561644	&	0,313038215	&	0,440060489	&	0,308348328	&	0,857655789	&	0,385688737	&	0,978953617	&	0,596449638	\\
5	&	0,564832283	&	0,029462634	&	0,107202711	&	0,60561476	&	0,861560219	&	0,985875509	&	0,92945761	&	0,972881358	&	0,353218975	\\
6	&	0,329386988	&	0,51090094	&	0,034069292	&	0,535695515	&	0,169786592	&	0,869104101	&	0,03560279	&	0,921982695	&	0,30592329	\\
7	&	0,511633354	&	0,842805285	&	0,329137575	&	0,568680527	&	0,141052516	&	0,625934389	&	0,3133518	&	0,09755602	&	0,334303033	\\
8	&	0,281636874	&	0,280653736	&	0,756512927	&	0,706062713	&	0,400186558	&	0,706819571	&	0,604525604	&	0,557480363	&	0,233879946	\\
9	&	0,38071327	&	0,232764601	&	0,048963612	&	0,812551796	&	0,217872205	&	0,380683162	&	0,82724635	&	0,146149765	&	0,298199846	\\
10	&	0,062407548	&	0,726899352	&	0,33231973	&	0,432914385	&	0,784851535	&	0,251724635	&	0,938082422	&	0,290168392	&	0,034146736	\\
11	&	0,131046425	&	0,048593047	&	0,915262003	&	0,207034917	&	0,586294612	&	0,140867223	&	0,876684036	&	0,930307056	&	0,86380663	\\
12	&	0,582394953	&	0,628115695	&	0,067240091	&	0,53597063	&	0,757613692	&	0,020690087	&	0,178675947	&	0,774516019	&	0,694931955	\\
13	&	0,071979998	&	0,145607327	&	0,503368456	&	0,728258837	&	0,181055609	&	0,226376226	&	0,151644913	&	0,945255187	&	0,943206043	\\
14	&	0,686322137	&	0,951534845	&	0,571753608	&	0,731261979	&	0,194580806	&	0,944672738	&	0,547201461	&	0,623500377	&	0,078779032	\\
15	&	0,873240419	&	0,409022554	&	0,633660947	&	0,899245726	&	0,841204704	&	0,461840363	&	0,786185057	&	0,723427216	&	0,750735979	\\
16	&	0,533727427	&	0,792328659	&	0,669860952	&	0,574881037	&	0,649978271	&	0,372605794	&	0,750398193	&	0,256982362	&	0,008381319	\\
17	&	0,170231561	&	0,524254572	&	0,993641848	&	0,690891393	&	0,582365636	&	0,859901365	&	0,257181024	&	0,935113251	&	0,365757236	\\
18	&	0,98493043	&	0,562974922	&	0,41776249	&	0,831460371	&	0,936776992	&	0,420577007	&	0,76572059	&	0,194668542	&	0,882835345	\\
19	&	0,672134225	&	0,881823874	&	0,59519598	&	0,538095501	&	0,568963646	&	0,390743944	&	0,469548832	&	0,434121743	&	0,804678952	\\
20	&	0,556034554	&	0,110471102	&	0,325907236	&	0,004655586	&	0,210699565	&	0,196128436	&	0,182453795	&	0,048287754	&	0,452918838	\\
21	&	0,921634241	&	0,788603162	&	0,732491335	&	0,810868591	&	0,909630297	&	0,028789469	&	0,506585994	&	0,896638136	&	0,436120247	\\
22	&	0,537438683	&	0,722793288	&	0,508497476	&	0,044080247	&	0,471523326	&	0,683793128	&	0,959315632	&	0,952560621	&	0,292164381	\\
23	&	0,034981867	&	0,692672538	&	0,80665406	&	0,236978544	&	0,30680117	&	0,386204868	&	0,003058233	&	0,64382416	&	0,962990634	\\
24	&	0,644079186	&	0,879231037	&	0,863490994	&	0,556341891	&	0,147899521	&	0,199341272	&	0,400559083	&	0,041104369	&	0,036156676	\\
25	&	0,993253164	&	0,924624054	&	0,516610595	&	0,842503781	&	0,272508291	&	0,144431607	&	0,590346591	&	0,977282226	&	0,232094746	\\
26	&	0,451671057	&	0,544948187	&	0,65781944	&	0,187156026	&	0,042672168	&	0,889729107	&	0,752058423	&	0,027599391	&	0,777417649	\\
27	&	0,879149574	&	0,911856388	&	0,134945963	&	0,391052413	&	0,418300516	&	0,481864471	&	0,783719419	&	0,400702755	&	0,936302642	\\
28	&	0,567436507	&	0,995890144	&	0,540943301	&	0,049734064	&	0,632905748	&	0,847661787	&	0,322440896	&	0,800759057	&	0,718193862	\\
29	&	0,665953915	&	0,104223221	&	0,274053057	&	0,301179091	&	0,645210734	&	0,643418117	&	0,965995418	&	0,999129176	&	0,533834653	\\
30	&	0,899272245	&	0,430188283	&	0,465774794	&	0,649539351	&	0,809528987	&	0,644614416	&	0,03887006	&	0,033638849	&	0,911700698	\\
31	&	0,940008316	&	0,138430411	&	0,778636702	&	0,837473579	&	0,995469104	&	0,183384494	&	0,820496428	&	0,989765565	&	0,243725312	\\
32	&	0,308493995	&	0,460830916	&	0,463738837	&	0,435957025	&	0,64590821	&	0,975566117	&	0,218943807	&	0,57920946	&	0,138645202	\\
33	&	0,029354566	&	0,952637565	&	0,673213552	&	0,119527742	&	0,362589472	&	0,25814974	&	0,260694083	&	0,282067299	&	0,687739163	\\
34	&	0,834404141	&	0,482590886	&	0,002857862	&	0,254633913	&	0,042483334	&	0,020952942	&	0,892646254	&	0,447622016	&	0,982613676	\\
35	&	0,512668682	&	0,620477926	&	0,987479824	&	0,424841407	&	0,878047689	&	0,733296724	&	0,602809952	&	0,691440658	&	0,156425792	\\
36	&	0,926656495	&	0,263132341	&	0,93578409	&	0,852496429	&	0,554809192	&	0,235038621	&	0,045828254	&	0,56589403	&	0,751126427	\\
37	&	0,749156149	&	0,993130577	&	0,732360942	&	0,167064335	&	0,822184862	&	0,300016749	&	0,690726437	&	0,973057807	&	0,108509156	\\
38	&	0,464686158	&	0,897064527	&	0,078529344	&	0,091964909	&	0,922372615	&	0,831279667	&	0,382455945	&	0,802596711	&	0,151158116	\\
39	&	0,239780548	&	0,092554563	&	0,100589128	&	0,780195003	&	0,562370713	&	0,417282814	&	0,858003797	&	0,006269686	&	0,503146932	\\
40	&	0,441541518	&	0,152978893	&	0,324815121	&	0,420191462	&	0,722242862	&	0,859372183	&	0,595288697	&	0,292375055	&	0,823143641	\\
41	&	0,060707334	&	0,04675086	&	0,841838868	&	0,117443671	&	0,975261069	&	0,619520222	&	0,444149607	&	0,555814937	&	0,592916308	\\
42	&	0,328688836	&	0,076239844	&	0,159990549	&	0,955348554	&	0,284409615	&	0,791296683	&	0,438752127	&	0,318119267	&	0,561730761	\\
43	&	0,42695644	&	0,591121294	&	0,786340938	&	0,778642535	&	0,992143986	&	0,228545646	&	0,451593777	&	0,444864005	&	0,829040373	\\
44	&	0,199470857	&	0,736101835	&	0,576730317	&	0,981188107	&	0,700045552	&	0,85355801	&	0,180218791	&	0,706125089	&	0,530777901	\\
45	&	0,589305571	&	0,175408604	&	0,052110445	&	0,546128329	&	0,05084049	&	0,667712864	&	0,9173299	&	0,564683352	&	0,979651498	\\
46	&	0,880392862	&	0,749140236	&	0,722326545	&	0,1776076	&	0,409299866	&	0,008413824	&	0,981865985	&	0,171963513	&	0,239995735	\\
47	&	0,960699985	&	0,730950197	&	0,893959311	&	0,104831423	&	0,933310452	&	0,950940936	&	0,127547799	&	0,561143175	&	0,651999485	\\
48	&	0,54745731	&	0,925996942	&	0,220511078	&	0,807207002	&	0,412479005	&	0,919948951	&	0,630550088	&	0,048027084	&	0,565749219	\\
49	&	0,141978728	&	0,839719276	&	0,840930733	&	0,573632039	&	0,210553233	&	0,734664787	&	0,177315757	&	0,36810953	&	0,187163369	\\
50	&	0,219136494	&	0,63158385	&	0,307877606	&	0,825538738	&	0,823084068	&	0,836478329	&	0,38660104	&	0,973387577	&	0,319958858	\\
51	&	0,046114581	&	0,866308212	&	0,078580041	&	0,426324032	&	0,109687241	&	0,548457356	&	0,008906781	&	0,232504351	&	0,624516972	\\
52	&	0,824415945	&	0,605991211	&	0,189288195	&	0,992303416	&	0,730025116	&	0,183716814	&	0,909738261	&	0,767193	&	0,354369825	\\
53	&	0,262460555	&	0,002530067	&	0,351880652	&	0,304773332	&	0,457597885	&	0,380455213	&	0,717804883	&	0,034925397	&	0,129684868	\\
54	&	0,795308305	&	0,425291171	&	0,111906457	&	0,654334142	&	0,132407165	&	0,720330607	&	0,713315569	&	0,255798271	&	0,26146416	\\
55	&	0,893536383	&	0,08085502	&	0,854704909	&	0,723727208	&	0,978329967	&	0,021833703	&	0,116985186	&	0,901257822	&	0,27373571	\\
56	&	0,519887542	&	0,676694549	&	0,669927421	&	0,351023355	&	0,275779783	&	0,591372966	&	0,651976083	&	0,450194951	&	0,290176951	\\
57	&	0,084419561	&	0,657491894	&	0,613382129	&	0,75649795	&	0,646061401	&	0,721074101	&	0,513490694	&	0,470837633	&	0,090473769	\\
58	&	0,854846362	&	0,364040332	&	0,822278379	&	0,904958388	&	0,593188396	&	0,666840665	&	0,334972053	&	0,176562623	&	0,828765663	\\
59	&	0,71458016	&	0,983072891	&	0,41677044	&	0,687364204	&	0,352305076	&	0,527978885	&	0,294389833	&	0,271325321	&	0,868856638	\\
60	&	0,072030211	&	0,409140723	&	0,323292958	&	0,630685269	&	0,039654108	&	0,53563699	&	0,801917505	&	0,217646271	&	0,961978431	\\
61	&	0,656311299	&	0,705420588	&	0,087770729	&	0,477120064	&	0,810851331	&	0,547340269	&	0,389635177	&	0,099803633	&	0,108740334	\\
62	&	0,741518818	&	0,821260391	&	0,774393218	&	0,992205243	&	0,571110967	&	0,837479217	&	0,370837244	&	0,18306951	&	0,429631054	\\
63	&	0,816429655	&	0,666609402	&	0,041733207	&	0,736826392	&	0,679522494	&	0,910036127	&	0,264233163	&	0,668835869	&	0,066696843	\\
64	&	0,979452361	&	0,182061474	&	0,142373711	&	0,092342407	&	0,108735959	&	0,732693453	&	0,913630047	&	0,048355888	&	0,171126148	\\
65	&	0,750554009	&	0,722577582	&	0,92864417	&	0,601539369	&	0,641307667	&	0,666492282	&	0,64533873	&	0,545064725	&	0,490876244	\\
66	&	0,560815243	&	0,566569493	&	0,134063933	&	0,843932539	&	0,101833329	&	0,459012064	&	0,350220312	&	0,253390613	&	0,647872519	\\
67	&	0,754939088	&	0,125649711	&	0,585993015	&	0,348378507	&	0,968039086	&	0,696089921	&	0,763640387	&	0,455612224	&	0,497836697	\\
68	&	0,374359216	&	0,278132754	&	0,513205862	&	0,272746935	&	0,10179335	&	0,589955846	&	0,04715551	&	0,585730192	&	0,42787873	\\
69	&	0,706245309	&	0,883369009	&	0,781822041	&	0,678936125	&	0,132531538	&	0,464305046	&	0,398677963	&	0,979836853	&	0,213935226	\\
70	&	0,580151958	&	0,164428935	&	0,194309049	&	0,309689085	&	0,269448493	&	0,104066692	&	0,920970719	&	0,387898999	&	0,722161208	\\
71	&	0,566392943	&	0,905795683	&	0,167971042	&	0,200655457	&	0,313801615	&	0,422104766	&	0,475728228	&	0,429536324	&	0,742613629	\\
72	&	0,35546886	&	0,67064041	&	0,838072045	&	0,229827859	&	0,3059112	&	0,786311288	&	0,687524848	&	0,444386093	&	0,914557832	\\
73	&	0,410416014	&	0,853084361	&	0,903697057	&	0,826437645	&	0,145217071	&	0,915086057	&	0,467674627	&	0,812987978	&	0,237336871	\\
74	&	0,530150402	&	0,284232756	&	0,679099865	&	0,849191373	&	0,047478651	&	0,705733115	&	0,265917823	&	0,448072853	&	0,440424253	\\
75	&	0,318129502	&	0,614803383	&	0,938344183	&	0,155430908	&	0,517246568	&	0,357726082	&	0,55346003	&	0,733579544	&	0,101366148	\\
76	&	0,472874306	&	0,964037308	&	0,331646448	&	0,771822488	&	0,358904693	&	0,316381938	&	0,011068697	&	0,804507997	&	0,212358462	\\
77	&	0,436738428	&	0,321590995	&	0,765297207	&	0,161754003	&	0,686960266	&	0,060312344	&	0,321991735	&	0,256242626	&	0,589793753	\\
78	&	0,266011642	&	0,636702257	&	0,482396665	&	0,281658641	&	0,978660312	&	0,200691365	&	0,063482616	&	0,865588328	&	0,400648273	\\
79	&	0,892058119	&	0,799941717	&	0,881679597	&	0,636506411	&	0,059931886	&	0,828530745	&	0,413616168	&	0,339120534	&	0,657209347	\\
80	&	0,988942038	&	0,169320304	&	0,282147505	&	0,026145658	&	0,381513511	&	0,582904282	&	0,91312474	&	0,029380566	&	0,336659174	\\
81	&	0,640209123	&	0,29826017	&	0,050950698	&	0,664049937	&	0,989117085	&	0,936775442	&	0,178042809	&	0,667703566	&	0,726566758	\\
82	&	0,819962153	&	0,972508638	&	0,804965657	&	0,418235977	&	0,467378251	&	0,504538972	&	0,817866915	&	0,456437759	&	0,05923774	\\
83	&	0,301248548	&	0,463481589	&	0,194633624	&	0,848919531	&	0,90298919	&	0,795401088	&	0,111106692	&	0,0109059	&	0,681643091	\\
84	&	0,551022488	&	0,538951401	&	0,721133113	&	0,979705853	&	0,121633889	&	0,789007797	&	0,167970424	&	0,999830629	&	0,170434932	\\
85	&	0,16222877	&	0,467194226	&	0,341824137	&	0,353207659	&	0,764181497	&	0,494878656	&	0,921633409	&	0,020966947	&	0,15207454	\\
86	&	0,646854153	&	0,063213986	&	0,922673301	&	0,135053196	&	0,036913222	&	0,987935	&	0,107284404	&	0,910233879	&	0,615053248	\\
87	&	0,444350327	&	0,715953772	&	0,204263677	&	0,419443004	&	0,178235713	&	0,42368539	&	0,522813436	&	0,315971567	&	0,160170385	\\
88	&	0,16690886	&	0,971338025	&	0,994227349	&	0,063755005	&	0,939457251	&	0,916598116	&	0,061524078	&	0,863521923	&	0,408483287	\\
89	&	0,625719508	&	0,085679752	&	0,880110162	&	0,202736121	&	0,533324216	&	0,830121825	&	0,90719488	&	0,761734086	&	0,836698808	\\
90	&	0,421283104	&	0,458034671	&	0,955671895	&	0,183495928	&	0,06664797	&	0,860016099	&	0,25922634	&	0,478163929	&	0,39738024	\\
91	&	0,410679293	&	0,411998692	&	0,908853291	&	0,609558877	&	0,676133627	&	0,022926995	&	0,271215187	&	0,356702728	&	0,549970608	\\
92	&	0,695183427	&	0,892805703	&	0,440404022	&	0,660878044	&	0,347134275	&	0,022554119	&	0,660732458	&	0,041280673	&	0,855839349	\\
93	&	0,975434255	&	0,033341492	&	0,934094237	&	0,754242673	&	0,013323826	&	0,06423705	&	0,520621734	&	0,520416649	&	0,107139668	\\
94	&	0,473789154	&	0,904068148	&	0,487018595	&	0,037355821	&	0,066754128	&	0,412221619	&	0,583572403	&	0,478281475	&	0,300460107	\\
95	&	0,053496837	&	0,784848113	&	0,718161308	&	0,698162994	&	0,502740669	&	0,172771394	&	0,601083782	&	0,19165562	&	0,687689889	\\
96	&	0,391046544	&	0,743950098	&	0,420207771	&	0,113290848	&	0,751931152	&	0,282437856	&	0,905756706	&	0,814772844	&	0,903890431	\\
97	&	0,512360848	&	0,048786774	&	0,198407195	&	0,30739711	&	0,605859562	&	0,209898133	&	0,895881936	&	0,020744665	&	0,417109473	\\
98	&	0,831513241	&	0,108627387	&	0,441663566	&	0,486124344	&	0,074482192	&	0,044614861	&	0,563898438	&	0,157640054	&	0,876449959	\\
99	&	0,596853226	&	0,798373287	&	0,475607515	&	0,690558138	&	0,474173302	&	0,332850167	&	0,026939022	&	0,305705706	&	0,887629548	\\
100	&	0,49996193	&	0,541537618	&	0,535530095	&	0,373723667	&	0,456195341	&	0,898729119	&	0,414300208	&	0,108082578	&	0,354516946	\\
\end{longtable}
\end{landscape}
 
\end{document}

Uwe

Uwe Ziegenhagen likes LaTeX and Python, sometimes even combined. Do you like my content and would like to thank me for it? Consider making a small donation to my local fablab, the Dingfabrik Köln. Details on how to donate can be found here Spenden für die Dingfabrik.

More Posts - Website

Menübefehl-Sequenzen mit LaTeX darstellen

Auf tex.stackexchange kam heute die Frage auf, wie man beliebig lange Menübefehl-Sequenzen mit LaTeX darstellen kann (http://tex.stackexchange.com/questions/40613/create-a-command-for-menu-sequences). Da ich dies auch gelegentlich benötige, hier eine Kopie der Lösung:

\documentclass{article}
\usepackage{etoolbox}% http://ctan.org/pkg/etoolbox
\begin{document}
\newcounter{menucount}\newcounter{curitem}% Counters
\newcommand{\menuitem}{\texttt}% Menu item formatting
\newcommand{\menusep}{\ensuremath{\rightarrow}}% Menu separator
\newcommand{\menuend}{\relax}% Menu end
\newcommand{\menulist}[1]{% \menulist{<menu list>}
  \setcounter{menucount}{0}\setcounter{curitem}{0}% Reset menucount & curitem
  \renewcommand*{\do}[1]{\stepcounter{menucount}}%
  \menulistparser{#1}% Count menu items
  \renewcommand*{\do}[1]{\menuitem{##1}\stepcounter{curitem}\ifnumless{\value{curitem}}{\value{menucount}}{\menusep}{\menuend}}%
  \menulistparser{#1}% Process list
}
\DeclareListParser{\menulistparser}{:}% List separator is ':'
 
\menulist{File:New:Class}% 3 menu items
 
\menulist{Tools:Options:Advanced:Properties:Document}% 5 menu items
 
\menulist{}% 0 menu items/empty list
 
\menulist{Help}% 1 menu item
 
\renewcommand{\menusep}{~\rule{1ex}{1ex}~}\renewcommand{\menuend}{!}% Different separator and end
\menulist{Your:Menu:Sequence:Here}
 
\end{document}

Nachtrag vom 23.03.2012:

Es geht sogar noch eleganter:

\documentclass[justified]{tufte-book}
\usepackage{lipsum}
\begin{document}
\def\spacer{\hspace{3pt}}
\def\test{}
%\def\test{\includegraphics[height=7pt]{./graphics/web/add.png}}
\def\alist{Dashboard, Content, Structure, Hello~yannis, Log Out, \test}
\makeatletter
\noindent\fbox{%
\begin{minipage}{9cm}
\noindent\colorbox{black}{\small
\@for \i:=\alist \do{\color{white}
  \texttt\i\spacer 
}}
\smallskip
\tiny \lipsum[1-2]
\end{minipage}}
\makeatother
\end{document}

Uwe

Uwe Ziegenhagen likes LaTeX and Python, sometimes even combined. Do you like my content and would like to thank me for it? Consider making a small donation to my local fablab, the Dingfabrik Köln. Details on how to donate can be found here Spenden für die Dingfabrik.

More Posts - Website