Mendelova univerzita v Brně Provozně ekonomická fakulta
Příprava stylů standardních dokumentů Bakalářská práce
Vedoucí práce: Ing. Jan Přichystal, Ph.D.
Jan Prokeš
Brno, 2010
Děkuji Ing. Janu Přichystalovi, Ph.D. za vedení této bakalářské práce a také doc. Ing. Dr. Jiřímu Rybičkovi za konzultace při tvorbě stylů.
Prohlašuji, že jsem tuto práci vytvořil samostatně a s použitím literatury uvedené v kapitole Použitá literatura.
V Brně 28. května 2010
....................................................
4
Abstract Prokeš, J. Preparation of standard document styles. Bachelor thesis. Brno, 2010. This bachelor thesis solves a creation of standard document styles in the typographic system TEX/LATEX. Different document types have been selected for their creation and thus the wall calendar and the curriculum vitae. A definition of requirements on each of them precedes a creation of these styles. The main part of this thesis is dedicated to a very detailed description of their implementation. Created styles will be used in TEXonWeb project. Keywords documents, styles, TEX/LATEX, TEXonWeb, calendar, curriculum vitae
Abstrakt Prokeš, J. Příprava stylů standardních dokumentů. Bakalářská práce. Brno, 2010. Tato bakalářská práce se zabývá tvorbou stylů dokumentů v typografickém systému TEX/LATEX. Pro jejich tvorbu byly zvoleny velmi odlišné typy dokumentů a sice nástěnný kalendář a životopis. Tvorbě těchto stylů předchází definice požadavků na každý z nich. Hlavní část této práce je věnována velmi podrobnému popisu jejich implementace. Vytvořené styly budou použity v projektu TEXonWeb. Klíčová slova dokumenty, styly, TEX/LATEX, TEXonWeb, kalendář, životopis
5
OBSAH
Obsah 1 Úvod a cíl práce 1.1 Úvod . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.2 Cíl práce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7 7 8
2 Metodika práce
9
3 Typografie a typografický systém TEX/LATEX 3.1 Typografie . . . . . . . . . . . . . . . . . . . . 3.1.1 Písmo . . . . . . . . . . . . . . . . . . 3.1.2 Zvýrazňování textu . . . . . . . . . . . 3.1.3 Nadpisy . . . . . . . . . . . . . . . . . 3.2 Typografický systém TEX/LATEX . . . . . . . . 3.2.1 Definice nových příkazů . . . . . . . . 3.2.2 Styly . . . . . . . . . . . . . . . . . . .
. . . . . . .
. . . . . . .
4 Volba stylů, současný stav a analýza 4.1 Stávající styly na TEXonWeb a volba stylů . . . . 4.2 Současný stav . . . . . . . . . . . . . . . . . . . . 4.3 Společné požadavky na styly . . . . . . . . . . . . 4.4 Styl na kalendář . . . . . . . . . . . . . . . . . . . 4.4.1 Požadavky na použití stylu na kalendář . . 4.4.2 Vstupní informace kalendáře . . . . . . . . 4.4.3 Vzhled jednotlivých stran kalendáře . . . . 4.5 Styl na životopis . . . . . . . . . . . . . . . . . . 4.5.1 Analýza výchozího dokumentu . . . . . . . 4.5.2 Požadavky na použití šablony na životopis
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
10 10 10 11 11 11 12 13
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
14 14 14 14 15 15 15 16 17 17 18
5 Implementace 5.1 Styl na kalendář . . . . . . . . . . . . . . . . . . . . . . . . 5.1.1 Základní definované příkazy . . . . . . . . . . . . . 5.1.2 Titulní strana . . . . . . . . . . . . . . . . . . . . . 5.1.3 Definované příkazy pro prvky na dalších stranách . 5.1.4 Hlavní příkaz stylového souboru \Kalendar{} . . . 5.1.5 Vstupní soubory kalendáře . . . . . . . . . . . . . . 5.1.6 Čítače . . . . . . . . . . . . . . . . . . . . . . . . . 5.1.7 Sazba dnů . . . . . . . . . . . . . . . . . . . . . . . 5.1.8 Sazba velikonočních svátků . . . . . . . . . . . . . 5.1.9 Problematika přestupného roku . . . . . . . . . . . 5.1.10 Popis souborů KalendarA4.tex a KalendarA3.tex 5.2 Styl na životopis . . . . . . . . . . . . . . . . . . . . . . . 5.2.1 Implementace jednotlivých struktur . . . . . . . . . 5.2.2 Popis souboru Zivotopis.tex . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
19 19 19 19 20 21 22 23 24 25 27 27 27 28 29
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
6
OBSAH
5.2.3
Anglická verze stylu
6 Zhodnocení 6.1 Styly na kalendář . . . . 6.1.1 Použití stylů . . . 6.1.2 Omezení a možná 6.2 Styly na životopis . . . . 6.2.1 Použití stylů . . .
. . . . . . . . . . . . . . . . . . . . . . . 30
. . . . . . . . . . . . . . . . . . . . . . . . . . budoucí rozšíření stylů . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
31 31 31 31 32 32
7 Závěr
33
8 Použitá literatura
34
Přílohy
35
A Ukázka kalendáře formátu A4
36
B Ukázka životopisu v češtině
39
C CD příloha
44
1
ÚVOD A CÍL PRÁCE
1
7
Úvod a cíl práce
1.1
Úvod
Pro tvorbu dokumentů na počítači má dnes uživatel možnost využít některého ze široké nabídky programového vybavení. Liší se od sebe množinou nabízených funkcí, uživatelským rozhraním, dále formáty souborů, s nimiž umožňují pracovat a vytvářet je a také typem dokumentů, pro jejichž tvorbu jsou určeny. Pravděpodobně nejčastěji používanou skupinou softwaru určenou pro tvorbu dokumentů na počítači patří textové procesory. Z těch nejznámějších je možné jmenovat např. Mircosoft Word nebo OpenOffice.org Writer. Textové procesory jsou velmi často součástí kancelářských balíků (skupiny programů pro tvorbu různých typů dokumentů, např. tabulkové procesory a programy pro tvorbu prezentací). Také zmíněné textové editory jsou součástí kancelářských balíků. Microsoft Word je součástí kancelářského balíku Microsoft Office (tvůrcem je firma Microsoft), OpenOffice.org Writer je součástí kancelářského balíku OpenOffice (tvůrcem je firma Sun Microsystems Inc.) Další možnost pro tvorbu dokumentů na počítači tvoří typografické systémy. Z nich je možné uvést např. InDesign od firmy Adobe a také typografický systém TEX/LATEX. Jednou z možností, jak typografický systém TEX/LATEX využívat, je pomocí projektu TEXonWeb1 . TeXonWeb je projekt umožňující využívat DTP systém TeX/LaTeX na webovém serveru za použití webového prohlížeče. Motivem k vytvoření tohoto projektu byla absence prostředí, kde by se dalo snadno a bez zdlouhavých instalací a nastavování předvést funkčnost kvalitního typografického systému. Druhým důvodem byl požadavek po TeXovém prekladači, který by byl přístupný odkudkoliv ze světa a umožnil tak na kterémkoliv počítači připojeném k Internetu získat kvalitní výstupy. (TeXonWeb, 2010) Projekt je založen na překladači tetex z distribuce Linux CentOS 5.2. Použité kodování je implicitně ISO-8859-2. Pro vytvoření webových aplikací byl použit skriptovací jazyk Perl využívající mimo jiné modul CGI a JavaScript. (TeXonWeb, 2010) Stejně jako v textových editorech, i v typografickém systému LATEX je možné vytvářet styly (šablony) dokumentů. Když chce uživatel vytvořit nějaký dokument specifického typu, musí znát jeho strukturu, běžnou grafickou úpravu a další náležitosti. Styl pro požadovaný typ dokumentu může v tomto případě uživateli značně usnadnit práci, neboť již má zpravidla definován vzhled, přednastavené formátování písma atd. splňující požadavky na dokument. V TEXonWeb již jsou styly pro některé typy dokumentů k dispozici. 1
Projekt TEXonWeb je dostupný na webové adrese http://tex.mendelu.cz.
1.2
1.2
Cíl práce
8
Cíl práce
Cílem této práce je tedy rozšířit stávající množinu stylů, která je v TEXonWeb již k dispozici a umožnit tak uživatelům vytvářet některé další typy dokumentů výrazně jednodušším způsobem, než je začít s tvorbou celého dokumentu od začátku.
2
2
METODIKA PRÁCE
9
Metodika práce
V úvodu práce je třeba uvést malý přehled o tom, jaký je v současnosti dostupný software pro účel tvorby dokumentů na počítači a především se zde zaměřit na typografický systém TEX/LATEX. Právě tento typografický systém bude třeba důkladně nastudovat, seznámit se se zásadami jeho používání a to až na úroveň tvorby vlastních příkazů a také tvorby nových stylů dokumentů. Další důležitou částí této práce bude připomenutí některých kapitol typografie. Tato věda je velmi obsáhlá a pro potřeby této práce se tak budu věnovat pouze těm částem, které velmi pravděpodobně bude třeba využít u stylů, které budou vytvořeny v rámci této práce. Protože styly budou realizovány v typografickém systému TEX/LATEX, bylo by také vhodné uvést, jak se tyto typografické úkony realizují právě v tomto typografickém systému. Podobně je také třeba uvést, jakým způsobem se v typografickém systému TEX/LATEX definují nové příkazy, neboť definice nových příkazů je zde v podstatě nezbytná. Rovněž je nutné uvést, jak se tvoří styly v tomto typografickém systému, právě především jejich tvorbou se totiž tato práce zabývá. Projekt TEXonWeb je jednou z možností, jak používat typografický systém TEX/LATEX. Zde již existuje určitá množina stylů pro některé typy dokumentů. Dalším úkolem tedy bude zjistit, pro které typy dokumentů zde již styly existují a rovněž se zamyslet nad tím, styly pro které typy dokumentů by tuto množinu doplnily. Pro zvolené typy dokumentů bude úkolem stanovit si požadavky nejen na rozsah možností jednotlivých stylů, ale také je třeba definovat některé požadavky na jejich použití. Následně bude nutné analyzovat tyto typy dokumentů, což je pro následnou tvorbu stylů velmi důležité. To může zahrnovat analýzu některých již existujících dokumentů tohoto typu, od nichž by bylo možné převzít např. jejich strukturu, znění uvedených textů nebo i vzhled. Následovat již bude hlavní náplň této práce, tedy tvorba stylů. Během ní bude samozřejmostí snaha o co nejpřehlednější strukturu všech vytvořených souborů. Používání komentářů bude jeden z nástrojů k jejímu dosažení. Usnadní orientaci v celém souboru již při jejich vytváření, ale třeba také v případech jeho budoucího vylepšování. Poté budou vytvořené styly zhodnoceny a zamyslím se nad přednostmi a omezeními vytvořených stylů a také nad tím, jakým způsobem by tyto styly bylo možné v budnoucnu vylepšit, dále rozšířit jejich možnosti.
3
TYPOGRAFIE A TYPOGRAFICKÝ SYSTÉM TEX/LATEX
3
10
Typografie a typografický systém TEX/LATEX
Při tvorbě dokumentů je nutné dbát na pravidla jejich tvorby. První skupinou takových pravidel jsou pravidla pravopisná. Lze je najít v Pravidlech českého pravopisu, např. (Kolektiv autorů, 1998). Druhou skupinou pravidel jsou pravidla typografická. Problematikou typografie se podrobně zabývají v první části této kapitoly citované knihy, (Beran, 2007) a (Kočička – Blažek, 2007). Zabývá se jí i třetí zde citovaná kniha, (Rybička, 2003), která se ale jinak zabývá především typografickým systémem TEX/LATEX. Z této knihy je v této práci velmi čerpáno. Obsahuje např. také popis a syntaxi příkazů typografického systému TEX/LATEX, čehož bylo využíváno při implementaci stylů.
3.1
Typografie
Na některá pravidla typografie je třeba se zaměřit podrobněji. Zmíněny budou jen takové kapitoly, které bude velmi pravděpodobně třeba vzít do úvahy v analýze i při následné implementaci zvolených stylů, ale také při jejich používání. 3.1.1
Písmo
Počítačové písmo se od tiskového písma předchozích staletí zásadně liší. Zejména tím, že nemá materiální podstatu, neboť je pouhým matematickým zápisem, řetězcem jedniček a nul. Zmizely drobné rozdíly mezi jednotlivými literami, každý znak v celém textu je identický. Písmo ztratilo náhodné chybičky v kresbě, patinu, která činila tištěné texty lidštějšími a přívětivějšími, než chladné a dokonalé otisky počítačového písma. (Kočička – Blažek, 2007) Základní soubor znaků potřebných k písemnému projevu je například klávesnice psacího stroje nebo počítače. (Beran, 2007) Především je to abeceda – alphabet. K vyjádření českého pravopisu potřebujeme navíc znaménka k rozlišení různé platnosti téhož písmena. Jsou to diakritická (rozlišovací) znaménka – diacritical marks, kterým se také říká akcenty – accent. Písmeno společně s diakritickým znaménkem vytváří akcentovaný znak – accented character. Některé akcentované znaky jsou také součástí české nebo slovenské abecedy. (Beran, 2007) Počet znaků potřebných pro sazbu je větší než rozsah klávesnice. Kromě alfanumerických znaků (tedy písmen a číslic) a akcentů budeme potřebovat i slitky (ligatury), značky měnových jednotek, pomlčku, dolní a horní uvozovky a mnohé další znaky. (Beran, 2007) Stupeň písma je velikost tzv. kuželky, což je myšlený prostor, do kterého se vejdou všechny znaky daného písma. Velikost kuželky je odvozena z rozměru kovové litery a nelze ji změřit na tisku daného písma. Na jedné velikosti kuželky mohou být realizovány různé typy písma, které zabírají různý prostor. (Rybička, 2003)
3.2
Typografický systém TEX/LATEX
11
Stupeň písma se udává v bodech. Využití jednotlivých stupňů písma není stejné. Volba stupně závisí na formátu a úpravě dokumentu, ale také na použitém papíru, technice tisku a určení publikace. (Rybička, 2003) 3.1.2
Zvýrazňování textu
Často potřebujete v sázeném textu určité slovo nebo větu zvýraznit. Tuto možnost máte tehdy, je-li vámi použité písmo vytvořeno kromě základní verze také v celé škále různých kresebných variant, kterým říkáme „řezy písmaÿ. (Beran, 2007) Nejběžnějším a nejpoužívanějším řezem pro sazbu tiskovin je základní písmo – body type, basic design. Je to písmo stojaté (obyčejné, normální), jehož znaky jsou vzpřímené, anglicky též roman, regular. (Beran, 2007) Vyznačovací řez písma, anglicky style, type style je taková kresebná verze, která se liší svou kresbou od základního písma, ale je z něj odvozena a používá se ke zvýraznění důležitých slov nebo celých částí textu. Je to kurzíva, polotučné, tučné, velmi tučné, tučná kurzíva a kapitálky. (Beran, 2007) Zvýraznění jinou barvou nebo jiným odstínem základní barvy se využívá zejména ve výtvarné typografii. Některé dvoubarevně tištěné knihy používaly druhou barvu také pro zvýraznění. Tady je nutné postupovat citlivě, protože druhá barva narušuje zabarvení sazby. Většinou se druhou barvou tiskla iniciála nebo jiné prvky, které byly mimo základní sazební obrazec. (Kočička – Blažek, 2007) Aby druhá barva nepůsobila příliš výrazně, používalo se „zlomeníÿ barvy – například do červené se nalila černá, aby se snížila intenzita. Dnes je ovšem praktičtější vybírat barvy ze vzorníků. Rozhodně lze doporučit použití přímé barvy, kterou (resp. jejíž tón) namíchá tiskař. Při složení barvy, např. červené ze žluté a purpurové složky, by mohlo docházet, při nedokonale spasovaném soutisku, ke „stínováníÿ barevných písmen a při použití jiného než 100% zabarvení písmen by byl patrný rastr, neboť výstup takových písmen by nebyl pérovkový. (Kočička – Blažek, 2007) 3.1.3
Nadpisy
Důležitosti daného oddílu by měl odpovídat i charakter titulku. V zásadě lze použít pro odlišování důležitosti titulku dvě metody: buď se mění stupeň písma a zůstává jeho řez, nebo se mění řez (například v sestupném pořadí kapitálky, kurzíva, obyčejné) a zůstává stupeň. (Rybička, 2003) Titulek nikdy nesmí zůstat jako poslední řádek na stránce. Měly by se za ním objevit nejméně 3 řádky následujícího textu. (Rybička, 2003)
3.2
Typografický systém TEX/LATEX
Systémem TEX se velmi podrobně zabývá kniha (Olšák, 2001). TEX je volně dostupný počítačový program na pořizování vysoce kvalitní elektronické sazby. Tento program se od svých stejně zaměřených komerčních kolegů liší v mnoha ohledech. Mezi nejpodstatnější odlišnost zřejmě patří otevřenost systému.
Typografický systém TEX/LATEX
3.2
12
Šikovnému uživateli se v takovém systému dostává do rukou nástroj na vytvoření nadstavby podle vlastní představy a potřeby. K tomu je ale potřeba o vlastnostech systému poměrně hodně vědět. (Olšák, 2001) LATEX je nadstavbou systému TEX. Jádro systému tvoří překladač jazyka TEX společně s nadstavbou LATEX, jehož vstupem je textový soubor pořízený libovolným editorem (pro snadnější orientaci budeme předpokládat, že název tohoto souboru obsahuje rozšíření .tex). Do takového souboru se vedle vlastního textu zapisují také příkazy, které určují, jak má být text vysázen. (Rybička, 2003) Příkazy zdrojového textu mohou patřit jak do množiny příkazů základního systému TEX, tak do množiny příkazů nadstavby LATEX. Vzhledem k tomu, že nadstavba pouze rozšiřuje možnosti základního systému, odpovídá celý princip činnosti víceméně chování systému TEX. Některé základní příkazy jsou však nadstavbou LATEX modifikovány, nelze tedy zdrojový text systému TEX a LATEX navzájem zaměňovat. (Rybička, 2003) Pořízení zdrojového textu pro překladač lze provést libovolným programovým nebo textovým editorem nebo textovým procesorem. Musí být splněna jen jedna podmínka. Soubor, který takto vznikne, nesmí obsahovat žádné řídící znaky, znaky v horní polovině rozšířeného kódu ASCII (vyjma znaků národní abecedy), ani vnitřní příkazy dokumentního tvaru2 použitého editoru. Není tedy vhodný takový editor, který automaticky do svého dokumentního souboru vkládá pomocné příkazy pro zobrazení na displeji nebo tiskárně (například Text602). U těchto editorů je potřebné vždy provést export do obyčejného tvaru ASCII. (Rybička, 2003) Pro tvorbu vstupních souborů je rozhodně vhodné používat textový editor, který dokáže zvýrazňovat syntaxi tohoto typografického systému, což velmi usnadňuje práci. V operačním systému Windows je možné zmínit jako příklad takového textového editoru PSPad, v operačním systému Linux např. textový editor vi. 3.2.1
Definice nových příkazů
K definici nových příkazů slouží příkaz \newcommand. Jeho prvním parametrem je název nového příkazu a druhým parametrem je text, který má být novým příkazem produkován (budeme jej nazývat tělo definice). (Rybička, 2003) Kromě LATEXového příkazu \newcommand lze taktéž užít i TEXový příkaz \def, jehož zápis je poněkud jednodušší a mocnost větší. (Rybička, 2003) Příklad definice nového příkazu pomocí příkazu \def: \def\DulezityText#1{\textbf{\textit{#1}}} Poté, při použití tohoto příkazu, se vysadí text v jeho parametru polotučným kurzívním řezem. Při zápisu např.: 2
Pojmem dokumentní tvar je zde myšlen soubor, do něhož si příslušný editor ukládá nejen vlastní text, ale i své značky pro zpracování v nejrůznějších podobách. (Rybička, 2003)
3.2
Typografický systém TEX/LATEX
13
\DulezityText{text získaný pomocí nového příkazu} bude vysazený text vypadat takto: text získaný pomocí nového příkazu Všeobecně platí, že nový příkaz (ať už je definován kterýmkoliv způsobem) se může objevit v těle definice jiného příkazu. Použijeme-li TEXový příkaz \def pro definici příkazu, který již existuje, bude existující příkaz bez varování nahrazen novou definicí. Naopak systém LATEX (patrně z bezpečnostních důvodů) vyžaduje, aby jméno nového příkazu nekolidovalo s některým již definovaným příkazem. (Rybička, 2003) Při tvorbě stylů, které jsou náplní této práce, budu pro definici nových příkazů používat příkaz \def. 3.2.2
Styly
Stylům je věnován odstavec již v úvodu této práce. Nyní je třeba se zaměřit na to, jak se se styly v typografickém systému TEX/LATEX pracuje. Každým příkazem \usepackage se čte a překládá soubor s rozšířením .sty, v němž jsou uvedeny všechny definice značek týkajících se určitého logického celku, například soubor multicol.sty obsahuje definici prostředí multicols a další příbuzné příkazy. (Rybička, 2003) Pracuje-li uživatel zcela důsledně, může veškeré formátování dokumentu provádět pouze změnami definic stylového souboru. Vytvořením několika stylových souborů s různými definicemi stejných příkazů lze celé formátování provést pouhou změnou jména souboru v příkazu \usepackage. Toho je možné využít v případě, že text má sloužit více účelům (brožura, průsvitné fólie a podobně). (Rybička, 2003) Při tvorbě dokumentu se tedy autor soustřeďuje jen na obsah textu – jednotlivé textové objekty opatřuje strukturními značkami a nesnaží se pod nimi vidět jejich vizuální podobu. Teprve v druhém kroku, kdy je text hotov, je vhodné přistoupit k úvahám o typografickém řešení. Toto řešení nemusí nutně provádět sám autor textu, ale například zkušený typograf, čímž je autor osvobozen od technických problémů a detailů použitého systému. Uvedená dělba práce mezi autorem a typografem (sazečem) je historicky osvědčená a vyplatí se i tehdy, je-li autorem a sazečem táž osoba. (Rybička, 2003)
4
VOLBA STYLŮ, SOUČASNÝ STAV A ANALÝZA
4 4.1
14
Volba stylů, současný stav a analýza Stávající styly na TEXonWeb a volba stylů
V TEXonWeb je k dispozici již poměrně rozsáhlá skupina šablon pro různé typy dokumentů. Jsou to: • dopis, • žádost, • vizitky, • a mnohé další. Velmi důležitým dokumentem v podstatě pro každého člověka ucházejícího se o zaměstnání a který TEXonWeb zatím neobsahoval, je životopis. V současnosti je velmi žádoucí, aby bylo možné vytvářet tento dokument také v anglickém jazyce a vytvořený styl by to tedy měl umožňovat. Druhým typem dokumentu, který byl zvolen pro tuto práci a je v každodenním životě naprosto běžný, je nástěnný kalendář. Také tento styl by jistě vhodně doplnil stávající množinu stylů, které již jsou na TEXonWeb k dispozici. Je to také velmi zajímavý námět pro realizaci šablony v typografickém systému TEX/LATEX.
4.2
Současný stav
Oba zvolené typy dokumentů jsou dnes zcela běžné a tak je samozřejmé, že je možné na Internetu snadno najít nástroje pro podporu jejich tvorby, příp. také přímo aplikace, které je dokáží vytvořit. Pro tvorbu kalendářů lze nalézt weby, které se touto činností zabývají. Jde ovšem velmi často o komerční produkty. Z webů, kde si lze vytvořit kalendář zdarma, bych zmínil např. (kalendar.beda.cz, 2010). Na tomto webu je možné vytisknout si velké množství různých typů kalendářů s různými typy a podrobnostmi v nich uváděných údajů. U některých typů kalendáře je možné vložit vlastní obrázek, ale je tu také nabízeno velké množství kalendářů bezobrázkových. Na Internetu není nijak obtížné vyhledat návody na tvorbu životopisu a vzory vytvořených životopisů. Např. na webu Úřadu práce v Prachaticích lze najít předlohy životopisů (Strukturovaný životopis, 2010) v mnoha různých jazykových variantách ve formátech .doc a .pdf.
4.3
Společné požadavky na styly
Vytvořené styly by měly splňovat určité požadavky bez ohledu na to, pro který styl dokumentů budou určeny. Především jsou to tyto: • jednoduché použití každého stylu, • pro vytvořené příkazy užít vhodné názvy tak, aby vyjadřovaly, co příkaz představuje,
4.4
Styl na kalendář
15
• případné použití textů, struktury a vzhledu z jiných již existujících dokumentů stejného nebo podobného typu. Jednoduchým použitím stylu se zde myslí především to, aby používání stylů mohl zvládnout i uživatel s pouze základními znalostmi typografického systému TEX/LATEX. Ke stylům dostupných v TEXonWeb jsou zpravidla mimo stylového souboru vytvořeny také vstupní soubory. Ty již mj. obsahují příkazy, které jsou pro daný styl definovány a předpokládá se jejich využití. Jsou zde také již připojena použitá rozšíření, atd. Uživatel tedy může s těmito příkazy hned pracovat. Kromě stylových souborů tedy bude nutné vytvořit vstupní soubory i pro styly, které se stanou výstupem této práce. Další obvyklou vlastností stylů, které již jsou dostupné v TEXonWeb, je jejich dokumentace. Ta je součástí dokumentace tohoto projektu (TeXonWeb, 2010). V rámci jednotlivých stylů tu bývá popsáno, jak se styl používá a např. také popis jednotlivých vytvořených příkazů. Obvykle tu je také vytvořen příklad vyplnění vstupního souboru a na ukázku také soubor .pdf, který by uživatel získal při takto vyplněném souboru a při zvolení tohoto výstupního formátu. Bylo by zde tedy vhodné vytvořit dokumentaci i pro styly, které budou vytvořeny v rámci této práce včetně příkladů vyplnění a z nich vytvořených dokumentů.
4.4 4.4.1
Styl na kalendář Požadavky na použití stylu na kalendář
Výsledná šablona by měla umožňovat vytvořit si vlastní nástěnný kalendář. Uživatel by měl mít možnost vybrat si mezi dokumentem formátu A4 a A3. Zásadní důležitost má také možnost volby roku. Rozhodně totiž není správné řešení automaticky vytvářet kalendář na následující rok, přestože tato volba bude zřejmě nejčastější. Zpřístupněný rozsah let by měl být dostatečně velký. Byl tedy definován požadavek zpřístupnit roky 2009–2020, celkem tedy dvanáct let. Mělo by ale být možné zpřístupňování i dalších roků a to co nejjednodušším způsobem. Další funkcí šablony by měla být možnost tisknout u názvu každého měsíce také letopočet. 4.4.2
Vstupní informace kalendáře
Pro analýzu potřebných informací pro sestavení kalendáře byl použit stolní kalendář (Nakladatelství Helma, s.r.o., 2008). Bylo zjištěno, že pro sestavení kalendáře je nutná určitá množina informací, které je možné rozdělit do dvou kategorií: 1. pro různé roky neměnné: • názvy měsíců, • názvy dnů v týdnu,
4.4
Styl na kalendář
16
• popisy všech dnů v jejich pořadí, což zahrnuje jméno (příp. jména), která mají v daný den svátek, dále názvy, popisy a data všech svátků, významných dnů a některých dalších dnů, nespadají sem ale data Velikonoční neděle a Velikonočního pondělí, 2. pro různé roky různé: • kterým dnem v týdnu rok začíná, • data Velikonoční neděle a Velikonočního pondělí, • samozřejmě také informace, zda je daný rok přestupný. Také všechny informace neměnné pro různé roky (včetně znění textů uvedených u velikonočních svátků) a také všechny údaje pro různé roky různé (ty ovšem jen pro roky 2009 a 2010) byly převzaty ze stolního kalednáře (Nakladatelství Helma, s.r.o., 2008). Informace pro různé roky různé pro roky 2011–2020 (tedy zbývající roky, které by měly být v tomto stylu v rámci této práce zpřístupněny, byly získány z jiných zdrojů. Informace o datech Velikonoc ze zdroje (Kalendář FAQ, 2010), informace o přestupnosti těchto let, o tom, kterým dnem v týdnu tyto jednotlivé roky začínají a text uvedený u 29. února ze zdroje (iKalendář.info, 2010). Informace něměnné pro libovolný rok není nutné uchovávat v rámci informací specifických pro každý rok, čehož je možné při implementaci využít. Naopak informace specifické pro každý rok je nutné pro každý rok, pro který bude možné kalendář vytvořit, uchovávat zvlášť. Těchto údajů ovšem není mnoho a jsou v textové podobě, takže nebudou náročné na paměť i při relativně velkém množství zpřístupněných let. 4.4.3
Vzhled jednotlivých stran kalendáře
V případě vzhledu se částečně vychází opět ze stolního kalendáře (Nakladatelství Helma, s.r.o., 2008). Je však třeba se přizpůsobit potřebám nástěnného kalendáře se stranami po jednotlivých měsících. Bude vhodné zvolit orientaci stran na šířku. Je důležité u všech stran vložit velkou mezeru u horního okraje dokumentu, aby se zde mohla použít vazba celého dokumentu. Veškeré použité texty by měly být tvořeny bezpatkovým písmem. Výstupní dokument kalendáře by se měl skládat celkem ze třinácti stran. Úvodní strana kalendáře by měla obsahovat letopočet zapsaný velkým písmem a pod ním náhled všech obrázků, které jsou umístěny na stránkách každého měsíce. Vzhled dalších dvanácti stran již bude jednotný. Samozřejmostí pak je možnost vložit na každou stranu rozdílný obrázek. Vzhledem ke zvolené orientaci strany se bude předpokládat orientace obrázků na šířku. Vkládané obrázky velmi pravděpodobně nebudou mít vhodnou velikost pro stránku a zřejmě tedy bude nutné automaticky upravit jejich velikost. V žádném případě ale nesmí docházet ke změně poměru délek jejich stran a tím k deformaci tohoto obrázku a to i za cenu požadavku na určitý poměr stran obrázku. Jednotlivé prvky a jejich požadované rozvržení na těchto stranách byly definovány takto:
4.5
• • • •
Styl na životopis
17
v horní levé části název měsíce, příp. letopočet, obrázek jako ústřední prvek strany horizontálně uprostřed, vertikálně vlevo, vlevo pod obrázkem jeho příp. popisek, vpravo od obrázku uvedení jednotlivých dnů měsíce.
4.5
Styl na životopis
Jako dokument, ze kterého bude vytvořený styl vycházet zněním textů a také grafickou úpravou, byl zvolen pro češtinu (Evropský formulář životopisu, 2010), pro angličtinu jeho anglická obdoba (European curriculum vitae format, 2010). Oba tyto dokumenty se nacházejí na webu Úřadu práce v Prachaticích umístěného na Integrovaném portálu ministerstva práce a sociálních věcí. 4.5.1
Analýza výchozího dokumentu
U tohoto formátu životopisu je použita dvousloupcová sazba. Pro veškerý text v levém sloupci je charakteristické zarovnání vpravo. Dokument začíná nadpisem s výrazně větším stupněm písma než všechny ostatní texty v dokumentu. Každá ucelená informace je vysázena na nový řádek. Dokument je dále členěn na jednotlivé kapitoly (oddíly), každá z nich je uvozena nadpisem, ve kterém je rovněž použit větší stupeň písma než v ostatních textech v dokumentu. Oddíly jsou od sebe odděleny relativně velkou vertikální mezerou. V oddílu Osobní informace je mezi jednotlivými údaji (jméno, adresa, . . . ) použita malá vertikální mezera. Naopak mezi údaji v následujících dvou oddílech (Pracovní zkušenosti a Vzdělání a kurzy) vztahující se ke stejné položce žádná vertikální mezera použita není, vkládá se však jako oddělení jednotlivých položek. Následuje oddíl Osobní schopnosti a dovednosti, jehož členění je odlišné od oddílů zmíněných. Je totiž dále rozčleněn. Nejprve je uveden mateřský jazyk. Následuje popis znalostí ostatních jazyků, které jsou ještě uvedeny nadpisem. Názvy těchto jazyků a úrovně (ty jsou zde uvedeny 3 a to výborně, dobře, základy) jednotlivých typů znalostí tvoří podobnou strukturu jako oddíly Pracovní zkušenosti a Vzdělání a kurzy. Názvy těchto jazyků jsou ale uvedeny v pravém sloupci, levý sloupec je v řádku s názvem jazyka prázdný. Následuje několik dalších menší oddílů (pododdílů), které se vyznačují tím, že nefungují přímo jako nadpisy, ale odpovídající údaje se vkládají přímo do pravého sloupce vedle jejich názvů. Věnují se dalším jednotlivým schopnostem a dovednostem. Poté následuje pododdíl Doplňující informace. Posledním pododdílem a zároveň posledními informacemi, které tento dokument popisuje, jsou Přílohy. Struktura tohoto pododdílu je stejná jako u ostatních pododdílů, je ale od nich oddělen větší vertikální mezerou. V celém dokumentu je také použito v levém i pravém sloupci velké množství pokynů, vysvětlivek a informací k zadávání údajů v levém i pravém sloupci.
4.5
Styl na životopis
18
Důležitá informace z hlediska typografie je také to, že se při sazbě tohoto dokumentu používá v podstatě výhradně text, jako jediný grafický prvek je zde použit obrázek na motivy znaku Evropské unie pod nadpisem. 4.5.2
Požadavky na použití šablony na životopis
Je velmi pravděpodobné, že do některého oddílu či pododdílu si uživatel nebude přát napsat žádné údaje. Stejně tak se může stát, že v některé položce si uživatel přeje nějaký údaj doplnit, některý se mu naopak nehodí a nechce jej použít. Takových a podobných situací může nastat opravdu hodně a z toho vychází hlavní požadavek na tyto šablony. Výsledná šablona by se měla držet struktury výchozích dokumentů, měla by ale nabízet co nejširší možnosti editace včetně možnosti úprav týkajících se vzhledu dokumentu (nejčastěji asi umístění dodatečné vertikální mezery). Z tohoto důvodu není zcela nutné se výchozích dokumentů držet zcela striktně, ale jen rámcově, neboť uživatel si bude moci výsledný dokument poměrně značně přizpůsobit. Nabízí se tedy řešení předvyplnit texty ve stejném znění, jako jsou uvedeny v předlohách a ponechat na uživateli, zda mu texty v tomto znění vyhovují, nebo zda si chce některé změnit, některé přidat, atd.
5
IMPLEMENTACE
5
19
Implementace
Zvolené typy dokumentů jsou svojí strukturou velmi odlišné a tak je nutné se při jejich implementaci zaměřit na každý z nich zvlášť. Jen obtížně se totiž hledají nějaké společné rysy implementace.
5.1
Styl na kalendář
Požadavek, aby bylo možné vytvářet kalendáře formátů A4 i A3, byl zrealizován vytvořením jednoho stylu pro každý z těchto formátů. Pro formát A4 byl tedy vytvořen stylový soubor kalendarA4.sty a vstupní soubor kalendarA4.tex, pro formát A3 stylový soubor kalendarA3.sty a vstupní soubor kalendarA3.tex. Rozvržení jednotlivých prvků na jednotlivých stránkách jsou přibližně stejná a oba styly se používají naprosto stejným způsobem. Všechny dále popisované části implementace se týkají obou těchto stylů pokud není uvedena varianta pro každý styl. Specifickým požadavkem byla také orientace stran na šířku. Tento požadavek je zajištěn použitím rozšíření geometry s volitelným parametrem landscape. Je nutné připojit ještě další rozšíření, color pro práci s barvami, graphicx pro práci s grafikou, samozřejmostí je pak rozšíření czech pro češtinu a připojení samotného stylového souboru, kalendarA4 v případě použití stylu pro formát A4 a kalendarA3 v případě použití stylu pro formát A3. U formátu A3 je při připojení rozšíření geometry uveden kromě landscape ještě volitelný parametr a3paper zajišťující právě tento formát papíru. Požadavek použití bezpatkového písma je zajišťován příkazem \textsf{}. Do implementace není zahrnuto uvádění významných dnů ani Hromnic a svátku matek). Popisy těchto dnů ve stolním kalendáři (Nakladatelství Helma, s.r.o., 2008) uváděny jsou. 5.1.1
Základní definované příkazy
Pro základní volby použité ve vstupním souboru, je zde definována dvojice příkazů. Prvním z nich je rok, pro který má být kalendář vytvořen, příkaz \Rok{}. Druhým z nich je \Letopočet{}, který slouží pro to, aby si uživatel mohl u názvu každého měsíce uvést také letopočet roku, tedy obsah parametru příkazu \Rok{}. 5.1.2
Titulní strana
Úvodní strana dokumentu je realizována prostřednictvím příkazu \TitulniStrana. Letopočet i jednotlivé náhledy obrázku jsou realizovány v prostředí picture. Sazba letopočtu je zajištěna pomocí příkazu \makebox, velikost písma je nastavena pomocí příkazu \Huge, v případě obou formátů je ale tento text třeba ještě více zvětšit. Toho bylo dosaženo pomocí příkazu \scalebox. Jednotlivé obrázky jsou vkládány pomocí příkazu \includegraphics, šířka obrázku je upravena pomocí volitelného parametru width na 6 cm v případě formátu A4 a na 9 cm v případě formátu A3.
5.1
Styl na kalendář
20
Umístění řady čtyř obrázků vedle sebe je zajištěno pomocí příkazu \makebox. To platí pro každou ze tří řad obrázků. Řady jsou mezi sebou posunuty tak, aby mezi obrázky vznikla vertikální oddělující mezera, u formátu A3 je samozřejmě větší. Celá strana je vycentrována použitím prostředí center. Prostředí picture, v němž jsou vytvořeny všechny prvky na straně, bylo použito až uvnitř tohoto prostředí. 5.1.3
Definované příkazy pro prvky na dalších stranách
Kromě jednotlivých prvků na titulní straně jsou také všechny prvky na dalších stranách realizovány pomocí prostředí picture. Pro názvy měsíců je vytvořen příkaz \Mesic{}. Vlastní text názvu měsíce je vkládán pomocí příkazu \makebox. Stupeň velikosti písma je zde nastaven na \Huge, avšak tato velikost by byla nedostačující i pro formát A4. Proto je zde použit ještě také již zmíněný příkaz \scalebox pro změnu velikosti tohoto textu. Jako první podpříkaz je v příkazu \Mesic{} také zajištěn přechod sazby na další stranu příkazem \newpage. Proto tento příkaz není použit již v příkazu pro sazbu titulní strany. Je zde také realizováno podmíněné uvedení letopočtu za názvem měsíce v závislosti na hodnotě uložené v parametru příkazu \Letopocet. Letopočet bude uveden pouze při zjištění, že se v parametru tohoto příkazu nachází znak *. Pro každý z 12 vkládaných obrázků je zde definován příkaz s jedním parametrem sloužící pro uchování cesty k jednotlivým obrázkům. Pro jejich vložení na příslušné místo na straně je definován příkaz \Obrazek{}, ve kterém je také upravena šířka obrázku pomocí volitelného parametru width na 20 cm v případě formátu A4 a na 28 cm v případě formátu A3. Podobně je pro každý popisek pod obrázkem definován příkaz pro uchování požadovaného textu pro každý obrázek \Popisek{}. Zde je však použit příkaz \parbox, aby bylo možné vkládat také delší, vícečádkové popisky. Není ale počítáno s příliš dlouhými popisky. Šířka tohoto textu je i zde nastavena na 20 cm v případě formátu A4 a na 28 cm v případě formátu A3, aby šířka popisku nebyla větší než šířka obrázku nad ním. Posledním prvkem na každé z těchto 12 stran je sloupec s jednotlivými dny a jejich popisem v daném měsíci. Pro tento účel je definován příkaz \Dny{}. Pro samotné správné umístění tohoto sloupce byl použit příkaz \parbox. Jeho šířka není důležitá, neboť text je rozdělen do jednotlivých řádků již ve vstupním textu dnů. Tento příkaz má ještě jeden účel, kterým je, po vysázení dnů daného měsíce, zvýšit hodnotu čítače měsíců \Mesice o 1. Údaje o jednotlivých dnech jsou poté vkládány pomocí dvou příkazů. Prvním z nich je \Den{}{}. Tento dvouparametrický příkaz je zde použit pro každý den v roce. Jeho první parametr značí, zda je v daný den svátek. Je tedy třeba rozlišit pouze dva stavy a tak tento parametr vždy obsahuje jedno ze dvou písmen: • A (jako „anoÿ) v případě, že daný den je svátkem, • N (jako „neÿ) v případě, že daný den není svátkem.
5.1
Styl na kalendář
21
Druhý parametr představuje prvního řádku k danému dni. U většiny z nich je to jméno, příp. jména, která mají v tento den svátek, může to být ale i jiný popis dne. Následující ukázka představuje definici dnů 1.–5. května: \Den{A}{Svátek práce} \Den{N}{Zikmund} \Den{N}{Alexej} \Den{N}{Květoslav} \Den{N}{Klaudie} V případě, že první řádek dne není jeho jediným, je pro sazbu každého dalšího řádku použit příkaz \Radek{}{}. Tento příkaz obsahuje také dva parametry. První obsahuje informaci o barvě sazby tohoto řádku. Ty jsou stejné jako v případě prvního parametru příkazu \Den{}{}, jejich význam je však trochu odlišný: • A (jako „anoÿ) v případě, že se má tento řádek zvýraznit, tedy vysázet červenou barvou, • N (jako „neÿ) v případě, že se tento řádek nemá zvýraznit a je tedy vysázen černou barvou. Druhý parametr obsahuje text, který bude vysázen v tomto řádku. Mezi dny, pro jehož sazbu jsou použity oba uvedené příkazy, patří např. 8. května, den jednoho ze státního svátku. Sazba tohoto dne sestává z dvou řádků, je tedy třeba jednou použít příkaz \Radek{}{}. Definice tohoto dne vypadá takto: \Den{A}{Státní svátek} \Radek{A}{Den vítězství} Byly definovány ještě další příkazy související se sazbou prvků na straně. Jsou to ale příkazy pomocné, sloužící pro sazbu některých zmíněných prvků. Budou zmíněny dále. 5.1.4
Hlavní příkaz stylového souboru \Kalendar{}
Ve stylovém souboru je také definován jeho hlavní příkaz, kterým je \Kalendar{}. Tento příkaz je použit na konci vstupního souboru a prakticky kompletně zajišťuje fungování stylu. Provádí načtení informací z příslušného vstupního souboru (implementováno příkazem \input{\@Rok.tex}) a na základě informací o datu Velikonoční neděle je zde určeno datum Velikonočního pondělí. Dále je zde použit příkaz \TitulniStrana pro sazbu titulní strany dokumentu. Dalšími prováděnými operacemi je nastavení čítače \Mesice na hodnotu 1 a čítače pro dny v týdnu \DnyTydne na hodnotu uložené v parametru příkazu \Zacatek, tato hodnota byla získána ze vstupního souboru pro daný rok.
5.1
Styl na kalendář
22
Dále právě v příkazu \Kalendar{} je použit příkaz \Dny{} pro správné vysazení dnů v každém měsíci obsahující vždy skupinu příkazů \Den{}{} a příp. také \Radek{}{} pro konkrétní dny v měsíci, příkaz \Mesic{} pro jednotlivé měsíce v roce, příkazy pro vysazení obrázků \ObrazekProLeden, \ObrazekProUnor, ... a popisků pod obrázky \PopisekProLeden, \PopisekProUnor, ... v jednotlivých měsících. 5.1.5
Vstupní soubory kalendáře
Každá skupina vstupních informací (konstantní a specifické pro každý rok) je pro styl získávána z jiného umístění. Skupina konstatních informací je umístěna přímo ve stylovém souboru (část jejich implementace již byla popsána), údaje specifické pro každý rok jsou získávány ze vstupního souboru pro příslušný rok. Bylo by samozřejmě možné specifické údaje pro jednotlivé roky vkládat přímo do stylového souboru. Toto řešení by ale pravděpodobně znamenalo větší riziko chyby při editaci a také by způsobilo větší nepřehlednost v už tak rozsáhlém souboru. Proto bylo zvoleno řešení rozšiřování množiny zpřístupněných roků způsobem, při kterém je pro každý zpřístupněný rok kalendáře vytvořen krátký vstupní soubor s požadovanými údaji. Každý vstupní soubor má název podle roku, pro který je určen (2009.tex, 2010.tex, . . . ). Při zadání roku, pro který není vytvořen vstupní soubor, nelze vytvořit výstupní dokument. Vstupní soubor obsahuje celkem čtyři příkazy, pomocí kterých je možné vytvořit kalendář pro daný rok. Každý obsahuje jeden parametr. Jsou to: • \Prestupnost – informace o tom, zda je daný rok přestupný. Pokud ano, uvádí se do parametru znak A (jako „anoÿ), pokud ne, je možné uvést v parametru cokoli jiného, u již vytvořených vstupních souborů se ale používá znak N (jako „neÿ), • \Zacatek – informace o tom, kterým dnem v týdnu rok začíná. Do parametru se uvádí číslo pořadí dne (1 pro pondělí, 2 pro úterý, . . . ), • \VNDen{} – informace o tom, který den připadá na Velikonoční neděli, • \VNMesic{} – informace o tom, ve kterém měsíci v roce je Velikonoční neděle. Datum Velikonočního pondělí z tohoto souboru získáván není, jeho datum je vypočteno z data Velikonoční neděle. Vstupní soubor pro kalendář na rok 2010 (tento rok začíná v pátek, není přestupný, datum Velikonoční neděle je 4. dubna) vypadá takto: % Vstupní soubor kalendáře % pro rok 2010 \Prestupnost{N} % přestupný rok \Zacatek{5} % počáteční den v týdnu v roce
5.1
Styl na kalendář
23
\VNDen{4} % den Velikonoční neděle \VNMesic{4} % měsíc Velikonoční neděle Vstupních souborů bylo vytvořeno celkem 12, pro roky 2009–2020. 5.1.6
Čítače
V definici příkazu \Den{}{} je možné namítnout, že dva parametry nejsou dostatečný počet, neboť chybí údaje o pořadí daného dne v měsíci a také informace o tom, o který den v týdnu jde. Také se nabízí otázka, jakým způsobem je v kalendáři implementováno uvedení Velikonoc jako pohyblivých svátků. Tyto úkoly byly vyřešeny pomocí čítačů. Těchto čítačů je ve stylovém souboru definováno celkem pět: • \Mesice pro uchování pořadí momentálního měsíce v roce • \DnyTydne pro uchování pořadí momentálního dne v týdnu • \DnyMesice pro uchování pořadí momentálního dne v měsíci • \Velikonoce pro indikaci sazby některého velikonočního svátku • \DenVelikonocniPondeli pro určení data Velikonočního pondělí Čítač \Mesice je nastaven na hodnotu 1 téměř na začátku definice hlavního příkazu \Kalendar{}. Jeho hodnota je navýšena o 1 po každé dokončené sazbě dnů v měsíci, zajištěno v závěru definice příkazu \Dny{}. Nabývá tedy hodnot 1--13 (hodnota je navýšena i po sazbě prosincových dnů, to však není podstatné, neboť tato hodnota se již nepoužije). Čítač \DnyTydne je nastaven na hodnotu podle příkazu \Zacatek{} získanou ze vstupního souboru daného roku. Zvyšování jeho hodnoty je zajištěno v příkazu \Den{}{} po sazbě každého dne. Pro zajištění rotace jednotlivých dnů v týdnu je v případě překročení hodnoty 7 (neděle) čítač nastaven na hodnotu 1 (pondělí). Čítač \DnyMesice je nastaven na hodnotu 1 v úvodu definice příkazu \Dny{}, tedy před sazbou jednotlivých dnů měsíce. Samozřejmě i tento čítač je zvyšován o hodnotu 1 po sazbě každého dne, opět v definici příkazu \Den{}{}. Může nabývat hodnot 1--32, neboť k navýšení dojde po sazbě každého dne v měsíci a po skončení sazby dnů v měsíci nabyde hodnoty o 1 vyšší, než je počet dnů v daném měsíci. Při dosažení této hodnoty již však chybí další použitý příkaz \Den{}{}, pro který by tato hodnota byla použita, takže počet vysázených dnů je správný. Čítač \Velikonoce je nastaven na hodnotu 0 v příkazu \Den{}{} předtím, než se rozhodne o tom, jestli právě sázený den je některý z velikonočních svátků nebo ne. V případě zjištění, že jde o Velikonoční neděli, je nastaven na hodnotu 1, v případě Velikonočního pondělí je nastaven na hodnotu 2. Tento čítač je tedy během sazby dnů v celém roce pouze jednou nastaven na hodnotu 1 a pouze jednou je nastaven na hodnotu 2. Při sazbě všech ostatních dnů je nastaven na hodnotu 0. Čítač \DenVelikonocniPondeli je pomocný čítač pro určení data Velikonoční neděle z data Velikonočního pondělí.
5.1
Styl na kalendář
5.1.7
24
Sazba dnů
Vlastní sazba každého dne, realizována samozřejmě v rámci příkazu \Den{}{}, při víceřádkovém textu k vysazovanému dni také jedním nebo více příkazy \Radek{}{}, je implementována pomocí prostředí tabular. Každý vysázený řádek je v podstatě tabulka o jednom řádku a třech sloupcích o šířkách 1 em, 1 em a 12 em v případě formátu A4 a o šířkách 2 em, 2 em a 20 em v případě formátu A3. Šířka posledního sloupce však není příliš podstatná, neboť přímo zdrojový text dnů již je rozdělen do jednotlivých řádků pomocí zmíněných přákazů. Stačí tedy, když velikost tohoto sloupce bude aspoň taková, aby se do něj vešel požadovaný text. V případě formátu A4 není nijak měněna velikost sazby jednotlivých dnů, je 10 pt. V případě formátu A3 by však tato velikost písma byla zcela nedostatečná a je tedy použita změna stupně písma pomocí příkazu Large. První sloupec tabulky je určen pro zkratku dne v týdnu. Zde se využívá čítače \DnyTydne. V definici příkazu \Den{}{} je mj. také pro každou hodnotu, jaké může tento čítač nabývat, definována příslušná zkratka dne v týdnu (např. hodnota 1 znamená pondělí, přiřazená zkratka je tedy Po, hodnota 2 znamená úterý, přiřazená zkratka je tedy Út, . . . ). Druhý sloupec je určen pro číslo pořadí dne v měsíci. Ten je zjištěn z hodnoty obsažené v čítači \DnyMesice. Třetí sloupec je určen pro text daného dne. Předchozí odstavec popisuje část implementace společnou pro sazbu všech dnů. Následující odstavce popisují implementaci, která se uplatňuje pouze tehdy, pokud je čítač \Velikonoce nastaven na hodnotu 0 (nejedná se tedy o žádný z velikonočních svátků), neboť pro dny velikonočních svátků je sazba implementována samostatně. U sazby dnů je třeba vyřešit ještě dva požadavky. Prvním z nich je změna barvy sazby na červenou u nedělí, druhým z nich je totéž také u svátků. Tyto požadavky se na první pohled mohou jevit jako jeden úkol, je však třeba k nim implementačně přistupovat částečně rozdílně, neboť neděle se cyklicky opakují, ale umístění svátků v roce tímto způsobem odvodit nelze. Jak je vidět z této definice, pro určení barvy sazby se používají 2 příkazy, příkaz \BarvaA{} pro barvu sazby prvních dvou sloupců a příkaz \BarvaB{} pro barvu sazby třetího sloupce. Parametrům obou příkazů je implicitně přiřazen text black. Obsah tohoto parametru je použit jako první parametr příkazu \textcolor{}{} sloužícího pro barevnou sazbu textu a použitého právě pro text v příslušných sloupcích. V případě nedělí je využito čítače pro dny v týdnu \DnyTydne. Pokud je jeho hodnota rovna hodnotě 7, je den vyhodnocen jako neděle: \ifnum\DnyTydne = 7 \BarvaA{red} \fi V případě svátku je využito prvního parametru aktuálně zpracovávaného příkazu \Den{}{}, který nese údaj právě o tom, zda je daný den svátkem. V případě,
5.1
Styl na kalendář
25
že ano, obsahuje tento parametr znak A, v případě, že ne, obsahuje znak N. Obsah tohoto parametru je tedy porovnán se znakem A, v případě shody je tento den vyhodnocen jako svátek. Toto větvení vypadá ve stylovém souboru takto: \if A#1 \BarvaA{red} \BarvaB{red} \fi Jak je vidět z uvedených definic, v případě nedělí je při pozitivním vyhodnocení dané podmínky nastaven parametr příkazu \BarvaA{} na red a první dva sloupce sazby dne jsou vysázeny červenou barvou. V případě vyhodnocení dne jako svátku jsou na hodnotu red nastaveny parametry obou příkazů, tedy kromě \BarvaA{} i příkaz \BarvaB{} a v tom případě se provede sazba všech sloupců červenou barvou. Pokud některý svátek připadá na neděli, jsou pozitivně vyhodnoceny obě podmínky, na správnou volbu sazby textu to samozřejmě nemá žádný vliv. Při negativním vyhodnocení obou podmínek zůstane v parametrech příkazů \BarvaA{} i \BarvaB{} uložen text black a sazba všech sloupců se tedy provede černou barvou Sazba dnů, které nepřipadají na žádný z velikonočních svátků, je ve stylovém souboru pro kalendář formátu A4 KalendarA4.sty implementována následovně: \ifnum\Velikonoce = 0 \begin{tabular}{p{1em}p{1em}p{12em}} \raggedleft\textsf{\textcolor{\@BarvaA}{\@DenMesice}} & \raggedleft\textsf{\textcolor{\@BarvaA}{\@DenTydne}} & \raggedright\textsf{\textcolor{\@BarvaB}{#2}} \end{tabular} \fi Výrazně jednodušeji je implementována sazba každého řádku dne následujících po prvním. Barva sazby těchto řádků je dána obsahem prvního parametru příkazu \Radek{}{}, který sazbu těchto řádků realizuje. Podle něj se určí barva, která se použije pro sazbu textu uvedeného v druhém parametru tohoto příkazu. Tento text je vždy umístěn do třetího sloupce, první dva sloupce zůstávají v těchto řádcích vždy prázdné. 5.1.8
Sazba velikonočních svátků
Údaje o datech velikonočních svátků jsou uchovávány v parametrech příkazů \VNDen{} (den Velikonoční neděle), \VNMesic{} (měsíc Velikonoční neděle), \VPDen{} (den Velikonočního pondělí) a \VPMesic{} (měsíc Velikonočního pondělí). Ze vstupního souboru jsou však zjištěny pouze první dva z těchto čtyř údajů, tedy datum Velikonoční neděle. V definici příkazu \Kalendar{} je po načtení informací
5.1
Styl na kalendář
26
ze vstupního souboru pro daný rok rozhodnuto o datu také Velikonočního pondělí a uložení příslušných hodnot také do parametrů dalších dvou příkazů. Z parametrů příkazů pro uložení data Velikonoční neděle je nejprve zjištěno, zda den Velikonoční neděle je 31 (v tomto případě není třeba zjišťovat měsíc, protože tento den musí být 31. března). Pokud ano, je za datum Velikonočního pondělí považován následující den, tedy 1. dubna. V opačném případě, tedy že datum Velikonoční neděle připadá na jiný den než 31. března, je využit pomocný čítač \DenVelikonocniPondeli, do kterého je uložena hodnota zjištěného dne Velikonoční neděle a poté je zvýšena o hodnotu 1. Tato zvýšená hodnota je považována za den Velikonočního pondělí, měsíc je v tomto případě stejný jako měsíc, ve kterém je Velikonoční neděle. V obou případech jsou po vyhodnocení známy den i měsíc Velikonočního pondělí a tyto údaje jsou vloženy do parametrů příslušných příkazů. Určení data Velikonočního pondělí je ve stylovém souboru implementován následujícím způsobem: \ifnum\@VNDen = 31 \VPDen{1} \VPMesic{4} \else \DenVelikonocniPondeli = \@VNDen \global\advance\DenVelikonocniPondeli 1 \VPDen{\DenVelikonocniPondeli} \VPMesic{\@VNMesic} \fi V implementaci sazby velikonočních svátků se používají tři definované čítače a sice \Mesice, \DnyMesice a samozřejmě \Velikonoce. Proces zjištění, zda právě sázený den je Velikonoční neděle nebo Velikonoční pondělí je realizován větveními. Nejprve je aktuální pořadí dne v měsíci (uložené v čítači \DnyMesice) porovnán s obsahem parametru příkazu \VNDen{}, kde je uložen den Velikonoční neděle. Pokud si jsou hodnoty rovny, je porovnáno také aktuální pořadí měsíce v roce (uložené v čítači \Mesice) s obsahem parametru příkazu \VNMesic{}, kde je uložen měsíc Velikonoční neděle, získaný rovněž ze vstupního souboru pro daný rok. Pokud souhlasí i tyto hodnoty, jde o den Velikonoční neděle a čítač \Velikonoce je nastaven na hodnotu 1. Poté je podobným způsobem zjišťováno, zda jde o den Velikonoční pondělí. Porovnává se samozřejmě aktuální pořadí dne v měsíci s parametrem příkazu \VPDen{}, kde je uložen den Velikonočního pondělí, v případě shody je pak porovnáno aktuální pořadí měsíce v roce s parametrem příkazu \VPMesic{}, kde je uložen měsíc Velikonočního pondělí. V případě shody je čítač \Velikonoce nastaven na hodnotu 2. Pokud je hodnota čítače \Velikonoce nastavena na hodnotu 1 nebo 2, proběhnou následující změny v sazbě tohoto dne:
5.2
Styl na životopis
27
• změna barvy sazby pořadí dne v měsíci a zkratky dne v týdnu na červenou barvu, • červenou barvou je vysázen text konkrétního z těchto dvou svátků, • na dalším řádku je uveden text pro daný den. 5.1.9
Problematika přestupného roku
Příkaz \Den{}{} den je použit ve stylovém souboru celkem 366×. Je tedy použit také pro den 29. února. Je ale třeba zajistit, aby se tento den vkládal pouze v případě přestupného roku. Informaci o tom, zda je daný rok přestupný, nese parametr příkazu \Prestupnost{} a je získána ze vstupního souboru daného roku. Pokud parametr tohoto příkazu obsahuje znak A (jako ano), jde o přestupný rok. Uvedení 29. února je tedy tímto podmíněno: \if\@Prestupnost A\Den{N}{Horymír}\fi 5.1.10
Popis souborů KalendarA4.tex a KalendarA3.tex
Příkazy jsou v těchto souborech rozděleny do dvou základních sekcí. Sekce ZÁKLADNÍ VOLBY obsahuje dvojici příkazů. Prvním z nich je příkaz \Rok{}. Ten představuje hlavní volbu, určuje pro který rok bude kalendář tisknut. Pokud bude zadán rok, pro který není vytvořen vstupní soubor, nebude možné výstupní dokument vytvořit. Druhým příkazem je \Letopocet{} představující doplňkovou volbu pro uvádění letopočtu kromě titulní strany také na všech ostatních stranách u názvu jednotlivých měsíců. Tato možnost je aktivní při zadání znaku *, implicitně je vypnutá (prázdný parametr). Následuje sekce OBRÁZKY A POPISKY POD OBRÁZKY PRO JEDNOTLIVÉ MĚSÍCE. Tato sekce obsahuje dvanáct dvojic příkazů. Vždy první z každé této dvojice příkazů slouží pro zadání cesty k obrázku pro jednotlivé měsíce (\ObrazekLeden{}, \ObrazekUnor{}). Druhý příkaz z této dvojice slouží pro zadání popisku pod obrázkem pro příslušný měsíc (\PopisekLeden{}, \PopisekUnor{}, . . . ) Tato dvojice je zde uvedena pro každý měsíc v roce.
5.2
Styl na životopis
Z důvodu požadavku anglické verze byly také pro styl na životopis vytvořeny dva styly. Pro českou verzi stylový soubor Zivotopis.sty a vstupní soubor Zivotopis.tex, pro anglickou verzi stylový soubor CurriculumVitae.sty a vstupní soubor CurriculumVitae.tex. Do implementace není zahrnut grafický prvek pod nadpisem dokumentu a jsou vynechány téměř všechny vysvětlující texty. Také je možné, že vznikly některé malé odlišnosti ve formátování.
5.2
Styl na životopis
5.2.1
28
Implementace jednotlivých struktur
Implementace již zmíněné dvousloupcové sazby je realizována v prostředí tabular a všechny vytvořené struktury jsou v podstatě jednořádkové tabulky s jedním nebo dvěma sloupci, jsou tedy implementovány jako tabulky jednobuňkové nebo dvoubuňkové. Příkazy definované ve stylovém souboru jsou jednoparametrické nebo dvouparametrické. První parametr příkazů představuje text umístěný v levém sloupci a tento text je vždy zarovnán vpravo. Pokud má příkaz i druhý parametr, představuje text umístěný v pravém sloupci. Byly tedy definovány tyto příkazy: • \Nadpis{} je definován pro nadpis dokumentu. Nadpis tohoto nadpisu je definován se zvětšeným stupněm písma pomocí příkazu Large. Po tomto nadpisu je v definici tohoto příkazu vložena ještě vertikální mezera o velikosti 0,5 em. • \Oddil{} je definován pro nadpis jednotlivých oddílů. Tento nadpis je definován se stupněm písma zvětšeným na large. Pro oddělení od textu v předcházejícím oddílu je zde vložena před tímto nadpisem vertikální mezera o velikosti 1 em. • \Pododdil{}{} je definován pro zápis pododdílů. Pro pododdíly již, oproti oddílům, není definována žádná změna stupně písma, zůstává však vertikální mezera, ikdyž o velikosti už jen 0,5 em. • \OstatniJazyky{} je definován pro nadpis, který uvozuje část životopisu věnované znalostem jiných jazyků než mateřského. • \Jazyk{}{} je definován pro uvedení jazyka. • \OsobniUdaj{}{} je definován pro uvedení osobního údaje. Je vytvořena vertikální mezera o velikosti 0,5 em za tímto osobním údajem • \Udaj{}{} je definován pro uvedení údaje. • \Prilohy{}{} je definován pro uvedení příloh. Definice tohoto příkazu je podobná definici příkazu \Pododdil{}{}, před uvedením příloh je však vložena vertikální mezera o velikosti 1,5 em Např. příkaz \Udaj{}{} je ve stylovém souboru Zivotopis.sty definován takto: \def\Udaj#1#2{ \begin{tabular}{p{4.5cm}p{12.5cm}} \raggedleft #1 & #2 \end{tabular} } Meziodstavcová mezera je definována o velikosti 1 em, mezi skupinami příkazů \Udaj vztahující se k různým položkám (příp. jazykům) se tedy pro docílení vytvoření mezery mezi nimi vždy vynechává řádek. Tato mezera je samozřejmě vytvářena při každém vynechání řádku ve vstupním souboru. U definic jednotlivých příkazů je tento fakt brán v úvahu a tak již u některých příkazů není oddělující vertikální
5.2
Styl na životopis
29
mezera vůbec definována. U některých příkazů by však odsazení pomocí pouze této meziodstavcové mezery nebylo dostatečné a tak je v některých definicích tato mezera zvětšena ještě použitím příkazu \vspace{}. 5.2.2
Popis souboru Zivotopis.tex
Texty v levém sloupci sazby jsou předvyplněny podle předlohy, jímž se stal již zmíněný (Evropský formulář životopisu, 2010), v případě anglické verze (European curriculum vitae format, 2010). Všechny tyto texty je ale možné plně editovat, je možné nevyhovující struktury přejmenovat, příp. také pomocí příslušných příkazů vytvořit nové a lze je také samozřejmě smazat. Na začátku dokumentu je nadpis realizovaný příkazem \Nadpis{}. Nadpisy jednotlivých oddílů se realizují pomocí příkazu \Oddil{}, do jehož parametru se vpisuje název oddílu. Prvním oddílem je oddíl Osobní informace, v němž se pro zadávání jednotlivých údajů používá příkaz \OsobniUdaj{}{}. Do jeho prvního parametru se zapisuje popis položky (text v levém sloupci), do druhého parametru poté vlastní obsah (text v pravém sloupci). Následují oddíly Pracovní zkušenosti a Vzdělání a kurzy, v nichž se pro zadávání údajů používá příkazu \Udaj{}{}. Jeho použití je stejné jako u předchozího příkazu \OsobniUdaj{}{}, ale skupiny těchto příkazů vztahujících se k jednotlivým položkám se oddělují vynecháním řádku. Následuje oddíl Osobní schopnosti a dovednosti. Ten začíná uvedením mateřského jazyka. Pro tento účel se používá příkaz \Jazyk{}{}. V jeho prvním parametru je předvyplněn text „Mateřský jazykÿ, jazyk se zapisuje do druhého parametru. Následuje přehled znalostí cizích jazyků. Ten je uveden nadpisem realizovaným pomocí příkazu \OstatniJazyky{}. Pro název každého jazyka se i zde používá příkaz \Jazyk{}{}. Pro tento účel použití se jazyk vpisuje do druhého parametru, první parametr se ale ponechává prázdný. Následuje uvedení příkazu \Udaj{}{} pro každý typ znalosti jazyka, tyto typy jsou opět předvyplněné v prvním parametru příkazu, do druhého parametru se vpisuje úroveň znalosti pro každý typ. Název jazyka a jednotlivé typy znalostí a jejich úrovně tvoří skupinu příkazů, které se opět oddělují vynecháním řádku od dalších uváděných jazyků. Důvodem, proč pro cizí jazyky nebyl zaveden další příkaz pouze s jedním parametrem představujícím název jazyka je to, aby zůstalo zachováno dodržované pravidlo, že u příkazů s jedním parametrem představuje tento parametr text v levém sloupci. Zavedení příkazu pro účel názvu cizích jazyků by toto pravidlo porušovalo. Následují pododdíly realizované příkazem \Pododdil{}{} pro další schopnosti a dovednosti. Do prvního parametru tohoto příkazu se vpisuje název pododdílu, do druhého parametru se vpisují informace vztahující se k tomuto pododdílu. Stejným způsobem jsou realizovány také následující uváděné pododdíly (Řidičské oprávnění, Doplňující informace).
5.2
30
Styl na životopis
Poslední pododdíl Přílohy je realizován příkazem \Prilohy{}{}. Důvodem, proč není realizován stejně jako předcházející pododdíly, tedy příkazem \Pododdil{}{}, je již zmíněný fakt, že je před uvedením tohoto pododdílu použita větší vertikální mezera. 5.2.3
Anglická verze stylu
Pro vytvoření anglické verze stylového souboru bylo možné využít v podstatě kompletní implementaci jeho české verze. Struktura souborů Zivotopis.tex a CurriculumVitae.tex je v podstatě stejná, stejně jako struktura souborů Zivotopis.sty a CurriculumVitae.sty. Bylo třeba pouze přejmenovat stávající české názvy příkazů na anglické. Podobně byl vytvořen také vstupní soubor k anglické verzi stylu. Zde však bylo třeba změnit kromě názvů souborů také předvyplněný český text na anglický podle předlohy (European curriculum vitae format, 2010). Přehled definovaných českých příkazů a jejich anglických protějšků je uveden v tabulce 1. V souboru CurriculumVitae.tex se již samozřejmě nepřipojuje rozšíření czech. Tab. 1: Přehled definovaných českých příkazů a jejich anglických protějšků v příslušných verzích stylu
český název struktury \Nadpis{} \Oddil{} \Pododdil{} \OstatniJazyky{} \Jazyk{}{} \OsobniUdaj{}{} \Udaj{}{} \Prilohy{}{}
anglický název struktury \Title{} \Portion{} \Subportion{} \OtherLanguages{} \Language{}{} \PersonalDatum{}{} \Datum{}{} \Annexes{}{}
6
ZHODNOCENÍ
6
31
Zhodnocení
Přestože původně měly být nové styly vytvořené v rámci této práce dva, kvůli požadavkům kladeným na tyto styly byly vytvořeny celkem 4, dva pro každý uvedený typ dokumentu.
6.1
Styly na kalendář
V případě stylu na kalendář byly vytvořeny dva styly z důvodu požadavku vytvářet výstupní dokumenty formátu A4 a A3. Formát papíru je ale v podstatě to jediné, čím se od sebe styly liší, rozvržení prvků na jednotlivých stranách je totiž prakticky stejné. 6.1.1
Použití stylů
Používání těchto stylů je velmi jednoduché. Kromě zadání roku, pro který má být kalendář vytvořen a jedné doplňkové volby týkající se možnosti uvádění letopočtu na jednotlivých stranách, jsou zde dvojice příkazů pro cestu ke vkládaným obrázkům pro jednotlivé měsíce a zadání popisků, které jsou uvedeny pod příslušnými obrázky. Tato dvojice příkazů je v souboru tex uvedena samozřejmě pro každý měsíc a tak se tento soubor může jevit na první pohled poměrně rozsáhlý. 6.1.2
Omezení a možná budoucí rozšíření stylů
Asi největším omezením je implementace pouze jediného vzhledu všech stran výstupního dokumentu. To je samozřejmě nejvíce patrné na stranách jednotlivých měsíců. Např. ne každému uživateli může připadat vhodné umístění sloupce se dny u pravého okraje strany, atd. Proto je jedním z možných budoucích vylepšení těchto stylů vytvořit několik variant vzhledu výstupního dokumentu. Pravděpodobně nejlepším způsobem, jak by si uživatel jeden z těchto předdefinovaných vzhledů zvolil je přidání dalšího příkazu s jedním parametrem do základních voleb ve vstupních souborů. Jeho (nejlépe asi číselná) hodnota by určovala zvolenou variantu. Samozřejmostí by pak byl krátký popis vzhledu jednotlivých variant, který by mohl být doplněn i jejich náhledy. V projektu TEXonWeb by pro umístění tohoto popisu sloužila dokumentace k tomuto stylu. Již zmíněným omezením je také možnost vytvářet kalendáře jen pro roky, pro které je již vytvořený vstupní soubor. Vzhledem k tomu, že jsou v současnosti vytvořeny tyto soubory pro roky 2009–2020, což je momentálně rozhodně více než dostačující časový horizont, rozhodně nejde o zásadní omezení. Navíc je tvorba dalších vstupních souborů (pro další roky) velmi jednoduchá, struktura těchto souborů je v této práci popsána. Dalším omezení stylu je požadavek na poměr stran vkládaných obrázků. Styly na kalendář upravují pouze šířku těchto obrázků, jejich výška je změněna ve stejném poměru jako šířka, což je implicitní chování typografického systému TEX/LATEX při
6.2
Styly na životopis
32
zadání pouze jednoho z těchto dvou rozměrů. Vzhled strany je optimalizován na poměr stran vkládaných obrázků 4:3. Při jiném poměru stran může dojít k již neoptimálnímu vzhledu všech stran včetně titulní. Posledním omezením, které je třeba zmínit, je současná existence pouze jediné jazykové varianty tohoto stylu. Do budoucna by bylo jistě vhodné vytvořit minimálně také anglickou verzi tohoto stylu. Obnášelo by to ovšem rozsáhlejší změny ve stylech než v případě stylů na životopis, jehož anglická verze je v rámci této práce implementována.
6.2
Styly na životopis
V případě stylu na životopis byly vytvořeny dva styly z důvodu požadavku umožnění tvorby životopisů v českém a anglickém jazyce. Pro tvorbu tohoto důležitého dokumentu vytvořené styly v podstatě vyhovují v jejich současné podobě. 6.2.1
Použití stylů
Použití těchto stylů je složitější než v případě stylů na kalendář, přesto je ale jejich užití velmi intuitivní a pokud uživatel nemá nějaký zásadní důvod měnit implementovanou strukturu některého stylu pro životopis, něměl by při tvorbě životopisu narazit na žádný zásadní problém. Nejpravděpodobnější uživatelskou změnou ve struktuře dokumentu může být umístění dodatečné vertikální mezery, příp. zvětšení některé stávající. Toho lze docílit standardním příkazem typografického systému TEX/LATEX \vspace{}. Příp. se také může stát, že si uživatel bude přát vložit stránkový zlom jinde, než kde byl vložen automaticky, protože zvolené umístění není z nějakého důvodu vhodné. Toho lze docílit dalším standardním příkazem \newpage. Narozdíl od dokumentů ve formátu .doc, pro anglickou a českou verzi, které jsou dostupné ke stažení na webu Úřadu práce v Prachaticích (Strukturovaný životopis, 2010), umožňují tyto vytvořené styly jednoduchou formou využívat tohoto formátu životopisu také uživatelům typografického systému TEX/LATEX.
7
7
ZÁVĚR
33
Závěr
Tato práce se zabývala tvorbou stylů v typografickém systému TEX/LATEX. Ty jsou v tomto typografickém systému realizovány stylovými soubory. Se styly, které budou vytvořeny v rámci této práce, se počítalo jako se styly, které rozšíří množinu nabízených stylů v projektu TEXonWeb. Ten představuje jednu z možností, jak využívat typografický systém TEX/LATEX. Po zjištění, pro které typy dokumentů již jsou v projektu TEXonWeb styly vytvořeny, byly zvoleny dva typy dokumentů, pro které zde styly doposud nebyly vytvořeny. Jde ale o takové typy dokumentů, se kterými se lze zcela běžně setkat. Prvním takovým, velmi důležitým typem dokumentu, byl zvolen životopis, pro sazbu kterého by byl styl velmi praktický. Druhým z nich byl zvolen nástěnný kalendář. Byly tedy zvoleny dva zcela odlišné typy dokumentů. Životopis obsahuje v podstatě výhradně text, kalendář naopak obsahuje velké množství grafických prvků (obrázků), používá se i barevného textu, atd. Pro životopis byl stanoven požadavek umožnit pomocí stylu jednoduchou tvorbu životopisu nejen v češtině, ale také i v angličtině. Jako předloha pro českou verzi byl zvolen (Evropský formulář životopisu, 2010), pro anglickou verzi (European curriculum vitae format, 2010). Pro kalendář byl definován požadavek na vzhled jednotlivých stran kalendáře. První strana byla zvolena jako úvodní, obsahuje náhledy všech obrázků použitých na dalších dvanácti stranách (jedna strana pro každý měsíc). Byl stanoven požadavek sazby kalendáře ve formátu A4 i A3. Během implementace stylu na životopis byly kvůli požadavku na dvě jazykové varianty vytvořeny styly dva, každý pro jednu jazykovou variantu. Podobně i v případě implementace stylu na kalendář došlo na volbu vytvořit dva styly, jeden pro každý z požadovaných formátů papíru. Kromě stylových souborů byl vytvořen vstupní soubor pro každý z těchto stylů, protože tak je tomu i u stylů v projektu TEXonWeb. Ten vždy obsahuje příkazy definované v příslušném stylovém souboru a usnadňuje uživatelům práci se stylem. Vytvořeny tedy byly čtyři styly, dva pro každý ze stanovených typů dokumentů. Podařilo se splnit požadavky kladené na každý z vytvořených stylů, nicméně zejména v případě stylů na kalendář je stále hodně možností, jak styly vylepšit, neboť současné řešení s sebou nese určitá, ne však vážná, omezení. V současnosti již jsou v projektu TEXonWeb všechny styly, které byly v rámci této práce vytvořeny, dostupné a to včetně jejich dokumentace.
8
8
POUŽITÁ LITERATURA
Použitá literatura
Beran, V. a kol. Aktualizovaný typografický manuál. 5. vydání. Praha: Kafka design, 2007. Strukturovaný životopis [online]. [cit. 2010-05-27]. Dostupné z: http://portal.mpsv.cz/sz/local/pt info/dokumenty stazeni/ formulare/zivotopis. European curriculum vitae format [online]. Publikováno: 30.5. 2005, poslední revize: 28.4.2006. [cit. 2010-04-25]. Dostupné z: http://portal.mpsv.cz/sz/local/pt info/dokumenty stazeni/ formulare/zivotopis/cv en.pdf. Evropský formulář životopisu [online]. Publikováno: 30.5. 2005, poslední revize: 28.4.2006. [cit. 2010-04-25]. Dostupné z: http://portal.mpsv.cz/sz/local/pt info/dokumenty stazeni/ formulare/zivotopis/cv cz.pdf. iKalendář.info online kalendář se svátky [online]. [cit. 2010-05-21]. Dostupné z: http://ikalendar.info. kalendar.beda.cz [online]. [cit. 2010-05-23]. Dostupné z: http://kalendar.beda.cz. Kalendář FAQ [online]. [cit. 2010-05-23]. Dostupné z: http://kalendar.beda.cz/faq3.php. Kočička, P. – Blažek, F. Praktická typografie. Dotisk 2. vydání. Brno: Computer Press a.s., 2007. 288 s. ISBN 80-7226-385-4. Kolektiv autorů. Pravidla českého pravopisu. 2. opravené vydání. Olomouc: FIN PUBLISHING, 1998. ISBN 80-86002-42-X. Nakladatelství Helma, s.r.o. Minimax – Naše příroda 2009. Praha: Nakladatelství Helma, s.r.o., 2008. Olšák, P. TEXbook naruby [online]. 2. vydání. Brno: Konvoj, 2001. 468 s. ISBN 80-7302-007-6. Dostupné z: ftp://math.feld.cvut.cz/pub/olsak/tbn/tbn.pdf. Rybička, J. LATEX pro začátečníky. 3. vydání. Brno: Konvoj, 2003. 238 s. ISBN 80-7302-049-1. TeXonWeb [online]. [cit. 2010-05-11]. Dostupné z: http://tex.mendelu.cz/navod.pl.
34
Přílohy
A
A
UKÁZKA KALENDÁŘE FORMÁTU A4
36
Ukázka kalendáře formátu A4
Ukázka vyplnění vstupního souboru KalendarA4.tex a první a šestá strana výstupního souboru ve formátu .pdf získaného pomocí takto vyplněného souboru. Některé řádky jsou v uvedeném příkladu vstupního souboru rozděleny do dvou řádků, aby se vešly na šířku této stránky. \documentclass{article} \usepackage{color, czech, graphicx, KalendarA4} \usepackage[landscape]{geometry} \begin{document}
% ZÁKLADNÍ VOLBY: \Rok{2010} % zadejte rok, pro který si přejete tisknout kalendář \Letopocet{} % zadejte "*" pokud si přejete uvádět letopočet kromě %prvního listu také u názvu každého měsíce
% OBRÁZKY A POPISKY POD OBRÁZKY PRO JEDNOTLIVÉ MĚSÍCE: \ObrazekLeden{jedna.png} % cesta k obrázku na měsíc leden \PopisekLeden{Poznámka k lednovému obrázku} % popisek pod % obrázkem na měsíc leden \ObrazekUnor{dve.png} % cesta k obrázku na měsíc únor \PopisekUnor{Poznámka k únorovému obrázku} % popisek pod % obrázkem na měsíc únor \ObrazekBrezen{tri.png} % cesta k obrázku na měsíc březen \PopisekBrezen{Poznámka k březnovému obrázku} % popisek pod % obrázkem na měsíc březen \ObrazekDuben{ctyri.png} % cesta k obrázku na měsíc duben \PopisekDuben{Poznámka k dubnovému obrázku} % popisek pod % obrázkem na měsíc duben \ObrazekKveten{pet.png} % cesta k obrázku na měsíc květen \PopisekKveten{Poznámka ke květnovému obrázku} % popisek pod % obrázkem na měsíc květen
A
UKÁZKA KALENDÁŘE FORMÁTU A4
\ObrazekCerven{sest.png} % Cesta k obrázku na měsíc červen \PopisekCerven{Poznámka k červnovému obrázku} % popisek pod % obrázkem na měsíc červen \ObrazekCervenec{sedm.png} % cesta k obrázku na měsíc červenec \PopisekCervenec{Poznámka k červencovému obrázku} % popisek pod % obrázkem na měsíc červenec \ObrazekSrpen{osm.png} % cesta k obrázku na měsíc srpen \PopisekSrpen{Poznámka k srpnovému obrázku} % popisek pod % obrázkem na měsíc srpen \ObrazekZari{devet.png} % cesta k obrázku na měsíc září \PopisekZari{Poznámka k zářijovému obrázku} % popisek pod % obrázkem na měsíc září \ObrazekRijen{deset.png} % cesta k obrázku na měsíc říjen \PopisekRijen{Poznámka k říjnovému obrázku} % popisek pod % obrázkem na měsíc říjen \ObrazekListopad{jedenact.png} % cesta k obrázku na měsíc listopad \PopisekListopad{Poznámka k listopadovému obrázku} % popisek pod % obrázkem na měsíc listopad \ObrazekProsinec{dvanact.png} % cesta k obrázku na měsíc prosinec \PopisekProsinec{Poznámka k prosincovému obrázku} % popisek pod % obrázkem na měsíc prosinec
\Kalendar \end{document}
37
A
UKÁZKA KALENDÁŘE FORMÁTU A4
38
B
B
UKÁZKA ŽIVOTOPISU V ČEŠTINĚ
39
Ukázka životopisu v češtině
Ukázka vyplnění vstupního souboru Zivotopis.tex a výstupního souboru ve formátu .pdf získaného pomocí takto vyplněného souboru. I zde jsou v uvedeném příkladu vstupního souboru některé řádky rozděleny do dvou řádků, aby se vešly na šířku této stránky. Údaje jsou vymyšlené, pouze v položkách v oddílu Vzdělání a kurzy jsou uvedeny informace podle existujících studijních oborů na Mendlově univerzitě v Brně (v příkladu je použit dřívější název univerzity). \documentclass{article} \usepackage{czech, Zivotopis} \begin{document} \Nadpis{Životopis}
\Oddil{Osobní informace} \OsobniUdaj{Jméno}{Jan Novák} \OsobniUdaj{Adresa}{Brněnská 328, 600 00 Brno} \OsobniUdaj{Telefon}{123 456 789} \OsobniUdaj{Fax}{987 654 321} \OsobniUdaj{E-mail}{
[email protected]} \OsobniUdaj{Národnost}{česká} \OsobniUdaj{Datum narození}{26. 2. 1980}
\Oddil{Pracovní zkušenosti} \Udaj{Období (od--do)}{2007--2009} \Udaj{Jméno a adresa zaměstnavatele}{Konečný \& Vágner -Dopravní stavby, s. r. o.} \Udaj{Oblast podnikání nebo název odvětví}{Dopravní infrastruktura} \Udaj{Dosažená pozice}{IT manager} \Udaj{Hlavní pracovní náplň a~odpovědnost}{Vedení týmu IT specialistů} \Udaj{Období (od--do)}{2004--2007} \Udaj{Jméno a adresa zaměstnavatele}{Stavby Vojtěch Malý, s. r. o.} \Udaj{Oblast podnikání nebo název odvětví}{Stavební práce} \Udaj{Dosažená pozice}{Správce podnikové sítě} \Udaj{Hlavní pracovní náplň a odpovědnost}{Zajišťování provozu podnikové sítě}
B
UKÁZKA ŽIVOTOPISU V ČEŠTINĚ
40
\Oddil{Vzdělání a kurzy} \Udaj{Období (od--do)}{2002--2004} \Udaj{Název a typ organizace poskytující vzdělání či kurzy} {Mendelova zemědělská a lesnická univerzita v Brně} \Udaj{Hlavní předměty/praktické dovednosti}{Inovace pro informatiky, Systémové inženýrství, Teorie programovacích jazyků} \Udaj{Získaný titul}{Ing.} \Udaj{Úroveň v národní klasifikaci (pokud možno uvést)}{ISCED 5A} \Udaj{Období (od--do)}{1999--2002} \Udaj{Název a typ organizace poskytující vzdělání či kurzy} {Mendelova zemědělská a lesnická univerzita v Brně} \Udaj{Hlavní předměty/praktické dovednosti}{Algoritmizace, Operační systémy, Programovací techniky} \Udaj{Získaný titul}{Bc.} \Udaj{Úroveň v národní klasifikaci (pokud možno uvést)}{ISCED 5A}
\Oddil{Osobní schopnosti a~dovednosti} \Jazyk{Mateřský jazyk}{český jazyk} \OstatniJazyky{Ostatní jazyky} \Jazyk{}{anglický jazyk} \Udaj{Čtení}{výborně} \Udaj{Psaní}{výborně} \Udaj{Mluvený projev}{výborně} \Jazyk{}{německý jazyk} \Udaj{Čtení}{dobře} \Udaj{Psaní}{dobře} \Udaj{Mluvený projev}{základy} %\Pododdil{Sociální schopnosti a~dovednosti}{} \Pododdil{Organizační schopnosti a~dovednosti} {Zkušenosti s vedením týmu pracovníků z předchozího zaměstnání.} \Pododdil{Technické schopnosti a~dovednosti}{Velmi dobrá znalost
B
UKÁZKA ŽIVOTOPISU V ČEŠTINĚ
programovacího jazyka C++, znalosti v oboru 3D modelování.} %\Pododdil{Umělecké schopnosti a~dovednosti}{} %\Pododdil{Ostatní schopnosti a~dovednosti}{} \Pododdil{Řidičské průkazy}{skupina A, B} %\Pododdil{Doplňující informace}{}
%\Prilohy{Přílohy}{} \end{document}
41
B
UKÁZKA ŽIVOTOPISU V ČEŠTINĚ
42
B
UKÁZKA ŽIVOTOPISU V ČEŠTINĚ
43
C
C
CD PŘÍLOHA
44
CD příloha
K této práci je také přiloženo CD. Obsahuje všechny soubory, které byly pro funkci všech čtyř vytvořených stylů vytvořeny. Soubory jsou rozděleny do dvou složek podle toho, ke kterému typu dokumentu patří: • Styly na kalendář – vstupní soubor pro kalendář formátu A4 KalendarA4.tex, – stylový soubor pro kalendář formátu A4 KalendarA4.sty, – vstupní soubor pro kalendář formátu A3 KalendarA3.tex, – stylový soubor pro kalendář formátu A3 KalendarA3.sty, – 12 vstupních souborů pro kalendář pro roky 2009–2020 (2009.tex, 2010.tex, . . . ), • Styly na životopis – vstupní soubor pro životopis v češtině Zivotopis.tex, – stylový soubor pro životopis v češtině Zivotopis.sty, – vstupní soubor pro životopis v angličtině CurriculumVitae.tex, – stylový soubor pro životopis v angličtině CurriculumVitae.sty.