texmf: Reformat with tabs and more consistent style

master
Pierre Neidhardt 2014-11-12 17:32:36 +01:00
parent 9b96367918
commit 3b5e714c13
3 changed files with 168 additions and 160 deletions

View File

@ -21,10 +21,10 @@
\usepackage{ifthen}
\def\localedef#1#2{
\ifthenelse{\equal{\locale}{#1}}{
\usepackage[#2]{babel}
\expandafter\def\csname#1\endcsname ##1{##1}
\usepackage[#2]{babel}
\expandafter\def\csname#1\endcsname ##1{##1}
}{
\expandafter\def\csname#1\endcsname ##1{}}
\expandafter\def\csname#1\endcsname ##1{}}
}
%% Supported locales: en, fr.
@ -106,9 +106,9 @@
%% Gender commands.
\def\genderdef#1{
\ifthenelse{\equal{\gender}{#1}}{
\expandafter\def\csname#1\endcsname ##1{##1}
\expandafter\def\csname#1\endcsname ##1{##1}
}{
\expandafter\def\csname#1\endcsname ##1{}}
\expandafter\def\csname#1\endcsname ##1{}}
}
\genderdef{male}
@ -116,25 +116,25 @@
\genderdef{org}
\def\civility{%
\en{\male{M.}\female{Mrs.}}%
\fr{\male{Monsieur}\female{Madame}\org{Madame, Monsieur}}%
\en{\male{M.}\female{Mrs.}}%
\fr{\male{Monsieur}\female{Madame}\org{Madame, Monsieur}}%
}
%% Greetings toggle.
\def\greetings #1{}
\ifthenelse{
\equal{\gender}{org}
\equal{\gender}{org}
}{}{\def\greetings #1{#1}}
%% Day-of-week translation
\makeatletter
\fr{
\renewcommand\weekday{%
\ifcase\theeuk@date Samedi\or Dimanche\or Lundi\or
Mardi\or Mercredi\or Jeudi\or Vendredi\fi}
\newcommand\weekdaylower{%
\ifcase\theeuk@date samedi\or dimanche\or lundi\or
mardi\or mercredi\or jeudi\or vendredi\fi}
\renewcommand\weekday{%
\ifcase\theeuk@date Samedi\or Dimanche\or Lundi\or
Mardi\or Mercredi\or Jeudi\or Vendredi\fi}
\newcommand\weekdaylower{%
\ifcase\theeuk@date samedi\or dimanche\or lundi\or
mardi\or mercredi\or jeudi\or vendredi\fi}
}
\makeatother
@ -142,7 +142,7 @@
\usepackage[scale=0.8]{geometry}
% \en{\setlength{\parindent}{0pt}}
\fr{
\setlength{\parindent}{4ex}
\setlength{\parindent}{4ex}
}
\addtolength{\parskip}{6pt}
@ -169,21 +169,21 @@
\ifpdf
\usepackage[]{hyperref}
\hypersetup{
pdfauthor = \FileAuthor,
pdftitle = \FileTitle,
pdfsubject = \FileSubject,
%% pdfkeywords = \FileKeyWords,
pdfcreator = \LaTeX,
pdfproducer = \LaTeX,
pdftex,
pdfborder=0,
breaklinks,
baseurl=http://,
pdfpagemode=None,
pdfstartview=XYZ,
pdfstartpage=1,
colorlinks=true,
urlcolor=black
pdfauthor = \FileAuthor,
pdftitle = \FileTitle,
pdfsubject = \FileSubject,
%% pdfkeywords = \FileKeyWords,
pdfcreator = \LaTeX,
pdfproducer = \LaTeX,
pdftex,
pdfborder=0,
breaklinks,
baseurl=http://,
pdfpagemode=None,
pdfstartview=XYZ,
pdfstartpage=1,
colorlinks=true,
urlcolor=black
}
\else
\usepackage[dvips]{hyperref}
@ -199,18 +199,18 @@
\en{\hfill}
\begin{minipage}{\mpwidth}
\edef\fullname{\firstname{} \familyname{}}
\pinex{\fullname}{\textbf{\fullname}
\vspace{0.5em}\\
}
\small\itshape%
\pinex{\street}{\street \\}
\pinex{\city}{\postcode{} \city\pinex{\country}{ -- \country{}}
\vspace{0.5em}\\
}
\pinex{\mobile}{\Mobilefone~\mobile \\}
\pinex{\phone}{\Telefon~\phone \\}
\pinex{\mail}{\Letter~\href{mailto:\mail}{\mail}}
\edef\fullname{\firstname{} \familyname{}}
\pinex{\fullname}{\textbf{\fullname}
\vspace{0.5em}\\
}
\small\itshape%
\pinex{\street}{\street \\}
\pinex{\city}{\postcode{} \city\pinex{\country}{ -- \country{}}
\vspace{0.5em}\\
}
\pinex{\mobile}{\Mobilefone~\mobile \\}
\pinex{\phone}{\Telefon~\phone \\}
\pinex{\mail}{\Letter~\href{mailto:\mail}{\mail}}
\end{minipage}
\vspace{\baselineskip}
@ -221,15 +221,15 @@
\en{\noindent}%
\fr{\hfill}%
\begin{minipage}{\mpwidth}
\edef\recipientfullname{\recipientfirstname{} \recipientfamilyname}
\pinex{\recipientfullname}{\textbf{\recipientfullname}\\[0.5\baselineskip]}
\pinex{\recipientinstitute}{\recipientinstitute{}\\[0.5\baselineskip]}
\pinex{\recipientcity}{
{\small\itshape
\recipientstreet{} \\
\pine{\recipientpostcode} \recipientcity{} \\
}
}
\edef\recipientfullname{\recipientfirstname{} \recipientfamilyname}
\pinex{\recipientfullname}{\textbf{\recipientfullname}\\[0.5\baselineskip]}
\pinex{\recipientinstitute}{\recipientinstitute{}\\[0.5\baselineskip]}
\pinex{\recipientcity}{
{\small\itshape
\recipientstreet{} \\
\pine{\recipientpostcode} \recipientcity{} \\
}
}
\end{minipage}
%%==============================================================================
@ -241,18 +241,18 @@
\hfill
\begin{minipage}{\mpwidth}
\en{\today}
\fr{\city, le \weekdaylower\ \today}
\en{\today}
\fr{\city, le \weekdaylower\ \today}
\end{minipage}\\
%%==============================================================================
%% Object
%%==============================================================================
\pinex{\subject}{
\noindent
\textbf{\en{Object}\fr{Objet}~:}
\subject{}.
\vspace{1\baselineskip}
\noindent
\textbf{\en{Object}\fr{Objet}~:}
\subject{}.
\vspace{1\baselineskip}
}
@ -260,7 +260,7 @@
%% Content
%%==============================================================================
\greetings{
\en{Dear}\fr{\male{Cher}\female{Chère}} \civility{} \recipientfamilyname,
\en{Dear}\fr{\male{Cher}\female{Chère}} \civility{} \recipientfamilyname,
}
\noindent
@ -275,19 +275,19 @@ I thank you for your consideration; I am looking forward to hearing from you soo
\vfill
\en{
Best regards.
%% Yours sincerely,
Best regards.
%% Yours sincerely,
}
\fr{
%% Cordialement,
Veuillez agréer, \civility{}, l'expression de mes sentiments les meilleurs.
%% Cordialement,
Veuillez agréer, \civility{}, l'expression de mes sentiments les meilleurs.
}
\vspace{\baselineskip}
\hfill
\begin{minipage}{\mpwidth}
\textbf{\firstname\ \familyname}\newline
%\includegraphics[scale=0.75]{signature_blue}
\textbf{\firstname\ \familyname}\newline
%\includegraphics[scale=0.75]{signature_blue}
\end{minipage}
%%==============================================================================
@ -297,9 +297,9 @@ I thank you for your consideration; I am looking forward to hearing from you soo
\vfill
\noindent{
\scriptsize
\emph{\fr{Pièce(s) joint(es)~:}\en{Attachment:}}
Curriculum Vitæ
\scriptsize
\emph{\fr{Pièce(s) joint(es)~:}\en{Attachment:}}
Curriculum Vitæ
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

View File

@ -6,72 +6,80 @@
\newcounter{pieCounterTotal}
\newcommand{\pieslice}[3]{
\pgfmathparse{0.5*#1+0.5*#2}
\let\midangle\pgfmathresult
\pgfmathparse{0.5*#1+0.5*#2}
\let\midangle\pgfmathresult
\setcounter{pieSlicePercentage}{\p*100/\thepieCounterTotal}
\setcounter{pieSlicePercentage}{\p*100/\thepieCounterTotal}
% slice
\draw[thick,fill=#3!\thepieSlicePercentage] (0,0) -- (#1:1) arc (#1:#2:1) -- cycle;
% slice
\draw[thick,fill=#3!\thepieSlicePercentage] (0,0) -- (#1:1) arc (#1:#2:1) -- cycle;
}
\newcommand{\pieslicelabel}[3]{
\pgfmathparse{0.5*#1+0.5*#2}
\let\midangle\pgfmathresult
\pgfmathparse{0.5*#1+0.5*#2}
\let\midangle\pgfmathresult
\setcounter{pieSlicePercentage}{\p*100/\thepieCounterTotal}
\setcounter{pieSlicePercentage}{\p*100/\thepieCounterTotal}
% Outer label.
\pgfmathparse{min((#2-#1-10)/110*(-0.3),0)}
\let\temp\pgfmathresult
\pgfmathparse{max(\temp,-0.5) + 1.55}
\let\outerpos\pgfmathresult
\node at (\midangle:\outerpos) {\textbf{#3}};
% Outer label.
\pgfmathparse{min((#2-#1-10)/110*(-0.3),0)}
\let\temp\pgfmathresult
\pgfmathparse{max(\temp,-0.5) + 1.55}
\let\outerpos\pgfmathresult
\node at (\midangle:\outerpos) {\textbf{#3}};
% Inner label.
\pgfmathparse{min((#2-#1-10)/110*(-0.3),0)}
\let\temp\pgfmathresult
\pgfmathparse{max(\temp,-0.5) + 0.8}
\let\innerpos\pgfmathresult
% Inner label.
\pgfmathparse{min((#2-#1-10)/110*(-0.3),0)}
\let\temp\pgfmathresult
\pgfmathparse{max(\temp,-0.5) + 0.8}
\let\innerpos\pgfmathresult
\node at (\midangle:\innerpos) {\thepieSlicePercentage \%};
\node at (\midangle:\innerpos) {\thepieSlicePercentage \%};
}
\newcommand{\piechart}[3]{
\setcounter{pieCounterCurrent}{0}
\setcounter{pieCounterNext}{0}
\setcounter{pieCounterTotal}{0}
\setcounter{pieCounterCurrent}{0}
\setcounter{pieCounterNext}{0}
\setcounter{pieCounterTotal}{0}
\begin{center}
\begin{tikzpicture}[scale=#2]
\begin{center}
%% Get the total to turn the values into percentages.
\foreach \p/\t in {#3} {
\setcounter{pieCounterTotal}{\thepieCounterTotal+\p}
}
\begin{tikzpicture}[scale=#2]
%% Draw the slices.
\foreach \p/\t in {#3} {
\setcounter{pieCounterCurrent}{\value{pieCounterNext}}
\addtocounter{pieCounterNext}{\p}
\pieslice{\thepieCounterCurrent/\thepieCounterTotal*360}
{\thepieCounterNext/\thepieCounterTotal*360}
{#1}
}
%% Get the total to turn the values into percentages.
\foreach \p/\t in {#3} {
\setcounter{pieCounterTotal}{\thepieCounterTotal+\p}
}
\setcounter{pieCounterCurrent}{0}
\setcounter{pieCounterNext}{0}
%% Draw the slices.
\foreach \p/\t in {#3} {
\setcounter{pieCounterCurrent}{\value{pieCounterNext}}
\addtocounter{pieCounterNext}{\p}
\pieslice{
\thepieCounterCurrent/\thepieCounterTotal*360
}{
\thepieCounterNext/\thepieCounterTotal*360
}{
#1
}
}
%% Write the labels.
\foreach \p/\t in {#3}{
\setcounter{pieCounterCurrent}{\value{pieCounterNext}}
\addtocounter{pieCounterNext}{\p}
\pieslicelabel{\thepieCounterCurrent/\thepieCounterTotal*360}
{\thepieCounterNext/\thepieCounterTotal*360}
{\t}
}
\setcounter{pieCounterCurrent}{0}
\setcounter{pieCounterNext}{0}
\end{tikzpicture}
\end{center}
%% Write the labels.
\foreach \p/\t in {#3}{
\setcounter{pieCounterCurrent}{\value{pieCounterNext}}
\addtocounter{pieCounterNext}{\p}
\pieslicelabel{
\thepieCounterCurrent/\thepieCounterTotal*360
}{
\thepieCounterNext/\thepieCounterTotal*360
}{
\t
}
}
\end{tikzpicture}
\end{center}
}

View File

@ -1,54 +1,54 @@
% name: plot generator
\newcommand{\\${1}}[7]{
\begin{figure}[h!]
\caption{#1}
\begin{center}
\begin{tikzpicture}[scale=0.5,x=1cm,y=0.15cm]
\begin{figure}[h!]
\caption{#1}
\begin{center}
\begin{tikzpicture}[scale=0.5,x=1cm,y=0.15cm]
%% User parameters.
\def\xmin{0}
\def\xmax{10}
\def\ymin{0}
\def\ymax{60}
\def\xstep{1}
\def\ystep{10}
%% User parameters.
\def\xmin{0}
\def\xmax{10}
\def\ymin{0}
\def\ymax{60}
\def\xstep{1}
\def\ystep{10}
%% Grid
\draw[style=help lines, ystep=\ystep, xstep=\xstep] (\xmin,\ymin) grid
(\xmax,\ymax);
%% Grid
\draw[style=help lines, ystep=\ystep, xstep=\xstep] (\xmin,\ymin) grid
(\xmax,\ymax);
%% Axes
\draw[->] (\xmin,\ymin) -- (\xmax+0.5*\xstep,\ymin)
node[below,yshift=-1em] {#2};
%% Axes
\draw[->] (\xmin,\ymin) -- (\xmax+0.5*\xstep,\ymin)
node[below,yshift=-1em] {#2};
\draw[->] (\xmin,\ymin) -- (\xmin,\ymax+0.5*\ystep)
node[above] {#3};
\draw[->] (\xmin,\ymin) -- (\xmin,\ymax+0.5*\ystep)
node[above] {#3};
%% xticks and yticks
\foreach \x in {\xmin,\xstep,...,\xmax}
\node at (\x, \ymin) [below] {\x};
\foreach \y in {\ymin,\ystep,...,\ymax}
\node at (\xmin,\y) [left] {\y};
%% xticks and yticks
\foreach \x in {\xmin,\xstep,...,\xmax}
\node at (\x, \ymin) [below] {\x};
\foreach \y in {\ymin,\ystep,...,\ymax}
\node at (\xmin,\y) [left] {\y};
%% DATA
%% Example from file.
%% Smooth the curve and mark the data point with a dot.
%% Data should be stored as
%% x1 y1
%% x2 y2
% \draw[color=blue]
% plot[smooth,mark=*,mark size=1pt, id=iter_sorted]
% file {#5}
% node [right] {#4};
%% DATA
%% Example from file.
%% Smooth the curve and mark the data point with a dot.
%% Data should be stored as
%% x1 y1
%% x2 y2
% \draw[color=blue]
% plot[smooth,mark=*,mark size=1pt, id=iter_sorted]
% file {#5}
% node [right] {#4};
%% Example trendline
%% \draw[color=orange,domain=\xmin+\xstep:\xmax]
%% plot[smooth, raw gnuplot, id=trend3]
%% function{f(x)=a*x*log(x)+b; fit f(x) '#5' via a,b; plot f(x)}
%% node [right,yshift=1em] {$\alpha_1 \cdot n\cdot \log(n) + \beta_1$};
$0
\end{tikzpicture}
\end{center}
\end{figure}
%% Example trendline
%% \draw[color=orange,domain=\xmin+\xstep:\xmax]
%% plot[smooth, raw gnuplot, id=trend3]
%% function{f(x)=a*x*log(x)+b; fit f(x) '#5' via a,b; plot f(x)}
%% node [right,yshift=1em] {$\alpha_1 \cdot n\cdot \log(n) + \beta_1$};
$0
\end{tikzpicture}
\end{center}
\end{figure}
}