/
Typesetting Typesetting

Typesetting - PDF document

yoshiko-marsland
yoshiko-marsland . @yoshiko-marsland
Follow
416 views
Uploaded On 2016-09-30

Typesetting - PPT Presentation

CYRILLICNUMERALS withConTEXtMkIV AModule ID: 471100

CYRILLICNUMERALS withConTEXtMkIV AModule

Share:

Link:

Embed:

Download Presentation from below link

Download Pdf The PPT/PDF document "Typesetting" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

Typesetting CYRILLICNUMERALS withConTEXtMkIV AModule · а· · в· · г· · д· · е· · ѕ· · з· · и· · ѳ· · і· · аі· · ві· · гі· · ді· · еі· · ѕі· · зі· · иі· · ѳі· · к· ©2011–2013PhilippGesang,RadebeulThelatestVersioncanbefoundat h((opA//bM(b)jNk(.OPl/ohl/ .Mailbugsandfixesorcomplaintsandsuggestionsto megas.kapaneus@gmail.com . 1 CONTENT а INTRODUCTION .....................................2 в FUNCTIONALITY ....................................4 в. а Setup 4 в. в PredefinedCommands 8 в. г CommandDerivation 10 г USAGEANDPRECAUTIONS .........................11 г. а Counters 11 г. в FontIssues 12 LICENSE ...............................................13 REFERENCES ..........................................14 2 аINTRODUCTIONTheConTEXtformatcomeswithacollectionofconversionroutinesfordifferentnumbersystemsthatarespecifiedinthefilesjOPk-jO#.mNMvandjOPk-jO#.n)i.Cyrillicnumerals,however,arenotpartofthiscollection.TheaimofthemoduleathandistoprovidemeansofhandlingCyrillicnumbersandmakethemseamlesslyintegratewiththeexistinginterfacefornumberconversion.IfyouarefamiliarwithCyrillicnumbers,youmightchoosetoskiptherestofthissectionandinsteadcontinueinmediasreswiththedescriptiononthemodule’susageinthesectionon“ Functionality ”.�123456789 �·100авгдеѕзиѳ�·101іклмнѯопч�·102рстуфхѱѡцTable1NumbervaluesoftheCyrillicalpha-bet.TheCyrillicnumeralsystem,likethealphabetitisbasedon,orig-inatedfromtheGreeknumeralsandthuscontinuesmanyfeaturesofthelatter. 1 AswiththeRomannumbersystem,therearenodedicatedglyphsreservedfornumerals,insteadnumbersarerepre-sentedbystringsoflettersfromtheordinaryalphabet,organizedinapeculiarway.Bothsystemsalsohavethebase(10)incommon.How-ever,unliketheRomansys-temCyrillicnumbersarepo-sitional,meaningthatthenumericalvalueofadigitdependsonitslocationrelativetotheotherdigits.Thefirstninedigits,inascendingorder,are:“а”,“в”,“г”,“д”,“е”,“ѕ”,“з”,“и”,and“ѳ”.Asyoumighthavenoticed,thisseriesdoesnotcorrespondtothefirstnineglyphsoftheCyrillicalphabet(абвгдежѕз),butrathertotheorderoftheoriginalGreeklettersfromwhich 1 ThoroughexaminationsofhowCyrillicnumberswereusedinpraxiarehardtofind.Thebestthatthecoupleofbookshelfsdedicatedtogrammarinalocalde-partmentofSlavoniclanguageshastoofferappearstobe Žolobov(2002) .Anotherwork, Trunte(2005) ,althoughitfollowsalessdescriptivebutratherinstructionalapproach,deservesmentioningaswell. introduction3theywerederived(14γ79ϛζ61,withthecharacterϛatposition№2representing“stigma”).Theinheritedorderofnumericalvalueswaskept,essentiallytradingbackwardcompatibilityforsimplicity.Thetwoothersetsoflettersthatrepresentmultiplesoftenandhundredarelistedin Table1 .Thedigitsarewrittenindescendingorder,beginningwiththemostsignificantone.Thenumbersfrom11to19followadifferentrulefortheirordermimicksthespokenlanguage,whichmeansthatthelesssignificantdigitprecedesthemoresignificantone(аі,ві,гі,ді,еі,ѕі,зі,иі,ѳі).Therearenoglyphstorepresentzeros,sotheyaresimplyomitted.Forexample,intheCyrillicsystemthenumber42iswrittenasмв;thelackofadistinctzerosigncauses402tohavetwodigitsaswell,butthecharacterrepresentingthedigit4ischosenfromthehundredsset:ув.Therulessofardonotallowfornumbersabove999.Tocompensateforthelackofadditionalletters,greaternumbersarerepresentedbythesameglyphs(theirvaluebeingpaddedby1000).Therearetwowaystoavoidconfusion:Eachdigitmaybeprefixedwithaspecialcharacter,thethousandssign҂.Thatway,42isstillwrittenмв,but42000becomes҂м҂в,andtheirsum҂м҂вмв.Butifnumbersbecomebigger,thehighdigitscantakealternativeornateforms:р҈–insteadof҂р–for100000,andа҉for1000000.Inanenvironmentwherepunctuationwasatbestminimalandinterwordspacingaluxury,numbersofthiskindtendtobeconfusedwithtext.Therefore,aCyrillicnumbercanhaveadditionalmarkers.Dotsareusedasdelimitersbeforeandafteranumber:·мв·.Addi-tionally,anumbermaybeindicatedbythetitlo,whichmayspanitswholelengthorjustpartsofit: мв.TheCyrillicnumbermodulecombinesalltheabovementionedaspectsintoonehandycommandgenerator,relyingonLuafortheconversionroutineandMETA%OSTforthetitloplacement.Withalloptionsinoneplace,itistrivialtocreateandmaintaindifferentconversionsettingsfordifferentpurposes. 4 вFUNCTIONALITY в. аsetupThemoduleisinitializedasanyother:\)pkmOK)nk[jyPMnnMj#)mbkPpHOncethemodulecodeisloaded,thesetupcommandprovidesmeanstoconfigureallthefunctionalityitoffers. \pk()ojyP#)m[...HOptional1[..,.=.,..H21Identifier2jOmmi#K=\...#1KO(p=#Oykp KO(pymbOn=Textok#.MK(h=DimensionoPkLkPh)#KPkKN=#O ykp(M(nO=mo LO#((M(nOjOnOP=Identifier(M(nOnOji(MO#=mMKKnk LM#inLMPp((M(nOmOKk=Number(M(nOpoi#=Number KO(p Let’swalkthroughtheoptionsonebyone.AswashintedintheintroductionacommonpracticeistodelimitCyrillicnumberswithdots.DotplacementisenabledordisabledbysettingtheKO(pkeytoyesornorespectively.TheKO(pymbOnkeyallowstheusertosupplyadelimiterofEirownchoice;itdefaultstothecharacter“·”(unicode KO(pymbOn u+00b7).Ifafontdoesn’tcontainaglyphforthiscodepointorforwhateverreasonanothersymbolisrequired,thesolutionwilllooklikethis:\pk()ojyP#)m[KO(p=ykp,KO(pymbOn=\jKO(H.Theresultofthismodificationlooksasfollows:⋅мв⋅.Asthedotcanbeanarbitrarysymbol,itcouldbereplacedbytheasterisk:*мв*,or–evenweirder–thehashcharacter(“Gartenzaun”):#мв#. functionality5 Inordertonotatethesixthdecimaldigit(formultiplesofone oPkLkPh)#KPkKN hundredmillion)therearetwomutuallyexcludingoptions:eitherthehundredthousandssignorthethousandsprefixmaybeemployed.Thus,thesetupkeyoPkLkPh)#KPkKNdetermineswhichonewillbechosen.Ifsettoyes,thenit’sgoingtobethehoundredthousandssign,elsetheregularthousandssign:ц҈=҂с+҂ѱ.(Asisobviousfromthisexample,thevisualqualityofthehoundredthousandssign,whichisaseparateglyph,dependsonthefontused.)NoteveryfontcontainsproperglyphsfortheentireCyrillicuni-coderange,infacteverydedicatedfontforasingleCyrillicalphabet–contemporaryRussian,say–mightnotcontainallthecharacters jOmmi#K neededtorepresenteveryCyrillicnumeral.Thisistheresultofthehis-toricaldevelopmenttherespectivescriptswentthrough.Thisprocessusuallyleadtotheeliminationofseveralglyphsatdifferentstagesofthedevelopment.ForexampletheRussianalphabetexperiencedonesignificantreductionoflettersatthehandofemperorPeterI 2 andanotherlaterin1917asaconsequenceof–notonly–therevolution. 3 Thus,chancesarethatinordertorepresentCyrillicnumbers,whichrelyonasupersetofthemodernRussianalphabet,anotherfontneedstobechosen. 4 TheCyrillicNumbersmoduleprovidesahookforthiskindofcustomization:youmaydefineyourownfontswitchingmacroandassignittothejOmmi#Kkeyofthesetup.SupposeyoudecidetotypesetyournumbersusingtheParatypeSeriffont. 5 %%%1.,OiK(hkmOK)nki#K(hkLO#(.\)pkmOK)nk[jyPMnnMj#)mbkPpH\)pk(yokpjPMo(LMnk[(yok-oiPi(yok.mNMvH%%%2.DkLM#k(hkLO#(i#KijOmmi#K(hi(p.M(jhkp(OM(.\KkLM#k(yokLijk[#)mbkPLO#(H[PmH[pkPMLH[oiPi(yokH[KkLi)n(H[H 2 Foranoverviewcf. http://www.paratype.ru/e-zine/issue04/peter1/peter1a.htm orjustgoogle“гражданскийшрифт”. 3 Cf. http://ru.wikipedia.org/wiki/___1918_ . 4 Fontfallbacksareanotheroptionifthesubstitutesmatchthemainfonttypograph-ically;see Hagen/Hoekwater(2011) ,pp.97–99. 5 AtypescriptcanbefoundontheConTEXtmailinglist: h((oA//iPjhMvk.jO#(k+(liPKk#.#k(/mkppilk/20110105.204326.K0228ji7.k#.h(mn .KeepinmindthatParaTypeSerifitselfisnotaparticularlysuitablenumberfontasitdoesnotcontainallrequiredglyphs. 6functionality мв мв мв мв мв мв мв мв мвFigure1Titloasamatteroftaste.\)#k+oi#KkK\KkLM#k[1H\#)mbkPjOmmi#K?%\bklM#lPO)o\ni#l)ilk[P)H%\pk()obOKyLO#([#)mbkPLO#(H%#1%\k#KlPO)o%}%%%3.HOON(hkjOmmi#KM#(OO)PjO#vkP(kP.\pk()ojyP#)m[KO(p=ykp,jOmmi#K=\#)mbkPjOmmi#KH%%%4.Fpkip#kkKkK.\p(iP((k+(dOPmin(k+(\jyP#)m?42}\KO(p\p(Oo(k+(%%%5.????%%%6.EPOLM(!!!!!Naturally,thejOmmi#Kmaydoanythingthatfitsinsideaone-ar-gumentmacro,fromcoloring( ·· )tocasemanipulation(МВ).Thekey(M(nOcontrolstheplacementand,ifapplicable,placement (M(nO methodofthe titlo.Thetwovalidmethodidentifiersarempandfont,everythingelsewillbeinterpretedasno,e.g.thetitlowillbeomitted.Thelattermethod,font,takesthetitloglyphassuppliedbythefontfile(codepointU+483).Themaindrawbackofthissolutionisthattomyknowledgethefonttitlaaredesignedtospanasinglecharacteronly.Asthetitlobelongstotheclassofcombiningcharacters,inthestreamofunicodeglyphsitwillbeappendedtothecharacterabovewhichitisplaced.Thus,multi-digitCyrillicnumbers(i.e.essentiallyanynumberwithtwoormorenon-zerodigits)won’tberepresentedinanoptimalway:мв҃.Thereisafurtheroption,(M(nOnOji(MO#,which (M(nOnOji(MO# controlstheplacementofafontspecifictitlo.Thethreepossiblevaluesspecifyapositionfirst:҂д҃смв,middle:҂дсм҃в,andfinal:҂дсмв҃.(Forevencharactercounts,themiddleargumentwillpickoneplacetotherightoftheexactmiddle.) functionality7 (M(nOpoi#result1҂у҂к҂дсм в2҂у҂к҂дс мв3҂у҂к҂д смв4҂у҂к ҂дсмв5҂у ҂к҂дсмв2 ҂у҂к҂дсмвFigure2Differenttitlospans.AnalternativetothefonttitloisprovidedbythempvariantwhichusesMETA%OSTtoactuallydrawatitloabovethestringofdig-its.Notonlydoesthistitlocovertheentirenumeral,italsocomesinavarietyofdrawingroutines.Atthemomentthereareninemoreorlessdifferenttitlayoumaychoosefromasdemonstratedin figure1 .Thesecanbeen-abledonviathe(M(nOmOKkkey.(Observantuserswillhaverecognizedmode8astheoldRubl’sign: мв. 2 )Therangeofdigitstobecoveredbythetitlocanbecustomizedbypassingtheparameter(M(nOpoi#aninteger.Thedefaultvalueof3resultsinthetitlospanningatmaximumtheleastsignificantthree (M(nOmOKk,(M(nOpoi# digits,becausethesewillnotbeprefixedbyathousandssign.Iftheuserwantsthenumeraltobecoveredasawhole,Ecansimplypassthevalueall.Bewarethatthedimensionsofthetitloareproportionaltothewidthofthenumeral.Therefore,sufficientlywide(intermsofnon-zerodigits)numberswillcausethetitlotoshrinkhorizontallyasseenin figure2 .E.g.forthesingledigitnumber аthetitloevenexceedsthecharacteritsitson,whileitdoesnotentirelycoverthefivedigitsplustwothousandsignsof ҂н҂дтка.Whenusingthemptitlothecolorofthiselementcanbechosenseparatelybypassingavalid (M(nOjOnOP coloridentifiertothe(M(nOjOnOPkey.Thefollowingexamplecodedemonstratesthecolorizationanddrawingfacilities.\)pkmOK)nk[jyPMnnMj#)mbkPpH\pk()obOKyLO#([jOmo)(kP-mOKkP#-)#MjOKkH\pk()ojyP#)m[(M(nO=mo,(M(nOjOnOP=bn)k,(M(nOpoi#=inn,(M(nOmOKk=7,H\p(iP((k+(\p(iP(nM#kp 2 Cf. http://ru.wikipedia.org/wiki/##.D0.92_.D0.98.D0.BC.D0.BF.D0.B5.D1.80.D0.B0.D1.82.D0.BE.D1.80.D1.81.D0.BA.D0.BE.D0.B9_.D0.A0.D0.BE.D1.81.D1.81.D0.B8.D0.B8 . 8functionality \jyP#)m?42}\jyP#)m[(M(nOjOnOP=PkK,(M(nOmOKk=9H?141213}\jyP#)m[(M(nOjOnOP=lPkk#,(M(nOmOKk=2H?271828}\jyP#)m[(M(nOjOnOP=jyi#,(M(nOmOKk=4H?314159}\p(OonM#kp\p(Oo(k+( ok#.MK(h TheMETA%OSTmethodalsocomeswithakeyok#.MK(h,whichratherobviouslydeterminesthewidthofthepenthatisusedwhendrawingatitlo.Findingtheoptimalwidthcaninvolvealotoftestingontheuser’sside;asarule,thegreaterthefontsize,thewiderthepenshouldbe.Referto table1 forademonstrationofdifferentvaluesforthisparameter.10.200pt· ·42012.200pt· ·20.800pt· ·42022.800pt· ·31.000pt· ·42033.000pt· ·41.200pt· ·42043.200pt· ·51.400pt· ·42053.400pt· ·21.200pt· ·42023.200pt· ·71.800pt· ·42073.800pt· ·82.000pt· ·42084.000pt· ·92.200pt· ·42094.200pt· ·102.400pt· ·42104.400pt· ·Table1Comparisonofdifferentvaluesfortheparameterok#.MK(h. в. вpredefinedcommandsOncethemoduleisloaded,thecommands\jyP#)mand\jyP#)mKPi.(M(nOwillhavebeenpredefined. \cyrnum[..,.=.,..HOptional1?...}21inheritsfrom\pk()ojyP#)m2Content functionality9 \jyP#)misthedefaultCyrillicnumbermacro.Itisfullyfunctional,meaningthatbesidesconvertinganonnegativeintegerintoaCyril-licnumeral,ittakesakey-valuesetofoptionsasanoptionalfirstargument.\)pkmOK)nk[jyPMnnMj#)mbkPpH\p(iP((k+(\jyP#)m?1}\jyP#)m[(M(nO=mo,(M(nOmOKk=4H?42}\jyP#)m?15}\p(Oo(k+(Anyoftheabovementionedsettingscanbespecifiedinthefirstargument.AscustomarywithConTEXtmacros,theseadditionalsettingsarelocaltooneinstance.Furthercallstothemacrowon’tbeaffected,unlesstheyareexplicitlyappliedvia\pk()ojyP#)m,Theuseoftitlaisnotrestrictedtoindicatingnumerals.Inad-ditionitisoftenemployedasakindofemphasisinhandwrittentextwhereitisnoteasytoachievevisualdistinctionbyfontswitching.Also,thetitloservesasadefaultmarkerforabbreviationsasinблагодѣть→ блгодѣть. \cyrnumdrawtitlo?...}**ContentThisiswherethemacro\jyP#)mKPi.(M(nOcomesintoplay.Forinstance,designationsofthingsconsidered“sacred”arehighlightedbydefaultinsometexts.Becausetheyappearveryfrequently,theywereshortenedaswell,likeгосподь→ гь. 7 господь->\jyP#)mKPi.(M(nO?гь} 7 Examplestakenfrom http://commons.wikimedia.org/wiki/Category:Titlo?uselang=uk . 10functionality благодѣть->\jyP#)mKPi.(M(nO?блг}одѣть в. гcommandderivationThereisnoneedtoreconfigurethe\jyP#)mmacrowheneveryouintendtodeviatefromthepresets.Instead,specialpurposecommandscanbedefinedvia\KkLM#kjyP#)m. \KkLM#kjyP#)m[...H1[..,.=.,..HOptional21Identifier2inheritsfrom\pk()ojyP#)mAlltheoptionsthatcanbepassedto\KkLM#kjyP#)marealsovalidforderivedmacros;theyinheritthesetupsofthemacrostheyarederivedfrom.Afullexampletoplaywithisgiveninbelowlisting:\)pkmOK)nk[jyPMnnMj#)mbkPpH\pk()obOKyLO#([jOmo)(kP-mOKkP#-)#MjOKkH\KkLM#kjyP#)m[my#)mO#kH[(M(nO=#O,KO(p=#OH\KkLM#kjyP#)m[my#)m(.OH[my#)mO#kH\pk()ojyP#)m[my#)m(.OH[(M(nO=mo,(M(nOmOKk=2,(M(nOjOnOP=PkKH\KkLM#kjyP#)m[my#)m(hPkkH[my#)m(.OH\pk()ojyP#)m[my#)m(hPkkH[(M(nOmOKk=4,KO(p=ykpH\p(iP((k+(\my#)mO#k?42}\my#)m(.O?42}\my#)m(hPkk?42}\p(Oo(k+(\k#KM#o)(Whichresultsin: · ·. 11 гUSAGEANDPRECAUTIONS г. аcountersThemacroscreatedby\KkLM#kjyP#)maregenericconversioncom-mands.Assuch,theycanbehookedintoanyfunctionalitythatoutputsintegersofsomesort:documentstructureelements,pagenum-bers&c.InordertohaveConTEXtrecognizeyourpersonalCyrillicnumbermacroasaconverteryouneedthemacro\KkLM#kjO#vkPpMO#.\)pkmOK)nk[jyPMnnMj#)mbkPpH\pk()obOKyLO#([jOmo)(kP-mOKkP#-)#MjOKkH%%%1.DkLM#ki#)mbkPjO#vkP(kP.\KkLM#kjyP#)m[#ki(pkj(MO#pH[KO(p=ykp,(M(nO=mo,(M(nOmOKk=7,H%%%2.RklMp(kP(hkjO#vkP(kP.\KkLM#kjO#vkPpMO#[my-pkj(MO#-jO#vkPpMO#H[\#ki(pkj(MO#pH%%%3.C#pkP(M(M#(Oip(P)j()Pkpk(.\KkLM#kp(P)j()PkjO#vkPpMO#pk([my-pkj(MO#-pk(H[#)mbkPp,my-pkj(MO#-jO#vkPpMO#H[my-pkj(MO#-jO#vkPpMO#H%%%4.Fpk(hkpk(M#yO)Pjhio(kPjOmmi#K.\KkLM#khkiK[myjhio(kPH[jhio(kPH\pk()ohkiK[myjhio(kPH[pkj(MO#jO#vkPpMO#pk(=my-pkj(MO#-pk(,oilk=#O,H\p(iP((k+(\KOPkj)Ppk?10}?%\p(iP(myjhio(kP[(M(nk=LOOH\M#o)(N#)(h\p(Oomyjhio(kP} 12usageandprecautions \p(Oo(k+(\k#KM#o)( г. вfontissuesAlthoughnottheentireCyrillicalphabetisneededtorepresentthenumerals,theyinvolvecertaincharacterswhichareuncommonincontemporarylanguages.ThereforetheyareusuallyomittedinCyrillicfonts,whichleadstotheproblemoffindinganadequatefont.AmatchingsupersetofKnuth’stypefaceisComputerModernUnicodewhichispartofTEXLiveandpackagedformanydistributions. 8 CMUisSIL-OpenFontlicensed;ithasbeenusedinsomeoftheaboveexamples.TherearealternativesofferingglyphshapesthatresemblethehandwrittenscriptofOldSlavoniccodices.OneofthemisthebeautifulBukyVedewhichhasbeenusedasthemainCyrillicfontthroughoutthetext.ItwascreatedbytheCodexprojectoftheBambergUniversity 9 butunfortunatelythelicensingtermsareimprecise(non-free).ItsauthorsofferanotherfontmatchingthepopularTimestypefaceunderayetmorerestrictivelicense. 10 8 Home: http://cm-unicode.sourceforge.net/ ;TEXLive: http://tug.org/svn/texlive/trunk/Master/texmf-dist/fonts/opentype/public/cm-unicode/ ;Arch: http://aur.archlinux.org/packages.php?ID=44029 ;Debian: http://packages.debian.org/wheezy/fonts-cmu . 9 Home: http://kodeks.uni-bamberg.de/aksl/Schrift/BukyVede.htm . 10 Home: http://kodeks.uni-bamberg.de/aksl/Schrift/RomanCyrillicStd.htm . LICENSECopyright2011–2013PhilippGesang.Allrightsreserved.Redistributionanduseinsourceandbinaryforms,withorwithoutmodification,arepermittedprovidedthatthefollowingconditionsaremet:1.Redistributionsofsourcecodemustretaintheabovecopyrightnotice,thislistofconditionsandthefollowingdisclaimer.2.Redistributionsinbinaryformmustreproducetheabovecopy-rightnotice,thislistofconditionsandthefollowingdisclaimerinthedocumentationand/orothermaterialsprovidedwiththedistribution.thissoftwareisprovidedbythecopyrightholder“asis”andanyexpressorimpliedwarranties,including,butnotlimitedto,theimpliedwarrantiesofmerchantabilityandfitnessforaparticularpurposearedisclaimed.innoeventshallthecopyrightholderorcontributorsbeliableforanydirect,indirect,incidental,special,exemplary,orconsequentialdamages(including,butnotlimitedto,procurementofsubstitutegoodsorservices;lossofuse,data,orprofits;orbusinessinterruption)howevercausedandonanytheoryofliability,whetherincontract,strictliability,ortort(includingnegligenceorotherwise)arisinginanywayoutoftheuseofthissoftware,evenifadvisedofthepossibilityofsuchdamage. REFERENCES1HAGEN,HansandTacoHOEKWATER.2011.FontsinConTEXt.Hasselt2TRUNTE,NikolaosH.2005.Altkirchenslavisch.InСловѣньскъиѩ’ъікъ.EinpraktischesLehrbuchdesKirchenslavischenin30Lektionen.ZugleicheineEin-führungindieslavischePhilologie.3ŽOLOBOV,O.F.2002.Čislitelnye.InIORDANIDI,S.I.andV.B.KRYSKO,editors,Istoričeskaâgrammatikadrevnerusskogoâzyka,pages58–23.