我一直试图通过我找到的 GNU SF 模板来生成我的每周时间表。因为我是希腊人,所以我希望时间表中的文本是希腊语。
我使用的模板是Pascal Gwosdek 的timetable.sty 包,它生成美观的每周时间表,如下所示:
问题开始出现当我尝试将包中的日期改为希腊字母时timetables.sty
,如下所示:
\newcommand{\greekdays}[1]
{
% Arguments: <number of start day>
% Macro for the greek week days
% added by dsfounis
\setcounter{@day}{#1}
\@ttforloop{@column}{1}{\value{@column} < \value{@colcount}}
{
\ifthenelse{\equal{\value{@day}}1}{\daymark{Δευτέρα}}{}
\ifthenelse{\equal{\value{@day}}2}{\daymark{Τρίτη}}{}
\ifthenelse{\equal{\value{@day}}3}{\daymark{Τετάρτη}}{}
\ifthenelse{\equal{\value{@day}}4}{\daymark{Πέμπτη}}{}
\ifthenelse{\equal{\value{@day}}5}{\daymark{Friday}}{}
\ifthenelse{\equal{\value{@day}}6}{\daymark{Saturday}}{}
\ifthenelse{\equal{\value{@day}}7}{\daymark{Sunday}}{}
\stepcounter{@day}
\ifthenelse{\value{@day} > 7}{\addtocounter{@day}{-7}}{}
}
}
结果:
我已经确定了为时间表的大部分元素设置字体的行是这些:
% SansSerif font
\newcommand{\timetablefont}{\sffamily}
\newcommand{\@ttfont}{\timetablefont\selectfont}
有没有什么方法可以正确显示 \sffamily 中的希腊字符?我以为 Computer Modern Sans Serif 包含希腊符号。
我还可以将字体更改为 Ubuntu basic,它适合时间表并且看起来不错,但我不知道如何通过以上两行来做到这一点。
最小工作示例(除 /greekdays 命令重写之外的默认模板)
.tex
:
\documentclass[a4paper,10pt]{report}
% Definitions
\usepackage{pdflscape}
\usepackage[height=25cm]{geometry}
\usepackage{timetable}
\begin{document}
\thispagestyle{empty}
\begin{landscape}
\printheading{Stundenplan 6. Semester}
% Define the layout of your time tables
\setslotsize{3.8cm}{0.3cm}
\setslotcount {5} {36}
\settextframe{0.8mm}
\setbottomstyle{\tiny}
\setbottomspace{1pt}
\setprinttimestamps{2}
\setframetype[t]{1}
\seteventcornerradius{0pt}
\definecolor{ttframecol2}{rgb}{0.9,0.9,0.9}
% Define event types
\defineevent{corelecture}{0.0} {0.28}{1.0} {1.0}{1.0}{1.0}
\defineevent{seminar} {1.0} {0.4} {0.2} {1.0}{1.0}{1.0}
\defineevent{langcourse} {1.0} {0.4} {0.2} {1.0}{1.0}{1.0}
\defineevent{tutorial} {0.6} {0.8} {1.0} {1.0}{1.0}{1.0}
\defineevent{work} {0.21}{0.5} {0.16}{1.0}{1.0}{1.0}
% Start the time table
\begin{timetable}
\hours{9}{15}{0}
\greekdays{1} %MARKER
\event 1 {1415} {1600} {Data Networks Lecture} {Druschel} {E1{\tiny3} 002} {corelecture}
\event 1 {1615} {1800} {Tutorial SysArch} {Gwosdek} {E1{\tiny3} SR014} {work}
\event 2 {0915} {1100} {Embedded Systems Lecture} {Finkbeiner} {E1{\tiny3} 003} {corelecture}
\event 2 {1115} {1300} {Differential Equations in IPCV Lecture} {Weickert} {E1{\tiny3} 001} {corelecture}
\event 2 {1415} {1600} {Office Hour SysArch} {Gwosdek} {E1{\tiny1} HaDePra} {work}
\event 3 {1415} {1600} {Data Networks Lecture} {Druschel} {E1{\tiny3} 002} {corelecture}
\event 3 {1615} {1800} {Numerical Algorithms in Image Analysis} {Bruhn, Weickert} {E1{\tiny1} 3.06} {seminar}
\event 4 {0915} {1100} {Embedded Systems Lecture} {Finkbeiner} {E1{\tiny3} 003} {corelecture}
\event 4 {1115} {1300} {Tutorial SysArch} {Gwosdek} {E1{\tiny3} SR014} {work}
\event 5 {1000} {1100} {Bremser Meeting} {SysArch United} {E1{\tiny3}} {work}
\event 5 {1115} {1300} {Differential Equations in IPCV Lecture} {Weickert} {E1{\tiny3} 001} {corelecture}
\end{timetable}
\end{landscape}
\end{document}
timetable.sty
% timetable.sty - The LaTeX timetable stylesheet V1.4
% http://www.planetk.de/index.php?title=Stundenplan
%
% Copyright (C) 2007-2009 Pascal Gwosdek
% Modifications (C) 2008 Daniel Bader
%
% This program is free software; you can redistribute it and/or modify it
% 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 program 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 program; if not, see <http://www.gnu.org/licenses/>.
%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{timetable}
\RequirePackage{ifthen, calc, color}
% Preset the colors
\definecolor{ttframecol1}{rgb}{0.8,0.8,0.8}
\definecolor{ttframecol2}{rgb}{0.7,0.7,0.7}
\definecolor{ttfontcolor}{rgb}{0.0,0.0,0.0}
\definecolor{ttlinecol1}{rgb}{0.0,0.0,0.0}
\definecolor{ttlinecol2}{rgb}{0.0,0.0,0.0}
% Simple for loop construct as proposed by N. Setzer
\newcommand{\@ttforloop}[5][1]
{
\setcounter{#2}{#3}
\ifthenelse{#4}
{
#5
\addtocounter{#2}{#1}
\@ttforloop[#1]{#2}{\value{#2}}{#4}{#5}
}
{}
}
% SansSerif font
\newcommand{\timetablefont}{\sffamily}
\newcommand{\@ttfont}{\timetablefont\selectfont}
% Dimensions
\newlength{\@rowheight}
\newlength{\@colwidth}
\newcounter{@rowcount}
\newcounter{@colcount}
\newlength{\@textframe}
\newlength{\@bottomspace}
\newlength{\@totalheight}
\newlength{\@totalwidth}
\newlength{\@toprowheight}
% Arbitrary stuff
\newcounter{@timemarks}
\newcounter{@daymarks}
\newcounter{@topheight}
\newcounter{@printtimestamps}
\newlength{\@cornerradius}
\newcounter{@frametype}
\newcounter{@framevalign}
% Predefines
\setlength{\@cornerradius}{3pt}
\setcounter{@frametype}2
\setcounter{@framevalign}2
\setlength{\@rowheight}{1.2cm}
\setlength{\@colwidth}{2.8cm}
\setlength{\@textframe}{0.8mm}
\setlength{\@bottomspace}{8pt}
\setcounter{@rowcount}9
\setcounter{@colcount}5
\setcounter{@topheight}{2}
\setcounter{@printtimestamps}{0}
\newcommand{\@bottomstyle}{\scriptsize}
\newcommand{\@timestyle}{\tiny}
% Event declarations
\newlength{\@startposx}
\newlength{\@startposy}
\newlength{\@eventheight}
\newlength{\@newcolwidth}
\newlength{\@newrowheight}
\newlength{\@newcolleft}
\newlength{\@newrowtop}
% Helpers
\newcounter{@hourslot}
\newcounter{@durationslots}
\newcounter{@minutesperslot}
\newcounter{@timetablehelp}
\newcounter{@day}
\newcounter{@column}
\newcounter{@row}
\newcounter{@hour}
\newcounter{@minute}
\newcounter{@minuteStep}
\newcounter{@startHour}
\newcounter{@startMinute}
\newcounter{@endHour}
\newcounter{@endMinute}
\newcounter{@hoursset}
\setcounter{@hoursset}{0}
\newcounter{@hourzero}
\newcommand{\seteventcornerradius}[1]
{
\setlength{\@cornerradius}{#1}
\ifthenelse{\strip@pt\@cornerradius > 7}
{
\setlength{\@cornerradius}{7pt}
}
{
\ifthenelse{\strip@pt\@cornerradius < 0}
{
\setlength{\@cornerradius}{0pt}
}
{}
}
}
\newcommand{\settopheight}[1]
{
\addtocounter{@rowcount}{#1-\value{@topheight}}
\setcounter{@topheight}{#1}
}
\newcommand{\setframetype}[2][c]
{
% Set frame type
\ifthenelse{#2 < 1}
{
% Lines
\setcounter{@frametype}{1}
}
{
\ifthenelse{#2 > 2}
{
% Checkerboard
\setcounter{@frametype}{2}
}
{
\setcounter{@frametype}{#2}
}
}
% Caption vertical alignment
\ifthenelse{\equal{#1}{b}}
{\setcounter{@framevalign}{1}}
{\ifthenelse{\equal{#1}{t}}
{\setcounter{@framevalign}{0}}
{\setcounter{@framevalign}{2}}
}
}
\newcommand{\setprinttimestamps}[1]
{
\setcounter{@printtimestamps}{#1}
}
\newcommand{\setbottomstyle}[1]
{
\renewcommand{\@bottomstyle}{#1}
}
\newcommand{\settimestyle}[1]
{
\renewcommand{\@timestyle}{#1}
}
\newcommand{\setbottomspace}[1]
{
\setlength{\@bottomspace}{#1}
}
\newcommand{\@fmtTime}[2]
{
% Arguments: {hour}{minute}
\ifthenelse{\value{#1} < 10}{0}{}\arabic{#1}:\ifthenelse{\value{#2} < 10}{0}{}\arabic{#2}
}
\newcommand{\slotevent}[7]
{
% Arguments: {x}{y}{duration}{title}{lecturer}{place}{type}{textcolor}
\renewcommand{\baselinestretch}{0.75}\normalsize
\setlength{\@startposx}{#1\@colwidth+0.5pt}
\setlength{\@startposy}{-#2\@rowheight-1.5pt}
\setlength{\@eventheight}{#3\@rowheight-1pt}
\addtolength{\@startposy}{-\@eventheight}
\addtolength{\@startposx}{\@cornerradius}
\put(\strip@pt\@startposx,\strip@pt\@startposy){\textcolor{@timetable#7block}{\rule[-\dp\strutbox]{\@colwidth-1pt-2\@cornerradius}{\@eventheight}}}
\addtolength{\@startposx}{-\@cornerradius}
\addtolength{\@startposy}{\@cornerradius}
\put(\strip@pt\@startposx,\strip@pt\@startposy){\textcolor{@timetable#7block}{\rule[-\dp\strutbox]{\@colwidth-1pt}{\@eventheight-2\@cornerradius}}}
\addtolength{\@startposy}{-\@cornerradius}
\setlength{\@cornerradius}{2\@cornerradius}
\ifthenelse{\strip@pt\@cornerradius > 0}
{
% Left rounded corners
\addtolength{\@startposx}{.5\@cornerradius}
\addtolength{\@startposy}{.5\@cornerradius-\dp\strutbox}
\put(\strip@pt\@startposx,\strip@pt\@startposy){\textcolor{@timetable#7block}{\circle*{\strip@pt\@cornerradius}}}
\addtolength{\@startposy}{-.5\@cornerradius+\dp\strutbox}
\addtolength{\@startposy}{-.5\@cornerradius-\dp\strutbox+\@eventheight}
\put(\strip@pt\@startposx,\strip@pt\@startposy){\textcolor{@timetable#7block}{\circle*{\strip@pt\@cornerradius}}}
\addtolength{\@startposy}{.5\@cornerradius+\dp\strutbox-\@eventheight}
\addtolength{\@startposx}{-.5\@cornerradius}
% Right rounded corners
\addtolength{\@startposx}{-.5\@cornerradius+\@colwidth-1pt}
\addtolength{\@startposy}{.5\@cornerradius-\dp\strutbox}
\put(\strip@pt\@startposx,\strip@pt\@startposy){\textcolor{@timetable#7block}{\circle*{\strip@pt\@cornerradius}}}
\addtolength{\@startposy}{-.5\@cornerradius+\dp\strutbox}
\addtolength{\@startposy}{-.5\@cornerradius-\dp\strutbox+\@eventheight}
\put(\strip@pt\@startposx,\strip@pt\@startposy){\textcolor{@timetable#7block}{\circle*{\strip@pt\@cornerradius}}}
\addtolength{\@startposy}{.5\@cornerradius+\dp\strutbox-\@eventheight}
\addtolength{\@startposx}{.5\@cornerradius-\@colwidth-1pt}
}{}
\setlength{\@cornerradius}{0.5\@cornerradius}
\setlength{\@newrowheight}{\@rowheight}
\addtolength{\@newrowheight}{-2\@textframe-1pt}
\setlength{\@newcolwidth}{\@colwidth}
\addtolength{\@newcolwidth}{-2\@textframe-1pt}
\setlength{\@newrowtop}{-#2\@rowheight}
\addtolength{\@newrowtop}{-2\@textframe}
\setlength{\@newcolleft}{#1\@colwidth+.5pt}
\addtolength{\@newcolleft}{\@textframe}
\ifthenelse{\value{@hoursset} = 0}{\setcounter{@printtimestamps}{0}}{}
% Title
\addtolength{\@newrowtop}{-1pt}
\put(\strip@pt\@newcolleft,\strip@pt\@newrowtop)
{\begin{minipage}[t]{\@newcolwidth}%
\@ttfont\raggedright\color{@timetable#7text}%
\ifthenelse{\value{@printtimestamps} > 0}%
{{\@timestyle \@fmtTime{@startHour}{@startMinute}}%
\ifthenelse{\value{@printtimestamps} = 2}%
{{\@timestyle -- \@fmtTime{@endHour}{@endMinute}}}%
{}%
\\}%
{}%
{#4}%
\end{minipage}}
\addtolength{\@newrowtop}{1pt}
\renewcommand{\baselinestretch}{0.5}\normalsize
\setlength{\@newrowtop}{-#2\@rowheight-#3\@rowheight}
\addtolength{\@newrowtop}{2\@textframe + \@bottomspace}
% Lecturer
\put(\strip@pt\@newcolleft,\strip@pt\@newrowtop)
{\begin{minipage}[t]{0.6\@newcolwidth}%
\@ttfont\raggedright\color{@timetable#7text}{\@bottomstyle #5%
\vphantom{A}}
\ifthenelse{\value{@printtimestamps} = 1}%
{{\@timestyle \@fmtTime{@endHour}{@endMinute}}}%
{}%
\end{minipage}}
\setlength{\@newcolleft}{#1\@colwidth + \@colwidth}
\addtolength{\@newcolleft}{-\@textframe-0.4\@newcolwidth}
% Location
\put(\strip@pt\@newcolleft,\strip@pt\@newrowtop)
{\begin{minipage}[t]{0.4\@newcolwidth}%
\@ttfont\raggedleft\color{@timetable#7text}{\@bottomstyle #6%
\vphantom{A}}%
\end{minipage}}
\renewcommand{\baselinestretch}{1.0}\normalsize
}
\newcommand{\event}[7]
{
% Arguments: {@day}{@start}{@end}{title}{lecturer}{place}{type}
% Use the time format, if hours are defined, and a slot number otherwise:
\ifthenelse{\value{@hoursset} > 0}
{
\setcounter{@startHour}{#2 / 100}
\setcounter{@startMinute}{#2 - #2 / 100 * 100}
\setcounter{@endHour}{#3 / 100}
\setcounter{@endMinute}{#3 - #3 / 100 * 100}
\setcounter{@hourslot}{((#2 - \value{@hourzero}) / 100 * (60 / \value{@minutesperslot})) + 2 + ((#2 - #2 / 100 * 100) / \value{@minutesperslot})}
\setcounter{@durationslots}{((#3 - \value{@hourzero}) / 100 * (60 / \value{@minutesperslot})) + 2 + ((#3 - #3 / 100 * 100) / \value{@minutesperslot}) - \value{@hourslot}}
% Compensate for 24h wrap
\ifthenelse{\value{@hourslot} < 0}{\addtocounter{@hourslot}{(24 * (60 / \value{@minutesperslot}))}}{}
\addtocounter{@hourslot}{\value{@topheight}-2}
}
{
\setcounter{@hourslot}{#2}
\setcounter{@durationslots}{#3-#2}
}
\slotevent{#1}{\value{@hourslot}}{\value{@durationslots}}{#4}{#5}{#6}{#7}
}
\newcommand{\legend}[3]
{
% Arguments: <horizontal> <vertical> <text>
% Lets you manually set slot contents (use this really rarely and
% SEE: \daymark, \timemark )
\setlength{\@newrowtop}{\@rowheight*(-#2+1)-\dp\strutbox}
\setlength{\@newcolleft}{#1\@colwidth-\@colwidth}
\ifthenelse{\value{@hoursset} = 0}
{\setcounter{@minutesperslot}{60}}
{}
% Select frame type
\ifthenelse{\value{@frametype} = 1}
{ % Lines
\ifthenelse{#1 = 1}{\put(\strip@pt\@newcolleft,\strip@pt\@newrowtop){\textcolor{ttframecol2}{\rule{\@colwidth}{1pt}}}}{}
\addtolength{\@newrowtop}{-\value{@topheight}\@rowheight}
\addtolength{\@newcolleft}{-1pt}
\ifthenelse{#2 = 1}{\put(\strip@pt\@newcolleft,\strip@pt\@newrowtop){\textcolor{ttframecol2}{\rule{1pt}{\value{@topheight}\@rowheight}}}}{}
\addtolength{\@newcolleft}{1pt}
\addtolength{\@newrowtop}{\value{@topheight}\@rowheight}
}
{ % Checkerboard
% Horizontal stripe
\ifthenelse{#2 = 1}
{\setcounter{@timetablehelp}{#1 * \real{0.5} * \real{2.0}}
\ifthenelse{\value{@timetablehelp} = #1}
{\addtolength{\@newrowtop}{-\value{@topheight}\@rowheight}
\put(\strip@pt\@newcolleft,\strip@pt\@newrowtop)
{\textcolor{ttframecol2}{\rule{\@colwidth}{\value{@topheight}\@rowheight}}}
\addtolength{\@newrowtop}{\value{@topheight}\@rowheight}
}
{}
}
{}
% Vertical stripe
\ifthenelse{#1 = 1}
{\setcounter{@timetablehelp}{(((#2-\value{@topheight}-1) * \value{@minutesperslot} / 120) * 2) - ((#2-\value{@topheight}-1) * \value{@minutesperslot} / 60)}
\ifthenelse{\value{@timetablehelp} = 0}
{\setcounter{@timetablehelp}{60 / \value{@minutesperslot}}
\addtolength{\@newrowtop}{-\value{@timetablehelp}\@rowheight}
\put(\strip@pt\@newcolleft,\strip@pt\@newrowtop)
{\textcolor{ttframecol2}{\rule{\@colwidth}{\value{@timetablehelp}\@rowheight}}}
\addtolength{\@newrowtop}{\value{@timetablehelp}\@rowheight}
}
{}
}
{}
}
% Print text
\addtolength{\@newcolleft}{\@textframe}
\addtolength{\@newrowtop}{-\@textframe-\heightof{\large #3}}
% Optionally move caption to middle or bottom
\ifthenelse{\value{@framevalign} > 0}
{
\ifthenelse{#1 = 1}
{
\addtolength{\@newrowtop}{(- \@rowheight * (60 / \value{@minutesperslot}) + 2\@textframe + \heightof{\Large #3})/\value{@framevalign}}
}
{
\ifthenelse{#2 = 1}
{
\addtolength{\@newrowtop}{(- \value{@topheight}\@rowheight + 2\@textframe + \heightof{\Large #3})/\value{@framevalign}}
}{}
}
}{}
\put(\strip@pt\@newcolleft,\strip@pt\@newrowtop){\makebox{\textcolor{ttfontcolor}{\@ttfont\large #3}}}
}
\newcommand{\timemark}[1]
{
\stepcounter{@timemarks}
\legend 1 {\value{@timemarks}} {#1}
}
\newcommand{\daymark}[1]
{
\stepcounter{@daymarks}
\legend {\value{@daymarks}} 1 {#1}
}
\newcommand{\defineevent}[7]
{
\definecolor{@timetable#1block}{rgb}{#2, #3, #4}
\definecolor{@timetable#1text} {rgb}{#5, #6, #7}
}
\newcommand{\printheading}[1]
{
{\@ttfont\LARGE #1}\par\vspace{5mm}\par
}
\newcommand{\setslotsize}[2]
{
% Arguments: <width> <height>
% Defines the slot size
\setlength{\@rowheight}{#2}
\setlength{\@colwidth}{#1}
}
\newcommand{\setslotcount}[2]
{
% Arguments: <days> <hours per day>
% Defines the number of slots in both dimensions
\setcounter{@colcount}{#1}
\setcounter{@rowcount}{#2+\value{@topheight}}
\stepcounter{@colcount}
}
\newcommand{\settextframe}[1]
{
% Arguments: <width>
% Defines the width of the border of each entry (i.e. the
% distance between outer border and text)
\setlength{\@textframe}{#1}
}
\newcommand{\hours}[3]
{
% Arguments: <start hour> <minute stepping> <print end time?>
% Automatically sets the time slots to full hours, beginning with <start hour>
\setcounter{@hoursset}{1}
\setcounter{@hourzero}{(#1 * 100)}
\setcounter{@hour}{#1}
\setcounter{@minute}{0}
\setcounter{@minuteStep}{#2}
\setcounter{@minutesperslot}{\value{@minuteStep}}
\@ttforloop{@row}{\value{@topheight}}{\value{@row} < \value{@rowcount}}
{
\ifthenelse{\value{@minute} = 0}{
\timemark{\@fmtTime{@hour}{@minute}\ifthenelse{#3 > 0}{-\setcounter{@hour}{\value{@hour}+1}\@fmtTime{@hour}{@minute}\setcounter{@hour}{\value{@hour}-1}}{}}
}{\stepcounter{@timemarks}}
\addtocounter{@minute}{#2}
\ifthenelse{\value{@minute} = 60}{\stepcounter{@hour}\setcounter{@minute}{0}}{}
\ifthenelse{\value{@hour} > 23}{\addtocounter{@hour}{-24}}{}
}
}
\newcommand{\englishdays}[1]
{
% Arguments: <number of start day>
% Macro for the english week days
\setcounter{@day}{#1}
\@ttforloop{@column}{1}{\value{@column} < \value{@colcount}}
{
\ifthenelse{\equal{\value{@day}}1}{\daymark{Monday}}{}
\ifthenelse{\equal{\value{@day}}2}{\daymark{Tuesday}}{}
\ifthenelse{\equal{\value{@day}}3}{\daymark{Wednesday}}{}
\ifthenelse{\equal{\value{@day}}4}{\daymark{Thursday}}{}
\ifthenelse{\equal{\value{@day}}5}{\daymark{Friday}}{}
\ifthenelse{\equal{\value{@day}}6}{\daymark{Saturday}}{}
\ifthenelse{\equal{\value{@day}}7}{\daymark{Sunday}}{}
\stepcounter{@day}
\ifthenelse{\value{@day} > 7}{\addtocounter{@day}{-7}}{}
}
}
\newcommand{\germandays}[1]
{
% Arguments: <number of start day>
% Macro for the english week days
\setcounter{@day}{#1}
\@ttforloop{@column}{1}{\value{@column} < \value{@colcount}}
{
\ifthenelse{\equal{\value{@day}}1}{\daymark{Montag}}{}
\ifthenelse{\equal{\value{@day}}2}{\daymark{Dienstag}}{}
\ifthenelse{\equal{\value{@day}}3}{\daymark{Mittwoch}}{}
\ifthenelse{\equal{\value{@day}}4}{\daymark{Donnerstag}}{}
\ifthenelse{\equal{\value{@day}}5}{\daymark{Freitag}}{}
\ifthenelse{\equal{\value{@day}}6}{\daymark{Samstag}}{}
\ifthenelse{\equal{\value{@day}}7}{\daymark{Sonntag}}{}
\stepcounter{@day}
\ifthenelse{\value{@day} > 7}{\addtocounter{@day}{-7}}{}
}
}
\newcommand{\greekdays}[1]
{
% Arguments: <number of start day>
% Macro for the greek week days
% added by dsfounis
\setcounter{@day}{#1}
\@ttforloop{@column}{1}{\value{@column} < \value{@colcount}}
{
\ifthenelse{\equal{\value{@day}}1}{\daymark{Δευτέρα}}{}
\ifthenelse{\equal{\value{@day}}2}{\daymark{Τρίτη}}{}
\ifthenelse{\equal{\value{@day}}3}{\daymark{Τετάρτη}}{}
\ifthenelse{\equal{\value{@day}}4}{\daymark{Πέμπτη}}{}
\ifthenelse{\equal{\value{@day}}5}{\daymark{Friday}}{}
\ifthenelse{\equal{\value{@day}}6}{\daymark{Saturday}}{}
\ifthenelse{\equal{\value{@day}}7}{\daymark{Sunday}}{}
\stepcounter{@day}
\ifthenelse{\value{@day} > 7}{\addtocounter{@day}{-7}}{}
}
}
\newenvironment{timetable}%
{\noindent%
% Arguments: None
% Starts a new timetable
%
% Set the new layout setting
\setlength{\@totalheight}{-\value{@rowcount}\@rowheight}%
\setlength{\@totalwidth}{\value{@colcount}\@colwidth}%
%
% Reset the counters
\setcounter{@timemarks}{\value{@topheight}}%
\setcounter{@daymarks}{1}%
%
% Minipage to correct bounding box
\begin{minipage}[t][-\@totalheight]{\@totalwidth}
%
% Begin. Note the offset hack of the picture, this is to make it consistent to the old pstricks package.
\begin{picture}(\strip@pt\@totalwidth,\strip@pt\@totalheight)(0,-\strip@pt\baselineskip)
% Draw the grey frame
\put(0,\strip@pt\@totalheight){\textcolor{ttframecol1}{\rule[-\dp\strutbox]{\@colwidth}{-\@totalheight}}}
\setlength{\@toprowheight}{\value{@topheight}\@rowheight}
\put(0,-\strip@pt\@toprowheight){\textcolor{ttframecol1}{\rule[-\dp\strutbox]{\@totalwidth}{\@toprowheight}}}
}
{
% Draw the contours
% Inner
\addtolength{\@colwidth}{-1pt}
\put(\strip@pt\@colwidth,-\strip@pt\@toprowheight){\textcolor{ttlinecol2}{\rule[-\dp\strutbox]{\@totalwidth-\@colwidth+1pt}{1pt}}}
\put(\strip@pt\@colwidth,\strip@pt\@totalheight){\textcolor{ttlinecol2}{\rule[-\dp\strutbox]{1pt}{-\@totalheight-\@toprowheight}}}
\addtolength{\@colwidth}{1pt}
% Outer
\put(0,0){\textcolor{ttlinecol1}{\rule[-\dp\strutbox]{\@totalwidth}{1pt}}}
\put(0,\strip@pt\@totalheight){\textcolor{ttlinecol1}{\rule[-\dp\strutbox]{1pt}{-\@totalheight}}}
\put(\strip@pt\@totalwidth,\strip@pt\@totalheight){\textcolor{ttlinecol1}{\rule[-\dp\strutbox]{1pt}{-\@totalheight+1pt}}}
\addtolength{\@totalheight}{-0.5pt}
\put(0,\strip@pt\@totalheight){\textcolor{ttlinecol1}{\rule[-\dp\strutbox]{\@totalwidth}{1pt}}}
\addtolength{\@totalheight}{0.5pt}
\end{picture}
\end{minipage}
}
答案1
首先,您必须添加对希腊语的支持。最简单的方法是使用babel
:
\documentclass[a4paper,10pt]{report}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[greek,english]{babel}
% Definitions
\usepackage{pdflscape}
\usepackage[height=25cm]{geometry}
\usepackage{timetable}
\begin{document}
\thispagestyle{empty}
\begin{landscape}
\printheading{Stundenplan 6. Semester}
% Define the layout of your time tables
\setslotsize{3.8cm}{0.3cm}
\setslotcount {5} {36}
\settextframe{0.8mm}
\setbottomstyle{\tiny}
\setbottomspace{1pt}
\setprinttimestamps{2}
\setframetype[t]{1}
\seteventcornerradius{0pt}
\definecolor{ttframecol2}{rgb}{0.9,0.9,0.9}
% Define event types
\defineevent{corelecture}{0.0} {0.28}{1.0} {1.0}{1.0}{1.0}
\defineevent{seminar} {1.0} {0.4} {0.2} {1.0}{1.0}{1.0}
\defineevent{langcourse} {1.0} {0.4} {0.2} {1.0}{1.0}{1.0}
\defineevent{tutorial} {0.6} {0.8} {1.0} {1.0}{1.0}{1.0}
\defineevent{work} {0.21}{0.5} {0.16}{1.0}{1.0}{1.0}
% Start the time table
\begin{timetable}
\hours{9}{15}{0}
\greekdays{1} %MARKER
\event 1 {1415} {1600} {Data Networks Lecture} {Druschel} {E1{\tiny3} 002} {corelecture}
\event 1 {1615} {1800} {Tutorial SysArch} {Gwosdek} {E1{\tiny3} SR014} {work}
\event 2 {0915} {1100} {Embedded Systems Lecture} {Finkbeiner} {E1{\tiny3} 003} {corelecture}
\event 2 {1115} {1300} {Differential Equations in IPCV Lecture} {Weickert} {E1{\tiny3} 001} {corelecture}
\event 2 {1415} {1600} {Office Hour SysArch} {Gwosdek} {E1{\tiny1} HaDePra} {work}
\event 3 {1415} {1600} {Data Networks Lecture} {Druschel} {E1{\tiny3} 002} {corelecture}
\event 3 {1615} {1800} {Numerical Algorithms in Image Analysis} {Bruhn, Weickert} {E1{\tiny1} 3.06} {seminar}
\event 4 {0915} {1100} {Embedded Systems Lecture} {Finkbeiner} {E1{\tiny3} 003} {corelecture}
\event 4 {1115} {1300} {Tutorial SysArch} {Gwosdek} {E1{\tiny3} SR014} {work}
\event 5 {1000} {1100} {Bremser Meeting} {SysArch United} {E1{\tiny3}} {work}
\event 5 {1115} {1300} {Differential Equations in IPCV Lecture} {Weickert} {E1{\tiny3} 001} {corelecture}
\end{timetable}
\end{landscape}
\end{document}
的定义\greekdays
应该是
\newcommand{\greekdays}[1]
{%
% Arguments: <number of start day>
% Macro for the greek week days
% added by dsfounis
%
\setcounter{@day}{#1}%
%
\@ttforloop{@column}{1}{\value{@column} < \value{@colcount}}
{%
\ifthenelse{\equal{\value{@day}}1}{\daymark{\textgreek{Δευτέρα}}}{}%
\ifthenelse{\equal{\value{@day}}2}{\daymark{\textgreek{Τρίτη}}}{}%
\ifthenelse{\equal{\value{@day}}3}{\daymark{\textgreek{Τετάρτη}}}{}%
\ifthenelse{\equal{\value{@day}}4}{\daymark{\textgreek{Πέμπτη}}}{}%
\ifthenelse{\equal{\value{@day}}5}{\daymark{Friday}}{}% %%%%FIX HERE!
\ifthenelse{\equal{\value{@day}}6}{\daymark{Saturday}}{}% %%%%FIX HERE!
\ifthenelse{\equal{\value{@day}}7}{\daymark{Sunday}}{}% %%%%FIX HERE!
%
\stepcounter{@day}%
\ifthenelse{\value{@day} > 7}{\addtocounter{@day}{-7}}{}%
}%
}
我认为它应该在文档前言中,而不是文件中的更改timetable.sty
。在本例中,在代码前面加上\makeatletter
,在代码后面加上\makeatother
。为什么?因为如果软件包作者更改了它,您将丢失更改。