123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353 |
- \input texinfo
- c %**start of header
- settitle The Org Manual
- include org-version.inc
- set MAINTAINERSITE
- set AUTHOR Carsten Dominik
- set MAINTAINEREMAIL
- set MAINTAINERCONTACT
- c %**end of header
- c -----------------------------------------------------------------------------
- c =======================================
- c When set, commands names are shown. When clear, they are not shown.
- c Below we define the following macros for Org key tables:
- c orgcmd{key,cmd} Key with command name
- itemx
- c orgcmdtkc{text,key,cmd} Like orgcmd,special text instead of key
- c orgcmdkxkc{key1,key2,cmd} Two keys with one command name, but
- itemx
- c xorgcmdkskc{key1,key2,cmd} Same as previous, but use
- c orgcmdkkcc{key1,key2,cmd1,cmd2} Two keys and two commands
- c Inserts:
- macro orgkey{key}
- item
- end macro
- kindex \key\
- kbd{\key\}
- c one key with a command
- item KEY COMMAND
- ifset cmdnames
- findex \command\
- item hskip 0pt plus 1filll
- end iftex
- item tie{}tie{}code{\command\})
- end ifset
- kindex \key\
- kbd{\key\}
- end macro
- itemx
- itemx KEY COMMAND
- ifset cmdnames
- findex \command\
- itemx hskip 0pt plus 1filll
- end iftex
- itemx tie{}tie{}code{\command\})
- end ifset
- kindex \key\
- kbd{\key\}
- end macro
- c Inserts:
- macro orgcmdnki{key,command}
- findex \command\
- item hskip 0pt plus 1filll
- end iftex
- item tie{}tie{}code{\command\})
- end ifset
- item
- end ifclear
- c one key with a command, and special text to replace key in item
- item TEXT COMMAND
- ifset cmdnames
- findex \command\
- item hskip 0pt plus 1filll
- end iftex
- item tie{}tie{}code{\command\})
- end ifset
- kindex \key\
- kbd{\text\}
- end macro
- c Inserts:
- macro orgcmdkkc{key1,key2,command}
- kindex \key1\
- findex \command\
- item hskip 0pt plus 1filll
- end iftex
- item tie{}tie{}code{\command\})
- end ifset
- kindex \key1\
- item
- end ifclear
- c Two keys with one command name, but different functions, so format as
- itemx
- item KEY1
- itemx KEY2 COMMAND
- ifset cmdnames
- kindex \key2\
- iftex
- kbd{\key1\}
- kbd{\key2\} code{\command\}
- ifnottex
- kbd{\key1\}
- kbd{\key2\} tie{}tie{}(
- end ifnottex
- ifclear cmdnames
- kindex \key2\
- kbd{\key1\}
- kbd{\key2\}
- end macro
- c Inserts:
- macro orgcmdkskc{key1,key2,command}
- kindex \key1\
- findex \command\
- item hskip 0pt plus 1filll
- end iftex
- item tie{}tie{}code{\command\})
- end ifset
- kindex \key1\
- item
- end ifclear
- c Same as previous, but use
- c Inserts:
- macro xorgcmdkskc{key1,key2,command}
- kindex \key1\
- findex \command\
- itemx hskip 0pt plus 1filll
- end iftex
- itemx tie{}tie{}code{\command\})
- end ifset
- kindex \key1\
- itemx
- end ifclear
- c two keys with two commands
- item KEY1 COMMAND1
- itemx KEY2 COMMAND2
- ifset cmdnames
- kindex \key2\
- findex \command2\
- item hskip 0pt plus 1filll
- itemx hskip 0pt plus 1filll
- end iftex
- item tie{}tie{}code{\command1\})
- kbd{\key2\} tie{}tie{}(
- end ifnottex
- ifclear cmdnames
- kindex \key2\
- kbd{\key1\}
- kbd{\key2\}
- end macro
- iftex
- hyphenation{time-stamp time-stamps time-stamp-ing time-stamp-ed}
- c Subheadings inside a table.
- ifinfo
- end ifinfo
- item
- end ifnotinfo
- copying
- This manual is for Org version
- copyright{} 2004--2017 Free Software Foundation, Inc.
- end quotation
- dircategory Emacs editing modes
- end direntry
- title The Org Manual
- value{VERSION}
- c The following two commands start the copyright page.
- vskip 0pt plus 1filll
- end titlepage
- shortcontents
- contents
- node Top, Introduction, (dir), (dir)
- insertcopying
- menu
- * Introduction:: Getting started
- * Document structure:: A tree works like your brain
- * Tables:: Pure magic for quick formatting
- * Hyperlinks:: Notes in context
- * TODO items:: Every tree branch can be a TODO item
- * Tags:: Tagging headlines and matching sets of tags
- * Properties and columns:: Storing information about an entry
- * Dates and times:: Making items useful for planning
- * Capture - Refile - Archive:: The ins and outs for projects
- * Agenda views:: Collecting information into views
- * Markup:: Prepare text for rich export
- * Exporting:: Sharing and publishing notes
- * Publishing:: Create a web site of linked Org files
- * Working with source code:: Export, evaluate, and tangle code blocks
- * Miscellaneous:: All the rest which did not fit elsewhere
- * Hacking:: How to hack your way around
- * MobileOrg:: Viewing and capture on a mobile device
- * History and acknowledgments:: How Org came into being
- * GNU Free Documentation License:: The license for this documentation.
- * Main Index:: An index of Org's concepts and features
- * Key Index:: Key bindings and where they are described
- * Command and Function Index:: Command names and some internal functions
- * Variable Index:: Variables mentioned in the manual
- LaTeX{}:: LaTeX can be freely used inside Org documents
- Embedded
- LaTeX{} fragments:: Complex formulas made easy
- * Previewing
- LaTeX{} export:: Exporting to
- LaTeX{} export
- * LaTeX{} and PDF documents.
- * LaTeX{} back-end.
- *
- LaTeX{} code:: Directly in the Org document.
- * Tables in
- LaTeX{} export:: Attributes specific to images.
- * Plain lists in
- LaTeX{} export:: Attributes specific to source code blocks.
- * Example blocks in
- LaTeX{} export:: Attributes specific to special blocks.
- * Horizontal rules in
- file{.doc},
- LaTeX{} fragments.
- * Labels and captions in ODT export:: Rendering objects.
- * Literal examples in ODT export:: For source code and example blocks.
- * Advanced topics in ODT export:: For power users.
- Math formatting in ODT export
- * Working with LaTeX{} format.
- * Working with MathML or OpenDocument formula files:: Embedding in native format.
- Advanced topics in ODT export
- * Configuring a document converter:: Registering a document converter.
- * Working with OpenDocument style files:: Exploring internals.
- * Creating one-off styles:: Customizing styles, highlighting.
- * Customizing tables in ODT export:: Defining table templates.
- * Validating OpenDocument XML:: Debugging corrupted OpenDocument files.
- Texinfo export
- * Texinfo export commands:: Invoking commands.
- * Texinfo specific export settings:: Setting the environment.
- * Texinfo file header:: Generating the header.
- * Texinfo title and copyright page:: Creating preamble pages.
- * Texinfo
- LaTeX{} export
- * Publishing links:: Which links keep working after publishing?
- * Sitemap:: Generating a list of all pages
- * Generating an index:: An index that reaches across pages
- Sample configuration
- * Simple example:: One-component publishing
- * Complex example:: A multi-component publishing example
- Working with source code
- * Structure of code blocks:: Code block syntax described
- * Editing source code:: Language major-mode editing
- * Exporting code blocks:: Export contents and/or results
- * Extracting source code:: Create pure source code files
- * Evaluating code blocks:: Place results of evaluation in the Org mode buffer
- * Library of Babel:: Use and contribute to a library of useful code blocks
- * Languages:: List of supported code block languages
- * Header arguments:: Configure code block functionality
- * Results of evaluation:: How evaluation results are handled
- * Noweb reference syntax:: Literate programming in Org mode
- * Key bindings and useful functions:: Work quickly with code blocks
- * Batch execution:: Call functions from the command line
- Header arguments
- * Using header arguments:: Different ways to set header arguments
- * Specific header arguments:: List of header arguments
- Using header arguments
- * System-wide header arguments:: Set globally, language-specific
- * Language-specific header arguments:: Set in the Org file's headers
- * Header arguments in Org mode properties:: Set in the Org file
- * Language-specific mode properties::
- * Code block specific header arguments:: The most commonly used method
- * Arguments in function calls:: The most specific level, takes highest priority
- Specific header arguments
- * var:: Pass arguments to
- LaTeX{} and other programs
- * Dynamic blocks:: Automatically filled blocks
- * Special agenda views:: Customized views
- * Speeding up your agendas:: Tips on how to speed up your agendas
- * Extracting agenda information:: Post-processing of agenda information
- * Using the property API:: Writing programs that use entry properties
- * Using the mapping API:: Mapping over all or selected entries
- Tables and lists in arbitrary syntax
- * Radio tables:: Sending and receiving radio tables
- * A
- end detailmenu
- node Introduction
- cindex introduction
- end menu
- section Summary
- i{agenda views} that also integrate the Emacs calendar and diary. Org can
- be used to implement many different project planning schemes, such as David
- Allen's GTD system.
- Org files can serve as a single source authoring system with export to many
- different formats such as HTML,
- cindex FAQ
- There is a website for Org which provides links to the newest
- version of Org, as well as additional information, frequently asked
- questions (FAQ), links to tutorials, etc. This page is located at
- cindex print edition
- An earlier version (7.3) of this manual is available as a
- page
- section Installation
- itemize
- item By using Emacs package system.
- item By using Org's git repository.
- b{strongly recommend} to stick to a single installation method.
- kbd{M-x package-install RET org}.
- b{Important}: you need to do this in a session where no
- code{(package-initialize)} in your Emacs init file
- before setting any Org option. If you want to use Org's package repository,
- check out the
- subsubheading Downloading Org as an archive
- You can download Org latest release from
- lisp
- (add-to-list 'load-path "~/path/to/orgdir/lisp")
- file{contrib} directory to your
- load-path:
- end lisp
- Optionally, you can compile the files and/or install them in your system.
- Run
- subsubheading Using Org's git repository
- You can clone Org's repository and install Org like this:
- end example
- Note that in this case,
- file{org-version.el} and Org's autoloads in
- code{make}, generate the documentation with
- code{make config} and
- install Org with code{make help} to get
- the list of compilation/installation options.
- For more detailed explanations on Org's build system, please check the Org
- Build System page on
- node Activation
- cindex activation
- cindex ELPA
- cindex key bindings, global
- findex org-capture
- findex org-iswitchb
- Org mode buffers need font-lock to be turned on: this is the default in
- Emacs
- code{(add-hook 'org-mode-hook 'turn-on-font-lock)}}.
- There are compatibility issues between Org mode and some other Elisp
- packages, please take the time to check the list (
- command{org-store-link},
- command{org-agenda}, and
- lisp
- (global-set-key "\C-cl" 'org-store-link)
- (global-set-key "\C-ca" 'org-agenda)
- (global-set-key "\C-cc" 'org-capture)
- (global-set-key "\C-cb" 'org-iswitchb)
- cindex Org mode, turning on
- Files with the
- file{.org}, make the first
- line of a file look like this:
- end example
- noindent which will select Org mode for this buffer no matter what
- the file's name is. See also the variable
- i{active}. To make
- use of this, you need to have
- code{transient-mark-mode}, you can create
- an active region by using the mouse to select a region, or pressing
- key{SPC}} twice before moving the cursor.
- section Feedback
- cindex bug reports
- cindex author
- If you find problems with Org, or if you have questions, remarks, or ideas
- about it, please mail to the Org mailing list
- uref{https://lists.gnu.org/mailman/listinfo/emacs-orgmode, on this web page}.
- If you are not a member of the mailing list, your mail will be passed to the
- list after a moderator has approved it
- kbd{M-x emacs-version
- kbd{M-x org-version RET}), as well as the Org related setup in the Emacs
- init file. The easiest way to do this is to use the command
- kbd{M-x org-submit-bug-report RET}
- noindent which will put all this information into an Emacs mail buffer so
- that you only need to add your description. If you are not sending the Email
- from within Emacs, please copy and paste the content into your Email program.
- Sometimes you might face a problem due to an error in your Emacs or Org mode
- setup. Before reporting a bug, it is very helpful to start Emacs with minimal
- customizations and reproduce the problem. Doing so often helps you determine
- if the problem is with your customization or with Org mode itself. You can
- start a typical minimal session with a command like the example below.
- end example
- However if you are using Org mode as distributed with Emacs, a minimal setup
- is not necessary. In that case it is sufficient to start Emacs as
- code{minimal-org.el} setup file can have contents as
- shown below.
- end lisp
- If an error occurs, a backtrace can be very useful (see below on how to
- create one). Often a small example file helps, along with clear information
- about:
- item What exactly did you do?
- item What happened instead?
- noindent Thank you for helping to improve this program.
- cindex backtrace of an error
- If working with Org produces an error with a message you don't
- understand, you may have hit a bug. The best way to report this is by
- providing, in addition to what was mentioned above, a
- enumerate
- example
- end example
- code{Org -> Refresh/Reload -> Reload Org uncompiled} from the
- menu.
- code{Options} menu and select
- item
- Do whatever you have to do to hit the error. Don't forget to
- document the steps you take.
- file{*Backtrace*} buffer will appear on the
- screen. Save this buffer to a file (for example using
- end enumerate
- section Typesetting conventions used in this manual
- table
- item TODO
- item boss
- item Release
- end table
- Moreover, Org uses code{#+TITLE} to set the title)
- and code{#+BEGIN_EXPORT html} to start
- a
- subsubheading Key bindings and commands
- findex org-agenda
- findex org-capture
- The manual suggests a few global key bindings, in particular
- code{org-agenda} and code{org-capture}. These are only
- suggestions, but the rest of the manual assumes that these key bindings are in
- place in order to list commands by key access.
- Also, the manual lists both the keys and the corresponding commands for
- accessing a functionality. Org mode often uses the same key for different
- functions, depending on context. The command that is bound to such keys has
- a generic name, like
- kbd{M-
- code{org-do-demote}, while in the chapter on tables, it
- will be listed to call
- code{cmdnames} in
- node Document structure
- cindex document structure
- menu
- * Outlines:: Org is based on Outline mode
- * Headlines:: How to typeset Org tree headlines
- * Visibility cycling:: Show and hide, much simplified
- * Motion:: Jumping to other headlines
- * Structure editing:: Changing sequence and level of headlines
- * Sparse trees:: Matches embedded in context
- * Plain lists:: Additional structure within an entry
- * Drawers:: Tucking stuff away
- * Blocks:: Folding blocks
- * Footnotes:: How footnotes are defined in Org's syntax
- * Orgstruct mode:: Structure editing outside Org
- * Org syntax:: Formal description of Org's syntax
- node Outlines
- cindex outlines
- command{org-cycle}, which is bound to the
- node Headlines
- cindex headlines
- vindex org-special-ctrl-a/e
- vindex org-ctrl-k-protect-subtree
- Headlines define the structure of an outline tree. The headlines in Org
- start with one or more stars, on the left margin
- code{org-special-ctrl-a/e},
- code{org-ctrl-k-protect-subtree} to configure special behavior of
- kbd{C-e}, and footnote{Clocking only works with
- headings indented less than 30 stars.}. For example:
- end example
- noindent Note that a headline named after
- samp{Footnotes}, is considered as special. A subtree with
- this headline will be silently ignored by exporting functions.
- Some people find the many stars too noisy and would prefer an
- outline that has whitespace followed by a single star as headline
- starters.
- vindex org-cycle-separator-lines
- An empty line after the end of a subtree is considered part of it and
- will be hidden when the subtree is folded. However, if you leave at
- least two empty lines, one empty line will remain visible after folding
- the subtree, in order to structure the collapsed view. See the
- variable
- node Visibility cycling
- cindex cycling, visibility
- cindex trees, visibility
- cindex hide text
- end menu
- subsection Global and local cycling
- Outlines make it possible to hide parts of the text in the buffer.
- Org uses just two commands, bound to
- kbd{S-
- cindex subtree visibility states
- cindex folded, subtree visibility state
- cindex subtree, subtree visibility state
- asis
- key{TAB},org-cycle}
- example
- ,-> FOLDED -> CHILDREN -> SUBTREE --.
- '-----------------------------------'
- vindex org-cycle-emulate-tab
- footnote{see, however,
- the option
- key{TAB} actually runs global cycling (see below)
- code{org-cycle-global-at-bob}.}. Also when called with a prefix
- argument (key{TAB}}), global cycling is invoked.
- cindex global cycling
- cindex contents, global visibility state
- orgcmd{S-
- itemx C-u
- emph{Global cycling}: Rotate the entire buffer among the states
- end example
- When key{TAB}} is called with a numeric prefix argument N, the
- CONTENTS view up to headlines of level N will be shown. Note that inside
- tables, key{TAB}} jumps to the previous field.
- orgcmd{C-u C-u
- pxref{Initial visibility}).
- orgcmd{C-u C-u C-u
- cindex revealing context
- pxref{Sparse trees}) or an agenda command
- (
- cindex show branches, command
- cindex show children, command
- key{TAB},outline-show-children}
- Expose all direct children of the subtree. With a numeric prefix argument N,
- expose all children down to level N
- orgcmd{C-c C-x b,org-tree-to-indirect-buffer}
- Show the current subtree in an indirect buffer
- pxref{Indirect Buffers,,,emacs,GNU Emacs Manual}) will contain the entire
- buffer, but will be narrowed to the current tree. Editing the indirect
- buffer will also change the original buffer, but without affecting visibility
- in that buffer.}. With a numeric prefix argument N, go up to level N and
- then take that tree. If N is negative then go up that many levels. With a
- orgcmd{C-c C-x v,org-copy-visible}
- Copy the
- end table
- subsection Initial visibility
- vindex org-startup-folded
- cindex
- cindex
- cindex
- cindex
- footnote{When
- code{nil}, Org will not honor the default
- visibility state when first opening a file for the agenda (
- code{org-startup-folded}, or on a per-file basis by adding one of the
- following lines anywhere in the buffer:
- end example
- noindent
- Furthermore, any entries with a pxref{Properties
- and columns}) will get their visibility adapted accordingly. Allowed values
- for this property are code{children},
- code{all}.
- asis
- key{TAB},org-set-startup-visibility}
- Switch back to the startup visibility of the buffer, i.e., whatever is
- requested by startup options and
- end table
- subsection Catching invisible edits
- cindex edits, catching invisible
- Sometimes you may inadvertently edit an invisible part of the buffer and be
- confused on what has been edited and how to undo the mistake. Setting
- code{nil} will help prevent this. See the
- docstring of this option on how Org should catch invisible edits and process
- them.
- section Motion
- cindex jumping, to headlines
- table
- orgcmd{C-c C-n,org-next-visible-heading}
- Next heading.
- orgcmd{C-c C-f,org-forward-same-level}
- Next heading same level.
- orgcmd{C-c C-u,outline-up-heading}
- Backward to higher level heading.
- vindex org-goto-auto-isearch
- key{TAB}
- key{down} / r{Next/previous visible headline.}
- r{Select this location.}
- r{Do a Sparse-tree search}
- code{org-goto-auto-isearch}}
- n / p
- r{Next/previous headline same level.}
- u
- r{Digit argument.}
- q
- end example
- noindent
- See also the option
- end table
- section Structure editing
- cindex headline, promotion and demotion
- cindex demotion, of subtrees
- cindex pasting, of subtrees
- cindex copying, of subtrees
- cindex subtrees, cut and paste
- asis
- key{RET},org-insert-heading}
- emph{beginning} of a line, and if there is
- a heading or a plain list item (
- emph{before} the current line. When used at the
- beginning of a regular line of text, turn that line into a heading.
- When this command is used in the middle of a line, the line is split and the
- rest of the line becomes the new item or headline. If you do not want the
- line to be split, customize
- kbd{C-u} prefix unconditionally inserts a new
- heading at the end of the current subtree, thus preserving its contents.
- With a double
- orgcmd{C-
- orgcmd{M-S-
- vindex org-treat-insert-todo-heading-as-state-change
- Insert new TODO entry with same level as current heading. See also the
- variable
- orgcmd{C-S-
- kbd{C-
- orgcmd{
- key{TAB} demotes the entry to
- become a child of the previous one. The next
- key{TAB}, and you are back
- to the initial level.
- key{left},org-do-promote}
- Promote current heading by one level.
- key{right},org-do-demote}
- Demote current heading by one level.
- key{left},org-promote-subtree}
- Promote the current subtree by one level.
- key{right},org-demote-subtree}
- Demote the current subtree by one level.
- key{up},org-move-subtree-up}
- Move subtree up (swap with previous subtree of same
- level).
- key{down},org-move-subtree-down}
- Move subtree down (swap with next subtree of same level).
- key{M-h} on a paragraph will mark it,
- hitting
- orgcmd{C-c ,org-mark-subtree}
- Mark the subtree at point. Hitting repeatedly will mark subsequent subtrees
- of the same level than the marked subtree.
- orgcmd{C-c C-x M-w,org-copy-subtree}
- Copy subtree to kill ring. With a numeric prefix argument N, copy the N
- sequential subtrees.
- samp{****}.
- vindex org-yank-adjusted-subtrees
- code{org-yank-adjusted-subtrees} and
- code{yank} command will
- paste subtrees folded and in a clever way, using the same command as
- code{yank} to be executed, with the prefix passed along. A good way to
- force a normal yank is code{yank-pop} after a
- yank, it will yank previous kill items plainly, without adjustment and
- folding.
- code{org-clone-subtree-with-time-shift}.
- xref{Refile and copy}.
- kbd{C-u} prefix,
- sorting will be case-sensitive.
- orgcmd{C-x n b,org-narrow-to-block}
- Narrow buffer to current block.
- orgcmd{C-c *,org-toggle-heading}
- Turn a normal line or plain list item into a headline (so that it becomes a
- subheading at its location). Also turn a headline into a normal line by
- removing the stars. If there is an active region, turn all lines in the
- region into headlines. If the first line in the region was an item, turn
- only the item lines into headlines. Finally, if the first line is a
- headline, remove the stars from all headlines in the region.
- cindex region, active
- cindex transient mark mode
- When there is an active region (Transient Mark mode), promotion and
- demotion work on all headlines in the region. To select a region of
- headlines, it is best to place both point and mark at the beginning of a
- line, mark at the beginning of the first headline, and point at the line
- just after the last headline to change. Note that when the cursor is
- inside a table (
- node Sparse trees
- cindex sparse trees
- cindex folding, sparse trees
- vindex org-show-context-detail
- An important feature of Org mode is the ability to construct
- footnote{See also the
- variable
- table
- orgcmd{C-c /,org-sparse-tree}
- This prompts for an extra key to select a sparse-tree creating command.
- vindex org-remove-highlights-with-change
- Prompts for a regexp and shows a sparse tree with all matches. If
- the match is in a headline, the headline is made visible. If the match is in
- the body of an entry, headline and body are made visible. In order to
- provide minimal context, also the full hierarchy of headlines above the match
- is shown, as well as the headline following the match. Each match is also
- highlighted; the highlights disappear when the buffer is changed by an
- editing command
- code{org-remove-highlights-with-change}}, or by pressing
- kbd{C-u} prefix argument, previous highlights are kept,
- so several calls to this command can be stacked.
- orgcmdkkc{M-g p,M-g M-p,previous-error}
- Jump to the previous sparse tree match in this buffer.
- noindent
- code{org-agenda-custom-commands} to define fast
- keyboard access to specific sparse trees. These commands will then be
- accessible through the agenda dispatcher (
- lisp
- (setq org-agenda-custom-commands
- '(("f" occur-tree "FIXME")))
- noindent will define the key
- samp{FIXME}.
- The other sparse tree commands select headings based on TODO keywords,
- tags, or properties and will be discussed later in this manual.
- cindex printing sparse trees
- code{ps-print-buffer-with-faces} which does not print invisible parts of the
- document. Or you can use
- node Plain lists
- cindex plain lists
- cindex lists, ordered
- pxref{Checkboxes}). Org supports editing such lists, and every exporter
- (
- itemize
- item
- samp{-},
- samp{*}samp{*} as a bullet, lines must be indented or
- they will be seen as top-level headlines. Also, when you are hiding leading
- stars to get a clean outline view, plain list items starting with a star may
- be hard to distinguish from true headlines. In short: even though
- item
- vindex org-list-allow-alphabetical
- footnote{You can filter out any of them by configuring
- samp{1.} or
- footnote{You can also get samp{A.},
- samp{A)} by configuring
- code{[20]}
- emph{before} the checkbox. If you have activated alphabetical
- lists, you can also use counters like
- item
- samp{ :: } to distinguish the description
- end itemize
- Items belonging to the same list must have the same indentation on the first
- line. In particular, if an ordered list reaches number
- vindex org-list-empty-line-terminates-plain-lists
- A list ends whenever every item has ended, which means before any line less
- or equally indented than items at top level. It also ends before two blank
- linescode{org-list-empty-line-terminates-plain-lists}.}.
- In that case, all items are closed. Here is an example:
- group
- ** Lord of the Rings
- My favorite scenes are (in this order)
- 1. The attack of the Rohirrim
- 2. Eowyn's fight with the witch king
- + this was already my favorite scene in the book
- + I really like Miranda Otto.
- 3. Peter Jackson being shot by Legolas
- - on DVD only
- He makes a really funny face when it happens.
- But in the end, no individual scenes matter but the film as a whole.
- Important actors in this film are:
- -
- b{Sean Astin} :: He plays Sam, Frodo's friend. I still remember
- him very well from his role as Mikey Walsh in
- end group
- pxref{Exporting}). Since
- indentation is what governs the structure of these lists, many structural
- constructs like
- vindex org-list-demote-modify-bullet
- code{org-list-demote-modify-bullet}. To get a greater difference of
- indentation between items and their sub-items, customize
- vindex org-list-automatic-rules
- The following commands act on items when the cursor is in the first line of
- an item (the line with the bullet or number). Some of them imply the
- application of automatic rules to keep list structure intact. If some of
- these actions get in your way, configure
- table
- orgcmd{
- cindex cycling, in plain lists
- code{org-cycle-include-plain-lists}. If this variable is set to
- key{TAB} demotes the item to become a child of the previous
- one. Subsequent
- orgcmd{M-
- vindex org-M-RET-may-split-line
- pxref{Structure editing}). If this command is used in the middle
- of an item, that item is
- footnote{If you do not want the item to be split, customize the
- variable
- emph{before item's body}, the new item is created
- end table
- kbd
- key{RET}
- key{RET}
- Insert a new item with a checkbox (
- kindex S-
- item S-up
- cindex shift-selection-mode
- vindex org-list-use-circular-motion
- Jump to the previous/next item in the current list
- code{org-list-use-circular-motion}.}, but only if
- kbd{C-kbd{C-
- kindex M-
- kindex M-
- item M-up
- footnote{See
- kindex M-
- kindex M-
- item M-left
- kindex M-S-
- kindex M-S-
- item M-S-
- itemx M-S-
- code{org-list-automatic-rules}. The global indentation of a list has no
- influence on the text
- kindex C-c C-c
- pxref{Checkboxes}) in the item line, toggle the
- state of the checkbox. In any case, verify bullets and indentation
- consistency in the whole list.
- vindex org-plain-list-ordered-item-terminator
- samp{-}, samp{*}, samp{1)}) or a subset of them,
- depending on
- kindex C-c *
- xref{Structure editing}, for a detailed explanation.
- item C-c C-*
- Turn the whole plain list into a subtree of the current heading. Checkboxes
- (
- kindex S-
- kindex S-
- item S-left/right
- code{org-support-shift-select}.
- cindex sorting, of plain list
- end table
- section Drawers
- cindex visibility cycling, drawers
- kindex C-c C-x d
- Sometimes you want to keep information associated with an entry, but you
- normally don't want to see it. For this, Org mode has
- example
- ** This is a headline
- Still outside the drawer
- :DRAWERNAME:
- This is inside the drawer.
- :END:
- After the drawer.
- code{org-insert-drawer}, which is bound to
- code{org-insert-property-drawer} and add
- a property drawer right below the current headline. Completion over drawer
- keywords is also possible using key{TAB}}
- kbd{M-kbd{C-M-i} or
- key{ESC} pxref{Completion}).}.
- Visibility cycling (
- key{TAB} there. Org mode uses the
- pxref{Properties and columns}), and you can also arrange
- for state change notes (
- pxref{Clocking work time}) to be stored in a drawer
- table
- kindex C-c C-z
- end table
- vindex org-export-with-properties
- You can select the name of the drawers which should be exported with
- code{org-export-with-properties} instead.
- section Blocks
- cindex blocks, folding
- Org mode uses begin...end blocks for various purposes from including source
- code examples (
- pxref{Clocking work time}). These blocks can be folded and
- unfolded by pressing TAB in the begin line. You can also get all blocks
- folded at startup by configuring the option
- cindex
- cindex
- example
- #+STARTUP: hideblocks
- #+STARTUP: nohideblocks
- node Footnotes
- cindex footnotes
- Org mode supports the creation of footnotes.
- A footnote is started by a footnote marker in square brackets in column 0, no
- indentation allowed. It ends at the next footnote definition, headline, or
- after two consecutive empty lines. The footnote reference is simply the
- marker in square brackets, inside text. Markers always start with
- example
- The Org homepage[fn:1] now looks a lot better than it used to.
- ...
- [fn:1] The link is: http://orgmode.org
- emph{named} footnotes and
- optional inline definition. Here are the valid references:
- code
- code{name} is a unique label word, or, for
- simplicity of automatic creation, a number.
- LaTeX{}-like anonymous footnote where the definition is given directly at the
- reference point.
- code{[fn:name]} to create additional references.
- vindex org-footnote-auto-label
- Footnote labels can be created automatically, or you can create names yourself.
- This is handled by the variable
- code{#+STARTUP} keywords. See the docstring of that variable
- for details.
- table
- kindex C-c C-x f
- vindex org-footnote-define-inline
- vindex org-footnote-auto-adjust
- Otherwise, create a new footnote. Depending on the option
- footnote{The corresponding in-buffer
- setting is: code{#+STARTUP: nofninline}}, the
- definition will be placed right into the text as part of the reference, or
- separately into the location determined by the option
- example
- s
- r{Org makes no effort to sort footnote definitions into a particular}
-
- r{also move entries according to
- r{sorting after each insertion/deletion can be configured using the}
- code{org-footnote-auto-adjust}.}
- r code{fn:N} footnotes. Automatic renumbering}
-
- r{
- r{Short for first code{s} action.}
- n
- r{inline definitions) into a special section, and then numbering them}
-
- r{Delete the footnote at point, and all definitions of and references}
-
- end example
- Depending on the variable footnote{the
- corresponding in-buffer options are code{nofnadjust}.},
- renumbering and sorting footnotes can be automatic after each insertion or
- deletion.
- item C-c C-c
- If the cursor is on a footnote reference, jump to the definition. If it is a
- the definition, jump back to the reference. When called at a footnote
- location with a prefix argument, offer the same menu as
- kindex C-c C-o
- kindex mouse-2
- r{or} mouse-1/2
- Footnote labels are also links to the corresponding definition/reference, and
- you can use the usual commands to follow these links.
- kindex C-c '
- item C-c '
- Edit the footnote definition corresponding to the reference at point in
- a seperate window. The window can be closed by pressing
- end table
- section The Orgstruct minor mode
- cindex minor mode for structure editing
- If you like the intuitive way the Org mode structure editing and list
- formatting works, you might want to use these commands in other modes like
- Text mode or Mail mode as well. The minor mode
- kbd{M-x orgstruct-mode RET}, or
- turn it on by default, for example in Message mode, with one of:
- end lisp
- When this mode is active and the cursor is on a line that looks to Org like a
- headline or the first line of a list item, most structure editing commands
- will work, even if the same keys normally have different functionality in the
- major mode you are using. If the cursor is not in one of those special
- lines, Orgstruct mode lurks silently in the shadows.
- When you use
- vindex orgstruct-heading-prefix-regexp
- You can also use Org structure editing to fold and unfold headlines in
- code{orgstruct-heading-prefix-regexp}:
- the regular expression must match the local prefix to use before Org's
- headlines. For example, if you set this variable to
- code{org-demote} are disabled when the
- prefix is set, but folding/unfolding will work correctly.
- section Org syntax
- uref{http://orgmode.org/worg/dev/org-syntax.html, a draft on
- Worg}, written and maintained by Nicolas Goaziou. It defines Org's core
- internal concepts such as code{sections},
- code{(greater) elements} and
- lisp
- M-: (org-element-parse-buffer) RET
- cindex syntax checker
- code{org-lint} command.
- chapter Tables
- cindex editing tables
- Org comes with a fast and intuitive table editor. Spreadsheet-like
- calculations are supported using the Emacs
- pxref{Top, Calc, , calc, Gnu Emacs Calculator Manual}).
- end menu
- section The built-in table editor
- . Any line with
- samp{|}
- is also the column separator
- code{\vert} or, inside a word {
- example
- | Name | Phone | Age |
- |-------+-------+-----|
- | Peter | 1234 | 17 |
- | Anna | 4321 | 25 |
- key{TAB} or
- kbd{C-c C-c} inside the table.
- key{RET} to the next row) and creates new table rows
- at the end of the table or before horizontal lines. The indentation
- of the table is set by the first line. Any line starting with
- example
- |Name|Phone|Age|
- |-
- noindent and then press
- code{|Name|Phone|Age} followed by
- key{RET}}.
- vindex org-table-auto-blank-field
- When typing text into a field, Org treats
- key{Backspace}, and all character keys in a special way, so that
- inserting and deleting avoids shifting other fields. Also, when
- typing
- kbd{kbd{S-kbd{
- code{org-enable-table-editor} and
- table
- tsubheading{Creation and conversion}
- kbd{C-u} forces CSV,
- kbd{C-u C-u C-u} will prompt for a regular expression to
- match the separator, and a numeric argument N indicates that at least N
- consecutive spaces, or alternatively a TAB will be the separator.
- kbd{|Name|Phone|Age key{TAB}}.
- orgcmd{C-c C-c,org-table-align}
- Re-align the table and don't move to another field.
- orgcmd{C-c SPC,org-table-blank-field}
- Blank the field at point.
- orgcmd{TAB,org-table-next-field}
- Re-align the table, move to the next field. Creates a new row if
- necessary.
- orgcmd{S-
- c
- key{RET},org-table-next-row}
- Re-align the table and move down to next row. Creates a new row if
- necessary. At the beginning or end of a line,
- c
- orgcmd{M-e,org-table-end-of-field}
- Move to end of the current table field, or on to the next field.
- orgcmdkkcc{M-key{right},org-table-move-column-left,org-table-move-column-right}
- Move the current column left/right.
- orgcmd{M-S-
- c
- key{right},org-table-insert-column}
- Insert a new column to the left of the cursor position.
- orgcmdkkcc{M-key{down},org-table-move-row-up,org-table-move-row-down}
- Move the current row up/down.
- orgcmd{M-S-
- c
- key{down},org-table-insert-row}
- Insert a new row above the current row. With a prefix argument, the line is
- created below the current one.
- orgcmd{C-c -,org-table-insert-hline}
- Insert a horizontal line below current row. With a prefix argument, the line
- is created above the current line.
- orgcmd{C-c
- c
- tsubheading{Regions}
- c
- c
- c
- key{RET},org-table-wrap-region}
- Split the current field at the cursor position and move the rest to the line
- below. If there is an active region, and both point and mark are in the same
- column, the text in the column is wrapped to minimum width for the given
- number of lines. A numeric prefix argument may be used to change the number
- of desired lines. If there is no region, but you specify a prefix argument,
- the current field is made blank, and the content is appended to the field
- above.
- cindex formula, in tables
- cindex region, active
- cindex transient mark mode
- kbd{C-y}.
- orgcmd{S-
- vindex org-table-copy-increment
- When current field is empty, copy from first non-empty field above. When not
- empty, copy current field down to next row and move cursor along with it.
- Depending on the option
- code{0} prefix argument temporarily disables the
- increment. This key is also used by shift-selection and related modes
- (
- tsubheading{Miscellaneous}
- pxref{Column width and alignment}). When called with
- a
- kbd{C-u} prefixes, make the editor
- window follow the cursor through the table and always show the current
- field. The follow mode exits automatically when the cursor leaves the table,
- or when you repeat this command with
- c
- orgcmd{C-c |,org-table-create-or-convert-from-region}
- Tables can also be imported by pasting tabular text into the Org
- buffer, selecting the pasted text with
- kbd{C-c |} command (see above under
- c
- findex org-table-export
- code{org-table-export-default-format}. You may also use properties
- code{TABLE_EXPORT_FORMAT} to specify the file
- name and the format for table export in a subtree. Org supports quite
- general formats for exported tables. The exporter format is the same as the
- format used by Orgtbl radio tables, see
- end table
- If you don't like the automatic table editor because it gets in your
- way on lines which you would like to start with
- lisp
- (setq org-enable-table-editor nil)
- noindent Then the only table command that still works is
- node Column width and alignment
- cindex narrow columns in tables
- samp{<N>} where
- example
- end group
- noindent
- Fields that are wider become clipped and end in the string
- kbd{C-c `} (that is
- kbd{C-c
- C-c}.
- code{org-startup-align-all-tables} will realign all tables in a file
- upon visiting, but also slow down startup. You can also set this option
- on a per-file basis with:
- end example
- If you would like to overrule the automatic alignment of number-rich columns
- to the right and of string-rich columns to the left, you can use
- samp{<c>}
- samp{<l>} in a similar fashion. You may
- also combine alignment and field width like this:
- node Column groups
- cindex grouping columns in tables
- When Org exports tables, it does so by default without vertical lines because
- that is visually more satisfying in general. Occasionally however, vertical
- lines can be useful to structure a table into groups of columns, much like
- horizontal lines can do for groups of rows. In order to specify column
- groups, you can use a special row where the first field contains only
- samp{<} to indicate that
- this column should start a group,
- samp{<>} (no space between samp{>}) to make a column a group
- of its own. Boundaries between column groups will upon export be marked with
- vertical lines. Here is an example:
- end example
- It is also sufficient to just insert the column group starters after
- every vertical line you would like to have:
- end example
- section The Orgtbl minor mode
- cindex minor mode for tables
- If you like the intuitive way the Org table editor works, you
- might also want to use it in other modes like Text mode or Mail mode.
- The minor mode Orgtbl mode makes this possible. You can always toggle
- the mode with
- lisp
- (add-hook 'message-mode-hook 'turn-on-orgtbl)
- LaTeX{} tables with the underlying ease and power of
- Orgtbl mode, including spreadsheet capabilities. For details, see
- node The spreadsheet
- cindex calculations, in tables
- cindex
- file{calc} package to implement
- spreadsheet-like capabilities. It can also evaluate Emacs Lisp forms to
- derive fields from other fields. While fully featured, Org's implementation
- is not identical to other spreadsheets. For example, Org knows the concept
- of a
- menu
- * References:: How to refer to another field or range
- * Formula syntax for Calc:: Using Calc to compute stuff
- * Formula syntax for Lisp:: Writing formulas in Emacs Lisp
- * Durations and time values:: How to compute durations and time values
- * Field and range formulas:: Formula for specific (ranges of) fields
- * Column formulas:: Formulas valid for an entire column
- * Lookup functions:: Lookup functions for searching tables
- * Editing and debugging formulas:: Fixing formulas
- * Updating the table:: Recomputing all dependent fields
- * Advanced features:: Field and column names, parameters and automatic recalc
- node References
- cindex references
- To compute fields in the table from other fields, formulas must
- reference other fields or ranges. In Org, fields can be referenced
- by name, by absolute coordinates, and by relative coordinates. To find
- out what the coordinates of a field are, press
- kbd{C-c
- subsubheading Field references
- cindex references, to fields
- Formulas can reference the value of another field in two ways. Like in
- any other spreadsheet, you may reference fields with a letter/number
- combination like
- vindex org-table-use-standard-references
- However, Org prefers
- samp{B4}, but it will not use this syntax when offering a formula
- for editing. You can customize this behavior using the option
- example
- var{column}
- code{$1},
- code{$
- code{$+1} or
- code{$<} and
- code{$>>>} to indicate the third
- column from the right.
- The row specification only counts data lines and ignores horizontal separator
- lines (hlines). Like with columns, you can use absolute row numbers
- code{2},...var{N}}, and row numbers relative to the
- current row like code{-1}. code{>} are
- immutable references the first and last
- code{$LR5} and
- code{>$} instead.} row in the table, respectively. You may also
- specify the row relative to one of the hlines:
- code{II} to the second, etc.
- code{+I} to the first such line below the
- current line. You can also write
- code{0} and
- emph{unsigned} numbers are fixed references
- in the sense that if you use the same reference in the formula for two
- different fields, the same field will be referenced each time.
- Org's references with
- example
- 2$3 code{C2})}
- $5 code{E&})}
- 2
- r{the field one row up, three columns to the left}
- -I$2
- r{field in the last row, in column 5}
- subsubheading Range references
- cindex references, to ranges
- You may reference a rectangular range of fields by specifying two field
- references connected by two dots
- samp{$2..$7}, but if at least one field
- is in a different row, you need to use the general
- samp{} in order to be interpreted correctly). Examples:
- r{first three fields in the current row}
- $P..$Q
- r{start in third column, continue to the last but one}
- 2$1..4$3 code{A2..C4})}
- -1$-2..-1
- r{between first and second hline, short for
- end example
- samp{E}, pxref{Formula syntax
- for Calc}.
- cindex field coordinates
- cindex row, of field coordinates
- code{#} and
- code{org-table-current-dline} and
- table
- item if(# % 2, $#, string(""))
- Insert column number on odd rows, set field to empty on even rows.
- code{FOO}
- into column 2 of the current table.
- code{FOO} into row 3 of the current table.
- noindent For the second/third example, the table named
- footnote{The computation time scales as O(N^2) because the table
- named
- subsubheading Named references
- cindex references, named
- cindex constants, in calculations
- vindex org-table-formula-constants
- code{org-table-formula-constants}, and locally (for the file) through a
- line like
- end example
- vindex constants-unit-system
- pxref{Properties and columns}) can be used as
- constants in table formulas: for a property
- samp{$PROP_Xyz}, and the property will be searched in the current
- outline entry and in the hierarchy above it. If you have the
- samp{$h} for Planck's constant, and
- units like footnote{
- code{SI}
- and
- code{constants-unit-system}. You can use the
- code{constSI} and
- ref{Advanced features}. All
- names must start with a letter, and further consist of letters and
- numbers.
- cindex remote references
- cindex references, to a different table
- cindex constants, in calculations
- example
- remote(NAME-OR-ID,REF)
- noindent
- where NAME can be the name of a table in the current file as set by a
- code{3$3} or
- code{ROW$COLUMN}
- it will be substituted with the name or ID found in this field of the current
- table. For example code{remote(year_2013,
- >$1)}. The format
- node Formula syntax for Calc
- cindex formula syntax, Calc
- file{Calc}
- package. Note that samp{/}
- has lower precedence than samp{a/b*c} is interpreted as
- code{calc-eval} (
- cindex vectors, in table calculations
- The range vectors can be directly fed into the Calc vector functions
- like samp{vsum}.
- cindex mode, for
- vindex org-calc-default-modes
- A formula can contain an optional mode string after a semicolon. This
- string consists of flags to influence Calc and other modes during
- execution. By default, Org uses the standard Calc modes (precision
- 12, angular units degrees, fraction and symbolic modes off). The display
- format, however, has been changed to
- code{org-calc-default-modes}.
- table
- item
- item code{s3}, code{f4}
- Normal, scientific, engineering or fixed format of the result of Calc passed
- back to Org. Calc formatting is unlimited in precision as long as the Calc
- calculation precision is greater.
- code{D},
- item code{S}
- Fraction and symbolic modes of Calc.
- code{T},
- pxref{Durations and time values}.
- code{E}
- If and how to consider empty fields. Without
- samp{E} the empty fields are kept. For empty
- fields in ranges or empty field references the value
- samp{N} to use 0 instead for both formula types. For the
- value of a field the mode samp{E}.
- code{N}
- Interpret all fields as numbers, use 0 for non-numbers. See the next section
- to see how this is essential for computations with Lisp formulas. In Calc
- formulas it is used only occasionally because there number strings are
- already interpreted as numbers without
- item
- end table
- samp{printf} format specifier to reformat the Calc result after it has been
- passed back to Org instead of letting Calc already do the
- formattingsamp{printf} reformatting is limited in precision
- because the value passed to it is converted into an
- samp{double}. The
- samp{double} is limited in precision to 64
- bits overall which leaves approximately 16 significant decimal digits.}. A
- few examples:
- r{Sum of first and second field}
- $1+$2;%.2f
- r{Math functions can be used}
- $0;%.1f
- r{Degrees F -> C conversion}
- $c/$1/$cm file{constants.el}}
- tan($1);Dp3s1
- r{Same, but use printf specifier for display}
- taylor($3,x=7,2)
- end example
- Calc also contains a complete set of logical operations, (
- table
- item if($1 < 20, teen, string(""))
- "teen" if age $1 is less than 20, else the Org table result field is set to
- empty with the empty string.
- samp{E} is required to not
- convert empty fields to 0.
- samp{%.1f} but leaves empty results empty.
- samp{nan} which lets
- samp{nan}. Then samp{nan} from
- item if("$1..$7" == "[]", string(""), vmean($1..$7))
- Mean value of a range with empty fields skipped. Every field in the range
- that is empty is skipped. When all fields in the range are empty the mean
- value is not defined and the Org table result field is set to empty. Use
- this when the sample set can have a variable size.
- end table
- You can add your own Calc functions defined in Emacs Lisp with
- node Formula syntax for Lisp
- cindex Lisp forms, as table formulas
- It is also possible to write a formula in Emacs Lisp. This can be useful
- for string manipulation and control structures, if Calc's functionality is
- not enough.
- If a formula starts with an apostrophe followed by an opening parenthesis,
- then it is evaluated as a Lisp form. The evaluation should return either a
- string or a number. Just as with
- samp{N} mode switch, all referenced elements will be numbers
- (non-number fields will be zero) and interpolated as Lisp numbers, without
- quotes. If you provide the
- code{"$3"}. Ranges are inserted as space-separated
- fields, so you can embed them in list or vector syntax.
- Here are a few examples---note how the
- table
- item '(concat (substring $1 1 2) (substring $1 0 1) (substring $1 2))
- Swap the first two characters of the content of column 1.
- code{$1+$2}.
- code{vsum($1..$4)}.
- node Durations and time values
- cindex Duration, computing
- vindex org-table-duration-custom-format
- If you want to compute time values use the
- example
- end group
- code{HH:MM[:SS]}, where seconds
- are optional. With the
- code{HH:MM:SS} (see the first formula above). With the
- code{org-table-duration-custom-format}, which defaults to
- node Field and range formulas
- cindex field formula
- cindex formula, for individual table field
- samp{:=}, for example
- key{TAB} or kbd{C-c C-c} with the cursor still in the field,
- the formula will be stored as the formula for this field, evaluated, and the
- current field will be replaced with the result.
- samp{#+TBLFM:} directly
- below the table. If you type the equation in the 4th field of the 3rd data
- line in the table, the formula will look like
- i{absolute references} (but not relative ones) in stored formulas are
- modified in order to still reference the same field. To avoid this, in
- particular in range references, anchor ranges at the table borders (using
- code{>}, code{$>}), or at hlines using the
- table
- orgcmd{C-u C-c =,org-table-eval-formula}
- Install a new formula for the current field. The command prompts for a
- formula with default taken from the
- end table
- The left-hand side of a formula can also be a special expression in order to
- assign the formula to a number of different fields. There is no keyboard
- shortcut to enter such range formulas. To add them, use the formula editor
- (code{#+TBLFM:} line
- directly.
- code
- ref{Column formulas}.
- code{>=} means
- the last row.
- item $name=
- Named field, see
- end table
- subsection Column formulas
- cindex formula, for table column
- When you assign a formula to a simple column reference like
- emph{header} and will not be modified by column
- formulas. Therefore a header is mandatory when you use column formulas and
- want to add hlines to group rows, like for example to separate a total row at
- the bottom from the summand rows above. (ii) Fields that already get a value
- from a field/range formula will be left alone by column formulas. These
- conditions make column formulas very easy to use.
- To assign a formula to a column, type it directly into any field in the
- column, preceded by an equal sign, like
- key{TAB} or kbd{C-c C-c} with the cursor still in the field,
- the formula will be stored as the formula for the current column, evaluated
- and the current field replaced with the result. If the field contains only
- samp{#+TBLFM:} line, column formulas will look like
- code{$>}.
- Instead of typing an equation into the field, you may also use the
- following command:
- kbd
- samp{#+TBLFM} line, applies it to the current field and
- stores it. With a numeric prefix argument(e.g.,
- end table
- subsection Lookup functions
- cindex table lookup functions
- Org has three predefined Emacs Lisp functions for lookups in tables.
- code
- findex org-lookup-first
- Searches for the first element code{S-LIST} for which
- end lisp
- is
- code{R-LIST}. The default code{equal}. Note that the
- parameters code{S} are passed to
- code{org-lookup-first}, where code{S-LIST}. If
- code{nil}, the matching element code{S-LIST}
- is returned.
- findex org-lookup-last
- Similar to i{last}
- element for which code{t}.
- findex org-lookup-all
- Similar to i{all} elements for
- which code{t}, and returns
- end table
- If the ranges used in these functions contain empty fields, the
- code{S-LIST} and/or
- code{S-LIST} to the corresponding
- element of
- uref{http://orgmode.org/worg/org-tutorials/org-lookups.html, this
- tutorial on Worg}.
- subsection Editing and debugging formulas
- cindex editing, of table formulas
- code{B3} or
- code{3$2} or
- code{org-table-use-standard-references}.
- kbd
- ref{Column formulas}, and
- orgcmd{C-u C-u C-c =,org-table-eval-formula}
- Re-insert the active formula (either a
- field formula, or a column formula) into the current field, so that you
- can edit it directly in the field. The advantage over editing in the
- minibuffer is that you can use the command
- orgcmd{C-c ?,org-table-field-info}
- While editing a formula in a table field, highlight the field(s)
- referenced by the reference at the cursor position in the formula.
- }
- item C-c
- command{org-table-toggle-coordinate-overlays}). These are updated each
- time the table is aligned; you can force it with
- kindex C-c
- findex org-table-toggle-formula-debugger
- {
- Toggle the formula debugger on and off
- (
- orgcmd{C-c ',org-table-edit-formulas}
- Edit all formulas for the current table in a special buffer, where the
- formulas will be displayed one per line. If the current field has an
- active formula, the cursor in the formula editor will mark it.
- While inside the special buffer, Org will automatically highlight
- any field or range reference at the cursor position. You may edit,
- remove and add formulas, and use the following commands:
- kbd
- kbd{C-u}
- prefix, also apply the new formulas to the entire table.
- orgcmd{C-c C-r,org-table-fedit-toggle-ref-type}
- Toggle all references in the formula editor between standard (like
- code{3$2}).
- key{TAB},org-table-fedit-lisp-indent}
- Pretty-print or indent Lisp formula at point. When in a line containing
- a Lisp formula, format the formula according to Emacs Lisp rules.
- Another
- key{TAB} re-indents just like in Emacs Lisp mode.
- key{TAB},lisp-complete-symbol}
- Complete Lisp symbols, just like in Emacs Lisp mode.
- kbd{M-kbd{C-M-i} or
- key{ESC} pxref{Completion}).}
- key{up}
- key{down}
- key{left}
- key{right}
- findex org-table-fedit-ref-down
- findex org-table-fedit-ref-right
- key{up}/key{left}/
- code{B3} and you press key{right}}, it will become
- orgcmdkkcc{M-S-key{down},org-table-fedit-line-up,org-table-fedit-line-down}
- Move the test line for column formulas in the Org buffer up and
- down.
- key{up},M-
- kindex C-c
- findex org-table-toggle-coordinate-overlays
- }
- Turn the coordinate grid in the table on and off.
- end table
- Making a table field blank does not remove the formula associated with
- the field, because that is stored in a different line (the
- samp{#+TBLFM} line.
- samp{#+TBLFM} directly and re-apply the changed
- equations with
- anchor{Using multiple #+TBLFM lines}
- cindex #+TBLFM line, multiple
- cindex #+TBLFM, switching
- samp{#+TBLFM} lines right
- after the table, and then press
- example
- | x | y |
- |---+---|
- | 1 | |
- | 2 | |
- #+TBLFM: $2=$1*1
- #+TBLFM: $2=$1*2
- noindent
- Pressing samp{#+TBLFM: $2=$1*2} yields:
- end example
- kbd{C-u C-c *}, for example), you
- will get the following result of applying only the first
- example
- | x | y |
- |---+---|
- | 1 | 1 |
- | 2 | 2 |
- #+TBLFM: $2=$1*1
- #+TBLFM: $2=$1*2
- subsubheading Debugging formulas
- cindex debugging, of table formulas
- When the evaluation of a formula leads to an error, the field content
- becomes the string
- code{Tbl} menu and repeat the
- calculation, for example by pressing key{RET}} in a
- field. Detailed information will be displayed.
- subsection Updating the table
- cindex updating, table
- Recalculation of a table is normally not automatic, but needs to be
- triggered by a command. See
- table
- orgcmd{C-c *,org-table-recalculate}
- Recalculate the current row by first applying the stored column formulas
- from left to right, and all field/range formulas in the current row.
- kindex C-u C-c *
- kindex C-u C-c C-c
- c
- i{later} in the calculation sequence.
- findex org-table-recalculate-buffer-tables
- Recompute all tables in the current buffer.
- findex org-table-iterate-buffer-tables
- Iterate all tables in the current buffer, in order to converge table-to-table
- dependencies.
- node Advanced features
- i{names}
- table
- orgcmd{C-#,org-table-rotate-recalc-marks}
- Rotate the calculation mark in first column through the states
- samp{#}, samp{!},
- end table
- Here is an example of a table that collects exam results of students and
- makes use of these features:
- group
- |---+---------+--------+--------+--------+-------+------|
- | | Student | Prob 1 | Prob 2 | Prob 3 | Total | Note |
- |---+---------+--------+--------+--------+-------+------|
- | ! | | P1 | P2 | P3 | Tot | |
- | # | Maximum | 10 | 15 | 25 | 50 | 10.0 |
- | ^ | | m1 | m2 | m3 | mt | |
- |---+---------+--------+--------+--------+-------+------|
- | # | Peter | 10 | 8 | 23 | 41 | 8.2 |
- | # | Sam | 2 | 4 | 3 | 9 | 1.8 |
- |---+---------+--------+--------+--------+-------+------|
- | | Average | | | | 25.0 | |
- | ^ | | | | | at | |
- | $ | max=50 | | | | | |
- |---+---------+--------+--------+--------+-------+------|
- #+TBLFM: $6=vsum($P1..$P3)::$7=10*$Tot/$max;%.1f::$at=vmean(-II..-I);%.1f
- end example
- b{Important}: please note that for these special tables,
- recalculating the table with
- samp{#} or
- cindex marking characters, tables
- The marking characters have the following meaning:
- samp
- samp{$Tot} instead of
- item ^
- This row defines names for the fields
- samp{$m1} to refer to
- the value
- samp{$name=...}.
- samp{^}, but defines names for the fields in the row
- item $
- Fields in this row can define
- samp{$} row contains
- samp{$max}.
- Parameters work exactly like constants, only that they can be defined on
- a per-table basis.
- key{TAB} or kbd{S-
- kbd{C-u C-c *}. Unmarked
- lines will be left alone by this command.
- kbd{C-u C-c *}, but
- not for automatic recalculation. Use this when automatic
- recalculation slows down editing too much.
- w{ }
- Unmarked lines are exempt from recalculation with
- samp{#}
- or
- item /
- Do not export this line. Useful for lines that contain the narrowing
- end table
- Finally, just to whet your appetite for what can be done with the
- fantastic
- code{n} at location
- example
- end group
- node Org-Plot
- cindex graph, in tables
- cindex #+PLOT
- Org-Plot can produce graphs of information stored in org tables, either
- graphically or in ASCII-art.
- file{Gnuplot}
- Org-Plot produces 2D and 3D graphs using
- uref{http://www.gnuplot.info/} and
- uref{http://xafs.org/BruceRavel/GnuplotMode}. To see this in action, ensure
- that you have both Gnuplot and Gnuplot mode installed on your system, then
- call kbd{M-x org-plot/gnuplot
- example
- end group
- code{#+PLOT:} lines preceding a table. See below
- for a complete list of Org-plot options. The
- uref{http://orgmode.org/worg/org-tutorials/org-plot.html}.
- table
- item set
- Specify any
- item title
- Specify the title of the plot.
- code{x} axis.
- code{dep:(3 4)} to graph the third and
- fourth columns (defaults to graphing all other columns aside from the
- item type
- Specify whether the plot will be code{3d}, or
- item with
- Specify a
- code{lines}, code{boxes},
- code{lines}.
- code{"@var{path/to/desired/output-file}"}.
- code{deps} (defaults to the column headers
- if they exist).
- item map
- When plotting code{grid} types, set this to
- code{3d} slope.
- samp{%Y-%m-%d-%H:%M:%S}.
- code{$datafile} in the specified script will be replaced with
- the path to the generated data file. Note: even if you set this option, you
- may still want to specify the plot type, as that can impact the content of
- the data file.
- subheading ASCII bar plots
- While the cursor is on a column, typing
- kbd{M-x orgtbl-ascii-plot
- kbd{C-u C-c *}.
- group
- | Sede | Max cites | |
- |---------------+-----------+--------------|
- | Chile | 257.72 | WWWWWWWWWWWW |
- | Leeds | 165.77 | WWWWWWWh |
- | Sao Paolo | 71.00 | WWW; |
- | Stockholm | 134.19 | WWWWWW: |
- | Morelia | 257.56 | WWWWWWWWWWWH |
- | Rochefourchat | 0.00 | |
- #+TBLFM: $3='(orgtbl-ascii-draw $2 0.0 257.72 12)
- end example
- The formula is an elisp call:
- end lisp
- code
- item MIN MAX
- are the minimal and maximal values displayed. Sources values
- outside this range are displayed as
- samp{too large}.
- samp{12}.
- node Hyperlinks
- cindex hyperlinks
- Like HTML, Org provides links inside a file, external links to
- other files, Usenet articles, emails, and much more.
- end menu
- section Link format
- cindex format, of links
- Org will recognize plain URL-like links and activate them as
- clickable links. The general link format, however, looks like this:
- r{or alternatively} [[link]]
- noindent
- Once a link in the buffer is complete (all brackets present), Org
- will change the display so that
- samp{[[link][description]]} and
- samp{[[link]]}. Links will be highlighted in the face
- samp{link}
- part (if there is no description) or the
- samp{link} part, use
- key{BACKSPACE}, you will remove the
- (invisible) bracket at that location. This makes the link incomplete
- and the internals are again displayed as plain text. Inserting the
- missing bracket hides the link internals again. To show the
- internal structure of all links, use the menu entry
- node Internal links
- cindex internal links
- cindex targets, for links
- samp{[[#my-custom-id]]} which will link to the entry with the
- samp{my-custom-id}. You are responsible yourself
- to make sure these custom IDs are unique in a file.
- Links such as samp{[[My Target][Find my target]]}
- lead to a text search in the current file.
- The link can be followed with
- pxref{Handling links}). Links to custom IDs will
- point to the corresponding headline. The preferred match for a text link is
- a
- samp{<<My Target>>}.
- code{#+NAME}
- keyword, which has to be put in the line before the element it refers to, as
- in the following example
- end example
- If none of the above succeeds, Org will search for a headline that is exactly
- the link text but may also include a TODO keyword and tags
- kbd{M-
- footnote{When targeting a
- code{#+CAPTION} keyword is mandatory in order to get proper numbering
- (
- example
- - one item
- - <<target>>another item
- Here we refer to item [[target]].
- noindent
- The last sentence will appear as
- samp{my target}.
- Following a link pushes a mark onto Org's own mark ring. You can
- return to the previous position with
- menu
- * Radio targets:: Make targets trigger links in plain text
- node Radio targets
- cindex radio targets
- cindex links, radio targets
- Org can automatically turn any occurrences of certain target names
- in normal text into a link. So without explicitly creating a link, the
- text connects to the target radioing its position. Radio targets are
- enclosed by triple angular brackets. For example, a target
- samp{my target} in normal text to
- become activated as a link. The Org file is scanned automatically
- for radio targets only when the file is first loaded into Emacs. To
- update the target list during editing, press
- node External links
- cindex links, external
- cindex Gnus links
- cindex IRC links
- cindex file links
- cindex MH-E links
- cindex SHELL links
- cindex Elisp links
- Org supports links to files, websites, Usenet and email messages, BBDB
- database entries and links to both IRC conversations and their logs.
- External links are URL-like locators. They start with a short identifying
- string followed by a colon. There can be no space after the colon. The
- following list shows examples for each link type.
- r{on the web}
- doi:10.1000/182
- r{file, absolute path}
- /home/dominik/images/jupiter.jpg
- r{file, relative path}
- ./papers/last.pdf
- r{file, path on remote machine}
- /myselfsome.where:papers/last.pdf
- r{file, jump to line number}
- file:projects.org
- r{text search in Org file}
- code{org-link-search-must-match-exact-headline}. If its value
- is
- code{query-to-create}, then an exact headline will be searched; if it is not
- found, then the user will be queried to create it.}
- file:projects.org::*task title
- footnote{Headline searches always match the exact headline, ignoring
- spaces and cookies. If the headline is not found and the value of the option
- code{query-to-create},
- then the user will be queried to create it.}
- docview:papers/last.pdf::NNN
- r{Link to heading by ID}
- news:comp.emacs
- r{Mail link}
- mhe:folder
- r{MH-E message link}
- rmail:folder
- r{RMAIL message link}
- gnus:group
- r{Gnus article link}
- bbdb:R.*Stallman
- r{IRC link}
- info:org#External links
- r{A shell command}
- elisp:org-agenda
- r{Elisp form to evaluate}
- cindex VM links
- code{contrib/} directory (
- code{contrib/} directory:
- r{VM folder link}
- vm:folder#id
- r{VM on remote machine}
- vm-imap:account:folder
- r{VM IMAP message link}
- wl:folder
- r{WANDERLUST message link}
- ref{Adding hyperlink types}.
- A link should be enclosed in double brackets and may contain a descriptive
- text to be displayed instead of the URL (
- example
- [[http://www.gnu.org/software/emacs/][GNU Emacs]]
- noindent
- If the description is a file name or URL that points to an image, HTML
- export (
- cindex square brackets, around links
- samp{bbdb:Richard Stallman}), or if you need to remove ambiguities
- about the end of the link, enclose them in square brackets.
- section Handling links
- table
- orgcmd{C-c l,org-store-link}
- emph{global} command (you
- must create the key binding yourself) which can be used in any buffer to
- create a link. The link will be stored for later insertion into an Org
- buffer (see below). What kind of link will be created depends on the current
- buffer:
- *
- For Org files, if there is a
- footnote{If the headline contains a timestamp, it will be
- removed from the link and result in a wrong link---you should avoid putting
- timestamp in the headline.}.
- cindex property, CUSTOM_ID
- code{CUSTOM_ID} property, a link to this custom ID
- will be stored. In addition or alternatively (depending on the value of
- code{ID} property will
- be created and/or used to construct a link
- file{org-id.el} must first be loaded, either through
- code{org-id} in code{(require
- 'org-id)} in your Emacs init file.}. So using this command in Org buffers
- will potentially create two links: a human-readable from the custom ID, and
- one that is globally unique and works even if the entry is moved from file to
- file. Later, when inserting the link, you need to decide which one to use.
- *
- Pretty much all Emacs mail clients are supported. The link will point to the
- current article, or, in some GNUS buffers, to the group. The description is
- constructed from the author and the subject.
- *
- Here the link will be the current URL, with the page title as description.
- *
- Links created in a BBDB buffer will point to the current entry.
- *
- code{org-irc-link-to-logs} to
- samp{file:/} style link to the relevant point in the logs for the current
- conversation is created. Otherwise an
- b{Other files}
- pxref{Search options}) pointing to the contents of the current line. If
- there is an active region, the selected words will form the basis of the
- search string. If the automatically created link is not working correctly or
- accurately enough, you can write custom functions to select the search string
- and to do the search for particular file types---see
- kbd{C-c l} is only a suggestion---see
- b{Agenda view}
- c
- cindex link completion
- cindex inserting links
- vindex org-link-parameters
- Insert a link
- footnote{After insertion of a stored link, the link will be
- removed from the list of stored links. To keep it in the list later use, use
- a triple kbd{C-c C-l}, or configure the option
- b{Inserting stored links}
- key{up} and kbd{M-p/n}).
- * Completion with
- samp{http:} or
- pxref{Link abbreviations}). If you
- press var{prefix}, Org will offer
- specific completion support for some link types
- samp{:complete} property of a link
- in kbd{file
- kbd{C-u C-c C-l}, see
- below) will be offered, and after key{RET}} you can complete
- contact names.
- cindex file name completion
- kbd{C-c C-l} is called with a
- samp{../}. Otherwise an absolute path
- is used, if possible with
- kbd{C-u} prefixes.
- item C-c C-l r{(with cursor on existing link)}
- When the cursor is on an existing link,
- c
- orgcmd{C-c C-o,org-open-at-point}
- vindex org-link-frame-setup
- Open link at point. This will launch a web browser for URLs (using
- samp{file:} links
- with Emacs and select a suitable application for local non-text files.
- Classification of files is based on file extension only. See option
- kbd{C-u} prefix. If you want to avoid
- opening in Emacs, use a *
- If the cursor is on a headline, but not on a link, offer all links in the
- headline and entry text. If you want to setup the frame configuration for
- following links, customize
- orgkey
- vindex org-return-follows-link
- When kbd{
- c
- kindex mouse-1
- itemx mouse-1
- On links, kbd{mouse-2} will open the link just as
- c
- item mouse-3
- kbd{mouse-2}, but force file links to be opened with Emacs, and
- internal links to be displayed in another window
- code{org-display-internal-link-with-indirect-buffer}}.
- orgcmd{C-c C-x C-v,org-toggle-inline-images}
- cindex images, inlining
- cindex
- cindex
- code{org-startup-with-inline-images}
- code{#+STARTUP} keywords code{noinlineimages}}.
- cindex mark ring
- Push the current position onto the mark ring, to be able to return
- easily. Commands following an internal link do this automatically.
- orgcmd{C-c &,org-mark-ring-goto}
- kbd{C-c %}. Using this
- command several times in direct succession moves through a ring of
- previously recorded positions.
- orgcmdkkcc{C-c C-x C-n,C-c C-x C-p,org-next-link,org-previous-link}
- kbd{C-n} and
- lisp
- (add-hook 'org-load-hook
- (lambda ()
- (define-key org-mode-map "\C-n" 'org-next-link)
- (define-key org-mode-map "\C-p" 'org-previous-link)))
- end table
- section Using links outside Org
- You can insert and follow links that have Org syntax not only in
- Org, but in any Emacs buffer. For this, you should create two
- global commands, like this (please select suitable global keys
- yourself):
- end lisp
- section Link abbreviations
- cindex abbreviation, links
- Long URLs can be cumbersome to type, and often many similar links are
- needed in a document. For this you can use link abbreviations. An
- abbreviated link looks like this
- end example
- vindex org-link-abbrev-alist
- where the tag is optional.
- The
- samp{-}, and
- code{org-link-abbrev-alist}
- that relates the linkwords to replacement text. Here is an example:
- group
- (setq org-link-abbrev-alist
- '(("bugzilla" . "http://10.1.2.9/bugzilla/show_bug.cgi?id=")
- ("url-to-ja" . "http://translate.google.fr/translate?sl=en&tl=ja&u=%h")
- ("google" . "http://www.google.com/search?q=")
- ("gmap" . "http://maps.google.com/maps?q=%s")
- ("omap" . "http://nominatim.openstreetmap.org/search?q=%s&polygon=1")
- ("ads" . "http://adsabs.harvard.edu/cgi-bin/nph-abs_connect?author=%s&db_key=AST")))
- end smalllisp
- If the replacement text contains the string
- samp{%h} instead of
- samp{%(my-function)} will pass the tag
- to a custom function, and replace it by the resulting string.
- If the replacement text doesn't contain any specifier, the tag will simply be
- appended in order to create the link.
- Instead of a string, you may also specify a function that will be
- called with the tag as the only argument to create the link.
- With the above setting, you could link to a specific bug with
- samp{OrgMode} with
- code{[[gmap:51 Franklin Street, Boston]]} or of Carsten office
- code{[[ads:Dominik,C]]}.
- If you need special abbreviations just for a single Org buffer, you
- can define them in the file with
- example
- #+LINK: bugzilla http://10.1.2.9/bugzilla/show_bug.cgi?id=
- #+LINK: google http://www.google.com/search?q=%s
- noindent
- In-buffer completion (samp{[} to
- complete link abbreviations. You may also define a function that implements
- special (e.g., completion) support for inserting such a link with
- lisp
- (org-link-set-parameters ``type'' :complete #'some-function)
- node Search options
- cindex search option in file links
- footnote{For backward
- compatibility, line numbers can also follow a single colon.} colon. For
- example, when the command pxref{Handling
- links}) to a file, it encodes the words in the current line as a search
- string that can be used to find this line back later when following the
- link with
- example
- [[file:~/code/main.c::255]]
- [[file:~/xx.org::My Target]]
- [[file:~/xx.org::*My Target]]
- [[file:~/xx.org::#my-custom-id]]
- [[file:~/xx.org::/regexp/]]
- table
- item 255
- Jump to line 255.
- samp{<<My Target>>}, or do a text search for
- ref{Internal links}. In HTML export (
- item *My Target
- In an Org file, restrict search to headlines.
- code{CUSTOM_ID} property
- code{regexp}. This uses the Emacs
- command
- code{org-occur} is used to create a
- sparse tree with the matches.
- c
- end table
- As a degenerate case, a file link with an empty file name can be used
- to search the current file. For example,
- samp{find me} in the current file, just as
- node Custom searches
- cindex custom search strings
- TeX{} database files have many entries like
- TeX{} entry is the
- citation key.
- vindex org-execute-file-search-functions
- If you come across such a problem, you can write custom functions to set
- the right search string for a particular file type, and to do the search
- for the string in the file. Using
- code{org-create-file-search-functions} and
- TeX{} database files, and you can use the corresponding code as
- an implementation example. See the file
- node TODO items
- cindex TODO items
- Org mode does not maintain TODO lists as separate documents
- menu
- * TODO basics:: Marking and displaying TODO entries
- * TODO extensions:: Workflow and assignments
- * Progress logging:: Dates and notes for progress
- * Priorities:: Some things are more important than others
- * Breaking down tasks:: Splitting a task into manageable pieces
- * Checkboxes:: Tick-off lists
- node TODO basics
- samp{TODO}, for example:
- end example
- table
- orgcmd{C-c C-t,org-todo}
- vindex org-use-fast-todo-selection
- Rotate the TODO state of the current item among
- end example
- If TODO keywords have fast access keys (see
- code{org-use-fast-todo-selection} is non-
- kbd{t} command key (
- orgkey{C-u C-c C-t}
- When TODO keywords have no selection keys, select a specific keyword using
- completion; otherwise force cycling through TODO states with no prompt. When
- code{prefix}, use the fast
- selection interface.
- key{right}
- key{left}
- key{right} r{/} key{left}
- pxref{TODO
- extensions}). See also
- code{shift-selection-mode}. See also the variable
- orgcmd{C-c / t,org-show-todo-tree}
- vindex org-todo-keywords
- View TODO items in a pxref{Sparse trees}). Folds the
- entire buffer, but shows all TODO items (with not-DONE state) and the
- headings hierarchy above them. With a prefix argument (or by using
- . You will be prompted for the keyword,
- and you can also give a list of keywords like
- code{org-todo-keywords}.
- With two prefix arguments, find all TODO states, both un-done and done.
- pxref{Agenda views}) into a single buffer. The new
- buffer will be in
- pxref{Agenda commands}).
- orgcmd{S-M-
- end table
- vindex org-todo-state-tags-triggers
- Changing a TODO state can also trigger tag changes. See the docstring of the
- option
- node TODO extensions
- cindex extended TODO keywords
- . Org mode allows you to classify TODO items in more complex ways
- with code{org-todo-keywords}). With
- special setup, the TODO keyword system can work differently in different
- files.
- Note that
- pxref{Tags}).
- end menu
- subsection TODO keywords as workflow states
- cindex workflow states as TODO keywords
- You can use TODO keywords to indicate different
- footnote{Changing
- this variable only becomes effective after restarting Org mode in a
- buffer.}:
- end lisp
- The vertical bar separates the TODO keywords (states that
- emph{no further action}). If
- you don't provide the separator bar, the last state is used as the DONE
- state.
- kbd{C-c C-t} will cycle an entry from TODO
- to FEEDBACK, then to VERIFY, and finally to DONE and DELEGATED
- kbd{C-3 C-c C-t} will change the state immediately to VERIFY
- kbd{S-
- pxref{Completion}) or even a special one-key selection scheme
- (
- ref{Tracking TODO state changes}, for more information.
- subsection TODO keywords as types
- cindex names as TODO keywords
- emph{types} of action items. For example, you might want to indicate
- that items are for ``work'' or ``home''. Or, when you work with several
- people on a single project, you might want to assign action items
- directly to persons, by using their names as TODO keywords. This would
- be set up like this:
- end lisp
- In this case, different keywords do not indicate a sequence, but rather
- different types. So the normal work flow would be to assign a task to a
- person, and later to mark it DONE
- kbd{C-c C-t}
- kbd{t} command in the timeline and agenda buffers.}. When used several
- times in succession, it will still cycle through all names, in order to first
- select the right type for a task. But when you return to the item after some
- time and execute
- . Use prefix arguments or completion to quickly select a specific
- name. You can also review the items of a specific TODO type in a sparse tree
- by using a numeric prefix to
- kbd{C-3 C-c / t}. To collect Lucy's items
- from all agenda files into a single buffer, you would use the numeric prefix
- argument as well when creating the global TODO list:
- node Multiple sets in one file
- cindex TODO keyword sets
- Sometimes you may want to use different sets of TODO keywords in
- parallel. For example, you may want to have the basic
- code{DONE}, but also a workflow for bug fixing, and a
- separate state indicating that an item has been canceled (so it is not
- DONE, but also does not require action). Your setup would then look
- like this:
- end lisp
- The keywords should all be different, this helps Org mode to keep track
- of which subsequence should be used for a given entry. In this setup,
- code{DONE} to (nothing) to code{FIXED} to
- (nothing) to
- table
- kindex C-S-
- kindex C-S-
- kindex C-u C-u C-c C-t
- itemx C-S-
- itemx C-S-
- kbd{C-u C-u C-c C-t} or key{right}} would jump from
- code{DONE} to
- code{CANCELED}. Note that the
- code{shift-selection-mode} (
- kindex S-
- kindex S-
- item S-
- itemx S-
- kbd{S-kbd{S-emph{all}
- keywords from all sets, so for example key{right}} would switch
- from code{REPORT} in the example above. See also
- code{shift-selection-mode}.
- node Fast access to TODO states
- footnote{All characters are allowed except
- lisp
- (setq org-todo-keywords
- '((sequence "TODO(t)" "|" "DONE(d)")
- (sequence "REPORT(r)" "BUG(b)" "KNOWNCAUSE(k)" "|" "FIXED(f)")
- (sequence "|" "CANCELED(c)")))
- vindex org-fast-tag-selection-include-todo
- If you then press
- kbd{SPC} can be used to remove any TODO
- keyword from an entry.
- code{org-fast-tag-selection-include-todo}, it allows you to change the TODO
- state through the tags interface (
- node Per-file keywords
- cindex keyword options
- cindex #+TODO
- cindex #+SEQ_TODO
- It can be very useful to use different aspects of the TODO mechanism in
- different files. For file-local settings, you need to add special lines to
- the file which set the keywords and interpretation for that file only. For
- example, to set one of the two examples discussed above, you need one of the
- following lines anywhere in the file:
- end example
- code{#+SEQ_TODO} to be explicit about the
- interpretation, but it means the same as
- example
- #+TYP_TODO: Fred Sara Lucy Mike | DONE
- example
- #+TODO: TODO | DONE
- #+TODO: REPORT BUG KNOWNCAUSE | FIXED
- #+TODO: | CANCELED
- cindex completion, of option keywords
- key{TAB}
- samp{#+} into the buffer and then use key{TAB}} completion.
- kbd{C-c C-c} with the cursor still in the line to make the changes
- known to Org mode
- kbd{C-c C-c} with the
- cursor in a line starting with
- node Faces for TODO keywords
- cindex faces, for TODO keywords
- r{(face)}
- r{(face)}
- code{org-todo}
- for keywords indicating that an item still has to be acted upon, and
- code{org-todo-keyword-faces}. For example:
- group
- (setq org-todo-keyword-faces
- '(("TODO" . org-warning) ("STARTED" . "yellow")
- ("CANCELED" . (:foreground "blue" :weight bold))))
- end lisp
- While using a list with face properties as shown for CANCELED
- code{org-faces-easy-properties} determines if that color is interpreted as a
- foreground or a background color.
- subsection TODO dependencies
- cindex dependencies, of TODO states
- vindex org-enforce-todo-dependencies
- . And sometimes
- there is a logical sequence to a number of (sub)tasks, so that one task
- cannot be acted upon before all siblings above it are done. If you customize
- the option
- .
- Furthermore, if an entry has a property
- . Here is an
- example:
- end example
- You can ensure an entry is never blocked by using the
- example
- * This entry is never blocked
- :PROPERTIES:
- :NOBLOCKING: t
- :END:
- table
- orgcmd{C-c C-x o,org-toggle-ordered-property}
- cindex property, ORDERED
- Toggle the
- i{track} the value of
- this property with a tag for better visibility, customize the option
- orgkey{C-u C-u C-u C-c C-t}
- Change TODO state, circumventing any state blocking.
- vindex org-agenda-dim-blocked-tasks
- If you set the option
- pxref{Agenda views}).
- vindex org-enforce-todo-dependencies
- You can also block changes of TODO states by looking at checkboxes
- (
- code{org-enforce-todo-checkbox-dependencies}, an entry that has unchecked
- checkboxes will be blocked from switching to DONE.
- If you need more complex dependency structures, for example dependencies
- between entries in different trees or files, check out the contributed
- module
- page
- section Progress logging
- cindex logging, of progress
- Org mode can automatically record a timestamp and possibly a note when
- you mark a TODO item as DONE, or even each time you change the state of
- a TODO item. This system is highly configurable; settings can be on a
- per-keyword basis and can be localized to a file or even a subtree. For
- information on how to clock working time for a task, see
- menu
- * Closing items:: When was this entry marked DONE?
- * Tracking TODO state changes:: When did the status change?
- * Tracking your habits:: How consistent have you been?
- node Closing items
- emph{when} a certain TODO
- item was finished. This is achieved with
- code{#+STARTUP: logdone}}
- end lisp
- noindent
- Then each time you turn an entry from a TODO (not-done) state into any of the
- DONE states, a line
- key{C-c C-t SPC} for example), that line
- will also be removed, unless you set
- code{nil}. If you want to record a note along with the timestamp,
- usecode{#+STARTUP:
- lognotedone}.}
- end lisp
- samp{Closing Note} heading.
- In the timeline (
- pxref{Weekly/daily agenda}), you can then use the
- samp{CLOSED} timestamp on each day,
- giving you an overview of what has been done.
- subsection Tracking TODO state changes
- vindex org-log-states-order-reversed
- cindex property, LOG_INTO_DRAWER
- When TODO keywords are used as workflow states (
- footnote{See the option
- pxref{Drawers}).
- Customize
- code{LOGBOOK}
- code{LOGBOOK} drawer is unfolded when pressing
- key{C-u SPC} to keep it folded here}. You can also
- overrule the setting of this variable for a subtree by setting a
- samp{!} (for a timestamp) or
- lisp
- (setq org-todo-keywords
- '((sequence "TODO(t)" "WAIT(w@@/!)" "|" "DONE(d!)" "CANCELED(c@@)")))
- samp{}, just type
- noindent
- footnote{It is possible that Org mode will record two timestamps
- when you are using both
- samp{Closing Note}.}, and that a note is recorded when switching to
- WAIT or CANCELED
- samp{!} after the slash means that in addition to the note taken when
- entering the state, a timestamp should be recorded when
- i{target} state does not configure
- logging for entering it. So it has no effect when switching from WAIT
- to DONE, because DONE is configured to record a timestamp only. But
- when switching from WAIT back to TODO, the
- example
- #+TODO: TODO(t) WAIT(w/!) | DONE(d!) CANCELED(c)
- cindex property, LOGGING
- In order to define logging settings that are local to a subtree or a
- single item, define a LOGGING property in this entry. Any non-empty
- LOGGING property resets all logging settings to
- code{lognotedone} or
- code{TODO(!)}. For example
- end example
- subsection Tracking your habits
- enumerate
- code{habits} module by customizing
- item
- The habit is a TODO item, with a TODO keyword representing an open state.
- code{STYLE} is set to the value
- item
- The TODO has a scheduled date, usually with a
- code{++} style may be appropriate for habits with time
- constraints, e.g., must be done on weekends, or a
- item
- The TODO may also have minimum and maximum ranges specified by using the
- syntax
- item
- You must also have state logging for the
- pxref{Tracking TODO state changes}), in order for historical data to be
- represented in the consistency graph. If it is not enabled it is not an
- error, but the consistency graphs will be largely meaningless.
- example
- ** TODO Shave
- SCHEDULED: <2009-10-17 Sat .+2d/4d>
- :PROPERTIES:
- :STYLE: habit
- :LAST_REPEAT: [2009-10-19 Mon 00:36]
- :END:
- - State "DONE" from "TODO" [2009-10-15 Thu]
- - State "DONE" from "TODO" [2009-10-12 Mon]
- - State "DONE" from "TODO" [2009-10-10 Sat]
- - State "DONE" from "TODO" [2009-10-04 Sun]
- - State "DONE" from "TODO" [2009-10-02 Fri]
- - State "DONE" from "TODO" [2009-09-29 Tue]
- - State "DONE" from "TODO" [2009-09-25 Fri]
- - State "DONE" from "TODO" [2009-09-19 Sat]
- - State "DONE" from "TODO" [2009-09-16 Wed]
- - State "DONE" from "TODO" [2009-09-12 Sat]
- code{SCHEDULED} date and repeat interval) and at least every 4 days. If
- today is the 15th, then the habit first appears in the agenda on Oct 17,
- after the minimum of 2 days has elapsed, and will appear overdue on Oct 19,
- after four days have elapsed.
- What's really useful about habits is that they are displayed along with a
- consistency graph, to show how consistent you've been at getting that task
- done in the past. This graph shows every day that the task was done over the
- past three weeks, with colors for each day. The colors used are:
- code
- item Green
- If the task could have been done on that day.
- item Red
- If the task was overdue on that day.
- table
- item org-habit-graph-column
- The buffer column at which the consistency graph should be drawn. This will
- overwrite any text in that column, so it is a good idea to keep your habits'
- titles brief and to the point.
- item org-habit-following-days
- The number of days after today that will appear in consistency graphs.
- code{nil}, only show habits in today's agenda view. This is set to true by
- default.
- kbd{K} in the agenda buffer will cause habits to
- temporarily be disabled and they won't appear at all. Press
- node Priorities
- cindex priorities
- If you use Org mode extensively, you may end up with enough TODO items that
- it starts to make sense to prioritize them. Prioritizing can be done by
- placing a
- example
- *** TODO [#A] Write letter to Sam Fortune
- noindent
- samp{A},
- samp{C}.
- samp{B}. Priorities make a difference only for
- sorting in the agenda (
- code{org-priority-faces}.
- Priorities can be attached to any outline node; they do not need to be TODO
- items.
- kbd
- kbd{C-c ,}
- kbd{C-c ,}
- command{org-priority}). The
- command prompts for a priority character samp{B} or
- key{SPC} instead, the priority cookie is removed from the
- headline. The priorities can also be changed ``remotely'' from the timeline
- and agenda buffer with the pxref{Agenda commands}).
- orgcmdkkcc{S-key{down},org-priority-up,org-priority-down}
- footnote{See also the option
- pxref{Creating timestamps}). See also
- code{shift-selection-mode}.
- vindex org-highest-priority
- vindex org-default-priority
- You can change the range of allowed priorities by setting the options
- code{org-lowest-priority}, and
- cindex #+PRIORITIES
- end example
- section Breaking tasks down into subtasks
- cindex statistics, for TODO items
- footnote{To keep subtasks out of the
- global TODO list, see the
- samp{[/]} or
- kbd{C-c C-c} on the cookie. For example:
- end example
- code{COOKIE_DATA} to either samp{todo} to resolve
- this issue.
- code{org-hierarchical-todo-statistics}. To do this for a single subtree,
- include the word code{COOKIE_DATA}
- property.
- end example
- If you would like a TODO entry to automatically change to DONE
- when all children are done, you can use the following setup:
- end example
- Another possibility is the use of checkboxes to identify (a hierarchy of) a
- large number of subtasks (
- node Checkboxes
- cindex checkboxes
- footnote{With the exception of description
- lists. But you can allow it by modifying
- pxref{Plain lists}) can be made into a checkbox by starting
- it with the string
- pxref{TODO items}), but is more lightweight. Checkboxes are not included
- in the global TODO list, so they are often great to split a task into a
- number of simple steps. Or you can use them in a shopping list. To toggle a
- checkbox, use
- file{org-mouse.el}).
- Here is an example of a checkbox list.
- end example
- Checkboxes work hierarchically, so if a checkbox item has children that
- are checkboxes, toggling one of the children checkboxes will make the
- parent checkbox reflect if none, some, or all of the children are
- checked.
- cindex checkbox statistics
- vindex org-checkbox-hierarchical-statistics
- The samp{[1/3]} in the first and second line are cookies
- indicating how many checkboxes present in this entry have been checked off,
- and the total number of checkboxes present. This can give you an idea on how
- many checkboxes remain, even without opening a folded entry. The cookies can
- be placed into a headline or into (the first line of) a plain list item.
- Each cookie covers checkboxes of direct children structurally below the
- headline/item on which the cookie appears
- code{org-checkbox-hierarchical-statistics} if you want such cookies to
- count all checkboxes below the cookie, not just those belonging to direct
- children.}. You have to insert the cookie yourself by typing either
- samp{[%]}. With samp{n out of m}
- result, as in the examples above. With
- samp{[50%]} and
- code{COOKIE_DATA}
- to either samp{todo} to resolve this issue.
- cindex checkbox blocking
- code{ORDERED} property, checkboxes must
- be checked off in sequence, and an error will be thrown if you try to check
- off a box while there are unchecked boxes above it.
- table
- orgcmd{C-c C-c,org-toggle-checkbox}
- Toggle checkbox status or (with prefix arg) checkbox presence at point. With
- a single prefix argument, add an empty checkbox or remove the current
- onekbd{C-u C-c C-c} before the
- samp{[-]}, which is considered to be an
- intermediate state.
- samp{[-]}, which is considered to be an
- intermediate state.
- minus
- item
- If the cursor is in a headline, toggle the state of the first checkbox in the
- region between this headline and the next---so
- item
- If there is no active region, just toggle the checkbox at point.
- orgcmd{M-S-
- pxref{Plain lists}).
- vindex org-track-ordered-property-with-tag
- code{ORDERED} property of the entry, to toggle if checkboxes must
- be checked off in sequence. A property is used for this behavior because
- this should be local to the current entry, not inherited like a tag.
- However, if you would like to
- code{org-track-ordered-property-with-tag}.
- kbd{C-u} prefix, update the entire file. Checkbox statistic cookies are
- updated automatically if you toggle checkboxes with
- kbd{M-S-
- end table
- chapter Tags
- cindex headline tagging
- cindex sparse tree, tag based
- An excellent way to implement labels and contexts for cross-correlating
- information is to assign
- vindex org-tag-faces
- Every headline can contain a list of tags; they occur at the end of the
- headline. Tags are normal words containing letters, numbers,
- samp{}. Tags must be preceded and followed by a single colon, e.g.,
- samp{:work:urgent:}.
- Tags will by default be in bold face with the same color as the headline.
- You may specify special faces for specific tags using the option
- pxref{Faces for TODO keywords}).
- end menu
- section Tag inheritance
- cindex inheritance, of tags
- i{Tags} make use of the hierarchical structure of outline trees. If a
- heading has a certain tag, all subheadings will inherit the tag as
- well. For example, in the list
- end example
- samp{:work:},
- samp{:notes:}, and
- footnote{As with all these in-buffer settings, pressing
- cindex #+FILETAGS
- end example
- vindex org-use-tag-inheritance
- code{org-tags-exclude-from-inheritance}.
- To turn it off entirely, use
- vindex org-tags-match-list-sublevels
- When a headline matches during a tags search while tag inheritance is turned
- on, all the sublevels in the same tree will (for a simple match form) match
- as well
- pxref{Property searches}).}. The list
- of matches may then become very long. If you only want to see the first tags
- match in a subtree, configure
- vindex org-agenda-use-tag-inheritance
- Tag inheritance is relevant when the agenda search tries to match a tag,
- either in the code{tags-todo} agenda types. In other agenda
- types,
- code{org-agenda-use-tag-inheritance} to control
- this: the default value includes all agenda types, but setting this to
- node Setting tags
- cindex setting tags
- kindex M-
- kbd{M-
- table
- orgcmd{C-c C-q,org-set-tags-command}
- vindex org-tags-column
- Enter new tags for the current headline. Org mode will either offer
- completion or a special single-key interface for setting tags, see
- below. After pressing
- code{org-tags-column}. When called with a
- pxref{TODO basics}).
- kbd{C-c C-q}.
- vindex org-tag-alist
- Org supports tag insertion based on a
- code{org-tag-alist}. Finally you can set
- the default tags for a given file with lines like
- example
- #+TAGS: work home tennisclub
- #+TAGS: laptop car pc sailboat
- code{org-tag-alist}, but would like to use a dynamic tag list
- in a specific file, add an empty TAGS option line to that file:
- end example
- code{org-tag-persistent-alist}. You may turn this off on a per-file basis
- by adding a STARTUP option line to that file:
- end example
- By default Org mode uses the standard minibuffer completion facilities for
- entering tags. However, it also implements another, quicker, tag selection
- method called
- code{org-tag-alist} in
- your Emacs init file. For example, you may find the need to tag many items
- in different files with
- lisp
- (setq org-tag-alist '(("@@work" . ?w) ("@@home" . ?h) ("laptop" . ?l)))
- noindent If the tag is only relevant to the file you are working on, then you
- can instead set the TAGS option line as:
- end example
- samp{\n} into the tag list
- end example
- example
- #+TAGS: work(w) home(h) tennisclub(t)
- #+TAGS: laptop(l) pc(p)
- noindent
- You can also group together tags that are mutually exclusive by using
- braces, as in:
- { work(w) home(h) tennisclub(t)
- end example
- samp{work},
- samp{tennisclub} should be selected. Multiple such groups are allowed.
- kbd{C-c C-c} with the cursor in one of
- these lines to activate any changes.
- code{org-tag-alist},
- you must use the dummy tags code{:endgroup} instead
- of the braces. Similarly, you can use
- lisp
- (setq org-tag-alist '((:startgroup . nil)
- ("@@work" . ?w) ("@@home" . ?h)
- ("@@tennisclub" . ?t)
- (:endgroup . nil)
- ("laptop" . ?l) ("pc" . ?p)))
- kbd{C-c C-c} will
- automatically present you with a special interface, listing inherited tags,
- the tags of the current headline, and a list of all valid tags with
- corresponding keys
- table
- kindex
- item
- kindex
- item
- kindex
- item
- item C-g
- Abort without installing changes.
- kbd{q} is not assigned to a tag, it aborts like
- item !
- Turn off groups of mutually exclusive tags. Use this to (as an
- exception) assign several tags from such a group.
- kbd{C-c} will display the
- selection window.
- noindent
- This method lets you assign tags to a headline with very few keys. With
- the above setup, you could clear the current tags and set
- samp{laptop} and kbd{C-c
- C-c key{RET}}. Switching from
- samp{work} would be done with key{RET}} or
- alternatively with
- samp{Sarah} could be done with key{TAB} S a r a h
- key{RET}}.
- code{org-fast-tag-selection-single-key}.
- Then you no longer have to press
- kbd{C-c} to turn off auto-exit for the current tag
- selection process (in effect: start selection with
- kbd{C-c C-c}). If you set the variable to the value
- kbd{C-c}.
- section Tag hierarchy
- cindex tags, groups
- emph{group
- tag} for a set of other tags. The group tag can be seen as the ``broader
- term'' for its set of tags. Defining multiple
- example
- #+TAGS: [ GTD : Control Persp ]
- samp{GTD} is the
- samp{Control}, samp{Control} and
- example
- #+TAGS: [ Control : Context Task ]
- #+TAGS: [ Persp : Vision Goal AOF Project ]
- example
- - GTD
- - Persp
- - Vision
- - Goal
- - AOF
- - Project
- - Control
- - Context
- - Task
- code{:startgrouptag},
- code{:endgrouptag} keyword directly when setting
- lisp
- (setq org-tag-alist '((:startgrouptag)
- ("GTD")
- (:grouptags)
- ("Control")
- ("Persp")
- (:endgrouptag)
- (:startgrouptag)
- ("Control")
- (:grouptags)
- ("Context")
- ("Task")
- (:endgrouptag)))
- example
- #+TAGS: }
- code{org-tag-alist} you can use
- code{:endgroup} instead of code{:endgrouptag} to
- make the tags mutually exclusive.
- Furthermore, the members of a
- {
- example
- #+TAGS: [ Vision : .+
- {G} ]
- #+TAGS: [ AOF : .+
- {P} ]
- samp{Project} will now list all tags also including
- regular expression matches for .+}, and similarly for tag searches on
- samp{Goal} and
- samp{P2014_OrgTags}.
- vindex org-group-tags
- If you want to ignore group tags temporarily, toggle group tags support
- with kbd{C-c C-x q}. If you
- want to disable tag groups completely, set code{nil}.
- section Tag searches
- cindex searching for tags
- Once a system of tags has been set up, it can be used to collect related
- information into special lists.
- kbd
- kbd{C-u} prefix argument, ignore headlines that are not a TODO line.
- orgcmd{C-c a m,org-tags-view}
- Create a global list of tag matches from all agenda files.
- orgcmd{C-c a M,org-tags-view}
- code{org-tags-match-list-sublevels}).
- samp{+boss+urgent-project1}, to find entries with tags
- samp{urgent}, but not samp{Kathy|Sally} to find entries
- tagged as samp{Sally}. The full syntax of the search string
- is rich and allows also matching against TODO keywords, entry levels and
- properties. For a complete description with many examples, see
- node Properties and columns
- cindex properties
- A property is a key-value pair associated with an entry. Properties can be
- set so they are associated with a single entry, with every entry in a tree,
- or with every entry in an Org mode file.
- There are two main applications for properties in Org mode. First,
- properties are like tags, but with a value. Imagine maintaining a file where
- you document bugs and plan releases for a piece of software. Instead of
- using tags like code{:release_2:}, you can use a
- property, say
- code{1.0} or
- pxref{Column view}).
- end menu
- section Property syntax
- cindex drawer, for properties
- Properties are key-value pairs. When they are associated with a single entry
- or with a tree they need to be inserted into a special drawer
- (code{PROPERTIES}, which has to be located
- right below a headline, and its planning line (
- example
- * CD collection
- ** Classic
- *** Goldberg Variations
- :PROPERTIES:
- :Title: Goldberg Variations
- :Composer: J.S. Bach
- :Artist: Glen Gould
- :Publisher: Deutsche Grammophon
- :NDisks: 1
- :END:
- code{org-use-property-inheritance}, a property set
- this way will either be associated with a single entry, or the subtree
- defined by the entry, see
- samp{:Xyz:}
- by setting a property
- emph{inherited}, so if you set it in a level 1 entry, it will apply to
- the entire tree. When allowed values are defined, setting the
- corresponding property becomes easier and is less prone to typing
- errors. For the example with the CD collection, we can predefine
- publishers and the number of disks in a box like this:
- end example
- If you want to set properties that can be inherited by any entry in a
- file, use a line like
- cindex #+PROPERTY
- end example
- Contrary to properties set from a special drawer, you have to refresh the
- buffer with
- code{+} to
- the property name. The following results in the property
- cindex property, +
- end example
- It is also possible to add to the values of inherited properties. The
- following results in the
- code{Goldberg Variations} subtree.
- example
- * CD collection
- ** Classic
- :PROPERTIES:
- :GENRES: Classic
- :END:
- *** Goldberg Variations
- :PROPERTIES:
- :Title: Goldberg Variations
- :Composer: J.S. Bach
- :Artist: Glen Gould
- :Publisher: Deutsche Grammophon
- :NDisks: 1
- :GENRES+: Baroque
- :END:
- vindex org-global-properties
- Property values set with the global variable
- noindent
- The following commands help to work with properties:
- kbd
- key{TAB},pcomplete}
- After an initial colon in a line, complete property keys. All keys used
- in the current file will be offered as possible completions.
- item C-u M-x org-insert-drawer RET
- orgcmd{C-c C-c,org-property-action}
- With the cursor in a property drawer, this executes property commands.
- orgcmdkkcc{S-key{left},org-property-next-allowed-value,org-property-previous-allowed-value}
- Switch property at point to the next/previous allowed value.
- orgcmd{C-c C-c D,org-delete-property-globally}
- Globally remove a property, from all entries in the current file.
- end table
- section Special properties
- pxref{Column view}), or to use them in queries. The
- following property names are special and should not be used as keys in the
- properties drawer:
- cindex property, special, BLOCKED
- cindex property, special, CLOCKSUM_T
- cindex property, special, DEADLINE
- cindex property, special, ITEM
- cindex property, special, SCHEDULED
- cindex property, special, TIMESTAMP
- cindex property, special, TODO
- r{All tags, including inherited ones.}
- BLOCKED
- r{The sum of CLOCK intervals in the subtree.
- r{must be run first to compute the values in the current buffer.}
- CLOCKSUM_T
- r{
- r{values in the current buffer.}
- CLOSED
- r{The deadline time string, without the angular brackets.}
- FILE
- r{The headline of the entry.}
- PRIORITY
- r{The scheduling timestamp, without the angular brackets.}
- TAGS
- r{The first keyword-less timestamp in the entry.}
- TIMESTAMP_IA
- r{The TODO keyword of the entry.}
- node Property searches
- cindex properties, searching
- pxref{Tag searches}).
- kbd
- kbd{C-u} prefix argument, ignore headlines that are not a TODO line.
- xref{Matching tags and properties}.
- vindex org-tags-match-list-sublevels
- Create a global list of tag matches from all agenda files, but check
- only TODO items and force checking of subitems (see the option
- end table
- The syntax for the search string is described in
- table
- orgkey{C-c / p}
- Create a sparse tree based on the value of a property. This first
- prompts for the name of a property, and then for a value. A sparse tree
- is created with all entries that define this property with the given
- value. If you enclose the value in curly braces, it is interpreted as
- a regular expression and matched against the property values.
- node Property inheritance
- cindex properties, inheritance
- vindex org-use-property-inheritance
- The outline structure of Org mode documents lends itself to an
- inheritance model of properties: if the parent in a tree has a certain
- property, the children can inherit this property. Org mode does not
- turn this on by default, because it can slow down property searches
- significantly and is often not needed. However, if you find inheritance
- useful, you can turn it on by setting the variable
- code{t} to make
- all properties inherited from the parent, to a list of properties
- that should be inherited, or to a regular expression that matches
- inherited properties. If a property has the value
- code{nil}.
- Org mode has a few properties for which inheritance is hard-coded, at
- least for the special applications for which they are used:
- table
- item COLUMNS
- The
- pxref{Column view}). It is inherited in the sense that the level
- where a
- item CATEGORY
- code{:CATEGORY:} property
- applies to the entire subtree.
- cindex property, ARCHIVE
- For archiving, the
- pxref{Moving subtrees}).
- cindex property, LOGGING
- The LOGGING property may define logging settings for an entry or a
- subtree (
- end table
- section Column view
- A great way to view and edit properties in an outline tree is
- kbd{S-key{TAB}}, or simply
- pxref{Agenda views}) where
- queries have collected selected items, possibly from a number of files.
- end menu
- subsection Defining columns
- cindex properties, column view
- Setting up a column view first requires defining the columns. This is
- done by defining a column format line.
- end menu
- subsubsection Scope of column definitions
- To define a column format for an entire file, use a line like
- example
- #+COLUMNS: %25ITEM %TAGS %PRIORITY %TODO
- code{:COLUMNS:} property to the top node of that tree, for example:
- end example
- If a
- node Column attributes
- example
- %[var{property}[({}]
- noindent
- Except for the percent sign and the property name, all items are
- optional. The individual parts have the following meaning:
- var{width}
- r{If omitted, the width will be determined automatically.}
- r{The property that should be edited in this column.}
-
- r{as well (
- var{title}
- r{name is used.}
- var{summary-type}r{The summary type. If specified, the column values for}
- footnote{If
- more than one summary type apply to the property, the parent
- values are computed according to the first of them.}.}
-
- {+r{Sum numbers in this column.}
- } samp{+}, but format result with
- {$r{Currency, short for
- {minr{Smallest number in column.}
- }
- {meanr{Arithmetic mean of numbers.}
- } samp{[X]} if all children are
- {X/r{Checkbox status,
- {X%r{Checkbox status,
- {:r{Sum times, HH:MM, plain numbers are
- hours
- code{org-effort-durations}, e.g.,
-
- {:minr{Smallest time value in column.}
- }
- {:meanr{Arithmetic mean of time values.}
- } footnote{An age is defined as
- a duration since a given time-stamp (
- samp{d}, samp{m} and
- samp{0d 13h 0m 10s}.} (in
- days/hours/mins/seconds).}
- }
- {meanr{Arithmetic mean of ages (in days/hours/mins/seconds).}
- } samp{low-high} estimates.}
- code{est+} summary type requires further explanation. It is used for
- combining estimates, expressed as
- code{est+} adds the
- statistical mean and variance of the sub-tasks, generating a final estimate
- from the sum. For example, suppose you had ten tasks, each of which was
- estimated at 0.5 to 2 days of work. Straight addition produces an estimate
- of 5 to 20 days, representing what to expect if everything goes either
- extremely well or extremely poorly. In contrast,
- code{%5d} or
- vindex org-columns-summary-types
- You can also define custom summary types by setting
- example
- :COLUMNS: %25ITEM %9Approved(Approved?)} %Owner %11Status \
- {:
- end example
- samp{%25ITEM}, means the first 25 characters of the
- item itself, i.e., of the headline. You probably always should start the
- column definition with the
- samp{Owner} with a list of names as allowed values, for
- samp{Approved}. When no width is given after the
- samp{Approved} column does have a
- modified title (
- samp{Time_Estimate} column by adding time duration
- expressions like HH:MM, and for the
- samp{[X]} status if all children have been checked. The
- samp{CLOCKSUM_T} columns are special, they lists the
- sums of CLOCK intervals in the subtree, either for all clocks or just for
- today.
- subsection Using column view
- kbd
- orgcmd{C-c C-x C-c,org-columns}
- code{#+COLUMNS} definition. If the
- cursor is somewhere inside the outline, this command searches the hierarchy,
- up from point, for a
- code{:COLUMNS:} property. If no such property
- is found, the format is taken from the
- code{org-columns-default-format}, and column view is established
- for the current entry and its subtree.
- orgcmd{g,org-columns-redo}
- Same as
- orgcmd{q,org-columns-quit}
- Exit column view.
- item key{right} key{down}
- Move through the column view from field to field.
- key{left}
- key{right}
- key{left}/
- item 1..9,0
- Directly select the Nth allowed value,
- orgcmdkkcc{n,p,org-columns-next-allowed-value,org-columns-previous-allowed-value}
- Same as key{left}/
- orgcmd{e,org-columns-edit-value}
- Edit the property at point. For the special properties, this will
- invoke the same interface that you normally use to change that
- property. For example, when editing a TAGS property, the tag completion
- or fast selection interface will pop up.
- orgcmd{v,org-columns-show-value}
- View the full value of this property. This is useful if the width of
- the column is smaller than that of the value.
- tsubheading{Modifying the table structure}
- orgcmd{S-M-
- orgcmd{S-M-
- end table
- subsection Capturing column view
- Since column view is just an overlay over a buffer, it cannot be
- exported or printed directly. If you want to capture a column view, use
- a pxref{Dynamic blocks}). The frame
- of this block looks like this:
- example
- * The column view
- #+BEGIN: columnview :hlines 1 :id "label"
- #+END:
- noindent This dynamic block has the following parameters:
- code
- cindex property, ID
- r{use the tree in which the capture block is located}
- global
- var{path-to-file}"
- @r{run column view at the top of this file}
- "r{call column view in the tree that has an
- r{property with the value
- r{
- r{the current entry and copy it to the kill-ring.}
- item :hlines
- When var{N}, insert
- an hline before each headline with level var{N}}.
- code{t}, force column groups to get vertical lines.
- item :skip-empty-rows
- When set to
- code{ITEM}.
- code{nil}, indent each
- end table
- table
- orgcmd{C-c C-x i,org-insert-columns-dblock}
- Insert a dynamic block capturing a column view. You will be prompted
- for the scope or ID of the view.
- code{#+BEGIN} line of the dynamic block.
- pxref{Dynamic blocks}). This is useful if
- you have several clock table blocks, column-capturing blocks or other dynamic
- blocks in a buffer.
- code{#+TBLFM:} after the table, the table will
- actually be recalculated automatically after an update.
- An alternative way to capture and process property values into a table is
- provided by Eric Schulte's
- footnote{Contributed packages are not part of Emacs, but are
- distributed with the main distribution of Org (visit
- node Property API
- cindex properties, API
- ref{Using the
- property API}.
- chapter Dates and times
- cindex times
- cindex date stamp
- To assist project planning, TODO items can be labeled with a date and/or
- a time. The specially formatted string carrying the date and time
- information is called a
- menu
- * Timestamps:: Assigning a time to a tree entry
- * Creating timestamps:: Commands which insert timestamps
- * Deadlines and scheduling:: Planning your work
- * Clocking work time:: Tracking how long you spend on a task
- * Effort estimates:: Planning work effort in advance
- * Timers:: Notes with a running timer
- node Timestamps
- cindex timestamps
- cindex date stamps
- cindex scheduling
- A timestamp is a specification of a date (possibly with a time or a range of
- times) in a special format, either footnote{In this
- simplest form, the day name is optional when you type the date yourself.
- However, any dates inserted or modified by Org will add that day name, for
- reading convenience.} or samp{<2003-09-16
- Tue 12:00-12:30>}
- ref{Custom time
- format}.}. A timestamp can appear anywhere in the headline or body of an Org
- tree entry. Its presence causes entries to be shown on specific dates in the
- agenda (
- table
- item Plain timestamp; Event; Appointment
- cindex appointment
- A simple timestamp just assigns a date/time to an item. This is just
- like writing down an appointment or event in a paper agenda. In the
- timeline and agenda displays, the headline of an entry associated with a
- plain timestamp will be shown exactly on that date.
- end example
- cindex timestamp, with repeater interval
- A timestamp may contain a
- example
- * Pick up Sam at school
- <2007-05-16 Wed 12:30 +1w>
- item Diary-style sexp entries
- For more complex date specifications, Org mode supports using the special
- sexp diary entries implemented in the Emacs calendar/diary
- package
- code{calendar-date-style} (or, for older Emacs
- versions,
- code{(diary-date 12 1 2005)} or
- code{(diary-date 2005 12 1)}, depending on
- the settings. This has been the source of much confusion. Org mode users
- can resort to special versions of these functions like
- code{org-anniversary}. These work just like the corresponding
- code{calendar-date-style}.}. For
- example with optional time
- end example
- cindex timerange
- samp{--} denote a range. The headline
- will be shown on the first and last day of the range, and on any dates
- that are displayed and fall in the range. Here is an example:
- end example
- cindex timestamp, inactive
- emph{not} trigger an entry to show up in the agenda.
- end example
- node Creating timestamps
- cindex creating timestamps
- table
- orgcmd{C-c .,org-time-stamp}
- Prompt for a date and insert a corresponding timestamp. When the cursor is
- at an existing timestamp in the buffer, the command is used to modify this
- timestamp instead of inserting a new one. When this command is used twice in
- succession, a time range is inserted.
- orgcmd{C-c !,org-time-stamp-inactive}
- Like
- c
- kindex C-u C-c !
- itemx C-u C-c !
- kbd{C-c .} and
- code{org-time-stamp-rounding-minutes}.
- orgkey{C-c C-c}
- Normalize timestamp, insert/fix day name if missing or wrong.
- orgcmd{C-c <,org-date-from-calendar}
- Insert a timestamp corresponding to the cursor date in the Calendar.
- orgcmd{C-c >,org-goto-calendar}
- Access the Emacs calendar for the current date. If there is a
- timestamp in the current line, go to the corresponding date
- instead.
- orgcmd{C-c C-o,org-open-at-point}
- Access the agenda for the date given by the timestamp or -range at
- point (
- c
- key{left},S-
- pxref{Conflicts}).
- orgcmdkkcc{S-key{down},org-timestamp-up,org-timestamp-down-down}
- Change the item under the cursor in a timestamp. The cursor can be on a
- year, month, day, hour or minute. When the timestamp contains a time range
- like
- pxref{Priorities}). The key bindings also conflict with shift-selection and
- related modes (
- c
- cindex evaluate time range
- Evaluate a time range by computing the difference between start and end.
- With a prefix argument, insert result after the time range (in a table: into
- the following column).
- menu
- * The date/time prompt:: How Org mode helps you entering date and time
- * Custom time format:: Making dates look different
- node The date/time prompt
- cindex date, reading in minibuffer
- vindex org-read-date-prefer-future
- When Org mode prompts for a date/time, the default is shown in default
- date/time format, and the prompt therefore seems to ask for a specific
- format. But it will in fact accept date/time information in a variety of
- formats. Generally, the information should start at the beginning of the
- string. Org mode will find whatever information is in
- there and derive anything you have not specified from the
- i{before} today, it will assume that you mean a future date
- code{org-read-date-prefer-future}. You may set that variable to
- the symbol
- samp{(=>F).}
- For example, let's assume that today is
- b{bold}.
- result{} 2003-02-05
- 2/5/3
- result{} b{06}-14
- 12 b{2006}-
- result{}
- result{} nearest Friday after the default date
- sep 15 b{2006}-09-15
- feb 15 b{2007}-02-15
- sep 12 9
- result{} b{06}-
- result{}
- result{} ISO week four of the current year
- result{} Friday of ISO week 4 in 2012
- 2012-w04-5
- end example
- Furthermore you can specify a relative date by giving, as the
- example
- +0
- result{} today
- +4d
- result{} same as above
- +2w
- result{} five days from default date
- +2tue
- result{} last Wednesday
- vindex parse-time-months
- code{parse-time-months} and
- vindex org-read-date-force-compatible-dates
- Not all dates can be represented in a given Emacs implementation. By default
- Org mode forces dates into the compatibility range 1970--2037 which works on
- all Emacs implementations. If you want to use dates outside of this range,
- read the docstring of the variable
- example
- 11am-1:15pm
- result{} same as above
- 11am+2:15
- end example
- vindex org-popup-calendar-for-date-prompt
- Parallel to the minibuffer prompt, a calendar is popped up
- code{org-popup-calendar-for-date-prompt}.}. When you exit the date
- prompt, either by clicking on a date in the calendar, or by pressing
- kindex <
- kindex M-v
- kindex mouse-1
- key{right}
- key{left}
- key{down}
- key{up}
- key{right}
- key{left}
- key{RET}
- key{down}
- key{up}
- key{RET}
- r{Select date by clicking on it.}
- S-key{left}
- key{down}/r{One week forward/backward.}
- M-S-key{left}
- r{Scroll calendar forward/backward by one month.}
- M-v / C-v
- key{down}/r{Scroll calendar forward/backward by one year.}
- vindex org-read-date-display-live
- The actions of the date/time prompt may seem complex, but I assure you they
- will grow on you, and you will start getting annoyed by pretty much any other
- way of entering a date/time out there. To help you understand what is going
- on, the current interpretation of your input will be displayed live in the
- minibuffer
- code{org-read-date-display-live}.}.
- subsection Custom time format
- cindex time format, custom
- vindex org-display-custom-times
- code{org-display-custom-times} and
- table
- orgcmd{C-c C-x C-t,org-toggle-time-stamp-overlays}
- Toggle the display of custom formats for dates and times.
- noindent
- Org mode needs the default format for scanning, so the custom date/time
- format does not
- emph{over} the default format using text properties. This has the
- following consequences:
- bullet
- item
- The key{up}/
- kbd{S-key{down}} will change the stamp by one day,
- just like key{left}/
- item
- If the timestamp contains a range of clock times or a repeater, these
- will not be overlaid, but remain in the buffer as they were.
- emph{all} (invisible) characters
- belonging to the ISO timestamp have been removed.
- end itemize
- section Deadlines and scheduling
- A timestamp may be preceded by special keywords to facilitate planning. Both
- the timestamp and the keyword have to be positioned immediatly after the task
- they refer to.
- var
- cindex DEADLINE keyword
- Meaning: the task (most likely a TODO item, though not necessarily) is supposed
- to be finished on that date.
- vindex org-agenda-skip-deadline-prewarning-if-scheduled
- On the deadline date, the task will be listed in the agenda. In
- addition, the agenda for
- code{org-deadline-warning-days} before the due date, and continuing
- until the entry is marked DONE
- example
- *** TODO write article about the Earth for the Guide
- DEADLINE: <2004-02-29 Sun>
- The editor in charge is [[bbdb:Ford Prefect]]
- code{DEADLINE: <2004-02-29 Sun -5d>}. This warning is
- deactivated if the task gets scheduled and you set
- code{t}.
- cindex SCHEDULED keyword
- Meaning: you are planning to start working on that task on the given
- date.
- footnote{It will still
- be listed on that date after it has been marked DONE
- code{org-agenda-skip-scheduled-if-done}.}. In
- addition, a reminder that the scheduled date has passed will be present
- in the compilation for
- example
- *** TODO Call Trillian for a date on New Years Eve.
- SCHEDULED: <2004-12-25 Sat>
- vindex org-scheduled-delay-days
- emph{delay} the display of this task in the agenda, use
- code{--2d}
- instead. See
- code{org-agenda-skip-scheduled-delay-if-deadline} for details on how to
- control this globally or per agenda.
- b{Important:} Scheduling an item in Org mode should
- i{scheduling a meeting}.
- Setting a date for a meeting is just a simple appointment, you should
- mark this entry with a simple plain timestamp, to get this item shown
- on the date where it applies. This is a frequent misunderstanding by
- Org users. In Org mode,
- end table
- You may use timestamps with repeaters in scheduling and deadline
- entries. Org mode will issue early and late warnings based on the
- assumption that the timestamp represents the
- c
- c
- in scheduling and deadline timestamps is limited. Org mode does not
- know enough about the internals of each sexp function to issue early and
- late warnings. However, it will show the item on each day where the
- sexp entry matches.
- end menu
- subsection Inserting deadlines or schedules
- The following commands allow you to quickly insert a deadline or to schedule
- an item:
- kbd
- orgcmd{C-c C-d,org-deadline}
- Insert
- code{org-log-redeadline}code{#+STARTUP}
- keywords code{lognoteredeadline}, and
- orgcmd{C-c C-s,org-schedule}
- Insert
- code{org-log-reschedule}code{#+STARTUP}
- keywords code{lognotereschedule}, and
- c
- cindex sparse tree, for deadlines
- code{org-deadline-warning-days}.
- With
- kbd{C-1 C-c / d} shows
- all deadlines due tomorrow.
- orgcmd{C-c / b,org-check-before-date}
- Sparse tree for deadlines and scheduled items before a given date.
- orgcmd{C-c / a,org-check-after-date}
- Sparse tree for deadlines and scheduled items after a given date.
- code{org-schedule} and
- node Repeated tasks
- cindex tasks, repeated
- example
- ** TODO Pay the rent
- DEADLINE: <2005-10-01 Sat +1m>
- noindent
- the
- code{y/w/m/d/h} letters. If you need both a repeater
- and a special warning period in a deadline entry, the repeater should come
- first and the warning period last:
- vindex org-todo-repeat-to-state
- Deadlines and scheduled items produce entries in the agenda when they are
- over-due, so it is important to be able to mark such an entry as completed
- once you have done so. When you mark a DEADLINE or a SCHEDULE with the TODO
- keyword DONE, it will no longer produce entries in the agenda. The problem
- with this is, however, that then also the
- kbd{C-c C-t}), it will
- shift the base date of the repeating timestamp by the repeater interval, and
- immediately set the entry state back to TODO
- code{REPEAT_TO_STATE} property or
- the variable
- example
- ** TODO Pay the rent
- DEADLINE: <2005-11-01 Tue +1m>
- code{DONE}, use
- code{org-todo} with a numeric prefix argument of -1.)
- footnote{You can change this using the option
- code{#+STARTUP} options
- code{lognoterepeat}, and code{lognoterepeat}, you
- will also be prompted for a note.} will be added under the deadline, to keep
- a record that you actually acted on the previous instance of this deadline.
- As a consequence of shifting the base date, this entry will no longer be
- visible in the agenda when checking past dates, but all future instances
- will be visible.
- With the
- i{after} the last time you did it. For these tasks, Org mode has
- special repeaters samp{.+}. For example:
- end example
- code{org-agenda-skip-scheduled-if-deadline-is-shown} to
- kbd{C-c C-x c} was
- created for this purpose, it is described in
- node Clocking work time
- cindex clocking time
- footnote{Clocking only works if all
- headings are indented with less than 30 stars. This is a hardcoded
- limitation of code{org-clock-sum}.} of a project.
- And it remembers a history or tasks recently clocked, so that you can jump
- quickly between a number of tasks absorbing your time.
- To save the clock history across Emacs sessions, use
- end lisp
- When you clock into a new task after resuming Emacs, the incomplete
- clock
- code{(setq org-clock-persist t)}.}
- will be found (
- menu
- * Clocking commands:: Starting and stopping a clock
- * The clock table:: Detailed reports
- * Resolving idle time:: Resolving time when you've been idle
- node Clocking commands
- table
- orgcmd{C-c C-x C-i,org-clock-in}
- vindex org-clock-continuously
- code{:LOGBOOK:} drawer (see also the variable
- code{CLOCK_INTO_DRAWER} or
- kbd{C-u} prefix argument,
- select the task from a list of recently clocked tasks. With two
- kbd{d} when
- selecting a clocking task. With three
- *
- cindex property: LAST_REPEAT
- pxref{Effort estimates}), the mode line displays the current
- clocking time against it
- code{org-clock-in-prepare-hook}.} If the task
- is a repeating one (
- footnote{as recorded by the
- code{CLOCK_MODELINE_TOTAL} property. It may have the values
- code{today} to
- show all time clocked on this task today (see also the variable
- code{all} to include all time, or
- footnote{See also the variable
- * Clicking with
- c
- vindex org-log-note-clock-out
- Stop the clock (clock-out). This inserts another timestamp at the same
- location where the clock was last started. It also directly computes
- the resulting time and inserts it after the time range as
- code{org-log-note-clock-out} for the
- possibility to record an additional note together with the clock-out
- timestamp
- code{#+STARTUP: lognoteclock-out}}.
- vindex org-clock-continuously
- Reclock the last clocked task. With one
- kbd{C-u} prefixes,
- force continuous clocking by starting the clock when the last clock
- stopped.
- kindex C-c C-y
- orgcmdkkc{C-c C-c,C-c C-y,org-evaluate-time-range}
- Recompute the time interval after changing one of the timestamps. This
- is only necessary if you edit the timestamps directly. If you change
- them with key{cursor}} keys, the update is automatic.
- key{up/down},org-clock-timestamps-up/down}
- On
- orgcmd{S-M-
- code{CLOCK} log lines, increase/decrease the timestamp at point and
- the one of the previous (or the next clock) timestamp by the same duration.
- For example, if you hit key{up}} to increase a clocked-out timestamp
- by five minutes, then the clocked-in timestamp of the next clock will be
- increased by five minutes.
- orgcmd{C-c C-x C-q,org-clock-cancel}
- Cancel the current clock. This is useful if a clock was started by
- mistake, or if you ended up working on something else.
- kbd{C-u}
- prefix arg, select the target task from a list of recently clocked tasks.
- vindex org-remove-highlights-with-change
- Display time summaries for each subtree in the current buffer. This puts
- overlays at the end of each headline, showing the total time recorded under
- that heading, including the time of any subheadings. You can use visibility
- cycling to study the tree, but the overlays disappear when you change the
- buffer (see variable
- kbd{C-c C-c}.
- kbd{l} key may be used in the timeline (
- pxref{Weekly/daily agenda}) to show which tasks have been
- worked on or closed during a day.
- code{org-clock-out} and
- node The clock table
- cindex clocktable, dynamic block
- emph{clock table}, because it is
- formatted as one or several Org tables.
- kbd
- pxref{Dynamic blocks}) containing a clock
- report as an Org mode table into the current file. When the cursor is
- at an existing clock table, just update it. When called with a prefix
- argument, jump to the first clock report in the current document and
- update it. The clock table always includes also trees with
- orgcmdkkc{C-c C-c,C-c C-x C-u,org-dblock-update}
- Update dynamic block at point. The cursor needs to be in the
- orgkey{C-u C-c C-x C-u}
- Update all dynamic blocks (
- orgcmdkxkc{S-key{right},org-clocktable-try-shift}
- Shift the current
- code{#+BEGIN: clocktable} line for this command. If
- code{today}, it will be shifted to
- end table
- Here is an example of the frame for a clock table as it is inserted into the
- buffer with the
- cindex #+BEGIN, clocktable
- end example
- vindex org-clocktable-defaults
- The
- code{org-clocktable-defaults}.
- example
- :maxlevel
- r{Clocks at deeper levels will be summed into the upper level.}
- :scope
- r{the current buffer or narrowed region}
- file
- r{the subtree where the clocktable is located}
- treer{the surrounding level code{tree3}}
- tree
- r{all agenda files}
- ("file"..)
- r{current file and its archives}
- agenda-with-archives
- r{The time block to consider. This block is specified either}
-
- r{these formats:}
- 2007-12-31
- r{December 2007}
- 2007-W50
- r{2nd quarter in 2007}
- 2007
- var{N}
- var{N}
- var{N}
- var{N}
- r{Use key{left}/
- r{A time string specifying when to start considering times.}
- code{"<-2w>"} can also be used. See}
- ref{Matching tags and properties} for relative time syntax.}
- :tend
- r{Relative times like
- r{
- r{The starting day of the week. The default is 1 for monday.}
- :mstart
- r{day of the month.}
- :step code{week} or
- r{To use this, code{:tstart},
- r{Do not show steps that have zero time.}
- :fileskip0
- r{A tags match to select entries that should contribute. See}
- ref{Matching tags and properties} for the match syntax.}
- code{org-clocktable-write-default},
- but you can specify your own function using the
- example
- :emphasize code{t}, emphasize level one and level two items.}
- :lang footnote{Language terms can be set through the variable
- r{Link the item headlines in the table to their origins.}
- :narrow
- r{the org table. If you write it like
- r{headline will also be shortened in export.}
- :indent
- r{Number of columns to be used for times. If this is smaller}
- code{:maxlevel}, lower levels will be lumped into one column.}
- :level
- r{A cons cell like containing the column to sort and a sorting type.}
- code{:sort (1 . ?a)} sorts the first column alphabetically.}
- :compact code{:level nil :indent t :narrow 40! :tcolumns 1}}
- code{:narrow}}
- :timestamp
- r{DEADLINE, TIMESTAMP and TIMESTAMP_IA, in this order.}
- :properties
- r{property will get its own column.}
- :inherit-props code{t}, the values for
- r{Content of a
- r{As a special case,
- r{If you do not specify a formula here, any existing formula}
-
- r{A function to format clock data and insert it into the buffer.}
- example
- #+BEGIN: clocktable :maxlevel 2 :block today :scope tree1 :link t
- #+END: clocktable
- noindent
- and to use a specific time range you could write
- example
- #+BEGIN: clocktable :tstart "<2006-08-10 Thu 10:00>"
- :tend "<2006-08-10 Thu 12:00>"
- #+END: clocktable
- example
- #+BEGIN: clocktable :tstart "<-1w>" :tend "<now>"
- #+END: clocktable
- example
- #+BEGIN: clocktable :scope subtree :link t :formula %
- #+END: clocktable
- example
- #+BEGIN: clocktable :scope agenda :block lastweek :compact t
- #+END: clocktable
- node Resolving idle time
- subsubheading Resolving idle time
- vindex org-clock-x11idle-program-name
- vindex org-clock-idle-time
- By customizing the variable
- footnote{On computers using Mac OS X,
- idleness is based on actual user idleness, not just Emacs' idle time. For
- X11, you can install a utility program
- code{contrib/scripts} directory of the Org git distribution, or install the
- code{org-clock-x11idle-program-name} if you are running Debian, to get the
- same general treatment of idleness. On other systems, idle time refers to
- Emacs idle time only.}, and ask what you want to do with the idle time.
- There will be a question waiting for you when you get back, indicating how
- much idle time has passed (constantly updated with the current amount), as
- well as a set of choices to correct the discrepancy:
- kbd
- kbd{k}. Org
- will ask how many of the minutes to keep. Press
- item K
- If you use the shift key and press
- item s
- To keep none of the minutes, use
- item S
- To keep none of the minutes and just clock out at the start of the away time,
- use the shift key and press
- item C
- To cancel the clock altogether, use
- end table
- What if you subtracted those away minutes from the current clock, and now
- want to apply them to a new clock? Simply clock in to any task immediately
- after the subtraction. Org will notice that you have subtracted time ``on
- the books'', so to speak, and will ask if you want to apply those minutes to
- the next task you clock in on.
- There is one other instance when this clock resolution magic occurs. Say you
- were clocked in and hacking away, and suddenly your cat chased a mouse who
- scared a hamster that crashed into your UPS's power button! You suddenly
- lose all your buffers, but thanks to auto-save you still have your recent Org
- mode changes, including your last clock in.
- If you restart Emacs and clock into any task, Org will notice that you have a
- dangling clock which was never clocked out from your last session. Using
- that clock's starting time as the beginning of the unaccounted-for period,
- Org will ask how you want to resolve that time. The logic and behavior is
- identical to dealing with away time due to idleness; it is just happening due
- to a recovery event rather than a set amount of idle time.
- You can also check all the files visited by your Org agenda for dangling
- clocks at any time using kbd{C-c C-x C-z}).
- cindex continuous clocking
- code{org-clock-continuously}
- to
- code{org-clock-in} and two code{org-clock-in-last}.
- section Effort estimates
- cindex property, Effort
- If you want to plan your work in a very detailed way, or if you need to
- produce offers with quotations of the estimated work effort, you may want to
- assign effort estimates to entries. If you are also clocking your work, you
- may later want to compare the planned effort with the actual working time,
- a great way to improve planning estimates. Effort estimates are stored in
- a special property
- table
- orgcmd{C-c C-x e,org-set-effort}
- Set the effort estimate for the current entry. With a numeric prefix
- argument, set it to the Nth allowed value (see below). This command is also
- accessible from the agenda with the
- orgcmd{C-c C-x C-e,org-clock-modify-effort-estimate}
- Modify the effort estimate of the item currently being clocked.
- pxref{Column view}). You should start by setting up discrete values for
- effort estimates, and a
- example
- #+PROPERTY: Effort_ALL 0 0:10 0:30 1:00 2:00 3:00 4:00 5:00 6:00 7:00
- #+COLUMNS: %40ITEM(Task) %17Effort(Estimated Effort)} %CLOCKSUM
- noindent
- vindex org-columns-default-format
- or, even better, you can set up these values globally by customizing the
- variables code{org-columns-default-format}.
- In particular if you want to use this setup also in the agenda, a global
- setup may be advised.
- The way to assign estimates to individual items is then to switch to column
- mode, and to use key{right}} and key{left}} to change the
- value. The values you enter will immediately be summed up in the hierarchy.
- In the column next to it, any clocked time will be displayed.
- footnote{Please note
- the pitfalls of summing hierarchical data in a flat list (
- code{org-agenda-columns-add-appointments-to-effort-sum}. The
- appointments on a day that take place over a specified time interval will
- then also be added to the load estimate of the day.
- Effort estimates can be used in secondary agenda filtering that is triggered
- with the pxref{Agenda commands}). If you have
- these estimates defined consistently, two or three key presses will narrow
- down the list to stuff that fits into an available time slot.
- section Taking notes with a timer
- cindex countdown timer
- table
- orgcmd{C-c C-x 0,org-timer-start}
- Start or reset the relative timer. By default, the timer is set to 0. When
- called with a
- kbd{C-u C-u}, change all timer strings
- in the active region by a certain amount. This can be used to fix timer
- strings if the timer was not started at exactly the right moment.
- code{org-timer-default-timer} sets the default countdown value. Giving
- a numeric prefix argument overrides this default value. This command is
- available as
- end table
- Once started, relative and countdown timers are controlled with the same
- commands.
- kbd
- orgcmd{C-c C-x -,org-timer-item}
- Insert a description list item with the value of the current relative or
- countdown timer. With a prefix argument, first reset the relative timer to
- 0.
- key{RET},org-insert-heading}
- Once the timer list is started, you can also use key{RET}} to insert
- new timer items.
- comma{},org-timer-pause-or-continue}
- Pause the timer, or continue it if it is already paused.
- end table
- chapter Capture - Refile - Archive
- i{capture}. It also can store files
- related to a task (
- menu
- * Capture:: Capturing new stuff
- * Attachments:: Add files to tasks
- * RSS feeds:: Getting input from RSS feeds
- * Protocols:: External (e.g., Browser) access to Emacs and Org
- * Refile and copy:: Moving/copying a tree from one place to another
- * Archiving:: What to do with finished projects
- node Capture
- cindex capture
- Capture lets you quickly store notes with little interruption of your work
- flow. Org's method for capturing new items is heavily inspired by John
- Wiegley excellent
- file{remember.el}, then replaced it with
- file{org-remember.el} has
- been completely replaced by
- file{org-remember.el}, you need to update
- it and use the setup described below. To convert your
- example
- end example
- kbd{M-x
- customize-variable org-capture-templates}, check the result, and save the
- customization.
- end menu
- subsection Setting up capture
- The following customization sets a default target file for notes, and defines
- a global keykbd{C-c c} is only a
- suggestion.} for capturing new material.
- smalllisp
- end group
- node Using capture
- table
- orgcmd{C-c c,org-capture}
- Call the command
- cindex date tree
- defined
- orgcmd{C-c C-c,org-capture-finalize}
- Once you have finished entering information into the capture buffer,
- orgcmd{C-c C-w,org-capture-refile}
- Finalize the capture process by refiling (
- code{org-refile} command.
- end table
- You can also call
- kbd{k c} key combination. With this access, any timestamps inserted by
- the selected capture template will default to the cursor date in the agenda,
- rather than to the current date.
- To find the locations of the last stored capture, use
- table
- orgkey{C-u C-c c}
- Visit the target location of a capture template. You get to select the
- template in the usual way.
- end table
- cindex org-capture-last-stored
- You can also jump to the bookmark
- code{org-capture-bookmark} to
- code{org-capture} with
- a
- node Capture templates
- cindex templates, for Capture
- You can use templates for different types of capture items, and
- for different target locations. The easiest way to create such templates is
- through the customize interface.
- kbd
- code{org-capture-templates}.
- samp{Tasks} in
- your file
- file{journal.org} should capture journal entries. A possible configuration
- would look like:
- group
- (setq org-capture-templates
- '(("t" "Todo" entry (file+headline "~/org/gtd.org" "Tasks")
- "* TODO %?\n %i\n %a")
- ("j" "Journal" entry (file+datetree "~/org/journal.org")
- "* %?\nEntered on %U\n %i\n %a")))
- end smalllisp
- kbd{C-c c t}, Org will prepare the template
- for you like this:
- var{link to where you initiated capture}]]
- noindent
- During expansion of the template,
- kbd{C-c C-c} and Org returns you to the same
- place where you started the capture process.
- To define special keys to capture to a particular template without going
- through the interactive template selection, you can create your key binding
- like this:
- end lisp
- end menu
- subsubsection Template elements
- Now lets look at the elements of a template definition. Each entry in
- table
- item keys
- The keys that will select the template, as a string, characters
- only, for example
- code{"bt"} for selection with two keys. When using
- several keys, keys using the same prefix key must be sequential
- in the list and preceded by a 2-element entry explaining the
- prefix key, for example
- end smalllisp
- kbd{C} key, this key will
- be used to open the customize buffer for this complex variable.
- item type
- The type of entry, a symbol. Valid values are:
- code
- item item
- A plain list item, placed in the first plain list at the target
- location. Again the target file should be an Org file.
- item table-line
- a new line in the first table at the target location. Where exactly the
- line will be inserted depends on the properties
- code{:table-line-pos} (see below).
- end table
- vindex org-default-notes-file
- Specification of where the captured item should be placed. In Org mode
- files, targets usually define a node. Entries will become children of this
- node. Other types will be added to the table or list in the body of this
- node. Most target specifications contain a file name. If that file name is
- the empty string, it defaults to
- code{org-directory}.
- Valid values are:
- code
- item (id "id of existing org entry")
- Filing as child of this entry, or in the body of the entry.
- item (file+olp "path/to/file" "Level 1 heading" "Level 2" ...)
- For non-unique headings, the full path is safer.
- item (file+datetree "path/to/file")
- Will create a heading in a date tree for today's date
- code{* 2013 :noexport:}
- and
- item (file+datetree+prompt "path/to/file")
- Will create a heading in a date tree, but will prompt for the date.
- item (file+weektree+prompt "path/to/file")
- Will create a heading in a week tree, but will prompt for the date.
- item (clock)
- File to the entry that is currently being clocked.
- end table
- code{(file "path/to/template")}. See below for
- more details.
- table
- item :prepend
- Normally new captured information will be appended at
- the target location (last child, last table line, last list item...).
- Setting this property will change that.
- item :empty-lines
- Set this to the number of lines to insert
- before and after the new item. Default 0, only common other value is 1.
- item :clock-keep
- Keep the clock running when filing the captured entry.
- code{:clock-keep} has precedence over
- code{t}, the current clock will
- run and the previous one will not be resumed.
- item :table-line-pos
- Specification of the location in the table where the new line should be
- inserted. It can be a string, a variable holding a string or a function
- returning a string. The string should look like
- item :kill-buffer
- If the target file was not yet visited when capture was invoked, kill the
- buffer again after capture is completed.
- end table
- subsubsection Template expansion
- In the template itself, special footnote{If you need one of
- these sequences literally, escape the
- smallexample
- %[r{Insert the contents of the file given by
- var{sexp}) var{sexp} and replace with the result.}
-
- r{within the expression will be expanded prior to this.}
-
- r{The result of format-time-string on the ... format specification.}
- %t
- r{Timestamp, with date and time.}
- %u, %U
- r{Initial content, the region when capture is called while the}
-
- r{The entire text will be indented like
- r{Annotation, normally the link created with
- r{Like
- r{Like %a, but only insert the literal link.}
- %c
- r{Content of the X clipboard.}
- %k
- r{Link to the currently clocked task.}
- %n code{user-full-name}).}
- %f
- r{Full path of the file or directory visited by current buffer.}
- %:keyword
- r{Prompt for tags, with completion on tags in target file.}
- %^G
- r{Like code{%^T}, code{%^U}.}
- code{%^}t}.}
- %^C
- r{Like
- {}p var{prop}.}
- %^var{prompt}r{prompt the user for a string and replace this sequence with it.}
-
- r{%^}.}
-
- dots{} %\N {}, where
- r{a number, starting from 1.}
- %?
- end smallexample
- footnote{If you define your own link types (
- code{org-store-link-props} can be accessed in capture templates in a
- similar way.}:
- smallexample
- Link type | Available keywords
- ---------------------------------+----------------------------------------------
- bbdb | %:name %:company
- irc | %:server %:port %:nick
- vm, vm-imap, wl, mh, mew, rmail, | %:type %:subject %:message-id
- gnus, notmuch | %:from %:fromname %:fromaddress
- | %:to %:toname %:toaddress
- | %:date
- r{(date as active timestamp)}
- | %:date-timestamp-inactive
- r{(either "to NAME" or "from NAME")code{org-from-is-user-regexp}.}}
- gnus | %:group,
- end smallexample
- smallexample
- %?
- end smallexample
- subsubsection Templates in contexts
- code{org-capture-templates-contexts}. Let's say
- for example that you have a capture template
- smalllisp
- (setq org-capture-templates-contexts
- '(("p" (in-mode . "message-mode"))))
- code{"p"} should refer to another
- template. In that case, add this command key like this:
- end smalllisp
- See the docstring of the variable for more information.
- section Attachments
- vindex org-attach-directory
- It is often useful to associate reference material with an outline node/task.
- Small chunks of plain text can simply be stored in the subtree of a project.
- Hyperlinks (
- i{attachments},
- which are files located in a directory belonging to an outline node. Org
- uses directories named by the unique ID of each entry. These directories are
- located in the
- footnote{If you move entries or Org files from one
- directory to another, you may want to configure
- code{git init}, Org will automatically commit changes when it sees them.
- The attachment system has been contributed to Org by John Wiegley.
- In cases where it seems better to do so, you can also attach a directory of your
- choice to an entry. You can also make children inherit the attachment
- directory from a parent, so that an entire subtree uses the same attached
- directory.
- table
- orgcmd{C-c C-a,org-attach}
- The dispatcher for commands related to the attachment system. After these
- keys, a list of commands is displayed and you must press an additional key
- to select a command:
- kbd
- vindex org-attach-method
- Select a file and move it into the task's attachment directory. The file
- will be copied, moved, or linked, depending on
- kindex C-c C-a c
- kindex C-c C-a l
- orgcmdtkc{n,C-c C-a n,org-attach-new}
- Create a new attachment as an Emacs buffer.
- orgcmdtkc{o,C-c C-a o,org-attach-open}
- code{org-file-apps}.
- For more details, see the information on following hyperlinks
- (
- orgcmdtkc{O,C-c C-a O,org-attach-open-in-emacs}
- Also open the attachment, but force opening the file in Emacs.
- orgcmdtkc{F,C-c C-a F,org-attach-reveal-in-emacs}
- Also open the directory, but force using
- orgcmdtkc{d,C-c C-a d,org-attach-delete-one}
- Select and delete a single attachment.
- command{dired} and delete from there.
- cindex property, ATTACH_DIR
- Set a specific directory as the entry's attachment directory. This works by
- putting the directory path into the
- orgcmdtkc{i,C-c C-a i,org-attach-set-inherit}
- code{ATTACH_DIR_INHERIT} property, so that children will use the
- same directory for attachments as the parent does.
- end table
- section RSS feeds
- cindex Atom feeds
- Org can add and change entries based on information found in RSS feeds and
- Atom feeds. You could use this to make a task out of each new podcast in a
- podcast feed. Or you could use a phone-based note-creating service on the
- web to import tasks into Org. To access feeds, configure the variable
- smalllisp
- end group
- noindent
- will configure that new items from the feed provided by
- file{~/org/feeds.org} under the heading
- table
- orgcmd{C-c C-x g,org-feed-update-all}
- code{org-feed-alist} and act upon
- them.
- end table
- Under the same headline, Org will create a drawer
- file{org-feed.el} and the docstring of
- node Protocols
- cindex protocols, for external access
- file{emacsserver}. For example, you can
- configure bookmarks in your web browser to send a link to the current page to
- Org and create a note from it using capture (
- uref{http://orgmode.org/worg/org-contrib/org-protocol.php} for detailed
- documentation and setup instructions.
- section Refile and copy
- cindex copying notes
- When reviewing the captured data, you may want to refile or to copy some of
- the entries into a different list, for example into a project. Cutting,
- finding the right location, and then pasting the note is cumbersome. To
- simplify this process, you can use the following special command:
- kbd
- findex org-copy
- Copying works like refiling, except that the original note is not deleted.
- findex org-refile
- vindex org-refile-targets
- vindex org-outline-path-complete-in-steps
- vindex org-log-refile
- vindex org-refile-keep
- Refile the entry or region at point. This command offers possible locations
- for refiling the entry and lets you select one with completion. The item (or
- all items in the region) is filed below the target heading as a subitem.
- Depending on
- *
- By default, all level 1 headlines in the current buffer are considered to be
- targets, but you can have more complex definitions across a number of files.
- See the variable
- code{org-refile-use-outline-path} and
- code{org-refile-allow-creating-parent-nodes}.
- When the variable footnote{with corresponding
- code{logrefile},
- code{nologrefile}} is set, a timestamp or a note will be
- recorded when an entry has been refiled.
- orgcmd{C-u C-u C-c C-w,org-refile-goto-last-stored}
- Jump to the location where
- item C-2 C-c C-w
- Refile as the child of the item currently being clocked.
- code{org-refile-keep} to make
- this the default behavior, and beware that this may result in duplicated
- orgcmdtkc{C-0 C-c C-w r{or}
- code{org-refile-use-cache}. To make the command see new possible
- targets, you have to clear the cache with this command.
- node Archiving
- cindex archiving
- When a project represented by a (sub)tree is finished, you may want
- to move the tree out of the way and to stop it from contributing to the
- agenda. Archiving is important to keep your working files compact and global
- searches like the construction of agenda views fast.
- kbd
- vindex org-archive-default-command
- Archive the current entry using the command specified in the variable
- end table
- end menu
- subsection Moving a tree to the archive file
- table
- orgcmdkskc{C-c C-x C-s,C-c $,org-archive-subtree}
- code{org-archive-location}.
- emph{not} on a headline when this command
- is invoked, the level 1 trees will be checked.
- emph{does} contain a
- timestamp, and that timestamp is in the past.
- cindex archive locations
- The default archive location is a file in the same directory as the
- current file, with the name derived by appending
- code{org-archive-location}.
- There is also an in-buffer option for setting this variable, for example:
- example
- #+ARCHIVE: %s_done::
- cindex property, ARCHIVE
- code{:ARCHIVE:} property with the
- location as the value (
- vindex org-archive-save-context-info
- When a subtree is moved, it receives a number of special properties that
- record context information like the file from where the entry came, its
- outline path the archiving time etc. Configure the variable
- node Internal archiving
- cindex archive tag
- If you want to just switch off---for agenda views---certain subtrees without
- moving them to a different file, you can use the archive tag.
- A headline that is marked with the pxref{Tags}) stays
- at its location in the outline tree, but behaves in the following way:
- minus
- vindex org-cycle-open-archived-trees
- It does not open when you attempt to do so with a visibility cycling
- command (
- kbd{C-
- code{org-cycle-open-archived-trees}. Also normal outline commands like
- item
- pxref{Sparse trees}), matches in
- archived subtrees are not exposed, unless you configure the option
- item
- pxref{Agenda views}), the content of
- archived trees is ignored unless you configure the option
- kbd{v a} to get archives
- temporarily included.
- vindex org-export-with-archived-trees
- Archived trees are not exported (
- code{org-export-with-archived-trees}.
- vindex org-columns-skip-archived-trees
- Archived trees are excluded from column view unless the variable
- code{nil}.
- table
- orgcmd{C-c C-x a,org-toggle-archive-tag}
- Toggle the ARCHIVE tag for the current headline. When the tag is set,
- the headline changes to a shadowed face, and the subtree below it is
- hidden.
- emph{not} on a headline when this command is invoked, the
- level 1 trees will be checked.
- kbd{TAB},org-force-cycle-archived}
- Cycle a tree even if it is tagged with ARCHIVE.
- emph{Archive Sibling}. This is a sibling of
- the entry with the heading samp{ARCHIVE}. The
- entry becomes a child of that sibling and in this way retains a lot of its
- original context, including inherited tags and approximate position in the
- outline.
- node Agenda views
- cindex agenda views
- Due to the way Org works, TODO items, time-stamped items, and
- tagged headlines can be scattered throughout a file or even a number of
- files. To get an overview of open action items, or of events that are
- important for a particular date, this information must be collected,
- sorted and displayed in an organized way.
- Org can select items based on various criteria and display them
- in a separate buffer. Seven different view types are provided:
- bullet
- emph{agenda} that is like a calendar and shows information
- for specific dates,
- emph{TODO list} that covers all unfinished
- action items,
- emph{match view}, showings headlines based on the tags, properties, and
- TODO state associated with them,
- emph{timeline view} that shows all events in a single Org file,
- in time-sorted view,
- emph{text search view} that shows all entries from multiple files
- that contain specified keywords,
- emph{stuck projects view} showing projects that currently don't move
- along, and
- emph{custom views} that are special searches and combinations of different
- views.
- noindent
- The extracted information is displayed in a special
- vindex org-agenda-skip-comment-trees
- cindex commented entries, in agenda views
- pxref{Comment lines}) and archived
- (
- code{org-agenda-skip-comment-trees} and
- code{nil}.
- vindex org-agenda-restore-windows-after-quit
- Two variables control how the agenda buffer is displayed and whether the
- window configuration is restored when the agenda exits:
- code{org-agenda-restore-windows-after-quit}.
- end menu
- section Agenda files
- cindex files for agenda
- emph{agenda
- files}, the files listed in the variable
- footnote{If the value of that variable is not a
- list, but a single file name, then the list of agenda files will be
- maintained in that external file.}. If a directory is part of this list,
- all files with the extension
- footnote{When using the dispatcher, pressing
- code{org-agenda-files} until the next
- dispatcher command.}. You can customize
- cindex files, adding to agenda list
- kbd
- orgcmd{C-c ],org-remove-file}
- Remove current file from the list of agenda files.
- cindex cycling, of agenda files
- itemx C-,
- Cycle through agenda file list, visiting one file after the other.
- item M-x org-iswitchb RET
- Command to use an
- end table
- kbd{<} once or several times in the dispatcher
- (
- table
- orgcmd{C-c C-x <,org-agenda-set-restriction-lock}
- Permanently restrict the agenda to the current subtree. When with a
- prefix argument, or with the cursor before the first headline in a file,
- the agenda scope is set to the entire file. This restriction remains in
- effect until removed with kbd{<}
- or
- orgcmd{C-c C-x >,org-agenda-remove-restriction-lock}
- Remove the permanent restriction created by
- end table
- file{speedbar.el}, you can use the following commands in
- the Speedbar frame:
- kbd
- r{in the speedbar frame},<,org-speedbar-set-agenda-restriction}
- Permanently restrict the agenda to the item---either an Org file or a subtree
- in such a file---at the cursor in the Speedbar frame.
- If there is a window displaying an agenda view, the new restriction takes
- effect immediately.
- r{in the speedbar frame},>,org-agenda-remove-restriction-lock}
- Lift the restriction.
- node Agenda dispatcher
- cindex agenda dispatcher
- kbd{C-c a} (
- kbd{C-c a} is indeed how the dispatcher
- is accessed and list keyboard access to commands accordingly. After
- pressing
- table
- item a
- Create the calendar-like agenda (
- item t
- pxref{Global TODO list}).
- r{/} M
- Create a list of headlines matching a TAGS expression (
- item L
- Create the timeline view for the current buffer (
- item s
- Create a list of entries selected by a boolean expression of keywords
- and/or regular expressions that must or must not occur in the entry.
- vindex org-agenda-text-search-extra-files
- Search for a regular expression in all agenda files and additionally in
- the files listed in
- code{multi-occur}. A prefix argument can be
- used to specify the number of context lines for each match, default is
- 1.
- r{/} !
- Create a list of stuck projects (
- item <
- Restrict an agenda command to the current buffer
- kbd{1} to restrict to the current
- buffer.}. After pressing
- item < <
- If there is an active region, restrict the following agenda command to
- the region. Otherwise, restrict it to the current subtree
- kbd{0} to restrict to the
- current region/subtree.}. After pressing
- item *
- vindex org-agenda-sticky
- Toggle sticky agenda views. By default, Org maintains only a single agenda
- buffer and rebuilds it each time you change the view, to make sure everything
- is always up to date. If you often switch between agenda views and the build
- time bothers you, you can turn on sticky agenda buffers or make this the
- default by customizing the variable
- kbd{r} or
- code{org-toggle-sticky-agenda}.
- xref{Custom agenda views}.
- section The built-in agenda views
- In this section we describe the built-in views.
- end menu
- subsection The weekly/daily agenda
- cindex weekly agenda
- emph{agenda} is to act like a page of a
- paper agenda, showing all the tasks for the current week or day.
- kbd
- orgcmd{C-c a a,org-agenda-list}
- Compile an agenda for the current week from a list of Org files. The agenda
- shows the entries for each day. With a numeric prefix
- kbd{C-u} causes all TODO entries to be
- listed before the agenda. This feature is deprecated, use the dedicated TODO
- list, or a block agenda instead (kbd{C-u 2 1
- C-c a a}) you may set the number of days to be displayed.
- vindex org-agenda-span
- vindex org-agenda-start-day
- code{org-agenda-span} (or the obsolete
- code{day}, code{month} or
- code{org-agenda-start-on-weekday}). You can also set the start
- date using a date shift:
- ref{Agenda
- commands}.
- cindex calendar integration
- lisp
- (setq org-agenda-include-diary t)
- noindent After that, everything will happen automatically. All diary
- entries including holidays, anniversaries, etc., will be included in the
- agenda buffer created by Org mode. key{TAB}, and
- kbd{i} command to
- insert new entries for the current date works in the agenda buffer, as
- well as the commands kbd{M}, and
- kbd{c} can be used to switch back and forth
- between calendar and agenda.
- If you are using the diary only for sexp entries and holidays, it is
- faster to not use the above setting, but instead to copy or even move
- the entries into an Org file. Org mode evaluates diary-style sexp
- entries, and does it faster because there is no overhead for first
- creating the diary display. Note that the sexp entries must start at
- the left margin, no whitespace is allowed before them. For example,
- the following segment of an Org file will be processed and entries
- will be made in the agenda:
- footnote{code{diary-anniversary}, but the argument order is always according to ISO and therefore independent of the value of
- end example
- cindex BBDB, anniversaries
- example
- * Anniversaries
- :PROPERTIES:
- :CATEGORY: Anniv
- :END:
- %%(org-bbdb-anniversaries)
- kbd{C-o anniversary
- code{YYYY-MM-DD} or
- samp{birthday} or
- samp{birthday}. Here are a few examples, the header for the file
- example
- 1973-06-22
- 06-22
- 1955-08-02 wedding
- 2008-04-14 %s released version 6.01 of org mode, %d years ago
- samp{%%(diary-anniversary)} entries
- in an Org or Diary file.
- If you would like to see upcoming anniversaries with a bit of forewarning,
- you can use the following instead:
- end example
- That will give you three days' warning: on the anniversary date itself and the
- two days prior. The argument is optional: if omitted, it defaults to 7.
- cindex
- cindex appointment reminders
- cindex reminders
- Org can interact with Emacs appointments notification facility. To add the
- appointments of your agenda files, use the command
- code{APPT_WARNTIME} property which will then override the
- value of
- node Global TODO list
- cindex global TODO list
- table
- orgcmd{C-c a t,org-todo-list}
- Show the global TODO list. This collects the TODO items from all agenda
- files (
- code{agenda-mode}, so there are commands to examine and manipulate the TODO
- entries directly from that buffer (
- orgcmd{C-c a T,org-todo-list}
- vindex org-todo-keywords
- Like the above, but allows selection of a specific TODO keyword. You can
- also do this by specifying a prefix argument to
- samp{|} as the boolean OR operator. With a numeric
- prefix, the Nth keyword in
- kindex r
- The
- kbd{3 r}. If you often need a search for a specific
- keyword, define a custom command for it (*
- Matching specific TODO keywords can also be done as part of a tags
- search (
- end table
- Remote editing of TODO items means that you can change the state of a
- TODO entry with a single key press. The commands available in the
- TODO list are described in
- cindex sublevels, inclusion into TODO list
- Normally the global TODO list simply shows all headlines with TODO
- keywords. This list can become very long. There are two ways to keep
- it more compact:
- minus
- vindex org-agenda-todo-ignore-scheduled
- vindex org-agenda-todo-ignore-timestamp
- emph{scheduled} for execution or
- have a pxref{Timestamps}) as no longer
- code{org-agenda-todo-ignore-scheduled},
- code{org-agenda-todo-ignore-timestamp} and/or
- item
- code{org-agenda-todo-list-sublevels} to get this behavior.
- node Matching tags and properties
- cindex matching, of tags
- cindex tags view
- emph{tags} (
- pxref{Properties and columns}), you can select headlines
- based on this metadata and collect them into an agenda buffer. The match
- syntax described here also applies when creating sparse trees with
- table
- orgcmd{C-c a m,org-tags-view}
- Produce a list of all headlines that match a given set of tags. The
- command prompts for a selection criterion, which is a boolean logic
- expression with tags, like
- samp{work|home} (
- pxref{Agenda dispatcher}).
- vindex org-tags-match-list-sublevels
- kbd{C-c a m}, but only select headlines that are also TODO items in a
- not-DONE state and force checking subitems (see variable
- code{org-agenda-tags-todo-honor-ignore-options}. Matching
- specific TODO keywords together with a tags match is also possible, see
- end table
- The commands available in the tags list are described in
- subsubheading Match syntax
- samp{&} for
- samp{|} for . samp{|}.
- Parentheses are not implemented. Each element in the search is either a
- tag, a regular expression matching tags, or an expression like
- samp{-}, to select
- against it, and
- code{AND} operator samp{+} or
- table
- item work
- Select headlines tagged
- item work&boss
- Select headlines tagged samp{:boss:}.
- samp{:work:}, but discard those also tagged
- item work|laptop
- Selects lines tagged samp{:laptop:}.
- samp{:laptop:} lines to be tagged also
- end table
- samp{work+}} matches headlines that contain the tag
- i{starting} with
- cindex group tags, as regular expressions
- Group tags (
- samp{:work:} is a group tag for the group
- samp{work} will search for {\(?:work\|lab\|conf\)
- samp{-work} will search for all headlines but those with
- one of the tags in the group (i.e., {\(?:work\|lab\|conf\)
- cindex TODO keyword matching, with tags search
- cindex category, require for tags/property match
- pxref{Properties and columns}) at the same
- time as matching tags. The properties may be real properties, or special
- properties that represent other metadata (
- code{TODO} represents the TODO keyword of the
- entry and the ``property''
- code{LEVEL} represents the
- level of an entry. So a search
- samp{boss} and are
- . In buffers with
- samp{LEVEL} does not count the number of stars, but
- table
- item work+TODO="WAITING"
- Select
- samp{WAITING}.
- end table
- When matching properties, a number of different operators can be used to test
- the value of a property. Here is a complex example:
- {Sarah\|Denny
- end example
- itemize
- item
- If the comparison value is a plain number, a numerical comparison is done,
- and the allowed operators are samp{=}, samp{<=},
- samp{<>}.
- item
- If the comparison value is enclosed in double-quotes
- samp{DEADLINE<="<2008-12-24 18:30>"}), both values are
- assumed to be date/time specifications in the standard Org way, and the
- comparison will be done accordingly. Special values that will be recognized
- are code{"<today>"}, and
- code{"<+5d>"} or
- code{d}, code{m}, and
- item
- If the comparison value is enclosed
- in curly braces, a regexp match is performed, with
- samp{<>} meaning that it does not
- match.
- samp{:work:} but
- not samp{A}, a
- samp{unlimited}, an
- samp{:With:} property that is
- matched by the regular expression
- ref{Property
- inheritance}, for details.
- For backward compatibility, and also for typing speed, there is also a
- different way to test TODO states in a search. For this, terminate the
- tags/property part of the search string (which may include several terms
- connected with samp{/} and then specify a Boolean
- expression just for TODO keywords. The syntax is then similar to that for
- tags, but should be applied with care: for example, a positive selection on
- several TODO keywords cannot meaningfully be combined with boolean AND
- emph{negative selection} combined with AND can be meaningful. To
- make sure that only lines are checked that actually have any TODO keyword
- (resulting in a speed-up), use
- samp{!}. Using samp{/!} will
- not match TODO keywords in a DONE state. Examples:
- samp
- samp{work+TODO="WAITING"}
- samp{:work:}-tagged TODO lines that are neither
- samp{NEXT}
- samp{:work:}-tagged TODO lines that are either
- samp{NEXT}.
- node Timeline
- cindex timeline, single file
- emph{time-sorted view}. The main purpose of this command is
- to give an overview over events in a project.
- kbd
- kbd{C-u} prefix, all unfinished TODO entries
- (scheduled or not) are also listed under the current date.
- noindent
- The commands available in the timeline buffer are listed in
- node Search view
- cindex search view
- cindex searching, for text
- This agenda view is a general text search facility for Org mode entries.
- It is particularly useful to find notes.
- kbd
- end table
- For example, the search string
- samp{computer equipment} as a substring. If the two words are
- separated by more space or a line break, the search will still match.
- Search view can also search for specific keywords in the entry, using Boolean
- logic. The search string {8\.11[bg]
- code{computer}
- and code{ethernet}, and which are also
- not matched by the regular expression
- samp{+} is necessary to turn on
- word search, other
- code{org-search-view}.
- code{org-agenda-text-search-extra-files}.
- subsection Stuck projects
- emph{stuck} project is a project that
- has no defined next actions, so it will never show up in the TODO lists
- Org mode produces. During the review, you need to identify such
- projects and define next actions for them.
- kbd
- kindex C-c a !
- vindex org-stuck-projects
- Customize the variable
- end table
- You almost certainly will have to configure this view before it will
- work for you. The built-in default assumes that all your projects are
- level-2 headlines, and that a project is not stuck if it has at least
- one entry marked with a TODO keyword TODO or NEXT or NEXTACTION.
- Let's assume that you, in your own way of using Org mode, identify
- projects with a tag PROJECT, and that you use a TODO keyword MAYBE to
- indicate a project that should not be considered yet. Let's further
- assume that the TODO keyword DONE marks finished projects, and that NEXT
- and TODO indicate next actions. The tag SHOP indicates shopping and
- is a next action even without the NEXT tag. Finally, if the project
- contains the special word IGNORE anywhere, it should not be listed
- either. In this case you would start by identifying eligible projects
- with a tags/todo matchxref{Tag searches}.}
- lisp
- (setq org-stuck-projects
- '("+PROJECT/-MAYBE-DONE" ("NEXT" "TODO") ("@@SHOP")
- "\\<IGNORE\\>"))
- node Presentation and sorting
- cindex presentation, of agenda items
- vindex org-agenda-tags-column
- Before displaying items in an agenda view, Org mode visually prepares the
- items and sorts them. Each item occupies a single line. The line starts
- with a emph{category} (
- code{org-agenda-tags-column}. You can
- also customize the prefix using the option
- menu
- * Categories:: Not all tasks are equal
- * Time-of-day specifications:: How the agenda knows the time
- * Sorting agenda items:: The order of things
- * Filtering/limiting agenda items:: Dynamically narrow the agenda
- node Categories
- cindex category
- example
- #+CATEGORY: Thesis
- noindent
- code{:CATEGORY:} property with the
- special category you want to apply as the value.
- noindent
- You can set up icons for category by customizing the
- node Time-of-day specifications
- cindex time-of-day specification
- Org mode checks each agenda item for a time-of-day specification. The
- time can be part of the timestamp that triggered inclusion into the
- agenda, for example as in samp{<2005-05-10 Tue 19:00>}}. Time
- ranges can be specified with two timestamps, like
- w{
- samp{12:45} or a
- pxref{Weekly/daily agenda}), time
- specifications in diary entries are recognized as well.
- For agenda display, Org mode extracts the time and displays it in a
- standard 24 hour format as part of the prefix. The example times in
- the previous paragraphs would end up in the agenda like this:
- end example
- example
- 8:00...... ------------------
- 8:30-13:00 Arthur Dent lies in front of the bulldozer
- 10:00...... ------------------
- 12:00...... ------------------
- 12:45...... Ford Prefect arrives and takes Arthur to the pub
- 14:00...... ------------------
- 16:00...... ------------------
- 18:00...... ------------------
- 19:00...... The Vogon reads his poem
- 20:00...... ------------------
- 20:30-22:15 Marvin escorts the Hitchhikers to the bridge
- vindex org-agenda-use-time-grid
- code{org-agenda-use-time-grid}, and can be configured with
- node Sorting agenda items
- cindex sorting, of agenda items
- itemize
- item
- emph{schedule} for the day. After that, items remain
- grouped in categories, in the sequence given by
- pxref{Priorities}),
- which is composed of the base priority (2000 for priority
- samp{B}, and 0 for
- item
- For the TODO list, items remain in the order of categories, but within
- each category, sorting takes place according to priority
- (
- item
- For tags matches, items are not sorted at all, but just appear in the
- sequence in which they are found in the agenda files.
- vindex org-agenda-sorting-strategy
- Sorting can be customized using the variable
- pxref{Effort estimates}).
- subsection Filtering/limiting agenda items
- Agenda built-in or customized commands are statically defined. Agenda
- filters and limits provide two ways of dynamically narrowing down the list of
- agenda entries: emph{limits}. Filters only act on the
- display of the items, while limits take effect before the list of agenda
- entries is built. Filters are more often used interactively, while limits are
- mostly useful when defined as local variables within custom agenda commands.
- cindex filtering, by tag, category, top headline and effort, in agenda
- cindex category filtering, in agenda
- cindex effort filtering, in agenda
- table
- orgcmd{/,org-agenda-filter-by-tag}
- footnote{Custom commands can preset a filter by
- binding the variable
- key{SPC} will mean any tag
- at all. Pressing
- emph{do} have the tag.
- A second
- kbd{+} or
- code{org-agenda-auto-exclude-function} is set to a user-defined function,
- that function can decide which tags should be excluded from the agenda
- automatically. Once this is set, the kbd{RET}
- as a sub-option key and runs the auto exclusion logic. For example, let's
- say you use a
- code{Errand} tag for errands in town, and a
- smalllisp
- end group
- c
- kindex ]
- {
- }
- {
- table
- item
- kbd{[} and
- kbd{kbd{
- samp{+}, indicating that this search
- term
- i{must not} occur/match in the entry for it to be
- selected.
- orgcmd{<,org-agenda-filter-by-category}
- code{<} another time will remove this filter. When called
- with a prefix argument exclude the category of the item at point from the
- agenda.
- You can add a filter preset in custom agenda commands through the option
- xref{Setting options}.
- orgcmd{=,org-agenda-filter-by-regexp}
- emph{out} entries matching the regexp. With two
- universal prefix arguments, it will remove all the regexp filters, which can
- be accumulated.
- You can add a filter preset in custom agenda commands through the option
- xref{Setting options}.
- vindex org-agenda-effort-filter-preset
- lisp
- (setq org-global-properties
- '(("Effort_ALL". "0 0:10 0:30 1:00 2:00 3:00 4:00")))
- kbd{<}, kbd{=}, and then the one-digit index of an effort
- estimate in your array of allowed values, where
- code{org-sort-agenda-noeffort-is-high}.
- When called with a prefix argument, it will remove entries matching the
- condition. With two universal prefix arguments, it will clear effort
- filters, which can be accumulated.
- You can add a filter preset in custom agenda commands through the option
- xref{Setting options}.
- end table
- cindex limits, in agenda
- vindex org-agenda-max-effort
- vindex org-agenda-max-tags
- Here is a list of options that you can set, either globally, or locally in
- your custom agenda views (
- table
- item org-agenda-max-entries
- Limit the number of entries.
- item org-agenda-max-todos
- Limit the number of entries with TODO keywords.
- end table
- When set to a positive integer, each option will exclude entries from other
- categories: for example,
- code{org-agenda-max-effort}.
- One useful setup is to use
- code{NEXT} TODO keyword.
- end smalllisp
- Once you mark one of these five entry as
- table
- orgcmd{~,org-agenda-limit-interactively}
- This prompts for the type of limit to apply and its value.
- node Agenda commands
- cindex commands, in agenda buffer
- Entries in the agenda buffer are linked back to the Org file or diary
- file where they originate. You are not allowed to edit the agenda
- buffer itself, but commands are provided to show and jump to the
- original entry location, and to edit the Org files ``remotely'' from
- the agenda buffer. In this way, all information is stored only once,
- removing the risk that your agenda and note files may diverge.
- Some commands can be executed with mouse clicks on agenda lines. For
- the other commands, the cursor needs to be in the desired line.
- kbd
- cindex motion commands in agenda
- key{down} and
- orgcmd{p,org-agenda-previous-line}
- Previous line (same as kbd{C-p}).
- orgcmd{P,org-agenda-previous-item}
- Previous item: same as previous line, but only consider items.
- orgcmdkkc{
- c
- c
- key{TAB},mouse-2,org-agenda-goto}
- Go to the original location of the item in another window.
- orgcmd{
- c
- vindex org-agenda-start-with-follow-mode
- Toggle Follow mode. In Follow mode, as you move the cursor through
- the agenda buffer, the other window always shows the corresponding
- location in the Org file. The initial setting for this mode in new
- agenda buffers can be set with the variable
- c
- kbd{C-u} prefix, do not remove the
- previously used indirect buffer.
- tsubheading{Change display}
- kindex A
- c
- item o
- Delete other windows.
- orgcmdkskc{v d,d,org-agenda-day-view}
- xorgcmd{v t,org-agenda-fortnight-view}
- xorgcmd{v y,org-agenda-year-view}
- vindex org-agenda-span
- Switch to day/week/month/year view. When switching to day or week view, this
- setting becomes the default for subsequent agenda refreshes. Since month and
- year views are slow to create, they do not become the default. A numeric
- prefix argument may be used to jump directly to a specific day of the year,
- ISO week, month, or year, respectively. For example,
- kbd{9 w} to ISO week number 9. When setting day, week, or
- month view, a year may be encoded in the prefix argument as well. For
- example,
- kbd{v
- code{org-agenda-span}.
- orgcmd{f,org-agenda-later}
- Go forward in time to display the following
- code{org-agenda-current-span} days.
- orgcmd{b,org-agenda-earlier}
- Go backward in time to display earlier dates.
- orgcmd{.,org-agenda-goto-today}
- Go to today.
- orgcmd{j,org-agenda-goto-date}
- Prompt for a date and go there.
- orgcmd{J,org-agenda-clock-goto}
- Go to the currently clocked-in task
- c
- ref{Weekly/daily agenda}.
- orgcmdkskc{v l,l,org-agenda-log-mode}
- vindex org-log-done
- code{org-log-done}) are shown in the agenda, as are
- entries that have been clocked on that day. You can configure the entry
- types that should be included in log mode using the variable
- kbd{C-u} prefix, show
- all possible logbook entries, including state changes. When called with two
- prefix arguments
- kbd{v L} is equivalent to
- c
- c
- xorgcmd{v A,org-agenda-archives-mode 'files}
- code{ARCHIVED} are also scanned when producing the agenda. When you use the
- capital
- kbd{v a} again.
- orgcmdkskc{v R,R,org-agenda-clockreport-mode}
- vindex org-clock-report-include-clocking-task
- Toggle Clockreport mode. In Clockreport mode, the daily/weekly agenda will
- always show a table with the clocked times for the time span and file scope
- covered by the current agenda view. The initial setting for this mode in new
- agenda buffers can be set with the variable
- kbd{C-u R}), the clock table will not show
- contributions from entries that are hidden by agenda filtering
- code{org-clock-report-include-clocking-task}.
- orgkey{v c}
- code{org-agenda-clock-consistency-checks} for
- information on how to customize the definition of what constituted a clocking
- problem. To return to normal agenda display, press
- c
- vindex org-agenda-start-with-entry-text-mode
- code{org-agenda-entry-text-maxlines}. Calling this command with a numeric
- prefix argument will temporarily modify that number to the prefix value.
- orgcmd{G,org-agenda-toggle-time-grid}
- vindex org-agenda-time-grid
- Toggle the time grid on and off. See also the variables
- code{org-agenda-time-grid}.
- orgcmd{r,org-agenda-redo}
- Recreate the agenda buffer, for example to reflect the changes after
- modification of the timestamps of items with key{left}} and
- key{right}}. When the buffer is the global TODO list, a prefix
- argument is interpreted to create a selective list for a specific TODO
- keyword.
- kbd{r}.
- orgcmdkskc{C-x C-s,s,org-save-all-org-buffers}
- Save all Org buffers in the current Emacs session, and also the locations of
- IDs.
- orgcmd{C-c C-x C-c,org-agenda-columns}
- pxref{Column view}) in the agenda buffer. The column
- view format is taken from the entry at point, or (if there is no entry at
- point), from the first entry in the agenda view. So whatever the format for
- that entry would be in the original buffer (taken from a property, from a
- code{org-columns-default-format}), will be used in the agenda.
- pxref{Agenda files}).
- pxref{Filtering/limiting
- agenda items}.
- orgcmd{<,org-agenda-filter-by-category}
- Filter the current agenda view with respect to the category of the item at
- point.
- orgcmd{=,org-agenda-filter-by-regexp}
- Filter the agenda view by a regular expression.
- orgcmd{|,org-agenda-filter-remove-all}
- Remove all filters in the current agenda view.
- cindex remote editing, from agenda
- c
- cindex remote editing, undo
- c
- c
- key{right},org-agenda-todo-nextset}
- key{left},org-agenda-todo-previousset}
- Switch to the next/previous set of TODO keywords.
- orgcmd{C-k,org-agenda-kill}
- code{org-agenda-confirm-kill}.
- orgcmd{C-c C-w,org-agenda-refile}
- Refile the entry at point.
- orgcmdkskc{C-c C-x C-a,a,org-agenda-archive-default-with-confirmation}
- code{org-archive-default-command}. When using the
- c
- c
- emph{archive
- sibling}.
- orgcmdkskc{C-c C-x C-s,$,org-agenda-archive}
- Archive the subtree corresponding to the current headline. This means the
- entry will be moved to the configured archive location, most likely a
- different file.
- orgcmd{T,org-agenda-show-tags}
- code{org-agenda-show-inherited-tags}, but still want to see all
- tags of a headline occasionally.
- orgcmd{:,org-agenda-set-tags}
- Set tags for the current headline. If there is an active region in the
- agenda, change a tag for all headings in the region.
- kindex ,
- command{org-agenda-priority}).
- Org mode prompts for the priority character. If you reply with
- c
- c
- key{up},org-agenda-priority-up}
- Increase the priority of the current item. The priority is changed in
- the original buffer, but the agenda is not resorted. Use the
- c
- key{down},org-agenda-priority-down}
- Decrease the priority of the current item.
- orgcmdkkc{z,C-c C-z,org-agenda-add-note}
- code{org-log-into-drawer}, this may be inside a drawer.
- orgcmd{C-c C-a,org-attach}
- Dispatcher for all command related to attachments.
- orgcmd{C-c C-s,org-agenda-schedule}
- Schedule this item. With prefix arg remove the scheduling timestamp
- orgcmd{C-c C-d,org-agenda-deadline}
- Set a deadline for this item. With prefix arg remove the deadline.
- orgcmd{S-
- *
- With a numeric prefix argument, change it by that many days. For example,
- key{right}} will change it by a year. With a
- kbd{C-u
- C-u} prefix, do the same for changing minutes.
- kbd{r} or
- c
- key{left},org-agenda-do-date-earlier}
- Change the timestamp associated with the current line by one day
- into the past.
- orgcmd{>,org-agenda-date-prompt}
- Change the timestamp associated with the current line. The key
- kbd{S-.} on my keyboard.
- orgcmd{I,org-agenda-clock-in}
- Start the clock on the current item. If a clock is running already, it
- is stopped first.
- orgcmd{O,org-agenda-clock-out}
- Stop the previously started clock.
- orgcmd{X,org-agenda-clock-cancel}
- Cancel the currently running clock.
- orgcmd{J,org-agenda-clock-goto}
- Jump to the running clock in another window.
- orgcmd{k,org-agenda-capture}
- Like
- code{org-capture-use-agenda-date} to make this
- the default behavior of
- cindex capturing, from agenda
- tsubheading{Dragging agenda lines forward/backward}
- orgcmd{M-<up>,org-agenda-drag-line-backward}
- Drag the line at point backward one line
- file{.org} files}. With a numeric prefix argument, drag backward by that
- many lines.
- tsubheading{Bulk remote editing selected entries}
- vindex org-agenda-bulk-custom-functions
- c
- c
- c
- c
- c
- c
- c
- kbd{B}
- will be passed through to the kbd{d} commands, to bulk-remove
- these special timestamps. By default, marks are removed after the bulk. If
- you want them to persist, set code{t}
- or hit
- table
- item *
- Toggle persistent marks.
- item A
- Archive entries by moving them to their respective archive siblings.
- item +
- Add a tag to all selected entries.
- item s
- Schedule all items to a new date. To shift existing schedule dates by a
- fixed number of days, use something starting with double plus at the prompt,
- for example samp{++2w}.
- item r
- Prompt for a single refile target and move all entries. The entries will no
- longer be in the agenda; refresh (
- item S
- Reschedule randomly into the coming N days. N will be prompted for. With
- prefix arg (
- item f
- Apply a function
- code{org-agenda-bulk-custom-functions}.} to marked entries. For
- example, the function below sets the CATEGORY property of the entries to web.
- group
- (defun set-category ()
- (interactive "P")
- (let* ((marker (or (org-get-at-bol 'org-hd-marker)
- (org-agenda-error)))
- (buffer (marker-buffer marker)))
- (with-current-buffer buffer
- (save-excursion
- (save-restriction
- (widen)
- (goto-char marker)
- (org-back-to-heading t)
- (org-set-property "CATEGORY" "web"))))))
- end lisp
- tsubheading{Calendar commands}
- orgcmd{c,org-agenda-goto-calendar}
- Open the Emacs calendar and move to the date at the agenda cursor.
- orgcmd{c,org-calendar-goto-agenda}
- When in the calendar, compute and show the Org mode agenda for the
- date at the cursor.
- cindex diary entries, creating from agenda
- vindex org-agenda-diary-file
- Insert a new entry into the diary, using the date at the cursor and (for
- block entries) the date at the mark. This will add to the Emacs diary
- file
- code{org-agenda-include-diary} is set.}, in a way similar to the
- code{org-agenda-diary-file} to point to an Org mode file,
- Org will create entries (in Org mode syntax) in that file instead. Most
- entries will be stored in a date-based outline tree that will later make it
- easy to archive appointments from previous months/years. The tree will be
- built under an entry with a
- code{org-agenda-diary-file} without further
- interaction. If you directly press
- kbd{k r} command.
- orgcmd{M,org-agenda-phases-of-moon}
- Show the phases of the moon for the three months around current date.
- orgcmd{S,org-agenda-sunrise-sunset}
- Show sunrise and sunset times. The geographical location must be set
- with calendar variables, see the documentation for the Emacs calendar.
- orgcmd{C,org-agenda-convert-date}
- Convert the date at cursor into many other cultural and historic
- calendars.
- orgcmd{H,org-agenda-holidays}
- Show holidays for three months around the cursor date.
- tsubheading{Exporting to a file}
- cindex exporting agenda views
- vindex org-agenda-exporter-settings
- Write the agenda view to a file. Depending on the extension of the selected
- file name, the view will be exported as HTML (file{.htm}),
- Postscript (file{.pdf}), Org (
- kbd{C-u} prefix argument, immediately open the newly created file. Use the
- variable
- file{ps-print} and for
- tsubheading{Quit and Exit}
- c
- orgcmd{x,org-agenda-exit}
- Exit agenda, remove the agenda buffer and all buffers loaded by Emacs
- for the compilation of the agenda. Buffers created by the user to
- visit Org files will not be removed.
- node Custom agenda views
- cindex custom agenda views
- pxref{Agenda dispatcher}), just like the default commands.
- end menu
- subsection Storing searches
- The first application of custom searches is the definition of keyboard
- shortcuts for frequently used searches, either creating an agenda
- buffer, or a sparse tree (the latter covering of course only the current
- buffer).
- vindex org-agenda-custom-commands
- cindex agenda, as an agenda views
- cindex tags, as an agenda view
- cindex tags-todo
- cindex occur-tree
- code{org-agenda-custom-commands}. You can customize this variable, for
- example by pressing
- lisp
- end group
- noindent
- The initial string in each entry defines the keys you have to press
- after the dispatcher command
- footnote{You can provide a description for a prefix key by
- inserting a cons cell with the prefix and the description.}. The second
- parameter is the search type, followed by the string or regular
- expression to be used for the matching. The example above will
- therefore define:
- kbd
- footnote{
- code{org-agenda-entry-types} on how to set what planning information will be
- taken into account.} this week/day.
- code{[h]h:mm}---think of them as appointments.
- samp{WAITING} as the TODO
- keyword
- item C-c a u
- as a global tags search for headlines marked
- samp{:urgent:}
- kbd{C-c a u}, but limiting the search to
- headlines that are also TODO items
- kbd{C-c a u}, but only in the current buffer and
- displaying the result as a sparse tree
- samp{FIXME}
- kbd{l}, kbd{k}) to select a name (Lisa,
- Peter, or Kim) as additional tag to match.
- code{*-tree} agenda views need to be called from an
- Org buffer as they operate on the current buffer only.
- subsection Block agenda
- cindex agenda, with block views
- Another possibility is the construction of agenda views that comprise
- the results of
- code{agenda} for the
- daily or weekly agenda (as created with code{alltodo}
- for the global TODO list (as constructed with
- code{todo},
- code{tags-todo}. Here are two examples:
- group
- (setq org-agenda-custom-commands
- '(("h" "Agenda and Home-related tasks"
- ((agenda "")
- (tags-todo "home")
- (tags "garden")))
- ("o" "Agenda and Office-related tasks"
- ((agenda "")
- (tags-todo "work")
- (tags "office")))))
- end lisp
- kbd{C-c a h} to create a multi-block view for stuff
- you need to attend to at home. The resulting agenda buffer will contain
- your agenda for the current week, all TODO items that carry the tag
- samp{garden}. Finally the
- command
- node Setting options
- cindex options, for custom agenda views
- code{org-agenda-custom-commands}. For example:
- group
- (setq org-agenda-custom-commands
- '(("w" todo "WAITING"
- ((org-agenda-sorting-strategy '(priority-down))
- (org-agenda-prefix-format " Mixed: ")))
- ("U" tags-tree "+boss-urgent"
- ((org-show-context-detail 'minimal)))
- ("N" search ""
- ((org-agenda-files '("~org/notes.org"))
- (org-agenda-text-search-extra-files nil)))))
- end lisp
- kbd{C-c a w} command will sort the collected entries only by
- priority, and the prefix format is modified to just say
- kbd{C-c a U} will now turn out ultra-compact, because neither the
- headline hierarchy above the match, nor the headline following the match
- will be shown. The command
- vindex org-agenda-custom-commands
- For command sets creating a block agenda,
- pxref{Block agenda}), let's change the sorting strategy
- for the code{priority-down}, but let's sort
- the results for GARDEN tags query in the opposite order,
- lisp
- end group
- emph{values} are just Lisp expressions. So if the
- value is a string, you need to add the double-quotes around the value
- yourself.
- code{org-agenda-custom-commands-contexts}. Let's
- say for example that you have an agenda command
- lisp
- (setq org-agenda-custom-commands-contexts
- '(("o" (in-mode . "message-mode"))))
- code{"o"} should refer to another
- command key
- lisp
- (setq org-agenda-custom-commands-contexts
- '(("o" "r" (in-mode . "message-mode"))))
- node Exporting agenda views
- cindex agenda views, exporting
- If you are away from your computer, it can be very useful to have a printed
- version of some agenda views to carry around. Org mode can export custom
- agenda views as plain text, HTML
- file{htmlize.el}.}, Postscript, PDF
- file{ps2pdf} utility must be installed on the system. Selecting
- a PDF file will also create the postscript file.}, and iCalendar files. If
- you want to do this only occasionally, use the command
- kbd
- cindex exporting agenda views
- vindex org-agenda-exporter-settings
- Write the agenda view to a file. Depending on the extension of the selected
- file name, the view will be exported as HTML (extension
- file{.htm}), Postscript (extension
- file{.ics}), or plain text (any other extension). Use the variable
- file{ps-print} and
- for
- vindex org-agenda-add-entry-text-maxlines
- vindex ps-number-of-columns
- lisp
- (setq org-agenda-exporter-settings
- '((ps-number-of-columns 2)
- (ps-landscape-mode t)
- (org-agenda-add-entry-text-maxlines 5)
- (htmlize-output-type 'css)))
- end table
- If you need to export certain agenda views frequently, you can associate
- any custom agenda command with a list of output file names
- lisp
- end group
- file{.html}, Org mode will use the
- file{.ps},
- file{.ics}, iCalendar export is
- run export over all files that were used to construct the agenda, and
- limit the export to entries listed in the agenda. Any other
- extension produces a plain ASCII file.
- The export files are
- emph{all} specified
- files in one step:
- kbd
- end table
- You can use the options section of the custom agenda commands to also
- set options for the export commands. For example:
- end lisp
- code{org-agenda-exporter-settings} will also apply, but the settings
- in
- noindent
- From the command line you may also use
- end example
- footnote{Quoting depends on the
- system you use, please check the FAQ for examples.}
- end example
- file{~/org/project.org}, without diary entries and with a 30-day
- extent.
- You can also extract agenda information in a way that allows further
- processing by other programs. See
- node Agenda column view
- cindex column view, in agenda
- pxref{Column view}) is normally used to view and edit
- properties embedded in the hierarchical structure of an Org file. It can be
- quite useful to use column view also from the agenda, where entries are
- collected by certain criteria.
- kbd
- end table
- To understand how to use this properly, it is important to realize that the
- entries in the agenda are no longer in their proper outline environment.
- This causes the following issues:
- item
- vindex org-overriding-columns-format
- Org needs to make a decision which
- code{COLUMNS} formats, this is a non-trivial problem.
- Org first checks if the variable
- code{org-columns-default-format}.
- cindex property, special, CLOCKSUM
- If any of the columns has a summary type defined (
- code{CLOCKSUM} property. Org will then sum the
- values displayed in the agenda. In the daily/weekly agenda, the sums will
- cover a single day; in all other views they cover the entire block. It is
- vital to realize that the agenda may show the same entry
- emph{parent} and its
- item
- When the column view in the agenda shows the
- kbd{R} in
- the agenda).
- cindex property, special, CLOCKSUM_T
- When the column view in the agenda shows the
- code{CLOCKSUM}---and with the planned total effort for it.
- node Markup
- LaTeX{} allow much richer formatting, Org mode has
- rules on how to prepare text for rich export. This section summarizes the
- markup rules used in an Org mode buffer.
- LaTeX{}:: LaTeX can be freely used inside Org documents
- node Paragraphs
- cindex paragraphs, markup rules
- Paragraphs are separated by at least one empty line. If you need to enforce
- a line break within a paragraph, use
- cindex #+BEGIN_VERSE
- example
- #+BEGIN_VERSE
- Great clouds overhead
- Tiny black birds rise and fall
- Snow covers Emacs
- -- AlexSchroeder
- #+END_VERSE
- cindex #+BEGIN_QUOTE
- example
- #+BEGIN_QUOTE
- Everything should be made as simple as possible,
- but not any simpler -- Albert Einstein
- #+END_QUOTE
- cindex #+BEGIN_CENTER
- example
- #+BEGIN_CENTER
- Everything should be made as simple as possible, \\
- but not any simpler
- #+END_CENTER
- node Emphasis and monospace
- cindex underlined text, markup rules
- cindex italic text, markup rules
- cindex code text, markup rules
- vindex org-fontify-emphasized-text
- vindex org-emphasis-alist
- You can make words i{/italic/}, _underlined_,
- code{~code~}, and, if you must,
- code{org-fontify-emphasized-text} to
- code{org-emphasis-alist}. To fine
- tune what characters are allowed before and after the markup characters, you
- can tweak
- node Horizontal rules
- cindex horizontal rules, markup rules
- A line consisting of only dashes, and at least 5 of them, will be exported as
- a horizontal line.
- section Images and Tables
- cindex #+CAPTION
- pxref{Tables}) and tables formatted with
- the
- code{[[tab:basic-data]]} (
- example
- #+CAPTION: This is the caption for the next table (or link)
- #+NAME: tab:basic-data
- | ... | ...|
- |-----|----|
- example
- #+CAPTION[Caption for list of tables]: Caption for table.
- cindex inlined images, markup rules
- Some back-ends allow you to directly include images into the exported
- document. Org does this, if a link to an image files does not have
- a description part, for example
- code{#+CAPTION} and
- example
- #+CAPTION: This is the caption for the next figure link (or table)
- #+NAME: fig:SED-HR4049
- [[./img/a.jpg]]
- noindent
- Such images can be displayed within the buffer.
- LaTeX{}
- equations, source code blocks). Depending on the export back-end, those may
- or may not be handled.
- section Literal examples
- cindex code line references, markup rules
- You can include literal examples that should not be subjected to
- markup. Such examples will be typeset in monospace, so this is well suited
- for source code and similar examples.
- example
- #+BEGIN_EXAMPLE
- Some example from a text file.
- #+END_EXAMPLE
- i{indented} in order to align nicely with
- indented text and in particular with plain list structure (
- example
- Here is an example
- : Some example from a text file.
- cindex formatting source code, markup rules
- footnote{This works automatically for
- the HTML back-end (it requires version 1.34 of the
- LaTeX{} can be
- achieved using either the
- url{https://github.com/gpoore/minted, minted,} package.
- If you use minted or listing, you must load the packages manually, for
- example by adding the desired package to
- code{org-latex-listings}
- for details.}. This is done with the
- footnote{Code in
- xref{Working with source code}, for more
- information on evaluating code blocks.}, see
- cindex #+BEGIN_SRC
- end example
- Both in code{src} snippets, you can add a
- code{BEGIN} line, to get the lines of the example
- numbered. The
- code{+n} switch, the
- numbering from the previous numbered snippet will be continued in the current
- one. The
- example
- #+BEGIN_SRC emacs-lisp -n 20
- ;; this will export with line number 20
- (message "This is line 21")
- #+END_SRC
- #+BEGIN_SRC emacs-lisp +n 10
- ;; This will be listed as line 31
- (message "This is line 32")
- #+END_SRC
- samp{(ref:name)} as
- labels, and use them as targets for special hyperlinks like
- code{-r} switch which
- footnote{Adding code{-n -r} will
- code{-n}
- switch, links to these references will be labeled by the line numbers from
- the code listing, otherwise links will use the labels with no parentheses.
- Here is an example:
- end example
- code{-i} to preserve the indentation of a specific code
- block (
- vindex org-coderef-label-format
- If the syntax for the label format conflicts with the language syntax, use a
- samp{#+BEGIN_SRC pascal
- -n -r -l "((%s))"}. See also the variable
- pxref{Text
- areas in HTML export}).
- Because the code{#+END_...} patterns need to be added
- so often, shortcuts are provided using the Easy templates facility
- (
- table
- kindex C-c '
- kbd{C-c '} againsamp{*},
- samp{#+} and
- kbd{C-c '}, and also for export.}.
- The edited version will then replace the old version in the Org buffer.
- Fixed-width regions (where each line starts with a colon followed by a space)
- will be edited using footnote{You may select
- a different-mode with the variable
- kindex C-c l
- code{org-store-link} while editing a source code example in a
- temporary buffer created with
- samp{(ref:label)} at the end of the current line. Then the
- label is stored as a link kbd{C-c C-l}.
- node Special symbols
- cindex Org entities
- cindex special symbols
- cindex
- LaTeX{}-like syntax to insert special symbols---named
- entities---like samp{\to} to
- indicate an arrow. Completion for these symbols is available, just type
- kbd{M-
- example
- Protip: Given a circle \Gamma of diameter d, the length of its circumference
- is \pi}d.
- findex org-entities-help
- LaTeX{}; you can comfortably browse the complete list from a dedicated
- buffer using the command
- code{org-entities-user}.
- During export, these symbols are transformed into the native format of the
- exporter back-end. Strings like code{α}
- in the HTML output, and as LaTeX{} output.
- Similarly, code{ } in HTML and
- LaTeX{}.
- samp{\under}not underlined\under} exports as
- cindex special symbols, in-buffer display
- If you would like to see entities displayed as UTF-8 characters, use the
- following command
- code{org-pretty-entities}, or on a per-file base with the
- code{entitiespretty}.}:
- kbd
- code{entitiespretty}, STARTUP keyword
- item C-c C-x \
- Toggle display of entities as UTF-8 characters. This does not change the
- buffer content which remains plain ASCII, but it overlays the UTF-8 character
- for display purposes only.
- cindex shy hyphen, special symbol
- cindex ellipsis, special symbol
- In addition to regular entities defined above, Org exports in a special
- waycode{-} export setting
- (
- samp{\-} is treated as a shy hyphen, samp{---}
- are converted into dashes, and
- node Subscripts and superscripts
- cindex subscript
- samp{^} and
- example
- The radius of the sun is R_sun = 6.96 x 10^8 m. On the other hand, the
- radius of Alpha Centauri is R_} = 1.28 x R_}.
- vindex org-use-sub-superscripts
- If you write a text where the underscore is often used in a different
- context, Org's convention to always interpret these as subscripts can get in
- your way. Configure the variable
- code{}},
- samp{a_}} will.
- kbd
- item C-c C-x \
- In addition to showing entities as UTF-8 characters, this command will also
- format sub- and superscripts in a WYSIWYM way.
- node Embedded
- section Embedded
- cindex
- cindex
- LaTeX{}LaTeX{} is a macro system based on
- Donald E. Knuth's
- LaTeX{}'' are really from
- LaTeX{} code into its files, because many academics are
- used to writing and reading
- menu
- *
- LaTeX{} fragments:: What will this snippet look like?
- * CDLaTeX mode:: Speed up entering of formulas
- node
- subsection
- cindex
- vindex org-format-latex-header
- Org mode can contain
- LaTeX{}, the code is
- left as it is. When exporting to HTML, Org can use either
- pxref{Math formatting in HTML
- export}) or transcode the math into images (see LaTeX{}
- fragments}).
- LaTeX{} source code:
- bullet
- footnote{When MathJax is used, only the
- environments recognized by MathJax will be processed. When
- file{dvisvgm} program or
- LaTeX{} environment will be handled.}. The only
- requirement is that the
- item
- Text within the usual
- samp{$} characters are only recognized as
- math delimiters if the enclosed text contains at most two line breaks, is
- directly attached to the
- samp{$} is followed by whitespace or punctuation
- (parentheses and quotes are considered to be punctuation in this
- context). For the other delimiters, there is no such restriction, so when in
- doubt, use
- end itemize
- example
- \begin}
- x=\sqrt}
- \end}
- If $a^2=b$ and \( b=2 \), then the solution must be
- either $$ a=+\sqrt} $$ or \[ a=-\sqrt} \].
- c FIXME
- noindent
- vindex org-format-latex-options
- c can configure the option
- c ones you do not wish to have interpreted by the
- vindex org-export-with-latex
- code{org-export-with-latex}. The default setting is
- LaTeX{} back-ends.
- You can also set this variable on a per-file basis using one of these
- lines:
- r{Do the right thing automatically (MathJax)}
- #+OPTIONS: tex:nil LaTeX{} fragments at all}
- #+OPTIONS: tex:verbatim
- end example
- LaTeX{} fragments
- LaTeX{} fragments
- LaTeX{} fragments, preview
- LaTeX{} installation and file{dvisvgm}
- or footnote{These are respectively available at
- url{http://dvisvgm.bplaced.net/}
- and from the
- code{org-preview-latex-default-process} accordingly.},
- pxref{
- vindex org-format-latex-options
- code{org-format-latex-options} and
- code{:scale} (and for HTML export,
- table
- kindex C-c C-x C-l
- LaTeX{} fragment at point and overlay it
- over the source code. If there is no fragment at point, process all
- fragments in the current entry (between two headlines). When called
- with a prefix argument, process the entire subtree. When called with
- two prefix arguments, or when the cursor is before the first headline,
- process the entire buffer.
- item C-c C-c
- Remove the overlay preview images.
- vindex org-startup-with-latex-preview
- You can turn on the previewing of all
- example
- #+STARTUP: latexpreview
- example
- #+STARTUP: nolatexpreview
- node CDLaTeX mode
- LaTeX{} to enter math
- LaTeX{}
- CD
- LaTeX{} mode like AUC
- LaTeX{} mode. You need to install
- file{texmathp.el} (the latter comes also with
- AUCurl{http://www.astro.uva.nl/~dominik/Tools/cdlatex}.
- Don't use CD
- code{org-cdlatex-mode} that comes as part of Org mode. Turn it
- on for the current buffer with
- lisp
- (add-hook 'org-mode-hook 'turn-on-org-cdlatex)
- LaTeX{} mode):
- bullet
- {
- kbd{C-c
- item
- key{TAB}
- The
- LaTeX{} fragment
- code{org-inside-LaTeX-fragment-p}.}. For example,
- code{fr} to {{
- key{TAB} will get you into
- the second brace. Even outside fragments,
- samp{equ} at the beginning of a line and press
- code{equation} environment.
- To get a list of all abbreviations, type
- item
- kindex ^
- kbd{_} and LaTeX{} fragment will insert these
- characters together with a pair of braces. If you use
- code{cdlatex-simplify-sub-super-scripts}).
- kindex `
- Pressing the grave accent
- LaTeX{} fragments. If you wait more than 1.5 seconds
- after the grave accent, a help window will pop up.
- kindex '
- Pressing the apostrophe
- LaTeX{} fragments; outside the quote
- is normal.
- node Exporting
- cindex exporting
- Sometimes, you may want to pretty print your notes, publish them on the web
- or even share them with people not using Org. In these cases, the Org export
- facilities can be used to convert your documents to a variety of other
- formats, while retaining as much structure (
- pxref{Markup}) as possible.
- itemize
- item beamer (
- item html (HTML format)
- item latex (
- item md (Markdown format)
- item org (Org format)
- item man (Man page format)
- noindent Org also uses additional libraries located in
- pxref{Installation}). Users can install additional export
- libraries for additional formats from the Emacs packaging system. For easy
- discovery, these packages have a common naming scheme:
- file{ox-koma-letter} for
- vindex org-export-backends
- Org loads back-ends for the following formats by default:
- code{html}, code{latex} and
- code{org-export-backends} variable configuration; or, by requiring the
- library in the Emacs init file like this:
- end lisp
- LaTeX{} export:: Exporting to
- end menu
- section The export dispatcher
- cindex Export, dispatcher
- The export dispatcher is the main interface for Org's exports. A
- hierarchical menu presents the currently configured export formats. Options
- are shown as easy toggle switches on the same screen.
- Org also has a minimal prompt interface for the export dispatcher. When the
- variable code{nil}
- value, Org prompts in the minibuffer. To switch back to the hierarchical
- menu, press
- table
- orgcmd{C-c C-e,org-export-dispatch}
- Invokes the export dispatcher interface. The options show default settings.
- The
- end table
- Org exports the entire buffer by default. If the Org buffer has an active
- region, then Org exports just that region.
- These are the export options, the key combinations that toggle them
- (
- table
- item C-a
- kbd{C-u} prefix
- argument. If already in the export dispatcher menu,
- vindex org-export-in-background
- To make the background export process the default, customize the variable,
- item C-b
- Toggle body-only export. Useful for excluding headers and footers in the
- export. Affects only those back-end formats that have such sections---like
- item C-s
- code{org-export-initial-scope}.
- end table
- section Export settings
- cindex #+OPTIONS
- Export options can be set: globally with variables; for an individual file by
- making variables buffer-local with in-buffer settings (
- code{#+OPTIONS} keyword; or for a tree by setting
- properties (
- cindex #+SETUPFILE
- In-buffer settings may appear anywhere in the file, either directly or
- indirectly through a file included using
- pxref{The export dispatcher}) using the
- key{#}. To insert keywords individually,
- a good way to make sure the keyword is correct is to type
- kbd{M-footnote{Many desktops intercept
- kbd{C-M-i} or key{ESC}
- table
- item AUTHOR
- vindex user-full-name
- The document author (
- item CREATOR
- vindex org-export-creator-string
- Entity responsible for output generation (
- item DATE
- vindex org-export-date-timestamp-format
- A date or a time-stamp
- code{org-export-date-timestamp-format} defines how this time-stamp will be
- exported.}.
- cindex #+EMAIL
- code{user-mail-address}).
- cindex #+LANGUAGE
- code{org-export-default-language}). With
- emph{Table of contents} to the French
- item SELECT_TAGS
- vindex org-export-select-tags
- The default value is
- code{:export:} (
- code{:noexport:} tags,
- see below. When selectively exporting files with
- item EXCLUDE_TAGS
- vindex org-export-exclude-tags
- The default value is
- code{:noexport:} (
- code{:noexport:} will be
- unconditionally excluded from the export, even if they have an
- item TITLE
- cindex document title
- Org displays this title. For long titles, use multiple
- end table
- The
- code{#+OPTIONS} lines.
- table
- item ':
- code{org-export-with-smart-quotes}). Depending on the
- language used, when activated, Org treats pairs of double quotes as primary
- quotes, pairs of single quotes as secondary quotes, and single quote marks as
- apostrophes.
- code{org-export-with-emphasize}).
- vindex org-export-with-special-strings
- Toggle conversion of special strings
- (
- item ::
- code{org-export-with-fixed-width}).
- vindex org-export-with-timestamps
- Toggle inclusion of time/date active/inactive stamps
- (
- item \n:
- code{org-export-preserve-breaks}).
- vindex org-export-with-sub-superscripts
- Toggle {
- samp{a_}} will be interpreted, but the simple
- code{org-export-with-sub-superscripts}).
- vindex org-export-with-archived-trees
- Configure how archived trees are exported. When set to
- code{org-export-with-archived-trees}).
- vindex org-export-with-author
- Toggle inclusion of author name into exported file
- (
- item broken-links:
- code{mark}, Org clearly marks the problem link in the output
- (
- item c:
- code{org-export-with-clocks}).
- vindex org-export-with-creator
- Toggle inclusion of creator information in the exported file
- (
- item d:
- code{org-export-with-drawers}).
- vindex org-export-with-date
- Toggle inclusion of a date into exported file (
- item e:
- code{org-export-with-entities}).
- vindex org-export-with-email
- Toggle inclusion of the author's e-mail into exported file
- (
- item f:
- code{org-export-with-footnotes}).
- vindex org-export-headline-levels
- Set the number of headline levels for export
- (
- item inline:
- code{org-export-with-inlinetasks}).
- vindex org-export-with-section-numbers
- code{org-export-with-section-numbers}). When set to
- number samp{n} or above.
- Set code{nil} to disable numbering of
- heading and subheadings entirely.
- vindex org-export-with-planning
- Toggle export of planning information (
- code{SCHEDULED:},
- code{CLOSED:}.
- vindex org-export-with-priority
- Toggle inclusion of priority cookies (
- item prop:
- code{org-export-with-properties}).
- vindex org-export-with-statistics-cookies
- Toggle inclusion of statistics cookies
- (
- item tags:
- code{not-in-toc}
- (
- item tasks:
- code{nil} to remove all tasks; or
- code{org-export-with-tasks}).
- vindex org-export-with-latex
- code{t} exports;
- code{org-export-with-latex}).
- vindex org-export-time-stamp-file
- Toggle inclusion of the creation time in the exported file
- (
- item title:
- code{org-export-with-title}).
- vindex org-export-with-toc
- Toggle inclusion of the table of contents, or set the level limit
- (
- item todo:
- code{org-export-with-todo-keywords}).
- vindex org-export-with-tables
- Toggle inclusion of tables (
- end table
- When exporting sub-trees, special node properties in them can override the
- above keywords. They are special because they have an
- samp{DATE} and
- samp{EXPORT_DATE} and samp{SETUPFILE},
- all other keywords listed above have an
- cindex #+BIND
- code{org-export-allow-bind-keywords} is non-
- samp{#+BIND: variable value}. This is particularly useful for in-buffer
- settings that cannot be changed using keywords.
- code{EXPORT_FILE_NAME} property.
- section Table of contents
- cindex list of tables
- cindex #+TOC
- code{nil}. This is configured in the
- example
- #+OPTIONS: toc:2
- r{no default TOC at all}
- code{org-export-with-toc} variable or with
- code{#+TOC: headlines N} at the desired location(s).
- r{no default TOC}
- ...
- #+TOC: headlines 2
- end example
- To adjust the TOC depth for a specific section of the Org document, append an
- additional
- LaTeX{} export, the Org file
- requires the inclusion of the
- code{titletoc} has to be loaded
- code{hyperref}. Customize the
- example
- * Section #+TOC: headlines 1 local
- end example
- Use the : all listings)
- with captions.
- r{build a list of listings}
- #+TOC: tables
- end example
- code{ALT_TITLE} property, a different entry can be specified for the
- table of contents.
- section Include files
- file{.emacs}
- file, you could use:
- example
- #+INCLUDE: "~/.emacs" src emacs-lisp
- noindent
- The first parameter is the file name to include. The optional second
- parameter specifies the block type: samp{export} or
- p
- samp{export}
- and
- samp{example} and
- pxref{Footnotes}) in the included file local to
- that file. The contents of the included file will belong to the same
- structure---headline, item---containing the
- code{:minlevel}. It shifts the headlines in the included file to
- become the lowest level. For example, this syntax makes the included file
- a sibling of the current top-level headline:
- end example
- Inclusion of only portions of files are specified using ranges parameter with
- example
- #+INCLUDE: "~/.emacs" :lines "5-10"
- r{Include lines 1 to 10, 10 excluded}
- #+INCLUDE: "~/.emacs" :lines "10-"
- end example
- Inclusions may specify a file-link to extract an object matched by
- footnote{Note that
- code{nil}. Therefore,
- pxref{Search options}).
- To extract only the contents of the matched object, set
- code{nil}. This will omit any planning lines or property
- drawers. The ranges for
- example
- #+INCLUDE: "./paper.org::#theory" :only-contents t
- samp{theory}}
- #+INCLUDE: "./paper.org::mytable"
- r{Include the first 20 lines of the headline named
- end example
- kbd
- item C-c '
- Visit the include file at point.
- node Macro replacement
- cindex macro replacement, during export
- example
- #+MACRO: name replacement text $1, $2 are arguments
- noindent which can be referenced using
- {{name(arg1, arg2)}footnote{Since commas separate the
- arguments, commas within arguments have to be escaped with the backslash
- character. So only those backslash characters before a comma need escaping
- with another backslash character.}.
- Org recognizes macro references in following Org markup areas: paragraphs,
- headlines, verse blocks, tables cells and lists. Org also recognizes macro
- references in keywords, such as code{#+TITLE},
- code{#+DATE}, and for some back-end specific export
- options.
- Org comes with following pre-defined macros:
- code
- {{title}
- itemx {}}
- {{email}
- cindex title, macro
- cindex email, macro
- Org replaces these macro references with available information at the time of
- export.
- {{date}
- itemx {var{FORMAT})}
- cindex date, macro
- This macro refers to the var{FORMAT} is an optional
- argument to the {{date}
- code{#+DATE} is a single timestamp.
- code{format-time-string}.
- {{time(}}
- {{modification-time(var{VC})}
- cindex time, macro
- var{FORMAT} is a string understood by
- code{modification-time} macro is non-file{vc.el} to
- retrieve the document's modification time from the version control
- system. Otherwise Org reads the file attributes.
- {{input-file}
- cindex input file, macro
- This macro refers to the filename of the exported file.
- {{property(}}
- {{property(var{SEARCH-OPTION})}
- cindex property, macro
- This macro returns the value of property
- var{SEARCH-OPTION} (
- end table
- The surrounding brackets can be made invisible by setting
- code{nil}.
- Org expands macros at the very beginning of the export process.
- section Comment lines
- cindex comment lines
- Lines starting with zero or more whitespace characters followed by one
- cindex #+BEGIN_COMMENT
- Likewise, regions surrounded by
- samp{#+END_COMMENT} are not exported.
- samp{COMMENT} keyword at the beginning of an entry, but after any
- other keyword or priority cookie, comments out the entire subtree. In this
- case, the subtree is not exported and no code block within it is executed
- either
- pxref{Export settings}) instead.}. The command below helps changing the
- comment status of a headline.
- kbd
- item C-c ;
- Toggle the
- end table
- section ASCII/Latin-1/UTF-8 export
- cindex Latin-1 export
- vindex org-ascii-text-width
- On export, Org fills and justifies text according to the text width set in
- vindex org-ascii-links-to-notes
- Org exports links using a footnote-like style where the descriptive part is
- in the text and the link is in a note before the next heading. See the
- variable
- subheading ASCII export commands
- kbd
- file{.txt} extension. For
- file{myfile.txt}, overwriting without warning. For
- file{myfile.txt.txt} in order to prevent
- data loss.
- end table
- pxref{Export
- settings}).
- samp
- cindex #+SUBTITLE (ASCII)
- The document subtitle. For long subtitles, use multiple
- end table
- pxref{Export settings}.
- cindex #+ASCII
- example
- Inline text ascii:and additional text within a paragraph.
- #+ASCII: Some text
- #+BEGIN_EXPORT ascii
- Org exports text in this block only when using ASCII back-end.
- #+END_EXPORT
- subheading ASCII specific attributes
- cindex horizontal rules, in ASCII export
- ASCII back-end recognizes only one attribute,
- example
- #+ATTR_ASCII: :width 10
- -----
- subheading ASCII special blocks
- cindex #+BEGIN_JUSTIFYLEFT
- code{#+BEGIN_CENTER} blocks (
- example
- #+BEGIN_JUSTIFYLEFT
- It's just a jump to the left...
- #+END_JUSTIFYLEFT
- #+BEGIN_JUSTIFYRIGHT
- ...and then a step to the right.
- #+END_JUSTIFYRIGHT
- node Beamer export
- cindex Beamer export
- Org uses
- emph{Beamer} is a
- menu
- * Beamer export commands:: For creating Beamer documents.
- * Beamer specific export settings:: For customizing Beamer export.
- * Sectioning Frames and Blocks in Beamer:: For composing Beamer slides.
- * Beamer specific syntax:: For using in Org documents.
- * Editing support:: For using helper functions.
- * A Beamer example:: A complete presentation.
- node Beamer export commands
- table
- orgcmd{C-c C-e l b,org-beamer-export-to-latex}
- Export as file{.tex} extension. For
- file{myfile.tex}, overwriting without warning.
- orgcmd{C-c C-e l P,org-beamer-export-to-pdf}
- Export as
- item C-c C-e l O
- Export as
- end table
- subsection Beamer specific export settings
- Beamer export back-end has several additional keywords for customizing Beamer
- output. These keywords work similar to the general options settings
- (
- table
- item BEAMER_THEME
- vindex org-beamer-theme
- The Beamer layout theme (
- smallexample
- #+BEAMER_THEME: Rochester [height=20pt]
- item BEAMER_FONT_THEME
- item BEAMER_INNER_THEME
- item BEAMER_OUTER_THEME
- item BEAMER_HEADER
- samp{hyperref}
- settings.
- cindex #+DESCRIPTION (Beamer)
- The document description. For long descriptions, use multiple
- samp{hyperref} inserts
- code{org-latex-hyperref-template} to
- configure document metadata. Use
- item KEYWORDS
- code{#+KEYWORDS} lines if necessary. By default,
- code{#+KEYWORDS} as metadata. Use
- code{org-latex-title-command} to configure
- typesetting of keywords as part of front matter.
- cindex #+SUBTITLE (Beamer)
- code{org-beamer-subtitle-format}
- string. Use
- code{org-latex-title-command} to configure typesetting of
- subtitle as part of front matter.
- node Sectioning Frames and Blocks in Beamer
- itemize
- item
- code{org-beamer-frame-level} or code{OPTIONS} line
- (
- cindex property, BEAMER_ENV
- Org overrides headlines to frames conversion for the current tree of an Org
- file if it encounters the code{frame} or
- code{org-beamer-frame-level} happens
- to be for that headline level in the Org tree. In Beamer terminology, a
- item
- vindex org-beamer-environments-extra
- Org exports a Beamer frame's objects as
- code{BEAMER_ENV} property is
- setcode{BEAMER_ENV} is set, Org export adds
- code{org-beamer-environments-default}. To add more values, see
- item
- code{BEAMER_ENV} is set to
- code{note}, Org exports the entry as a note within
- the frame or between frames, depending on the entry's heading level. When
- set to
- code{againframe}, Org exports the entry with
- code{BEAMER_REF} property mandatory because
- code{ignoreheading} is set, Org export ignores the entry's headline but
- not its content. This is useful for inserting content between frames. It is
- also useful for properly closing a
- end itemize
- cindex property, BEAMER_OPT
- When
- code{BEAMER_OPT} to set any options applicable to the current Beamer frame
- or block. The Beamer export back-end wraps with appropriate angular or
- square brackets. It also adds the
- cindex property, BEAMER_COL
- To create a column on the Beamer slide, use the
- code{BEAMER_COL} to a
- decimal number representing the fraction of the total text width. Beamer
- export uses this value to set the column's width and fills the column with
- the contents of the Org entry. If the Org entry has no specific environment
- defined, Beamer export ignores the heading. If the Org entry has a defined
- environment, Beamer export uses the heading as title. Behind the scenes,
- Beamer export automatically handles
- code{BEAMER_ENV} property.
- subsection Beamer specific syntax
- Since Org's Beamer export back-end is an extension of the
- LaTeX{} specific syntax---for example,
- samp{#+ATTR_LATEX:}. LaTeX{} export}, for details.
- Beamer export wraps the table of contents generated with
- code{OPTION} keyword in a
- code{TOC} keyword (
- example
- #+TOC: headlines [currentsection]
- cindex #+BEAMER
- example
- #+BEAMER: \pause
- #+BEGIN_EXPORT beamer
- Only Beamer export back-end will export this line.
- #+END_BEAMER
- Text beamer:some code within a paragraph.
- code{bold}, code{link},
- code{target} types. Enclose the value in angular
- brackets and place the specification at the beginning the object as shown in
- this example:
- end example
- code{ATTR_BEAMER} keyword with the following
- attributes from Beamer configurations:
- code{:overlay} for specifying Beamer overlays in angular
- or square brackets, and
- example
- #+ATTR_BEAMER: :environment nonindentlist
- - item 1, not indented
- - item 2, not indented
- - item 3, not indented
- example
- #+ATTR_BEAMER: :overlay <+->
- - item 1
- - item 2
- example
- #+ATTR_BEAMER: :options [Lagrange]
- Let $G$ be a finite group, and let $H$ be
- a subgroup of $G$. Then the order of $H$ divides the order of $G$.
- node Editing support
- code{org-beamer-mode} is a special minor mode for faster editing of
- Beamer documents.
- end example
- kbd
- code{org-beamer-mode} provides this key for quicker selections in Beamer
- normal environments, and for selecting the
- end table
- subsection A Beamer example
- Here is an example of an Org document ready for Beamer export.
- end example
- section HTML export
- menu
- * HTML Export commands:: Invoking HTML export
- * HTML Specific export settings:: Settings for HTML export
- * HTML doctypes:: Exporting various (X)HTML flavors
- * HTML preamble and postamble:: Inserting preamble and postamble
- * Quoting HTML tags:: Using direct HTML in Org files
- * Links in HTML export:: Interpreting and formatting links
- * Tables in HTML export:: Formatting and modifying tables
- * Images in HTML export:: Inserting figures with HTML output
- * Math formatting in HTML export:: Handling math equations
- * Text areas in HTML export:: Showing an alternate approach, an example
- * CSS support:: Styling HTML output
- * JavaScript support:: Folding scripting in the web browser
- node HTML Export commands
- table
- orgcmd{C-c C-e h h,org-html-export-to-html}
- Export as HTML file with a file{myfile.org},
- Org exports to kbd{C-c C-e
- h o} Exports to HTML and opens it in a web browser.
- end table
- subsection HTML Specific export settings
- HTML export has a number of keywords, similar to the general options settings
- described in
- table
- item DESCRIPTION
- code{#+DESCRIPTION} lines. The exporter takes care of wrapping the lines
- properly.
- cindex #+HTML_DOCTYPE
- code{org-html-doctype}).
- cindex #+HTML_CONTAINER
- samp{div}, for wrapping sections and
- elements (
- item HTML_LINK_HOME
- vindex org-html-link-home
- The URL for home link (
- item HTML_LINK_UP
- vindex org-html-link-up
- The URL for the up link of exported HTML pages (
- item HTML_MATHJAX
- vindex org-html-mathjax-options
- Options for MathJax (
- LaTeX{} math in HTML documents.
- item HTML_HEAD
- vindex org-html-head
- Arbitrary lines for appending to the HTML document's head
- (
- item HTML_HEAD_EXTRA
- vindex org-html-head-extra
- More arbitrary lines for appending to the HTML document's head
- (
- item KEYWORDS
- code{#+KEYWORDS} lines.
- cindex #+LATEX_HEADER (HTML)
- Arbitrary lines for appending to the preamble; HTML exporter appends when
- transcoding pxref{Math formatting in HTML
- export}).
- cindex #+SUBTILE (HTML)
- The document's subtitle. HTML exporter formats subtitle if document type is
- samp{subtitle} class.
- node HTML doctypes
- vindex org-html-doctype
- code{org-html-doctype} variable for different (X)HTML variants.
- Depending on the variant, the HTML exporter adjusts the syntax of HTML
- conversion accordingly. Org includes the following ready-made variants:
- item
- ``html4-strict''
- item
- ``html4-frameset''
- item
- ``xhtml-transitional''
- item
- ``xhtml-11''
- item
- ``xhtml5''
- noindent See the variable
- vindex org-html-html5-fancy
- code{org-html-html5-fancy} to
- non-code{OPTIONS} line in the file to set
- example
- #+BEGIN_aside
- Lorem ipsum
- #+END_aside
- example
- <aside>
- <p>Lorem ipsum</p>
- </aside>
- example
- #+ATTR_HTML: :controls controls :width 350
- #+BEGIN_video
- #+HTML: <source src="movie.mp4" type="video/mp4">
- #+HTML: <source src="movie.ogg" type="video/ogg">
- Your browser does not support the video tag.
- #+END_video
- example
- <video controls="controls" width="350">
- <source src="movie.mp4" type="video/mp4">
- <source src="movie.ogg" type="video/ogg">
- <p>Your browser does not support the video tag.</p>
- </video>
- vindex org-html-html5-elements
- When special blocks do not have a corresponding HTML5 element, the HTML
- exporter reverts to standard translation (see
- code{#+BEGIN_lederhosen}
- exports to
- samp{<section>} or
- code{HTML_CONTAINER} property for the headline.
- subsection HTML preamble and postamble
- vindex org-html-postamble
- vindex org-html-postamble-format
- vindex org-export-creator-string
- code{org-html-preamble} is
- code{org-html-preamble-format} for
- the format string.
- Set
- code{org-html-preamble} is set
- code{org-html-postamble} is
- code{org-html-postamble} to
- code{org-html-postamble-format} variable. The HTML exporter will not insert
- a postamble if code{nil}.
- subsection Quoting HTML tags
- The HTML export back-end transforms samp{>} to
- samp{>}. To include raw HTML code in the Org file so the HTML export
- back-end can insert that HTML code in the output, use this inline syntax:
- samp{html:<b>bold
- texthtml:</b>}. For larger raw HTML code blocks, use these HTML
- export code blocks:
- cindex #+BEGIN_EXPORT html
- end example
- cindex #+BEGIN_EXPORT html
- end example
- subsection Links in HTML export
- cindex internal links, in HTML export
- vindex org-html-link-org-files-as-html
- The HTML export back-end transforms Org's internal links (
- pxref{Radio
- targets}) similarly. For Org links to external files, the back-end
- transforms the links to
- file{.org} files, the back-end automatically changes
- the file extension to
- file{.org} files have an equivalent
- code{org-html-link-org-files-as-html} to
- samp{id:}-based links in the HTML
- output. For more about linking files when publishing to a directory,
- code{#+ATTR_HTML} lines to specify new format attributes
- to code{<img>} tags. This example shows changing the link's
- code{style}:
- example
- #+ATTR_HTML: :title The Org mode homepage :style color:red;
- [[http://orgmode.org]]
- node Tables in HTML export
- cindex tables, in HTML
- code{org-html-table-default-attributes} when
- exporting Org tables to HTML. By default, the exporter does not draw frames
- and cell borders. To change for this for a table, use the following lines
- before the table in the Org file:
- cindex #+ATTR_HTML
- end example
- The HTML export back-end preserves column groupings in Org tables
- (
- table
- vindex org-html-table-align-individual-fields
- code{nil} attaches style attributes for alignment to each table field.
- item org-html-table-caption-above
- Non-
- vindex org-html-table-data-tags
- vindex org-html-table-default-attributes
- vindex org-html-table-header-tags
- vindex org-html-table-row-tags
- vindex org-html-table-use-header-tags-for-first-column
- code{nil} formats column one in tables with header tags.
- node Images in HTML export
- cindex images, inline in HTML
- vindex org-html-inline-images
- The HTML export back-end has features to convert Org image links to HTML
- inline images and HTML clickable image links.
- When the link in the Org file has no description, the HTML export back-end by
- default in-lines that image. For example:
- samp{[[file:myimg.jpg][the image]]} links to the text,
- code{org-html-inline-images}.
- On the other hand, if the description part of the Org link is itself another
- link, such as code{http:} URL pointing to an image, the HTML
- export back-end in-lines this image and links to the main image. This Org
- syntax enables the back-end to link low-resolution thumbnail to the
- high-resolution version of the image, as shown in this example:
- end example
- To change attributes of in-lined images, use
- code{alt} and
- cindex #+CAPTION
- example
- #+CAPTION: A black cat stalking a spider
- #+ATTR_HTML: :alt cat/spider image :title Action! :align right
- [[./img/a.jpg]]
- noindent
- The HTML export back-end copies the
- node Math formatting in HTML export
- cindex MathJax
- cindex dvisvgm
- LaTeX{} math snippets (LaTeX{} fragments}) can be displayed in two
- different ways on HTML pages. The default is to use
- footnote{By default Org loads MathJax from
- uref{http://www.mathjax.org, MathJax}.}. Some MathJax display
- options can be configured via
- smallexample
- #+HTML_MATHJAX: align: left indent: 5em tagside: left font: Neo-Euler
- noindent See the docstring of
- code{org-html-mathjax-template}.
- If you prefer, you can also request that
- file{dvipng} program,
- file{imagemagick} suite is available on your system. You can still get
- this processing with
- end example
- end example
- or:
- end example
- subsection Text areas in HTML export
- code{:textarea}. The advantage of this approach was that copying
- and pasting was built into browsers with simple JavaScript commands. Even
- editing before pasting was made simple.
- The HTML export back-end can create such text areas. It requires an
- code{:textarea} option. This must be followed by either an
- code{src} code block. Other Org block types will not
- honor the
- code{:width} and code{#+ATTR_HTML:} line.
- end example
- subsection CSS support
- cindex HTML export, CSS
- vindex org-html-tag-class-prefix
- You can modify the CSS style definitions for the exported file. The HTML
- exporter assigns the following special CSS classes
- code{org-html-todo-kwd-class-prefix} and
- example
- p.author
- r{publishing date}
- p.creator
- r{document title}
- .subtitle
- r{TODO keywords, all not-done states}
- .done
- r{each TODO keyword also uses a class named after itself}
- .timestamp
- r{keyword associated with a timestamp, like SCHEDULED}
- .timestamp-wrapper
- r{tag in a headline}
- ._HOME
- r{target for links}
- .linenr
- r{for highlighting referenced code lines}
- div.outline-N
- r{extra div for text at outline level N}
- .section-number-N
- r{label like "Figure 1:"}
- .table-number
- r{label like "Listing 1:"}
- div.figure
- r{formatted source code}
- pre.example
- r{verse paragraph}
- div.footnotes
- r{footnote definition paragraph, containing a footnote}
- .footref
- r{footnote number in footnote definition (always <sup>)}
- .org-svg file{.svg} image}
- vindex org-html-style-default
- vindex org-html-head
- cindex #+HTML_INCLUDE_STYLE
- The HTML export back-end includes a compact default style in each exported
- HTML file. To override the default style with another style, use these
- keywords in the Org file. They will replace the global defaults the HTML
- exporter uses.
- cindex #+HTML_HEAD_EXTRA
- end example
- To just turn off the default style, customize
- example
- #+OPTIONS: html-style:nil
- noindent
- For longer style definitions, either use several
- code{#+HTML_HEAD_EXTRA} lines, or use code{</style>} blocks
- around them. Both of these approaches can avoid referring to an external
- file.
- In order to add styles to a sub-tree, use the
- code{:CUSTOM_ID:}
- property.
- Never change the
- c FIXME: More about header and footer styles
- node JavaScript support
- cindex Rose, Sebastian
- Sebastian Rose has written a JavaScript program especially designed to
- enhance the web viewing experience of HTML files created with Org. This
- program enhances large files in two different ways of viewing. One is an
- kbd{n} and
- kbd{?} for an overview of the available keys). The second
- one has a
- url{http://orgmode.org/org-info.js} and the
- documentation at
- url{http://orgmode.org}, but for reliability, prefer installing
- it on your own web server.
- To use this program, just add this line to the Org file:
- example
- #+INFOJS_OPT: view:info toc:nil
- noindent
- The HTML header now has the code needed to automatically invoke the script.
- For setting options, use the syntax from the above line for options described
- below:
- r{The path to the script. The default grabs the script from}
- url{http://orgmode.org/org-info.js}, but you might want to have}
- samp{../scripts/org-info.js}.}
- view:
- r{Info-like interface with one section per page.}
- overview
- r{Folding interface, starting with all headlines visible.}
- showall
- r{Maximum headline level that will still become an independent}
-
- r{code{H} switch in
- r{If this is smaller than in
- r{info/folding section can still contain child headlines.}
- toc: emph{initially} be visible?}
- code{nil}, you can always get to the "toc" with
- r{The depth of the table of contents. The defaults are taken from}
- code{org-export-headline-levels} and
- r{Does the CSS of the page specify a fixed position for the "toc"?}
-
- r{Should there be short contents (children) in each section?}
- code{above} if the section should be above initial text.}
- mouse:
- r{samp{#cccccc}.}
- buttons: code{nil} (the}
-
- end example
- vindex org-html-infojs-options
- code{org-html-infojs-options}. If you want the script to always apply to
- your pages, configure the variable
- node
- section
- cindex
- cindex PDF export
- The
- LaTeX{} document classes, generate documents using
- alternate
- code{org-latex-compiler}; for build sequences, see
- code{org-latex-default-packages-alist} and
- LaTeX{} export back-end: it is sensitive to
- blank lines in the Org document. That's because
- menu
- * LaTeX{} and PDF documents.
- * LaTeX{} back-end.
- *
- LaTeX{} code:: Directly in the Org document.
- * Tables in
- LaTeX{} export:: Attributes specific to images.
- * Plain lists in
- LaTeX{} export:: Attributes specific to source code blocks.
- * Example blocks in
- LaTeX{} export:: Attributes specific to special blocks.
- * Horizontal rules in
- end menu
- LaTeX{} export commands
- LaTeX{} export commands
- kbd
- LaTeX{} file with a file{myfile.org},
- Org exports to kbd{C-c C-e
- l l} Exports to
- orgcmd{C-c C-e l L,org-latex-export-as-latex}
- Export to a temporary buffer. Do not create a file.
- LaTeX{} file and convert it to PDF file.
- LaTeX{} file and convert it to PDF, then open the PDF using the default viewer.
- vindex org-latex-compiler
- vindex org-latex-default-packages-alist
- The LaTeX{} engines:
- samp{xelatex}, and
- LaTeX{} files with different compilers, packages, and output options. The
- code{org-latex-compiler} variable or the
- code{org-latex-default-packages-alist} for loading packages with certain
- compilers. Also see
- footnote{This does not allow setting different bibliography
- compilers for different files. However, ``smart''
- samp{latexmk}, can select the correct bibliography
- compiler.}.
- LaTeX{} specific export settings
- LaTeX{} specific export settings
- The
- LaTeX{} output. Setting these keywords works similar to the general options
- (
- table
- item DESCRIPTION
- LaTeX{})
- The document's description. The description along with author name,
- keywords, and related file metadata are inserted in the output file by the
- code{org-latex-hyperref-template} for
- customizing metadata items. See
- code{#+DESCRIPTION} lines for long descriptions.
- cindex #+LATEX_CLASS
- vindex org-latex-classes
- This is code{article},
- code{book}, and so on, which contain predefined preamble and headline level
- mapping that the
- code{org-latex-default-class} variable. Org has
- code{org-latex-classes}.
- cindex #+LATEX_CLASS_OPTIONS
- Options the LaTeX{} document
- class.
- cindex #+LATEX_COMPILER
- samp{pdflatex}, samp{lualatex}, for
- producing the PDF (
- item LATEX_HEADER
- vindex org-latex-classes
- Arbitrary lines to add to the document's preamble, before the
- code{org-latex-classes} for adjusting the structure and order
- of the
- item LATEX_HEADER_EXTRA
- vindex org-latex-classes
- Arbitrary lines to add to the document's preamble, before the
- code{org-latex-classes} for adjusting the structure and order
- of the
- item KEYWORDS
- LaTeX{})
- The keywords for the document. The description along with author name,
- keywords, and related file metadata are inserted in the output file by the
- code{org-latex-hyperref-template} for
- customizing metadata items. See
- code{#+KEYWORDS} lines if necessary.
- cindex #+SUBTITLE (
- vindex org-latex-subtitle-separate
- code{org-latex-subtitle-format}. If
- code{nil}, it is typed as part of the
- code{org-latex-hyperref-template} for customizing metadata items. See
- end table
- The following sections have further details.
- LaTeX{} header and sectioning
- LaTeX{} header and sectioning structure
- LaTeX{} class
- LaTeX{} sectioning structure
- LaTeX{} header
- LaTeX{} files
- LaTeX{} export
- The
- LaTeX{} headlines. The remaining Org levels are exported as
- code{enumerate} lists. To change this globally for the
- cut-off point between levels and lists, (
- LaTeX{} export back-end uses the
- vindex org-latex-default-class
- vindex org-latex-default-packages-alist
- code{org-latex-default-class}.
- To change the default class locally in an Org file, add option lines
- code{EXPORT_LATEX_CLASS}. The
- class name entered here must be valid member of
- code{org-latex-default-packages-alist} and
- cindex #+LATEX_CLASS
- cindex property, EXPORT_LATEX_CLASS
- LaTeX{} export back-end sends the
- code{EXPORT_LATEX_CLASS_OPTIONS} property as options to the
- code{\documentclass} macro. The options and the syntax for specifying them,
- including enclosing them in square brackets, follow
- example
- #+LATEX_CLASS_OPTIONS: [a4paper,11pt,twoside,twocolumn]
- cindex #+LATEX_HEADER
- LaTeX{} export back-end appends values from
- code{LATEX_HEADER_EXTRA} keywords to the
- code{org-latex-classes} explains in more detail. Also note that
- code{LATEX_HEADER_EXTRA} to the header when
- previewing pxref{Previewing
- example
- #+LATEX_CLASS: article
- #+LATEX_CLASS_OPTIONS: [a4paper]
- #+LATEX_HEADER: \usepackage}
- * Headline 1
- some text
- * Headline 2
- some more text
- node Quoting
- subsection Quoting
- LaTeX{} export back-end can insert any arbitrary
- pxref{Embedded
- symbols:
- LaTeX{} export
- end example
- Inserting as one or more keyword lines in the Org file:
- example
- #+LATEX: any arbitrary LaTeX code
- cindex #+BEGIN_EXPORT latex
- end example
- LaTeX{} export
- LaTeX{} export
- LaTeX{} export
- LaTeX{} export back-end can pass several
- pxref{Images and
- tables}), the other valid
- table
- item :mode
- LaTeX{} export back-end wraps the table differently depending on the
- mode for accurate rendering of math symbols. Mode is either
- code{math}, code{verbatim}. For
- code{inline-math} mode,
- LaTeX{} export
- back-end determines the default mode from
- LaTeX{} export back-end
- merges contiguous tables in the same mode into a single environment.
- vindex org-latex-default-table-environment
- Set the default LaTeX{} export back-end
- to use when exporting Org tables. Common
- code{tabularx}, code{array},
- code{bmatrix}. For packages, such as
- code{tabu}, or any newer replacements, include them in the
- LaTeX{} export back-end can
- insert the appropriate load package headers in the converted
- code{org-latex-packages-alist} variable for
- configuring these packages for
- item :caption
- Use
- pxref{Images and tables}). For custom captions, use
- LaTeX{} code.
- code{#+CAPTION} value.
- itemx :placement
- The table environments by default are not floats in
- code{:float} with one of the following options:
- code{multicolumn}, code{nil}. Note that
- LaTeX{} floats can
- also have additional layout
- code{[h t b p ! H]} permissions specified in square brackets. Note
- that for LaTeX{} export back-end ignores
- item :align
- itemx :width
- The
- item :spread
- When code{nil}, the
- code{:width} for code{longtabu}
- environments. code{:width} is not set.
- itemx :center
- vindex org-latex-tables-booktabs
- code{:booktabs} brings in modern
- typesetting enhancements to regular tables. The
- code{org-latex-packages-alist}.
- code{:rmlines} removes all but the very first
- horizontal line made of ASCII characters from "table.el" tables only.
- itemx :math-suffix
- LaTeX{} export back-end inserts
- LaTeX{} export back-end inserts
- LaTeX{} export back-end inserts
- code{:math-arguments} comes in use
- for matrix macros that require more than one argument, such as
- end table
- example
- #+ATTR_LATEX: :environment longtable :align l|lp}r|l
- | ..... | ..... |
- | ..... | ..... |
- #+ATTR_LATEX: :mode math :environment bmatrix :math-suffix \times
- | a | b |
- | c | d |
- #+ATTR_LATEX: :mode math :environment bmatrix
- | 1 | 2 |
- | 3 | 4 |
- LaTeX{} command
- {HeadingA{HeadingB
- example
- #+ATTR_LATEX: :caption \bicaption}}
- | ..... | ..... |
- | ..... | ..... |
- node Images in
- subsection Images in
- cindex images, inline in
- cindex inlining images in
- cindex #+ATTR_LATEX, in images
- The
- samp{[[file:img.jpg]]} or
- LaTeX{} export back-end uses
- footnote{
- code{\input} macro wrapped within
- a
- code{:width},
- code{:options}, use this syntax:
- end example
- For custom commands for captions, use the
- code{#+CAPTION} value:
- {HeadingA{HeadingB
- end example
- When captions follow the method as described in
- LaTeX{} export back-end wraps the picture in a floating
- code{:float} attribute to one of the following:
- minus
- code{t}: for a standard
- item
- code{figure*} environment.
- code{wrap}: for text to flow around the image on the right; the figure
- occupies the left half of the page.
- code{sideways}: for a new page with the image sideways, rotated ninety
- degrees, in a code{:placement}
- setting.
- code{nil}: to avoid a
- end itemize
- code{placement} attribute to modify a floating environment's placement.
- {r{0.4\textwidth
- end example
- cindex center image (
- cindex image, centering (
- LaTeX{} export back-end centers all images by default. Setting
- code{nil} disables centering. To disable
- centering globally, set code{t}.
- Set the code{nil} value for the
- code{\includegraphics} macro.
- LaTeX{} export
- LaTeX{} export
- LaTeX{} export
- LaTeX{} export back-end accepts the
- code{:options} attributes for plain lists. Both attributes work together
- for customizing lists, as shown in the examples:
- {enumitem
- {{,{, and
- end example
- Since
- samp{enumitem} in
- example
- #+LATEX_HEADER: \usepackage}
- #+LATEX_HEADER: \renewlist}}}
- #+LATEX_HEADER: \setlist[itemize]}
- - One
- - Two
- - Three
- - Four
- - Five
- node Source blocks in
- subsection Source blocks in
- cindex source blocks, in
- cindex #+ATTR_LATEX, in source blocks
- The
- code{:float} and
- code{:float}:
- minus
- code{t}: makes a source block float; by default floats any source block with
- a caption.
- code{multicolumn}: spans the source block across multiple columns of a page.
- code{nil}: avoids a
- end itemize
- end example
- vindex org-latex-minted-options
- The code{:options} to
- code{:options} are set for Minted. Minted is a source
- code highlighting
- example
- #+ATTR_LATEX: :options commentstyle=\bfseries
- #+BEGIN_SRC emacs-lisp
- (defun Fib (n)
- (if (< n 2) n (+ (Fib (- n 1)) (Fib (- n 2)))))
- #+END_SRC
- code{org-latex-listings-options} and
- node Example blocks in
- subsection Example blocks in
- cindex example blocks, in
- cindex verbatim blocks, in
- cindex #+ATTR_LATEX, in example blocks
- The
- samp{verbatim} environment. To change this behavior to use another
- environment globally, specify an appropriate export filter (
- code{:environment} parameter to specify a custom environment.
- end example
- LaTeX{} export
- LaTeX{} export
- LaTeX{} export
- LaTeX{} export
- LaTeX{} export
- LaTeX{} export back-end makes
- a special environment of the same name. The back-end also takes
- example
- #+BEGIN_abstract
- We demonstrate how to solve the Syracuse problem.
- #+END_abstract
- #+ATTR_LATEX: :options [Proof of important theorem]
- #+BEGIN_proof
- ...
- Therefore, any even number greater than 2 is the sum of two primes.
- #+END_proof
- noindent
- exports to
- {abstract
- {abstract
- {proof
- {proof
- end example
- If you need to insert a specific caption command, use
- code{#+CAPTION} value, if any. For
- example:
- {HeadingA
- end example
- LaTeX{} export
- LaTeX{} export
- LaTeX{} export
- LaTeX{} export back-end converts horizontal rules by the specified
- code{:thickness} attributes. For example:
- end example
- section Markdown export
- code{md}, converts an Org file to a Markdown
- format, as defined at
- code{md} is built on top of the HTML back-end, any Org constructs not
- supported by Markdown, such as tables, the underlying
- pxref{HTML export}) converts them.
- table
- orgcmd{C-c C-e m m,org-md-export-to-markdown}
- Export to a text file with Markdown syntax. For
- file{myfile.md}, overwritten without warning.
- item C-c C-e m o
- Export as a text file with Markdown syntax, then open it.
- subheading Header and sectioning structure
- code{org-md-headline-style}, markdown export can generate headlines
- of both code{setext} types.
- code{setext} limits headline levels to six. Beyond these
- limits, the export back-end converts headlines to lists. To set a limit to a
- level before the absolute limit (
- c begin opendocument
- section OpenDocument Text export
- cindex OpenDocument
- cindex LibreOffice
- The ODT export back-end handles creating of OpenDocument Text (ODT) format
- files. The format complies with
- footnote{
- menu
- * Pre-requisites for ODT export:: Required packages.
- * ODT export commands:: Invoking export.
- * ODT specific export settings:: Configuration options.
- * Extending ODT export:: Producing file{.pdf} files.
- * Applying custom styles:: Styling the output.
- * Links in ODT export:: Handling and formatting links.
- * Tables in ODT export:: Org table conversions.
- * Images in ODT export:: Inserting images.
- * Math formatting in ODT export:: Formatting
- end menu
- subsection Pre-requisites for ODT export
- file{zip} program to create the final
- compressed ODT output. Check if
- file{zip}, export cannot finish.
- subsection ODT export commands
- cindex region, active
- cindex transient-mark-mode
- kbd
- cindex property EXPORT_FILE_NAME
- Export as OpenDocument Text file.
- code{org-odt-preferred-output-format} is specified, the ODT export
- back-end automatically converts the exported file to that format.
- file{myfile.org}, Org exports to
- code{transient-mark-mode}
- has to be turned on.
- If the selected region is a single tree, the ODT export back-end makes the
- tree head the document title. Incidentally,
- code{EXPORT_FILE_NAME} property, the ODT export back-end uses that for file
- name.
- vindex org-odt-preferred-output-format
- When
- xref{x-export-to-other-formats, , Automatically exporting to
- other formats}.
- node ODT specific export settings
- pxref{Export settings}).
- samp
- cindex #+DESCRIPTION (ODT)
- This is the document's description, which the ODT export back-end inserts as
- document metadata. For long descriptions, use multiple
- item KEYWORDS
- code{#+KEYWORDS} lines if
- necessary.
- cindex ODT_STYLES_FILE
- code{org-odt-styles-file} by default. See
- item SUBTITLE
- end table
- subsection Extending ODT export
- The ODT export back-end can produce documents in other formats besides ODT
- using a specialized ODT converter process. Its common interface works with
- popular converters to produce formats such as
- samp{csv}, to another format, say
- cindex
- cindex LibreOffice
- Customize code{unoconv},
- which is the ODT's preferred converter. Working installations of LibreOffice
- would already have
- xref{Configuring a document converter}.
- anchor{x-export-to-other-formats}
- samp{doc}, samp{rtf}, or
- code{org-odt-preferred-output-format} variable. This is one way to
- extend (
- subsubheading Converting between document formats
- vindex org-odt-convert
- kbd
- end table
- subsection Applying custom styles
- cindex template, custom
- The ODT export back-end comes with many OpenDocument styles (
- subsubheading Applying custom styles: the easy way
- item
- Create a sample
- example
- #+OPTIONS: H:10 num:t
- item
- Open the above file{Stylist}
- to locate the target styles, which typically have the
- file{.odt}) or
- OpenDocument Template (
- item
- vindex org-odt-styles-file
- Customize the variable
- pxref{x-overriding-factory-styles,,Overriding factory styles}.
- To apply and ODT style to a particular file, use the
- example
- #+ODT_STYLES_FILE: "/path/to/example.ott"
- example
- #+ODT_STYLES_FILE: ("/path/to/file.ott" ("styles.xml" "image/hdr.png"))
- end enumerate
- node Links in ODT export
- cindex links, in ODT export
- ODT export back-end creates native cross-references for internal links and
- Internet-style links for all other link types.
- A link with no description and pointing to a regular---un-itemized---outline
- heading is replaced with a cross-reference and section number of the heading.
- A {label: is replaced
- with a cross-reference and sequence number of the labeled entity.
- node Tables in ODT export
- cindex tables, in ODT export
- The ODT export back-end handles native Org mode tables (
- file{table.el} tables. Complex
- pxref{Column
- groups}). All tables are typeset to occupy the same width. The ODT export
- back-end honors any table alignments and relative widths for columns
- (
- cindex #+ATTR_ODT
- Specifying code{#+ATTR_ODT} line controls
- the width of the table. For example:
- end example
- On export, the above table takes 50% of text width area. The exporter sizes
- the columns in the ratio: 13:5:5:5:6. The first column is left-aligned and
- rest of the columns, right-aligned. Vertical rules separate the header and
- the last column. Horizontal rules separate the header and the last row.
- For even more customization, create custom table styles and associate them
- with a table using the xref{Customizing tables in
- ODT export}.
- subsection Images in ODT export
- cindex embedding images in ODT
- samp{[[file:img.jpg]]} or
- example
- [[file:img.png]]
- example
- [[./img.png]]
- subsubheading Embedding clickable images
- For clickable images, provide a link whose description is another link to an
- image file. For example, to embed a image
- uref{http://Orgmode.org} website, do the following
- end example
- cindex #+ATTR_ODT
- Control the size and scale of the embedded images with the
- cindex identify, ImageMagick
- file{identify}
- program or Emacs code{image-size} API. ImageMagick
- is the preferred choice for large file sizes or frequent batch operations.
- The back-end then converts the pixel dimensions using
- code{display-pixels-per-inch}, which can be
- tweaked for better results based on the capabilities of the output device.
- Here are some common image scaling operations:
- asis
- file{img.png} as a 10 cm x 10 cm image, do the following:
- end example
- file{img.png} at half its size, do the following:
- end example
- file{img.png} with a width of 10 cm while retaining the original
- height:width ratio, do the following:
- end example
- file{img.png} with a height of 10 cm while retaining the original
- height:width ratio, do the following
- end example
- subsubheading Anchoring of images
- samp{"as-char"},
- samp{"page"}. Set the preferred anchor using the
- code{#+ATTR_ODT} line.
- To create an image that is anchored to a page:
- end example
- subsection Math formatting in ODT export
- The ODT export back-end has special support built-in for handling math.
- LaTeX{} math snippets:: Embedding in
- end menu
- LaTeX{} math snippets
- LaTeX{} math snippets
- pxref{
- cindex MathML
- item MathML
- Add this line to the Org file. This option is activated on a per-file basis.
- end example
- With this option,
- LaTeX{}-to-MathML converter program. The
- resulting MathML fragments are then embedded as an OpenDocument Formula in
- the exported document.
- vindex org-latex-to-mathml-jar-file
- To specify the
- code{org-latex-to-mathml-convert-command} and
- footnote{See
- lisp
- (setq org-latex-to-mathml-convert-command
- "java -jar %j -unicode -force -df %o %I"
- org-latex-to-mathml-jar-file
- "/path/to/mathtoweb.jar")
- LaTeX{}MLuref{http://dlmf.nist.gov/LaTeXML/}.} use
- end lisp
- To quickly verify the reliability of the
- table
- item M-x org-odt-export-as-odf RET
- Convert a file{.odf}) file.
- LaTeX{} math snippet to an OpenDocument formula (
- end table
- cindex dvisvgm
- item PNG images
- Add this line to the Org file. This option is activated on a per-file basis.
- end example
- end example
- or:
- end example
- Under this option,
- file{dvipng} program, file{imagemagick}
- programs.
- node Working with MathML or OpenDocument formula files
- LaTeX{} math snippets in ODT documents is not reliable, there
- is one more option to try. Embed an equation by linking to its MathML
- (file{.odf}) file as shown
- below:
- end example
- or
- end example
- subsection Labels and captions in ODT export
- ODT format handles labeling and captioning of objects based on their
- types. Inline images, tables,
- example
- #+CAPTION: Bell curve
- #+LABEL: fig:SED-HR4049
- [[./img/a.png]]
- example
- Figure 2: Bell curve
- vindex org-odt-category-map-alist
- To modify the category component of the caption, customize the option
- samp{Illustration} instead of the default string
- lisp
- (setq org-odt-category-map-alist
- '(("__Figure__" "Illustration" "value" "Figure" org-odt--enumerable-image-p)))
- example
- Illustration 2: Bell curve
- node Literal examples in ODT export
- pxref{Literal examples})
- with full fontification. Internally, the ODT export back-end relies on
- samp{OrgSrc} prefix and inherit
- colors from the faces used by Emacs
- vindex org-odt-fontify-srcblocks
- For custom fontification styles, customize the
- vindex org-odt-create-custom-styles-for-srcblocks
- To turn off fontification of literal examples, customize the
- node Advanced topics in ODT export
- menu
- * Configuring a document converter:: Registering a document converter.
- * Working with OpenDocument style files:: Exploring internals.
- * Creating one-off styles:: Customizing styles, highlighting.
- * Customizing tables in ODT export:: Defining table templates.
- * Validating OpenDocument XML:: Debugging corrupted OpenDocument files.
- node Configuring a document converter
- cindex convert
- cindex converter
- The ODT export back-end works with popular converters with little or no extra
- configuration.
- enumerate
- vindex org-odt-convert-processes
- Add the name of the converter to the
- item Configure its capabilities
- anchor{x-odt-converter-capabilities} Specify which formats the converter can
- handle by customizing the variable
- item Choose the converter
- code{org-odt-convert-process}.
- node Working with OpenDocument style files
- cindex styles, custom
- anchor{x-factory-styles}
- code{org-odt-styles-dir}. The two files are:
- anchor{x-orgodtstyles-xml}
- file{OrgOdtStyles.xml}
- This file contributes to the samp{ODT}
- document. This file gets modified for the following purposes:
- item
- To control outline numbering based on user settings.
- file{htmlfontify.el} for fontification of code
- blocks.
- anchor{x-orgodtcontenttemplate-xml}
- file{OrgOdtContentTemplate.xml}
- This file contributes to the samp{ODT}
- document. The contents of the Org outline are inserted between the
- dots{}
- file{content.xml}, the
- file serves the following purposes:
- item
- It contains automatic styles for formatting of tables which are referenced by
- the exporter.
- samp{<text:sequence-decl>}samp{</text:sequence-decl>}
- elements that control numbering of tables, images, equations, and similar
- entities.
- end itemize
- subsubheading b) Overriding factory styles
- The following two variables control the location from where the ODT exporter
- picks up the custom styles and content template files. Customize these
- variables to override the factory styles used by the exporter.
- anchor{x-org-odt-styles-file}
- code{org-odt-styles-file}
- The ODT export back-end uses the file pointed to by this variable, such as
- enumerate
- file{styles.xml} file
- Use this file instead of the default
- item A file{.ott} file
- Use the
- item A file{.ott} file and a subset of files contained within them
- Use the
- samp{ODT} document.
- Use this option if the
- item
- file{styles.xml}
- anchor{x-org-odt-content-template-file}
- code{org-odt-content-template-file}
- Use this variable to specify the blank
- end itemize
- subsubheading Creating one-off styles
- The ODT export back-end can read embedded raw OpenDocument XML from the Org
- file. Such direct formatting are useful for one-off instances.
- item Embedding ODT tags as part of regular text
- Enclose OpenDocument syntax in
- example
- odt:<text:span text:style-name="Highlight">This is highlighted
- text</text:span>. But this is regular text.
- strong{Hint:} To see the above example in action, edit the
- pxref{x-orgodtstyles-xml,,Factory styles}) and add a custom
- example
- <style:style style:name="Highlight" style:family="text">
- <style:text-properties fo:background-color="#ff0000"/>
- </style:style>
- item Embedding a one-line OpenDocument XML
- The ODT export back-end can read one-liner options with
- example
- #+ODT: <text:p text:style-name="PageBreak"/>
- strong{Hint:} To see the above example in action, edit your
- pxref{x-orgodtstyles-xml,,Factory styles}) and add a
- custom
- example
- <style:style style:name="PageBreak" style:family="paragraph"
- style:parent-style-name="Text_20_body">
- <style:paragraph-properties fo:break-before="page"/>
- </style:style>
- item Embedding a block of OpenDocument XML
- The ODT export back-end can also read ODT export blocks for OpenDocument XML.
- Such blocks use the dots{}
- example
- #+BEGIN_EXPORT odt
- <text:p text:style-name="Text_20_body_20_bold">
- This paragraph is specially formatted and uses bold text.
- </text:p>
- #+END_EXPORT
- end enumerate
- subsubheading Customizing tables in ODT export
- cindex #+ATTR_ODT
- Override the default table format by specifying a custom table style with the
- pxref{Tables in ODT export}.
- This feature closely mimics the way table templates are defined in the
- OpenDocument-v1.2
- specification.url{http://docs.oasis-open.org/office/v1.2/OpenDocument-v1.2.html,
- OpenDocument-v1.2 Specification}}
- lisp
- (setq org-odt-table-styles
- (append org-odt-table-styles
- '(("TableWithHeaderRowAndColumn" "Custom"
- ((use-first-row-styles . t)
- (use-first-column-styles . t)))
- ("TableWithFirstRowandLastRow" "Custom"
- ((use-first-row-styles . t)
- (use-last-row-styles . t))))))
- example
- #+ATTR_ODT: :style TableWithHeaderRowAndColumn
- | Name | Phone | Age |
- | Peter | 1234 | 17 |
- | Anna | 4321 | 25 |
- samp{Custom} template and installed two table styles
- samp{TableWithFirstRowandLastRow}.
- samp{Custom Table Template} in
- pxref{x-orgodtcontenttemplate-xml,,Factory styles}. For adding new
- templates, define new styles here.
- To use this feature proceed as follows:
- item
- Create a table templatecode{<table:table-template>}
- element of the OpenDocument-v1.2 specification}
- A table template is set of samp{paragraph} styles for
- each of the following table cell categories:
- minus
- item First column
- item First row
- item Even row
- item Even column
- end itemize
- The names for the above styles must be chosen based on the name of the table
- template using a well-defined convention.
- The naming convention is better illustrated with an example. For a table
- template with the name
- multitable {Table cell type} {CustomEvenColumnTableCell} {CustomEvenColumnTableParagraph}
- tab
- tab
- item
- tab
- tab
- tab
- item First column
- samp{CustomFirstColumnTableCell}
- samp{CustomFirstColumnTableParagraph}
- tab
- tab
- item First row
- samp{CustomFirstRowTableCell}
- samp{CustomFirstRowTableParagraph}
- tab
- tab
- item Even row
- samp{CustomEvenRowTableCell}
- samp{CustomEvenRowTableParagraph}
- tab
- tab
- item Even column
- samp{CustomEvenColumnTableCell}
- samp{CustomEvenColumnTableParagraph}
- tab
- tab
- end multitable
- To create a table template with the name
- code{<office:automatic-styles>}...
- pxref{x-orgodtcontenttemplate-xml,,Factory
- styles}).
- footnote{See the attributes
- code{table:use-first-row-styles},
- code{table:use-first-column-styles},
- code{table:use-banding-rows-styles}, and
- code{<table:table>} element in
- the OpenDocument-v1.2 specification}
- code{org-odt-table-styles} and specify the following:
- minus
- item the set of cell styles in that template that are to be activated
- samp{TableWithHeaderRowAndColumn} and
- samp{Custom}. The styles achieve their intended
- effect by selectively activating the individual cell styles in that template.
- end lisp
- code{ATTR_ODT} line as shown below.
- end example
- node Validating OpenDocument XML
- file{.odt} file corruption.
- To verify if the
- file{.odt} files have to be decompressed using
- file{.odt} files are inforef{File Archives,,emacs}.
- The contents of file{.xml}. For general help with
- validation---and schema-sensitive editing---of XML files:
- vindex org-odt-schema-dir
- Customize
- file{.rnc} files and the needed schema-locating rules. The ODT export
- back-end takes care of updating the
- c end opendocument
- section Org export
- code{org} export back-end creates a normalized version of the Org document
- in current buffer. The exporter evaluates Babel code (
- subheading Org export commands
- kbd
- file{.org} extension. For
- file{myfile.org.org}, overwriting without warning.
- item C-c C-e O v
- Export to an Org file, then open it.
- node Texinfo export
- cindex Texinfo export
- The
- menu
- * Texinfo export commands:: Invoking commands.
- * Texinfo specific export settings:: Setting the environment.
- * Texinfo file header:: Generating the header.
- * Texinfo title and copyright page:: Creating preamble pages.
- * Texinfo
- end menu
- subsection Texinfo export commands
- table
- orgcmd{C-c C-e i t,org-texinfo-export-to-texinfo}
- Export as a Texinfo file with file{myfile.org},
- Org exports to
- orgcmd{C-c C-e i i,org-texinfo-export-to-info}
- Export to Texinfo format first and then process it to make an Info file. To
- generate other formats, such as DocBook, customize the
- end table
- subsection Texinfo specific export settings
- The Texinfo export back-end has several additional keywords for customizing
- Texinfo output. Setting these keywords works similar to the general options
- (
- table
- item SUBTITLE
- item SUBAUTHOR
- item TEXINFO_FILENAME
- item TEXINFO_CLASS
- vindex org-texinfo-default-class
- The default document class (
- code{org-texinfo-classes}.
- cindex #+TEXINFO_HEADER
- Arbitrary lines inserted at the end of the header.
- cindex #+TEXINFO_POST_HEADER
- Arbitrary lines inserted after the end of the header.
- cindex #+TEXINFO_DIR_CATEGORY
- The directory category of the document.
- cindex #+TEXINFO_DIR_TITLE
- The directory title of the document.
- cindex #+TEXINFO_DIR_DESC
- The directory description of the document.
- cindex #+TEXINFO_PRINTED_TITLE
- The printed title of the document.
- node Texinfo file header
- cindex #+TEXINFO_FILENAME
- After creating the header for a Texinfo file, the Texinfo back-end
- automatically generates a name and destination path for the Info file. To
- override this default with a more sensible path and name, specify the
- vindex org-texinfo-coding-system
- cindex #+TEXINFO_HEADER
- pxref{Export settings}) and encoding system as set in the
- code{#+TEXINFO_HEADER}
- keywords for each additional command in the header, for example:
- code}.
- Instead of repeatedly installing the same set of commands, define a class in
- code{#+TEXINFO_CLASS} keyword to that class.
- subsection Texinfo title and copyright page
- code{#+TITLE} and pxref{Export settings}). To replace the
- regular
- code{#+TEXINFO_PRINTED_TITLE} and
- cindex #+SUBAUTHOR
- If one code{#+SUBAUTHOR}
- keywords. They have to be set in raw Texinfo code.
- {tex,*{
- end example
- code{nil}
- code{copying} command at the beginning of the document. The heading
- itself does not appear in the structure of the document.
- Copyright information is printed on the back of the title page.
- end example
- samp{Top} node
- samp{Top} node
- cindex #+TEXINFO_DIR_TITLE
- code{#+TEXINFO_DIR_CATEGORY},
- code{#+TEXINFO_DIR_DESC} that establish where in the Info hierarchy the file
- fits.
- Here's an example that writes to the
- example
- #+TEXINFO_DIR_CATEGORY: Emacs
- #+TEXINFO_DIR_TITLE: Org Mode: (org)
- #+TEXINFO_DIR_DESC: Outline-based notes management and organizer
- node Headings and sectioning structure
- vindex org-texinfo-classes
- cindex #+TEXINFO_CLASS
- The Texinfo export back-end uses a pre-defined scheme to convert Org
- headlines to an equivalent Texinfo structuring commands. A scheme like this
- maps top-level headlines to numbered chapters tagged as
- code{unnumbered}.
- To override such mappings to introduce
- code{org-texinfo-classes}.
- Activate the new class with the
- code{org-texinfo-default-class}.
- If an Org headline's level has no associated Texinfo structuring command, or
- is below a certain threshold (
- cindex property, APPENDIX
- The Texinfo export back-end makes any headline with a non-
- code{:APPENDIX:} property into an appendix. This happens independent of the
- Org headline level or the
- cindex property, DESCRIPTION
- The Texinfo export back-end creates a menu entry after the Org headline for
- each regular sectioning structure. To override this with a shorter menu
- entry, use the pxref{Table of contents}).
- Texinfo menu entries also have an option for a longer
- example
- * Controlling Screen Display
- :PROPERTIES:
- :ALT_TITLE: Display
- :DESCRIPTION: Controlling Screen Display
- :END:
- node Indices
- cindex #+CINDEX
- cindex #+KINDEX
- cindex #+TINDEX
- code{#+CINDEX}, code{#+KINDEX},
- code{#+TINDEX}, and
- pxref{Quoting
- Texinfo code}).
- end example
- code{:INDEX:} property to samp{vr}. These abbreviations come
- from Texinfo that stand for concept index and variable index. The Texinfo
- manual has abbreviations for all other kinds of indexes. The back-end
- exports the headline as an unnumbered chapter or section command, and then
- inserts the index after its contents.
- end example
- subsection Quoting Texinfo code
- Use any of the following three methods to insert or escape raw Texinfo code:
- cindex #+BEGIN_EXPORT texinfo
- {Stallmantexinfo:
- end example
- subsection Plain lists in Texinfo export
- code{table}, which results in a table with
- two columns. To change this behavior, specify
- code{ftable} or
- inforef{Two-column Tables,,texinfo}.
- code{org-texinfo-def-table-markup}. To override the
- default highlight command, specify another one with the
- example
- #+ATTR_TEXINFO: :indic asis
- - foo :: This is the text for /foo/, with no highlighting.
- node Tables in Texinfo export
- cindex #+ATTR_TEXINFO, in tables
- When exporting tables, the Texinfo export back-end uses the widest cell width
- in each column. To override this and instead specify as fractions of line
- length, use the
- example
- #+ATTR_TEXINFO: :columns .5 .5
- | a cell | another cell |
- node Images in Texinfo export
- cindex #+ATTR_TEXINFO, in images
- Insert a file link to the image in the Org file, and the Texinfo export
- back-end inserts the image. These links must have the usual supported image
- extensions and no descriptions. To scale the image, use
- code{:height} attributes. For alternate text, use
- example
- #+ATTR_TEXINFO: :width 1in :alt Alternate i}
- [[ridt.pdf]]
- node Special blocks in Texinfo export
- cindex #+ATTR_TEXINFO, in special blocks
- The Texinfo export back-end converts special blocks to commands with the same
- name. It also adds any
- example
- #+attr_texinfo: :options org-org-export-to-org ...
- #+begin_defun
- A somewhat obsessive function.
- #+end_defun
- noindent
- becomes
- end example
- subsection A Texinfo example
- Here is a more detailed example Org file.
- example
- #+MACRO: version 2.0
- #+MACRO: updated last updated 4 March 2014
- #+OPTIONS: ':t toc:t author:t email:t
- #+TITLE: GNU Sample {}}
- #+AUTHOR: A.U. Thor
- #+EMAIL: bug-samplegnu.org
- #+LANGUAGE: en
- #+TEXINFO_FILENAME: sample.info
- #+TEXINFO_HEADER: syncodeindex pg cp
- #+TEXINFO_DIR_CATEGORY: Texinfo documentation system
- #+TEXINFO_DIR_TITLE: sample: (sample)
- #+TEXINFO_DIR_DESC: Invoking sample
- #+TEXINFO_PRINTED_TITLE: GNU Sample
- #+SUBTITLE: for version {}}, {}}
- * Copying
- :PROPERTIES:
- :COPYING: t
- :END:
- This manual is for GNU Sample (version {}},
- {}}), which is an example in the Texinfo documentation.
- Copyright texinfo:copyright} 2013 Free Software Foundation,
- Inc.
- #+BEGIN_QUOTE
- Permission is granted to copy, distribute and/or modify this
- document under the terms of the GNU Free Documentation License,
- Version 1.3 or any later version published by the Free Software
- Foundation; with no Invariant Sections, with no Front-Cover Texts,
- and with no Back-Cover Texts. A copy of the license is included in
- the section entitled "GNU Free Documentation License".
- #+END_QUOTE
- * Invoking sample
- #+PINDEX: sample
- #+CINDEX: invoking command}
- This is a sample manual. There is no sample program to invoke, but
- if there were, you could see its basic usage and command line
- options here.
- * GNU Free Documentation License
- :PROPERTIES:
- :APPENDIX: t
- :END:
- #+TEXINFO: include fdl.texi
- * Index
- :PROPERTIES:
- :INDEX: cp
- :END:
- node iCalendar export
- cindex iCalendar export
- vindex org-icalendar-use-deadline
- vindex org-icalendar-categories
- code{org-icalendar-include-todo} variable. The
- back-end exports plain timestamps as VEVENT, TODO items as VTODO, and also
- create events from deadlines that are in non-TODO items. The back-end uses
- the deadlines and scheduling dates in Org TODO items for setting the start
- and due dates for the iCalendar TODO entry. Consult the
- code{org-icalendar-use-scheduled}
- variables for more details.
- For tags on the headline, the iCalendar export back-end makes them into
- iCalendar categories. To tweak the inheritance of tags and TODO states,
- configure the variable
- code{org-icalendar-alarm-time} variable.
- cindex property, ID
- The iCalendar format standard requires globally unique identifier---UID---for
- each entry. The iCalendar export back-end creates UIDs during export. To
- save a copy of the UID in the Org file set the variable
- code{:ID:}
- property of the entry for re-using the same UID for subsequent exports.
- Since a single Org entry can result in multiple iCalendar entries---as
- timestamp, deadline, scheduled item, or TODO item---Org adds prefixes to the
- UID, depending on which part of the Org entry triggered the creation of the
- iCalendar entry. Prefixing ensures UIDs remains unique, yet enable
- synchronization programs trace the connections.
- kbd
- file{.ics}.
- vindex org-agenda-files
- Create iCalendar entries from Org files in
- orgcmd{C-c C-e c c,org-icalendar-combine-agenda-files}
- code{org-agenda-files}
- and write it to
- end table
- vindex org-icalendar-include-body
- cindex property, DESCRIPTION
- code{org-use-property-inheritance} variable.
- When Org entries do not have SUMMARY, DESCRIPTION and LOCATION properties,
- the iCalendar export back-end derives the summary from the headline, and
- derives the description from the body of the Org item. The
- node Other built-in back-ends
- cindex export back-ends, built-in
- itemize
- file{ox-man.el}: export to a man page.
- code{org-export-backends} or
- load directly with
- pxref{The export
- dispatcher}).
- Follow the comment section of such files, for example,
- node Advanced configuration
- subheading Hooks
- vindex org-export-before-parsing-hook
- The export process executes two hooks before the actual exporting begins.
- The first hook,
- code{org-export-before-parsing-hook}, runs before the buffer is
- parsed. Both hooks are specified as functions, see example below. Their main
- use is for heavy duty structural modifications of the Org content. For
- example, removing every headline in the buffer during export:
- group
- (defun my-headline-removal (backend)
- "Remove all headlines in the current buffer.
- BACKEND is the export back-end being used, as a symbol."
- (org-map-entries
- (lambda () (delete-region (point) (progn (forward-line) (point))))))
- (add-hook 'org-export-before-parsing-hook 'my-headline-removal)
- end lisp
- Note that the hook function must have a mandatory argument that is a symbol
- for the back-end.
- cindex Filters, exporting
- The Org export process relies on filters to process specific parts of
- conversion process. Filters are just lists of functions to be applied to
- certain parts for a given back-end. The output from the first function in
- the filter is passed on to the next function in the filter. The final output
- is the output from the final function in the filter.
- The Org export process has many filter sets applicable to different types of
- objects, plain text, parse trees, export options, and final output formats.
- The filters are named after the element type or object type:
- code{TYPE} is the type
- targeted by the filter. Valid types are:
- columnfractions .33 .33 .33
- tab bold
- item center-block
- tab code
- tab drawer
- item entity
- tab export-block
- tab final-output
- item footnote-definition
- tab headline
- tab inline-babel-call
- item inlinetask
- tab item
- tab latex-environment
- item line-break
- tab node-property
- tab paragraph
- item plain-list
- tab planning
- tab quote-block
- item section
- tab src-block
- tab strike-through
- item superscript
- tab table-cell
- tab target
- item underline
- tab verse-block
- code{~} in the
- Org buffer with LaTeX{} back-end.
- group
- (defun my-latex-filter-nobreaks (text backend info)
- "Ensure \"_\" are properly handled in LaTeX export."
- (when (org-export-derived-backend-p backend 'latex)
- (replace-regexp-in-string "_" "~" text)))
- (add-to-list 'org-export-filter-plain-text-functions
- 'my-latex-filter-nobreaks)
- end lisp
- A filter requires three arguments: the code to be transformed, the name of
- the back-end, and some optional information about the export process. The
- third argument can be safely ignored. Note the use of
- code{latex}
- back-end or any other back-end, such as
- code{latex}.
- code{#+BIND} keyword. Here is an example with two filters; one
- removes brackets from time stamps, and the other removes strike-through text.
- The filter functions are defined in a
- example
- #+BIND: org-export-filter-timestamp-functions (tmp-f-timestamp)
- #+BIND: org-export-filter-strike-through-functions (tmp-f-strike-through)
- #+begin_src emacs-lisp :exports results :results none
- (defun tmp-f-timestamp (s backend info)
- (replace-regexp-in-string "&[lg]t;\\|[][]" "" s))
- (defun tmp-f-strike-through (s backend info) "")
- #+end_src
- subheading Extending an existing back-end
- Some parts of the conversion process can be extended for certain elements so
- as to introduce a new or revised translation. That is how the HTML export
- back-end was extended to handle Markdown format. The extensions work
- seamlessly so any aspect of filtering not done by the extended back-end is
- handled by the original back-end. Of all the export customization in Org,
- extending is very powerful as it operates at the parser level.
- For this example, make the
- code{nil}, like the following:
- end example
- Then extend code{my-ascii} back-end.
- group
- (defun my-ascii-src-block (src-block contents info)
- "Transcode a SRC-BLOCK element from Org to ASCII.
- CONTENTS is nil. INFO is a plist used as a communication
- channel."
- (if (not (org-export-read-attribute :attr_ascii src-block :language))
- (org-export-with-backend 'ascii src-block contents info)
- (concat
- (format ",--[ %s ]--\n%s`----"
- (org-element-property :language src-block)
- (replace-regexp-in-string
- "^" "| "
- (org-element-normalize-string
- (org-export-format-code-default src-block info)))))))
- (org-export-define-derived-backend 'my-ascii 'ascii
- :translate-alist '((src-block . my-ascii-src-block)))
- end lisp
- The
- code{ascii} back-end. If true,
- which it is in this example, it creates a box around the code and leaves room
- for the inserting a string for language. The last form creates the new
- back-end that springs to action only when translating
- smalllisp
- (org-export-to-buffer 'my-ascii "*Org MY-ASCII Export*")
- node Export in foreign buffers
- table
- item org-html-convert-region-to-html
- Convert the selected region into HTML.
- LaTeX{}.
- code{Texinfo}.
- code{MarkDown}.
- code{M-x
- orgstruct-mode} in an HTML buffer, then use the convenient Org keyboard
- commands to create a list, select it, and covert it to HTML with
- node Publishing
- cindex publishing
- Org includes a publishing management system that allows you to configure
- automatic HTML conversion of
- menu
- * Configuration:: Defining projects
- * Uploading files:: How to get files up on the server
- * Sample configuration:: Example projects
- * Triggering publication:: Publication commands
- node Configuration
- menu
- * Project alist:: The central configuration variable
- * Sources and destinations:: From here to there
- * Selecting files:: What files are part of the project?
- * Publishing action:: Setting the function doing the publishing
- * Publishing options:: Tweaking HTML/
- end menu
- subsection The variable
- cindex org-publish-project-alist
- vindex org-publish-project-alist
- Publishing is configured almost entirely through setting the value of one
- variable, called
- lisp
- ("project-name" :property value :property value ...)
-
- r{or}
- ("project-name" :components ("project-name" "project-name" ...))
- code{:components} property are taken to be sub-projects, which group
- together files requiring different publishing options. When you publish such
- a ``meta-project'', all the components will also be published, in the
- sequence given.
- subsection Sources and destinations for files
- multitable
- item
- tab Directory containing publishing source files
- code{:publishing-directory}
- file{tramp} package. Or you can publish to a local directory and
- use external tools to upload your website (
- item
- tab Function or list of functions to be called before starting the
- publishing process, for example, to run
- item
- tab Function or list of functions called after finishing the publishing
- process, for example, to change permissions of the resulting files. Each
- completion function is called with a single argument, the project property
- list.
- noindent
- subsection Selecting files
- file{.org} in the base directory
- are considered part of the project. This can be modified by setting the
- properties
- columnfractions 0.25 0.75
- code{:base-extension}
- code{any} if you want to get all
- files in
- item
- tab Regular expression to match file names that should not be
- published, even though they have been selected on the basis of their
- extension.
- code{:include}
- code{:base-extension}
- and
- item
- tab non-
- end multitable
- subsection Publishing action
- code{org-html-publish-to-html}, which calls the HTML exporter (
- code{org-latex-publish-to-pdf} or as code{Texinfo}, etc.,
- using the corresponding functions.
- If you want to publish the Org file as an
- i{archived}, i{tag-excluded} trees removed, use the
- function file{file.org}
- and put it in the publishing directory. If you want a htmlized version of
- this file, set the parameter code{t}, it will
- produce footnote{If the
- publishing directory is the same than the source directory,
- file{file.org.org}, so probably don't want to do this.}.
- Other files like images only need to be copied to the publishing destination.
- For this you can use
- multitable
- item
- tab Function executing the publication of a file. This may also be a
- list of functions, which will all be called in turn.
- code{:htmlized-source}
- code{nil} means, publish htmlized source.
- code{:publishing-directory} property, the name of the file to be published
- and the path to the publishing directory of the output file. It should take
- the specified file, make the necessary transformation (if any) and place the
- result into the destination folder.
- subsection Options for the exporters
- vindex org-publish-project-alist
- When a property is given a value in
- pxref{Export settings}),
- however, override everything.
- multitable {code{org-export-with-sub-superscripts}}
- code{:archived-trees} code{org-export-with-archived-trees}
- code{:exclude-tags} code{org-export-exclude-tags}
- code{:headline-levels} code{org-export-headline-levels}
- code{:language} code{org-export-default-language}
- code{:preserve-breaks} code{org-export-preserve-breaks}
- code{:section-numbers} code{org-export-with-section-numbers}
- code{:select-tags} code{org-export-select-tags}
- code{:with-author} code{org-export-with-author}
- code{:with-broken-links} code{org-export-with-broken-links}
- code{:with-clocks} code{org-export-with-clocks}
- code{:with-creator} code{org-export-with-creator}
- code{:with-date} code{org-export-with-date}
- code{:with-drawers} code{org-export-with-drawers}
- code{:with-email} code{org-export-with-email}
- code{:with-emphasize} code{org-export-with-emphasize}
- code{:with-fixed-width} code{org-export-with-fixed-width}
- code{:with-footnotes} code{org-export-with-footnotes}
- code{:with-latex} code{org-export-with-latex}
- code{:with-planning} code{org-export-with-planning}
- code{:with-priority} code{org-export-with-priority}
- code{:with-properties} code{org-export-with-properties}
- code{:with-special-strings} code{org-export-with-special-strings}
- code{:with-sub-superscript} code{org-export-with-sub-superscripts}
- code{:with-tables} code{org-export-with-tables}
- code{:with-tags} code{org-export-with-tags}
- code{:with-tasks} code{org-export-with-tasks}
- code{:with-timestamps} code{org-export-with-timestamps}
- code{:with-title} code{org-export-with-title}
- code{:with-toc} code{org-export-with-toc}
- code{:with-todo-keywords} code{org-export-with-todo-keywords}
- subsubheading ASCII specific properties
- code{:ascii-table-keep-all-vertical-lines}} {
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- end multitable
- multitable {code{org-beamer-frame-default-options}}
- code{:beamer-theme} code{org-beamer-theme}
- code{:beamer-column-view-format} code{org-beamer-column-view-format}
- code{:beamer-environments-extra} code{org-beamer-environments-extra}
- code{:beamer-frame-default-options} code{org-beamer-frame-default-options}
- code{:beamer-outline-frame-options} code{org-beamer-outline-frame-options}
- code{:beamer-outline-frame-title} code{org-beamer-outline-frame-title}
- code{:beamer-subtitle-format} code{org-beamer-subtitle-format}
- subsubheading HTML specific properties
- code{:html-table-use-header-tags-for-first-column}} {
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- end multitable
- LaTeX{} specific properties
- code{:latex-link-with-unknown-path-format}} {
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- end multitable
- multitable {code{org-md-footnotes-section}}
- code{:md-footnote-format} code{org-md-footnote-format}
- code{:md-footnotes-section} code{org-md-footnotes-section}
- code{:md-headline-style} code{org-md-headline-style}
- subsubheading ODT specific properties
- code{:odt-format-inlinetask-function}} {
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- end multitable
- multitable {code{org-texinfo-link-with-unknown-path-format}}
- code{:texinfo-active-timestamp-format} code{org-texinfo-active-timestamp-format}
- code{:texinfo-classes} code{org-texinfo-classes}
- code{:texinfo-class} code{org-texinfo-default-class}
- code{:texinfo-def-table-markup} code{org-texinfo-def-table-markup}
- code{:texinfo-diary-timestamp-format} code{org-texinfo-diary-timestamp-format}
- code{:texinfo-filename} code{org-texinfo-filename}
- code{:texinfo-format-drawer-function} code{org-texinfo-format-drawer-function}
- code{:texinfo-format-headline-function} code{org-texinfo-format-headline-function}
- code{:texinfo-format-inlinetask-function} code{org-texinfo-format-inlinetask-function}
- code{:texinfo-inactive-timestamp-format} code{org-texinfo-inactive-timestamp-format}
- code{:texinfo-link-with-unknown-path-format} code{org-texinfo-link-with-unknown-path-format}
- code{:texinfo-node-description-column} code{org-texinfo-node-description-column}
- code{:texinfo-table-scientific-notation} code{org-texinfo-table-scientific-notation}
- code{:texinfo-tables-verbatim} code{org-texinfo-tables-verbatim}
- code{:texinfo-text-markup-alist} code{org-texinfo-text-markup-alist}
- node Publishing links
- cindex links, publishing
- To create a link from one Org file to another, you would use something like
- samp{file:foo.org}
- (
- file{foo.html}. You can thus interlink the pages of your ``org web''
- project and the links will work as expected when you publish them to HTML.
- If you also publish the Org source file and want to link to it, use an
- code{file:} link, because
- file{html} file.
- You may also link to related files, such as images. Provided you are careful
- with relative file names, and provided you have also configured Org to upload
- the related files, these links will work too. See
- pxref{Search options}), which will be resolved to the appropriate location
- in the linked file. For example, once published to HTML, the following links
- all point to a dedicated anchor in
- example
- [[file:foo.org::*heading]]
- [[file:foo.org::#custom-id]]
- [[file:foo.org::target]]
- node Sitemap
- cindex sitemap, of published pages
- The following properties may be used to control publishing of
- a map of files for a given project.
- columnfractions 0.35 0.65
- code{:auto-sitemap}
- code{nil}, publish a sitemap during
- code{org-publish-all}.
- code{:sitemap-filename}
- file{sitemap.org} (which
- becomes
- item
- tab Title of sitemap page. Defaults to name of file.
- code{:sitemap-function}
- code{org-publish-org-sitemap}, which generates a plain list
- of links to all files in the project.
- code{:sitemap-sort-folders}
- code{first}
- (default) or
- item
- tab How the files are sorted in the site map. Set this to
- code{chronologically} or
- code{chronologically} sorts the files with
- older date first while
- code{alphabetically} sorts the files alphabetically. The date of
- a file is retrieved with
- item
- tab Should sorting be case-sensitive? Default
- item
- tab With this option one can tell how a sitemap's entry is formatted in the
- sitemap. This is a format string with some escape sequences:
- code{%a} stands for the author of the file and
- code{org-publish-find-date} function and formatted with
- code{%t}.
- code{:sitemap-date-format}
- code{format-time-string} function that tells how
- a sitemap entry's date is to be formatted. This property bypasses
- code{%Y-%m-%d}.
- code{:sitemap-sans-extension}
- code{nil}, remove filenames' extensions from the generated sitemap.
- Useful to have cool URIs (see
- code{nil}.
- node Generating an index
- cindex index, in a publishing project
- Org mode can generate an index across the files of a publishing project.
- columnfractions 0.25 0.75
- code{:makeindex}
- code{nil}, generate in index in the file
- file{theindex.html}.
- code{:makeindex} set. The file only contains a statement
- cindex #+INDEX
- Index entries are specified with
- example
- * Curriculum Vitae
- #+INDEX: CV
- #+INDEX: Application!CV
- node Uploading files
- cindex rsync
- command{rsync} or
- i{remote} publishing facilities of Org mode which rely heavily on
- Tramp. Tramp, while very useful and powerful, tends not to be
- so efficient for multiple file transfer and has been known to cause problems
- under heavy usage.
- Specialized synchronization utilities offer several advantages. In addition
- to timestamp comparison, they also do content and permissions/attribute
- checks. For this reason you might prefer to publish your web to a local
- directory (possibly even
- file{unison} or
- code{org-publish} and let the synchronization tool do the rest.
- You do not need, in this scenario, to include attachments such as
- file{css} or
- code{org-publish-use-timestamps-flag} to
- code{#+INCLUDE:}. The timestamp mechanism in
- Org is not smart enough to detect if included files have been modified.
- section Sample configuration
- Below we provide two example configurations. The first one is a simple
- project publishing only a set of Org files. The second example is
- more complex, with a multi-component project.
- end menu
- subsection Example: simple publishing configuration
- This example publishes a set of Org files to the
- lisp
- (setq org-publish-project-alist
- '(("org"
- :base-directory "~/org/"
- :publishing-directory "~/public_html"
- :section-numbers nil
- :with-toc nil
- :html-head "<link rel=\"stylesheet\"
- href=\"../other/mystyle.css\"
- type=\"text/css\"/>")))
- node Complex example
- file{~/org} and your
- publishable images in
- c
- end example
- lisp
- (setq org-publish-project-alist
- '(("orgfiles"
- :base-directory "~/org/"
- :base-extension "org"
- :publishing-directory "/ssh:user@@host:~/html/notebook/"
- :publishing-function org-html-publish-to-html
- :exclude "PrivatePage.org" ;; regexp
- :headline-levels 3
- :section-numbers nil
- :with-toc nil
- :html-head "<link rel=\"stylesheet\"
- href=\"../other/mystyle.css\" type=\"text/css\"/>"
- :html-preamble t)
- ("images"
- :base-directory "~/images/"
- :base-extension "jpg\\|gif\\|png"
- :publishing-directory "/ssh:user@@host:~/html/images/"
- :publishing-function org-publish-attachment)
- ("other"
- :base-directory "~/other/"
- :base-extension "css\\|el"
- :publishing-directory "/ssh:user@@host:~/html/other/"
- :publishing-function org-publish-attachment)
- ("website" :components ("orgfiles" "images" "other"))))
- node Triggering publication
- table
- orgcmd{C-c C-e P x,org-publish}
- Prompt for a specific project and publish all files that belong to it.
- orgcmd{C-c C-e P f,org-publish-current-file}
- Publish only the current file.
- end table
- code{org-publish-use-timestamps-flag}.
- This may be necessary in particular if files include other files via
- code{#+INCLUDE:}.
- chapter Working with source code
- cindex Davison, Dan
- samp{src} code blocks are not restricted to the preamble or
- the end of an Org document; they can go anywhere---with a few exceptions,
- such as not inside comments and fixed width areas. Here's a sample
- example
- #+BEGIN_SRC emacs-lisp
- (defun org-xor (a b)
- "Exclusive or."
- (if a (not b) b))
- #+END_SRC
- samp{#+BEGIN_SRC} and
- samp{live code} blocks (as compared to the static text and
- documentation around it). Users can control how
- samp{src} code block type is one of many block types, such as quote,
- export, verse, latex, example, and verbatim. This section pertains to
- samp{#+BEGIN_SRC} and
- samp{src} code blocks, Org provides native Emacs major-modes.
- That leverages the latest Emacs features for that source code language mode.
- For exporting, Org can then extract
- dfn{tangling} in literate
- programming terminology).
- For publishing, Org's back-ends can handle the
- samp{src} code blocks, Org provides
- facilities that glue the tasks of compiling, collecting the results of the
- execution, and inserting them back to the Org file. Besides text output,
- results may include links to other data types that Emacs can handle: audio,
- video, and graphics.
- An important feature of Org's execution of the
- samp{src} blocks. Such
- interoperability uses a common syntax even if these
- samp{src} code block in the Org
- file. That should partly explain why this functionality by the original
- contributors, Eric Schulte and Dan Davison, was called
- samp{src} code blocks.
- Org mode fulfills the promise of easy verification and maintenance of
- publishing reproducible research by keeping all these in the same file: text,
- data, code, configuration settings of the execution environment, the results
- of the execution, and associated narratives, claims, references, and internal
- and external links.
- Details of Org's facilities for working with source code are shown next.
- end menu
- section Structure of code blocks
- cindex source code, block structure
- cindex #+BEGIN_SRC
- Org offers two ways to structure source code in Org documents: in a
- samp{src} block conforms to this structure:
- end example
- Org mode's templates system (
- samp{src} code blocks with just three keystrokes. Do not be put-off by
- having to remember the source block syntax. Org also works with other
- completion systems in Emacs, some of which predate Org and have custom
- domain-specific languages for defining templates. Regular use of templates
- reduces errors, increases accuracy, and maintains consistency.
- example
- src_<language>}
- example
- src_<language>[<header arguments>]}
- table
- item #+NAME: <name>
- Optional. Names the
- samp{src} blocks or inline blocks to evaluate or to capture the
- results. Code from other blocks, other files, and from table formulas
- (samp{src} block.
- This naming serves the same purpose as naming Org tables. Org mode requires
- unique names. For duplicate names, Org mode's behavior is undefined.
- item #+BEGIN_SRC
- code{#+BEGIN_SRC} line takes additional arguments, as described next.
- item <language>
- Mandatory for live code blocks. It is the identifier of the source code
- language in the block.
- cindex source code, language
- ref{Literal examples})
- item <header arguments>
- Optional. Heading arguments control many aspects of evaluation, export and
- tangling of code blocks (
- item source code, header arguments
- end table
- section Editing source code
- cindex source code, editing
- vindex org-edit-src-turn-on-auto-save
- kbd{C-c '} for editing the current code block. It opens a new major-mode
- edit buffer containing the body of the
- kbd{C-c '} again to close the buffer and return to the Org buffer.
- code{org-edit-src-auto-save-idle-delay} to save the base buffer after
- a certain idle delay time.
- Set
- code{auto-save-mode}.
- code{org-src-mode}
- minor mode remains active. It provides these customization variables as
- described below. For even more variables, look in the customization
- group
- table
- item org-src-lang-modes
- If an Emacs major-mode named code{<lang>}
- is the language identifier from code block's header line, then the edit
- buffer uses that major-mode. Use this variable to arbitrarily map language
- identifiers to major modes.
- item org-src-preserve-indentation
- code{nil}. Source code is indented. This indentation applies
- during export or tangling, and depending on the context, may alter leading
- spaces and tabs. When non-
- item org-src-ask-before-returning-to-edit-buffer
- When
- end table
- Set code{nil} to turn on native code
- fontification in the samp{src} code
- blocks can give visual separation of text and code on the display page. To
- further customize the appearance of
- code{org-src-block-faces}. The following example shades the
- background of regular blocks, and colors source blocks only for Python and
- Emacs-Lisp languages.
- end lisp
- section Exporting code blocks
- cindex source code, exporting
- Org can flexibly export just the
- emph{results} of evaluation of the code block,
- emph{none}. Org defaults to
- exporting
- code{ditaa}, Org defaults to
- pxref{Literal examples}. To selectively export sub-trees of
- an Org document,
- code{:exports} header arguments control exporting code blocks only and
- not inline code:
- table
- cindex
- item :exports code
- This is the default for most languages where the body of the code block is
- exported. See
- item :exports results
- On export, Org includes only the results and not the code block. After each
- evaluation, Org inserts the results after the end of code block in the Org
- buffer. By default, Org replaces any previous results. Org can also append
- results.
- item :exports none
- Org does not export the code block nor the results.
- vindex org-export-babel-evaluate
- To stop Org from evaluating code blocks during export, set
- code{nil}.
- Turning off evaluation comes in handy when batch processing. For example,
- markup languages for wikis, which have a high risk of untrusted code.
- Stopping code block evaluation also stops evaluation of all header arguments
- of the code block. This may not be desirable in some circumstances. So
- during export, to allow evaluation of just the header arguments but not any
- code evaluation in the source block, set
- pxref{eval}).
- To evaluate just the inline code blocks, set
- code{inline-only}. Isolating the option to allow inline evaluations
- separate from
- pxref{Comment lines}). On the other hand, Org does evaluate code blocks in
- sub-trees excluded from export (
- node Extracting source code
- cindex tangling
- cindex code block, extracting source code
- Extracting source code from code blocks is a basic task in literate
- programming. Org has features to make this easy. In literate programming
- parlance, documents on creation are
- emph{tangled} for execution by a computer. Org
- facilitates weaving and tangling for producing, maintaining, sharing, and
- exporting literate programming documents. Org provides extensive
- customization options for extracting source code.
- When Org tangles
- emph{tangling} process, Org
- expands variables in the source code, and resolves any ``noweb'' style
- references (
- subsubheading Header arguments
- code
- code{:tangle}, src header argument
- samp{src} code block on export.
- samp{src} code block.
- end table
- subsubheading Functions
- code
- kbd{C-c C-v t}.
- With prefix argument only tangle the current
- item org-babel-tangle-file
- Choose a file to tangle. Bound to
- end table
- table
- item org-babel-post-tangle-hook
- This hook runs from within code tangled by
- end table
- code{org-babel-tangle-jump-to-org} function with two additional source code
- block header arguments: One, set pxref{padline}) to true
- (the default setting). Two, set pxref{comments}) to
- node Evaluating code blocks
- cindex code block, evaluating
- cindex #+RESULTS
- A note about security: With code evaluation comes the risk of harm. Org
- safeguards by prompting for user's permission before executing any code in
- the source block. To customize this safeguard (or disable it) see
- samp{src} code block evaluation and inserts
- them in the Org file, right after the
- code{#+RESULTS} label. Org creates the
- code{emacs-lisp}
- ref{Languages} for identifiers to enable other languages.
- samp{src} code blocks.
- kbd{C-c C-v e} with the point on a footnote{The option
- kbd{C-c C-c} key binding.} calls the
- cindex #+CALL
- By calling a named code block
- {
- code{#+KEYWORD:},
- samp{src} code
- blocks from the current Org mode buffer or from the ``Library of Babel''
- (code{#+CALL:}
- syntax is used, the result is wrapped based on the variable
- code{"=%s="}
- to produce verbatim text suitable for markup.
- The syntax for
- example
- #+CALL: <name>(<arguments>)
- #+CALL: <name>[<inside header arguments>](<arguments>) <end header arguments>
- example
- ... call_<name>(<arguments>) ...
- ... call_<name>[<inside header arguments>](<arguments>)[<end header arguments>] ...
- table
- item <name>
- This is the name of the code block to be evaluated (
- item <arguments>
- Org passes arguments to the code block using standard function call syntax.
- For example, a samp{4} to a code block named
- code{:var n=2}, would be
- written as
- item <inside header arguments>
- Org passes inside header arguments to the named
- code{[:results output]} collects results printed
- to
- item <end header arguments>
- End header arguments affect the results returned by the code block. For
- example, code{BEGIN_EXPORT html}
- block before inserting the results in the Org buffer.
- For more examples of header arguments for
- pxref{Arguments in function calls}.
- node Library of Babel
- cindex babel, library of
- cindex code block, library
- The ``Library of Babel'' is a collection of code blocks. Like a function
- library, these code blocks can be called from other Org files. This
- collection is in a repository file in Org mode format in the
- pxref{Evaluating code blocks}.
- samp{src} code blocks of an Org file, and then load the Org file with
- kbd{C-c C-v i}.
- section Languages
- cindex source code, languages
- samp{src} code blocks:
- columnfractions 0.25 0.25 0.25 0.25
- b{Language} b{Identifier} b{Language} b{Identifier}
- tab asymptote tab awk
- tab C tab C++
- tab clojure tab css
- tab d tab ditaa
- tab dot tab calc
- tab emacs-lisp tab fortran
- tab gnuplot tab haskell
- tab java tab js
- tab latex tab ledger
- tab lisp tab lilypond
- tab lua tab matlab
- tab mscgen tab ocaml
- tab octave tab org
- tab oz tab perl
- tab plantuml tab processing
- tab python tab R
- tab ruby tab sass
- tab scheme tab screen
- tab sed tab sh
- tab sql tab sqlite
- uref{http://orgmode.org/worg/org-contrib/babel/languages.html}.
- By default, only
- code{org-babel-load-languages}
- variable either through the Emacs customization interface, or by adding code
- to the init file as shown next:
- In this example, evaluation is disabled for
- code{R}.
- end lisp
- Note that this is not the only way to enable a language. Org also enables
- languages when loaded with
- code{clojure} code blocks:
- end lisp
- section Header arguments
- cindex source code, block header arguments
- Details of configuring header arguments are shown here.
- end menu
- subsection Using header arguments
- Since header arguments can be set in several ways, Org prioritizes them in
- case of overlaps or conflicts by giving local settings a higher priority.
- Header values in function calls, for example, override header values from
- global defaults.
- end menu
- subsubheading System-wide header arguments
- code{org-babel-default-header-args} variable:
- code{:session}, src header argument
- code{:results}, src header argument
- code{:exports}, src header argument
- code{:cache}, src header argument
- code{:noweb}, src header argument
- end example
- This example sets code{yes}, which makes
- Org expand
- lisp
- (setq org-babel-default-header-args
- (cons '(:noweb . "yes")
- (assq-delete-all :noweb org-babel-default-header-args)))
- node Language-specific header arguments
- code{org-babel-default-header-args:<lang>}, where
- uref{http://orgmode.org/worg/org-contrib/babel}.
- subsubheading Header arguments in Org mode properties
- For header arguments applicable to the buffer, use
- pxref{Property syntax}).
- The following example sets only for code{session},
- making all the
- code{results} to
- samp{R} code blocks; no results inserted for any block.
- end example
- pxref{Property syntax})
- apply at the sub-tree level on down. Since these property drawers can appear
- anywhere in the file hierarchy, Org uses outermost call or source block to
- resolve the values. Org ignores
- code{:cache} defaults to
- samp{sample header}.
- end example
- vindex org-babel-default-header-args
- Properties defined through
- kbd{C-c C-x p}, apply to all active languages. They override properties set
- in
- node Language-specific mode properties
- code{header-args:<lang>} where
- example
- * Heading
- :PROPERTIES:
- :header-args:clojure: :session *clojure-1*
- :header-args:R: :session *R*
- :END:
- ** Subheading
- :PROPERTIES:
- :header-args:clojure: :session *clojure-2*
- :END:
- samp{R} blocks. Blocks in Subheading
- inherit settings from Heading.
- subsubheading Code block specific header arguments
- Header arguments are most commonly set at the
- code{#+BEGIN_SRC} line. Arguments set at this level take precedence
- over those set in the
- code{results} to
- code{:exports} to
- samp{src} code block to HTML or
- example
- #+NAME: factorial
- #+BEGIN_SRC haskell :results silent :exports code :var n=0
- fac 0 = 1
- fac n = n * fac (n-1)
- #+END_SRC
- samp{src} code block:
- {fac 5
- end example
- Code block header arguments can span multiple lines using
- code{#+HEADER:} only as a convenience for backward-compatibility. It may be
- removed at some point.
- samp{src} code block:
- end example
- Multi-line header arguments on a named
- example
- #+NAME: named-block
- #+HEADER: :var data=2
- #+BEGIN_SRC emacs-lisp
- (message "data:%S" data)
- #+END_SRC
- #+RESULTS: named-block
- : data:2
- node Arguments in function calls
- code{#+CALL:} examples are shown below. For the complete syntax of
- ref{Evaluating code blocks}.
- In this example,
- code{#+CALL:} line.
- end example
- In this example,
- code{factorial} code block.
- end example
- subsection Specific header arguments
- Org comes with many header arguments common to all languages. New header
- arguments are added for specific languages as they become available for use
- in
- menu
- * var:: Pass arguments to
- end menu
- For language-specific header arguments, see
- node var
- code{:var}
- code{:var}, src header argument
- Use samp{src} code blocks. The
- specifics of variables in
- code{:var}, however, is the same for all languages. This includes declaring
- a variable, and assigning a default value.
- Arguments can take values as literals, or as references, or even as Emacs
- Lisp code (
- code{#+NAME:} or
- code{#+BEGIN_EXAMPLE} blocks,
- other types of
- samp{src} code blocks.
- For better performance, Org can cache results of evaluations. But caching
- comes with severe limitations (
- pxref{var, Indexable variable
- values}).
- The following syntax is used to pass arguments to
- code{:var} header argument.
- end example
- The samp{"string"}, a
- number
- table
- item table
- an Org mode table named with either a
- example
- #+NAME: example-table
- | 1 |
- | 2 |
- | 3 |
- | 4 |
- #+NAME: table-length
- #+BEGIN_SRC emacs-lisp :var table=example-table
- (length table)
- #+END_SRC
- #+RESULTS: table-length
- : 4
- item list
- a simple list named with a
- example
- #+NAME: example-list
- - simple
- - not
- - nested
- - list
- #+BEGIN_SRC emacs-lisp :var x=example-list
- (print x)
- #+END_SRC
- #+RESULTS:
- | simple | list |
- item code block without arguments
- a code block name (from the example above), as assigned by
- example
- #+BEGIN_SRC emacs-lisp :var length=table-length()
- (* 2 length)
- #+END_SRC
- #+RESULTS:
- : 8
- item code block with arguments
- a code{#+NAME:}, followed by
- parentheses and optional arguments passed within the parentheses following
- the
- example
- #+NAME: double
- #+BEGIN_SRC emacs-lisp :var input=8
- (* 2 input)
- #+END_SRC
- #+RESULTS: double
- : 16
- #+NAME: squared
- #+BEGIN_SRC emacs-lisp :var input=double(input=2)
- (* input input)
- #+END_SRC
- #+RESULTS: squared
- : 4
- item literal example
- a literal example block named with a
- example
- #+NAME: literal-example
- #+BEGIN_EXAMPLE
- A literal example
- on two lines
- #+END_EXAMPLE
- #+NAME: read-literal-example
- #+BEGIN_SRC emacs-lisp :var x=literal-example
- (concatenate 'string x " for you.")
- #+END_SRC
- #+RESULTS: read-literal-example
- : A literal example
- : on two lines for you.
- end table
- code{,}s then each subsequent section will index as
- the next dimension. Note that this indexing occurs
- code{:hlines},
- code{:rownames}. The following example assigns the
- last cell of the first row the table
- code{data}:
- end example
- Ranges of variable values can be referenced using two integers separated by a
- code{example-table}
- to
- example
- #+NAME: example-table
- | 1 | a |
- | 2 | b |
- | 3 | c |
- | 4 | d |
- | 5 | 3 |
- #+BEGIN_SRC emacs-lisp :var data=example-table[1:3]
- data
- #+END_SRC
- #+RESULTS:
- | 2 | b |
- | 3 | c |
- | 4 | d |
- code{*}.
- example
- #+NAME: example-table
- | 1 | a |
- | 2 | b |
- | 3 | c |
- | 4 | d |
- #+BEGIN_SRC emacs-lisp :var data=example-table[,0]
- data
- #+END_SRC
- #+RESULTS:
- | 1 | 2 | 3 | 4 |
- example
- #+NAME: 3D
- #+BEGIN_SRC emacs-lisp
- '(((1 2 3) (4 5 6) (7 8 9))
- ((10 11 12) (13 14 15) (16 17 18))
- ((19 20 21) (22 23 24) (25 26 27)))
- #+END_SRC
- #+BEGIN_SRC emacs-lisp :var data=3D[1,,1]
- data
- #+END_SRC
- #+RESULTS:
- | 11 | 14 | 17 |
- subsubheading Emacs Lisp evaluation of variables
- Emacs lisp code can set the values for variables. To differentiate a value
- from lisp code, Org interprets any value starting with code{[},
- code{`} as Emacs Lisp code. The result of evaluating that code
- is then assigned to the value of that variable. The following example shows
- how to reliably query and pass file name of the Org mode buffer to a code
- block using headers. We need reliability here because the file's name could
- change once the code in the block starts executing.
- end example
- Note that values read from tables and lists will not be mistakenly evaluated
- as Emacs Lisp code, as illustrated in the following example.
- end example
- subsubsection
- cindex
- code{:results} header arguments. Each
- itemize
- item
- samp{src}
- code block
- b{type} for which type of result the code block will return; affects how Org
- processes and inserts results in the Org buffer
- b{format} for the result; affects how Org processes and inserts results in
- the Org buffer
- b{handling} for processing results after evaluation of the
- end itemize
- itemize
- item
- samp{src} code block. Languages like Python may require an
- explicit samp{src} code block. Usage
- example:
- item
- samp{src} code block. Usage example:
- end itemize
- itemize
- item code{vector}
- Interpret the results as an Org table. If the result is a single value,
- create a table with one row and one column. Usage example:
- item
- item code{verbatim}
- Interpret literally and insert as quoted text. Do not create a table. Usage
- example:
- item
- code{:results value file}.
- subsubheading Format
- Format pertains to the type of the result returned by the
- itemize
- item
- code{:results value raw}.
- code{org}
- Results enclosed in a
- kbd{TAB} in the block, or export the file. Usage example:
- item
- code{BEGIN_EXPORT html} block. Usage example:
- item
- code{BEGIN_EXPORT latex} block. Usage example:
- item
- samp{src} code block. Useful for parsing. Usage
- example:
- item
- samp{src} code
- block. Languages supported: Emacs Lisp, Python, and Ruby. Usage example:
- item
- code{raw} or
- code{:results value drawer}.
- subsubheading Handling
- Handling options after collecting the results.
- bullet
- code{silent}
- Do not insert results in the Org mode buffer, but echo them in the
- minibuffer. Usage example:
- item
- code{:results output replace}.
- code{append}
- Append results to the Org buffer. Latest results are at the bottom. Does
- not remove previous results. Usage example:
- item
- code{:results output prepend}.
- node file
- code{:file}
- code{:file}, src header argument
- An external
- code{:file} is either a file name or two strings, where the
- first is the file name and the second is the description. A link to the file
- is inserted. It uses an Org mode style pxref{Link
- format}). Some languages, such as samp{dot},
- samp{gnuplot}, automatically wrap the source code in additional boilerplate
- code. Such code wrapping helps recreate the output, especially graphics
- output, by executing just the
- node file-desc
- code{:file-desc}
- A description of the results file. Org uses this description for the link
- (see code{:file-desc}
- has no value, Org will use file name for both the ``link'' and the
- ``description'' portion of the Org mode link.
- subsubsection
- cindex
- code{:file-ext},
- ref{output-dir} header argument. To override this
- auto generated file name, use the
- node output-dir
- code{:output-dir}
- code{:output-dir}, src header argument
- Specifies the
- code{/}) or a relative directory (without
- code{#+NAME:} of the source block
- and ref{file-ext} header arguments.
- subsubsection
- cindex
- code{:file} header argument can be used to specify the path to the
- output file, samp{src}
- code block execution. If it is absent, then the directory associated with
- the current buffer is used. In other words, supplying
- kbd{M-x cd path RET}, and then not supplying
- code{:dir} simply sets the value of the Emacs variable
- code{:dir}, relative paths (for example,
- code{:file results/myfile.jpg}) become relative to the default directory.
- For example, to save the plot file in the
- example
- #+BEGIN_SRC R :file myplot.png :dir ~/Work
- matplot(matrix(rnorm(100), 10), type="l")
- #+END_SRC
- subsubheading Remote execution
- To evaluate the
- samp{Tramp} syntax. For example:
- end example
- Org first captures the text results as usual for insertion in the Org file.
- Then Org also inserts a link to the remote file, thanks to Emacs
- code{:dir} and
- example
- [[file:/scp:dandyakuba.princeton.edu:/home/dand/plot.png][plot.png]]
- subsubheading Some more warnings
- bullet
- code{:dir} is used with
- item
- Do not use code{:exports results} or with
- code{default directory} to avoid some underlying
- portability issues.
- node exports
- code{:exports}
- code{:exports}, src header argument
- The
- LaTeX{} formats. Note that
- samp{src} code blocks and not inline code.
- bullet
- code{code}
- The default. The body of code is included into the exported file. Example:
- item
- code{:exports results}.
- code{both}
- Both the code and results of evaluation are included in the exported file.
- Example:
- item
- code{:exports none}.
- node tangle
- code{:tangle}
- code{:tangle}, src header argument
- The samp{src} code block is
- exported to source file(s).
- bullet
- code{tangle}
- Export the
- code{:tangle
- yes}.
- code{no}
- The default. Do not extract the code a source code file. Example:
- item other
- Export the
- code{:tangle} header argument. Org derives
- the file name as being relative to the directory of the Org file's location.
- Example:
- end itemize
- subsubsection
- cindex
- code{:mkdirp} header argument creates parent directories for tangled
- files if the directory does not exist.
- code{no} inhibits directory creation.
- subsubsection
- cindex
- samp{src} code block.
- bullet
- code{no}
- The default. Do not insert any extra comments during tangling.
- code{link}
- Wrap the
- item
- item
- item
- item
- samp{src} code block.
- node padline
- code{:padline}
- code{:padline}, src header argument
- Control insertion of newlines to pad
- itemize
- item
- samp{src} code block in the
- tangled file.
- code{no}
- Do not insert newlines to pad the tangled
- end itemize
- subsubsection
- cindex
- samp{src} code blocks during tangling. The
- code{org-babel-expand-src-block} also assigns
- values to pxref{var}) variables. Expansions also replace
- ``noweb'' references with their targets (
- samp{src} code blocks for execution have to be expanded
- anyway.
- subsubsection
- cindex
- code{:session} header argument is for running multiple source code
- blocks under one session. Org runs
- itemize
- item
- samp{src} code block gets a new interpreter process to
- execute. The process terminates once the block is evaluated.
- code{other}
- Any string besides
- code{:session mysession} names it
- code{:session} has no argument, then the session name is derived from the
- source language identifier. Subsequent blocks with the same source code
- language use the same session. Depending on the language, state variables,
- code from other blocks, and the overall interpreted environment may be
- shared. Some interpreted languages support concurrent sessions when
- subsequent source code language blocks change session names.
- node noweb
- code{:noweb}
- code{:noweb}, src header argument
- The
- pxref{Noweb reference syntax}). Expansions occur when source
- code blocks are evaluated, tangled, or exported.
- bullet
- code{no}
- Default. No expansion of ``Noweb'' syntax references in the body of the code
- when evaluating, tangling, or exporting.
- code{yes}
- Expansion of ``Noweb'' syntax references in the body of the
- item
- samp{src} code
- block when tangling. No expansion when evaluating or exporting.
- code{no-export}
- Expansion of ``Noweb'' syntax references in the body of the
- item
- samp{src} code
- block when expanding prior to evaluating or tangling. Removes ``noweb''
- syntax references when exporting.
- code{eval}
- Expansion of ``Noweb'' syntax references in the body of the
- end itemize
- code{<<reference>>}. This behavior is illustrated in the following example.
- Because the
- samp{src} code block:
- end example
- expands to:
- end example
- Since this change will not affect noweb replacement text without newlines in
- them, inline noweb references are acceptable.
- subsubsection
- cindex
- samp{src} code
- blocks by matching the reference name to either the block name or the
- code{:noweb-ref} header argument at the
- sub-tree or file level. In the example Org file shown next, the body of the
- source code in each block is extracted for concatenation to a pure code file.
- {if (u < +$5) }{print m
- end example
- subsubsection
- cindex
- code{:noweb-sep} (
- node cache
- code{:cache}
- code{:cache}, src header argument
- The
- samp{src} code blocks that
- have not changed since the previous run. To benefit from the cache and avoid
- redundant evaluations, the source block must have a result already present in
- the buffer, and neither the header arguments (including the value of
- samp{src} blocks are pure functions,
- that is functions that return the same value for the same input arguments
- (
- code{:cache} is used for a
- pxref{Noweb reference syntax}). For
- reasons why, see
- code{:cache} header argument can have one of two values:
- code{no}.
- bullet
- code{no}
- Default. No caching of results;
- item
- samp{src} code block and
- arguments passed to it. This hash value is packed on the
- samp{src} code block. When hash values mismatch, Org evaluates the
- code{#+RESULTS:} line.
- code{caller} runs only if
- the result from
- example
- #+NAME: random
- #+BEGIN_SRC R :cache yes
- runif(1)
- #+END_SRC
- #+RESULTS[a2a72cd647ad44515fab62e144796432793d68e1]: random
- 0.4659510825295
- #+NAME: caller
- #+BEGIN_SRC emacs-lisp :var x=random :cache yes
- x
- #+END_SRC
- #+RESULTS[bec9c8724e397d5df3b696502df3ed7892fc4f5f]: caller
- 0.254227238707244
- node sep
- code{:sep}
- code{:sep}, src header argument
- The
- pxref{file}) external to Org mode. Org defaults to tab delimited
- output. The function, kbd{C-c
- C-o}, also uses
- node hlines
- code{:hlines}
- code{:hlines}, src header argument
- In-between each table row or below the table headings, sometimes results have
- horizontal lines, which are also known as hlines. The
- code{yes} accepts such lines. The default is
- itemize
- item
- code{hline} symbols raise unbound variable errors.
- The default is
- example
- #+NAME: many-cols
- | a | b | c |
- |---+---+---|
- | d | e | f |
- |---+---+---|
- | g | h | i |
- #+NAME: echo-table
- #+BEGIN_SRC python :var tab=many-cols
- return tab
- #+END_SRC
- #+RESULTS: echo-table
- | a | b | c |
- | d | e | f |
- | g | h | i |
- item
- code{:hlines yes}, the example shows hlines unchanged.
- end example
- node colnames
- code{:colnames}
- code{:colnames}, src header argument
- The code{yes},
- code{nil} values. The default value is
- itemize
- item
- example
- #+NAME: less-cols
- | a |
- |---|
- | b |
- | c |
- #+NAME: echo-table-again
- #+BEGIN_SRC python :var tab=less-cols
- return [[val + '*' for val in row] for row in tab]
- #+END_SRC
- #+RESULTS: echo-table-again
- | a |
- |----|
- | b* |
- | c* |
- pxref{var, Indexable variable values}) because column names are not removed
- for indexing.
- code{no}
- Do not pre-process column names.
- code{yes}
- For an input table that has no hlines, process it like the
- end itemize
- subsubsection
- cindex
- code{:rownames} header argument can take on values
- code{no} values. The default is code{emacs-lisp}
- code blocks ignore
- itemize
- item
- item
- example
- #+NAME: with-rownames
- | one | 1 | 2 | 3 | 4 | 5 |
- | two | 6 | 7 | 8 | 9 | 10 |
- #+NAME: echo-table-once-again
- #+BEGIN_SRC python :var tab=with-rownames :rownames yes
- return [[val + 10 for val in row] for row in tab]
- #+END_SRC
- #+RESULTS: echo-table-once-again
- | one | 11 | 12 | 13 | 14 | 15 |
- | two | 16 | 17 | 18 | 19 | 20 |
- pxref{var, Indexable variable values}) because row names are not removed
- for indexing.
- node shebang
- code{:shebang}
- code{:shebang}, src header argument
- This header argument can turn results into executable script files. By
- setting the
- code{:shebang "#!/bin/bash"}), Org inserts that string as the first line of
- the tangled file that the
- node tangle-mode
- code{:tangle-mode}
- code{:tangle-mode}, src header argument
- The
- code{set-file-modes}. For example, to make read-only
- tangled file, use
- code{:tangle-mode (identity #o755)}.
- On code{shebang} (
- code{tangle-mode} header argument.
- When multiple
- code{tangle-mode} header arguments, Org's behavior is
- undefined.
- subsubsection
- cindex
- code{:eval} header argument can limit evaluation of specific code
- blocks. It is useful for protection against evaluating untrusted
- code{org-confirm-babel-evaluate} setting.
- code
- samp{src} code block.
- samp{src} code block.
- samp{src} code block when exporting, yet the user
- can evaluate this source block interactively.
- samp{src} code block.
- code{:eval} header argument is not set for a source block, then Org
- determines whether to evaluate from the
- pxref{Code evaluation security}).
- subsubsection
- cindex
- code{:wrap} header argument marks the results block by appending strings
- to code{#+END_}. If no string is specified, Org wraps
- the results in a
- node post
- code{:post}
- code{:post}, src header argument
- The
- samp{src} block evaluation. When
- code{*this*} variable for easy passing to
- samp{src}
- code blocks, or for even direct Emacs Lisp code execution.
- The following two examples illustrate
- code{#+ATTR_LATEX:} line using
- example
- #+name: attr_wrap
- #+begin_src sh :var data="" :var width="\\textwidth" :results output
- echo "#+ATTR_LATEX: :width $width"
- echo "$data"
- #+end_src
- #+header: :file /tmp/it.png
- #+begin_src dot :post attr_wrap(width="5cm", data=*this*) :results drawer
- digraph
- }
- #+end_src
- #+RESULTS:
- :RESULTS:
- #+ATTR_LATEX :width 5cm
- [[file:/tmp/it.png]]
- :END:
- code{:colnames} in
- samp{src} code blocks.
- end example
- subsubsection
- cindex
- code{prologue} header argument is for appending to the top of the code
- block for execution. For example, a clear or reset code at the start of new
- execution of a code{reset} for
- code{:prologue "reset"}. See also
- lisp
- (add-to-list 'org-babel-default-header-args:gnuplot
- '((:prologue . "reset")))
- node epilogue
- code{:epilogue}
- code{:epilogue}, src header argument
- The value of the
- ref{prologue}.
- section Results of evaluation
- cindex source code, results of evaluation
- How Org handles results of a code block execution depends on many header
- arguments working together. Here is only a summary of these. For an
- enumeration of all the header arguments that affect results, see
- code{:session}
- or not? Orthogonal to that is if the expected result is a
- code{:results output}, which is a concatenation of output from
- start to finish of the
- multitable
- item b{Non-session} b{Session}
- code{:results value} tab value of last expression
- code{:results output} tab concatenation of interpreter output
- code{:session} and non-session, the
- subsection Non-session
- code{:results value}
- code{:results}, src header argument
- Default. Org gets the value by wrapping the code in a function definition in
- the language of the code{:results
- value}, code should execute like a function and return a value. For
- languages like Python, an explicit
- code{:results value}.
- This is one of four evaluation contexts where Org automatically wraps the
- code in a function definition.
- code{:results output}
- code{:results}, src header argument
- For
- subsection Session
- code{:results value}
- code{:results}, src header argument
- For code{:session}, Org passes the code to an
- interpreter running as an interactive Emacs inferior process. So only
- languages that provide interactive evaluation can have session support. Not
- all languages provide this support, such as samp{ditaa}. Even
- those that do support, such as samp{Haskell}, they impose
- limitations on allowable language constructs that can run interactively. Org
- inherits those limitations for those
- code{:session}.
- Org gets the value from the source code interpreter's last statement
- output. Org has to use language-specific methods to obtain the value. For
- example, from the variable samp{Python} and
- code{.Last.value} in
- subsubsection
- cindex
- code{:results output}, Org passes the code to the interpreter running as
- an interactive Emacs inferior process. Org concatenates whatever text output
- emitted by the interpreter to return the collection as a result. Note that
- this collection is not the same as collected from
- example
- #+BEGIN_SRC python :results output
- print "hello"
- 2
- print "bye"
- #+END_SRC
- #+RESULTS:
- : hello
- : bye
- example
- #+BEGIN_SRC python :results output :session
- print "hello"
- 2
- print "bye"
- #+END_SRC
- #+RESULTS:
- : hello
- : 2
- : bye
- code{:session} mode, the interactive interpreter receives and
- prints ``2''. Results show that.
- section Noweb reference syntax
- cindex syntax, noweb
- uref{http://www.cs.tufts.edu/~nr/noweb/}).
- end example
- For the header argument
- samp{src} code block before evaluation.
- For the header argument
- samp{src} code block before evaluation.
- The default is
- pxref{noweb-ref}).
- Org can handle naming of
- samp{src} code block, using ``noweb'' style references.
- For ``noweb'' style reference, append parenthesis to the code block name for
- arguments, as shown in this example:
- end example
- Note: Org defaults to
- samp{Ruby} where ``noweb'' syntax is equally valid characters. For
- example, code{:noweb yes} for
- languages where there is no risk of confusion.
- For faster tangling of large Org mode files, set
- code{t}.
- The speedup comes at the expense of not correctly resolving inherited values
- of the
- node Key bindings and useful functions
- cindex code block, key bindings
- Many common Org mode key sequences are re-bound depending on the context.
- Active key bindings in code blocks:
- columnfractions 0.25 0.75
- item tab
- kindex C-c C-o
- kbd{C-c C-o} code{org-babel-open-src-block-result}
- item key{up}} code{org-babel-load-in-session}
- item key{down}} code{org-babel-switch-to-session}
- multitable
- kindex C-c C-v p
- item r{or} tab
- kindex C-c C-v n
- item r{or} tab
- kindex C-c C-v e
- item r{or} tab
- kindex C-c C-v o
- item r{or} tab
- kindex C-c C-v v
- item r{or} tab
- kindex C-c C-v u
- item r{or} tab
- kindex C-c C-v g
- item r{or} tab
- kindex C-c C-v r
- item r{or} tab
- kindex C-c C-v b
- item r{or} tab
- kindex C-c C-v s
- item r{or} tab
- kindex C-c C-v d
- item r{or} tab
- kindex C-c C-v t
- item r{or} tab
- kindex C-c C-v f
- item r{or} tab
- kindex C-c C-v c
- item r{or} tab
- kindex C-c C-v j
- item r{or} tab
- kindex C-c C-v l
- item r{or} tab
- kindex C-c C-v i
- item r{or} tab
- kindex C-c C-v I
- item r{or} tab
- kindex C-c C-v z
- item r{or} tab
- kindex C-c C-v a
- item r{or} tab
- kindex C-c C-v h
- item r{or} tab
- kindex C-c C-v x
- item r{or} tab
- end multitable
- c columnfractions 0.25 0.75
- item tab
- c kbd{C-c C-v C-b} code{org-babel-execute-buffer}
- item tab
- c kbd{C-c C-v C-l} code{org-babel-lob-ingest}
- item tab
- c kbd{C-c C-v C-s} code{org-babel-execute-subtree}
- item tab
- c kbd{C-c C-v C-z} code{org-babel-switch-to-session}
- end multitable
- section Batch execution
- cindex source code, batch execution
- Org mode features, including working with source code facilities can be
- invoked from the command line. This enables building shell scripts for batch
- processing, running automated system tasks, and expanding Org mode's
- usefulness.
- The sample script shows batch processing of multiple files using
- example
- #!/bin/sh
- # -*- mode: shell-script -*-
- #
- # tangle files with org-mode
- #
- DIR=`pwd`
- FILES=""
- # wrap each argument in the code required to call tangle on it
- for i in $; do
- FILES="$FILES \"$i\""
- done
- emacs -Q --batch \
- --eval "(progn
- (require 'org)(require 'ob)(require 'ob-tangle)
- (mapc (lambda (file)
- (find-file (expand-file-name file \"$DIR\"))
- (org-babel-tangle)
- (kill-buffer)) '($FILES)))" 2>&1 |grep -i tangled
- node Miscellaneous
- menu
- * Completion:: M-TAB guesses completions
- * Easy templates:: Quick insertion of structural elements
- * Speed keys:: Electric commands at the beginning of a headline
- * Code evaluation security:: Org mode files evaluate inline code
- * Customization:: Adapting Org to changing tastes
- * In-buffer settings:: Overview of the #+KEYWORDS
- * The very busy C-c C-c key:: When in doubt, press C-c C-c
- * Clean view:: Getting rid of leading stars in the outline
- * TTY keys:: Using Org on a tty
- * Interaction:: With other Emacs packages
- * org-crypt:: Encrypting Org files
- node Completion
- cindex completion, of
- cindex completion, of TODO keywords
- cindex completion, of option keywords
- cindex completion, of property keys
- cindex
- cindex TODO keywords completion
- cindex option keyword completion
- cindex link abbreviations, completion of
- Org has in-buffer completions. Unlike minibuffer completions, which are
- useful for quick command interactions, Org's in-buffer completions are more
- suitable for content creation in Org documents. Type one or more letters and
- invoke the hot key to complete the text in-place. Depending on the context
- and the keys, Org will offer different types of completions. No minibuffer
- is involved. Such mode-specific hot keys have become an integral part of
- Emacs and Org provides several shortcuts.
- kbd
- key{TAB}
- key{TAB}
- Complete word at point
- bullet
- item
- After TeX{} symbols supported by the exporter.
- samp{*}, complete headlines in the current buffer so that they
- can be used in search links like
- item
- After
- code{org-tag-alist} (possibly set through the
- pxref{Setting tags}), or it is created
- dynamically from all tags used in the current buffer.
- samp{:} and not in a headline, complete property keys. The list
- of keys is constructed dynamically from all keys used in the current
- buffer.
- samp{[}, complete link abbreviations (
- item
- After samp{TYP_TODO} or
- file-specific
- kbd{M-
- item
- After
- item
- When the point is anywhere else, complete dictionary words using Ispell.
- kindex C-M-i
- If your desktop intercepts the combo key{TAB}} to switch windows, use
- kbd{key{TAB}} as an alternative or customize your
- environment.
- node Easy templates
- cindex template insertion
- code{#+BEGIN_SRC} and
- file{yasnippet} and other Emacs template expansion packages.
- key{<}} key{s}} key{TAB}} completes the
- kbd{<} kbd{
- multitable
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- item tab
- end multitable
- More templates can added by customizing the variable
- node Speed keys
- cindex speed keys
- vindex org-speed-commands-user
- Single keystrokes can execute custom commands in an Org file when the cursor
- is on a headline. Without the extra burden of a meta or modifier key, Speed
- Keys can speed navigation or execute custom commands. Besides faster
- navigation, Speed Keys may come in handy on small mobile devices that do not
- have full keyboards. Speed Keys may also work on TTY devices known for their
- problems when entering Emacs keychords.
- By default, Org has Speed Keys disabled. To activate Speed Keys, configure
- the variable
- kbd{?} shows currently
- active Speed Keys. To add or modify Speed Keys, customize the variable,
- node Code evaluation security
- samp{src} code block,
- in terms of risk, is equivalent to an executable file. Org therefore puts a
- few confirmation prompts by default. This is to alert the casual user from
- accidentally running untrusted code.
- For users who do not run code blocks or write code regularly, Org's default
- settings should suffice. However, some users may want to tweak the prompts
- for fewer interruptions. To weigh the risks of automatic execution of code
- blocks, here are some details about code evaluation.
- Org evaluates code in the following circumstances:
- i
- samp{src} code blocks in an Org file during export. Org also
- evaluates a kbd{C-c C-c} key chord. Users
- exporting or running code blocks must load files only from trusted sources.
- Be weary of customizing variables that remove or alter default security
- measures.
- code{t}, Org prompts the user for confirmation before executing each
- code block. When
- code{t} or
- end defopt
- For example, this function enables execution of
- lisp
- (defun my-org-confirm-babel-evaluate (lang body)
- (not (string= lang "ditaa"))) ; don't ask for ditaa
- (setq org-confirm-babel-evaluate 'my-org-confirm-babel-evaluate)
- item Following code{elisp} links
- Org has two link types that can also directly evaluate code (
- defopt org-confirm-shell-link-function
- Function that prompts the user before executing a shell link.
- defopt org-confirm-elisp-link-function
- Function that prompts the user before executing an Emacs Lisp link.
- item Formulas in tables
- Org executes formulas in tables (
- emph{calc} or the
- end table
- section Customization
- cindex options, for customization
- kbd{M-x org-customize RET} command. Or through the Org
- menu,
- pxref{In-buffer settings}).
- section Summary of in-buffer settings
- cindex special keywords
- In-buffer settings start with
- kbd{C-c C-c} activates any changes to the in-buffer settings. Closing and
- reopening the Org file in Emacs also activates the changes.
- table
- item #+ARCHIVE: %s_done::
- Sets the archive location of the agenda file. This location applies to the
- lines until the next
- code{org-archive-location}.
- item #+COLUMNS: %25ITEM ...
- code{COLUMNS} property.
- vindex org-table-formula-constants
- code{org-table-formula-constants-local}. The global
- version of this variable is
- item #+FILETAGS: :tag1:tag2:tag3:
- Set tags that all entries in the file will inherit from here, including the
- top-level entries.
- vindex org-link-abbrev-alist
- Each line specifies one abbreviation for one link. Use multiple
- pxref{Link abbreviations}. The corresponding
- variable is
- item #+PRIORITIES: highest lowest default
- vindex org-lowest-priority
- item #+PROPERTY: Property_Name Value
- This line sets a default inheritance value for entries in the current
- buffer, most useful for specifying the allowed values of a property.
- item #+SETUPFILE: file
- The setup file is for additional in-buffer settings. Org loads this file and
- parses it for any settings in it only when Org opens the main file.
- kbd{C-c '} while the cursor is on the line with the file
- name.
- cindex #+STARTUP
- Startup options Org uses when first visiting a file.
- The first set of options deals with the initial visibility of the outline
- tree. The corresponding variable for global default settings is
- code{t}, which is the same
- as
- vindex org-startup-folded
- code{overview}, STARTUP keyword
- code{content}, STARTUP keyword
- code{showall}, STARTUP keyword
- code{showeverything}, STARTUP keyword
- r{top-level headlines only}
- content
- r{no folding of any entries}
- showeverything
- end example
- cindex
- cindex
- code{org-startup-indented}
- r{start with
- r{start with
- end example
- code{org-startup-align-all-tables} with
- cindex
- cindex
- example
- align
- r{don't align tables on startup}
- vindex org-startup-with-inline-images
- Whether Org should automatically display inline images. The corresponding
- variable is
- code{nil} to avoid delays when visiting a file.
- code{inlineimages}, STARTUP keyword
- code{noinlineimages}, STARTUP keyword
- r{show inline images}
- noinlineimages
- end example
- LaTeX{} fragments to images. The
- variable
- code{nil} by default to avoid startup delays.
- code{latexpreview}, STARTUP keyword
- code{nolatexpreview}, STARTUP keyword
- r{preview
- r{don't preview
- end example
- vindex org-log-note-clock-out
- code{org-log-done},
- code{org-log-repeat})
- code{logdone}, STARTUP keyword
- code{lognotedone}, STARTUP keyword
- code{nologdone}, STARTUP keyword
- code{lognoteclock-out}, STARTUP keyword
- code{nolognoteclock-out}, STARTUP keyword
- code{logrepeat}, STARTUP keyword
- code{lognoterepeat}, STARTUP keyword
- code{nologrepeat}, STARTUP keyword
- code{logreschedule}, STARTUP keyword
- code{lognotereschedule}, STARTUP keyword
- code{nologreschedule}, STARTUP keyword
- code{logredeadline}, STARTUP keyword
- code{lognoteredeadline}, STARTUP keyword
- code{nologredeadline}, STARTUP keyword
- code{logrefile}, STARTUP keyword
- code{lognoterefile}, STARTUP keyword
- code{nologrefile}, STARTUP keyword
- code{logdrawer}, STARTUP keyword
- code{nologdrawer}, STARTUP keyword
- code{logstatesreversed}, STARTUP keyword
- code{nologstatesreversed}, STARTUP keyword
- r{record a timestamp when an item is marked DONE}
- lognotedone
- r{don't record when items are marked DONE}
- logrepeat
- r{record a note when reinstating a repeating item}
- nologrepeat
- r{record a note when clocking out}
- nolognoteclock-out
- r{record a timestamp when scheduling time changes}
- lognotereschedule
- r{do not record when a scheduling date changes}
- logredeadline
- r{record a note when deadline changes}
- nologredeadline
- r{record a timestamp when refiling}
- lognoterefile
- r{do not record when refiling}
- logdrawer
- r{store log outside of drawer}
- logstatesreversed
- r{do not reverse the order of states notes}
- vindex org-hide-leading-stars
- code{org-hide-leading-stars} and
- code{nil}
- (meaning code{oddeven}).
- code{hidestars}, STARTUP keyword
- code{showstars}, STARTUP keyword
- code{odd}, STARTUP keyword
- code{even}, STARTUP keyword
- r{hide all stars on the headline except one.}
- showstars
- r{virtual indents according to the outline level}
- noindent
- r{show odd outline levels only (1,3,...)}
- oddeven
- end example
- vindex org-time-stamp-overlay-formats
- To turn on custom format overlays over timestamps (variables
- code{org-time-stamp-overlay-formats}), use
- code{customtime}, STARTUP keyword
- r{overlay custom time format}
- vindex constants-unit-system
- The following options influence the table spreadsheet (variable
- cindex
- cindex
- example
- constcgs file{constants.el} should use the c-g-s unit system}
- constSI file{constants.el} should use the SI unit system}
- vindex org-footnote-define-inline
- vindex org-footnote-auto-adjust
- For footnote settings, use the following keywords. The corresponding
- variables are
- code{org-footnote-auto-label}, and
- cindex
- cindex
- cindex
- cindex
- cindex
- cindex
- cindex
- cindex
- cindex
- example
- fninline
- r{define footnotes in separate section}
- fnlocal
- r{prompt for footnote labels}
- fnauto code{[fn:1]}-like labels automatically (default)}
- fnconfirm
- r{create
- r{automatically renumber and sort footnotes}
- nofnadjust
- end example
- code{org-hide-block-startup}.
- code{hideblocks}, STARTUP keyword
- code{nohideblocks}, STARTUP keyword
- r{Hide all begin/end blocks on startup}
- nohideblocks
- end example
- code{org-pretty-entities} and the keywords
- code{entitiespretty}, STARTUP keyword
- code{entitiesplain}, STARTUP keyword
- r{Show entities as UTF-8 characters where possible}
- entitiesplain
- end example
- vindex org-tag-alist
- These lines specify valid tags for this file. Org accepts multiple tags
- lines. Tags could correspond to the
- code{org-tag-alist}.
- item #+TBLFM:
- This line is for formulas for the table directly above. A table can have
- multiple
- samp{#+TBLFM:} line. For details see
- ref{Editing and debugging formulas}.
- itemx #+OPTIONS:, #+BIND:,
- ref{Export settings}.
- vindex org-todo-keywords
- These lines set the TODO keywords and their significance to the current file.
- The corresponding variable is
- end table
- section The very busy C-c C-c key
- cindex C-c C-c, overview
- The
- itemize
- item
- If any highlights shown in the buffer from the creation of a sparse tree, or
- from clock display, remove such highlights.
- code{#+KEYWORD} lines, scan the
- buffer for these lines and update the information.
- item
- If the cursor is on a
- item
- If the current buffer is a capture buffer, close the note and file it. With
- a prefix argument, also jump to the target location after saving the note.
- code{<<<target>>>}, update radio targets and
- corresponding links in this buffer.
- item
- If the cursor is at a footnote reference, go to the corresponding
- definition, and
- item
- If the cursor is on a statistics cookie, update it.
- item
- If the cursor is on a numbered item in a plain list, renumber the
- ordered list.
- code{#+BEGIN} line of a dynamic block, the
- block is updated.
- end itemize
- section A cleaner outline view
- cindex dynamic indentation
- cindex clean outline view
- Org's default outline with stars and no indents can become too cluttered for
- short documents. For
- example
- end group
- noindent
- To turn this mode on, use the minor mode,
- footnote{The
- code{wrap-prefix} correctly for indenting and wrapping long lines of
- headlines or text. This minor mode handles
- code{word-wrap}.}.
- To make more horizontal space, the headlines are shifted by two stars. This
- can be configured by the
- code{org-hide} variable.
- Note that turning on
- code{org-hide-leading-stars} to code{org-adapt-indentation} to
- samp{2.} below shows how this works.
- To globally turn on
- code{org-startup-indented}.
- To turn on indenting for individual files, use
- example
- #+STARTUP: indent
- enumerate
- emph{Indentation of text below headlines}
- example
- *** 3rd level
- more text, now indented
- vindex org-adapt-indentation
- Org adapts indentations with paragraph filling, line wrapping, and structure
- editingcode{org-adapt-indentation}.}.
- vindex org-hide-leading-stars
- * Org can make leading stars invisible. For
- global preference, configure the variable
- code{#+STARTUP} options:
- end example
- With stars hidden, the tree is shown as:
- group
- * Top level headline
- * Second level
- * 3rd level
- ...
- end example
- vindex org-hide
- code{org-hide} face may need tweaking to get the effect
- right. For some black and white combinations,
- item
- dots{}, can also clean up the
- clutter. This removes two stars from each level
- samp{LEVEL=2} has 3 stars,
- code{org-odd-levels-only}. To set this per-file, use either
- one of the following lines:
- end example
- To switch between single and double stars layouts, use
- kbd{M-x org-convert-to-oddeven-levels}.
- node TTY keys
- cindex tty key bindings
- Org provides alternative key bindings for TTY and modern mobile devices that
- cannot handle cursor keys and complex modifier key chords. Some of these
- workarounds may be more cumbersome than necessary. Users should look into
- customizing these further based on their usage needs. For example, the
- normal key{cursor}} for editing timestamp might be better with
- multitable
- item tab tab tab
- item key{TAB}} kbd{C-u tab tab
- kbd{M-tab tab tab key{Esc}
- item key{left}} kbd{C-c C-x L} kbd{L}
- item key{right}} kbd{C-c C-x r} kbd{r} kbd{key{right}}
- kbd{M-S-tab tab tab
- kbd{M-tab tab tab key{Esc}
- item key{up}} kbd{C-c C-x U} kbd{U}
- item key{down}} kbd{C-c C-x d} kbd{ } kbd{key{down}}
- kbd{M-S-tab tab tab
- kbd{S-tab tab tab
- kbd{M-tab tab tab key{Esc}
- item key{RET}} kbd{C-c C-x M} kbd{ }
- item key{left}} kbd{C-c tab tab
- kbd{S-tab key{right}} kbd{ }
- item key{up}} kbd{C-c tab tab
- kbd{S-tab key{down}} kbd{ }
- item key{left}} kbd{C-c C-x tab tab
- kbd{C-S-tab key{right}} kbd{ }
- end multitable
- section Interaction with other packages
- menu
- * Cooperation:: Packages Org cooperates with
- * Conflicts:: Packages that lead to conflicts
- node Cooperation
- table
- cindex
- cindex Gillespie, Dave
- file{calc.el} by Dave Gillespie
- Org uses the Calc package for tables to implement spreadsheet functionality
- (
- xref{Embedded Mode, , Embedded Mode, calc, GNU Emacs Calc Manual}.
- file{constants.el} by Carsten Dominik
- file{constants.el}
- vindex org-table-formula-constants
- Org can use names for constants in formulas in tables. Org can also use
- calculation suffixes for units, such as samp{Mega}. For a
- standard collection of such constants, install the
- url{http://www.astro.uva.nl/~dominik/Tools}. Org checks if the function
- file{constants.el}.
- file{cdlatex.el} by Carsten Dominik
- file{cdlatex.el}
- LaTeX{} package to efficiently enter
- pxref{CDLaTeX mode}).
- file{imenu.el} by Ake Stenhoff and Lars Lindberg
- file{imenu.el}
- Imenu creates dynamic menus based on an index of items in a file. Org mode
- supports Imenu menus. Enable it with a mode hook as follows:
- end lisp
- code{org-imenu-depth}.
- file{speedbar.el} by Eric M. Ludlam
- file{speedbar.el}
- kbd{<} in the Speedbar frame tweeks the
- agenda commands to that file or to a subtree.
- file{table.el}
- file{table.el} by Takaaki Ota
- cindex table editor,
- cindex
- cindex Ota, Takaaki
- Complex ASCII tables with automatic line wrapping, column- and row-spanning,
- and alignment can be created using the Emacs table package by Takaaki Ota.
- Org mode recognizes such tables and export them properly.
- samp{src} code
- blocks. Because of interference with other Org mode functionality, Takaaki
- Ota tables cannot be edited directly in the Org buffer.
- kbd
- file{table.el} table. Works when the cursor is in a table.el table.
- orgcmd{C-c ~,org-table-create-with-table.el}
- Insert a
- file{table.el} format and the Org mode
- format. See the documentation string of the command
- end table
- node Conflicts
- table
- cindex
- vindex org-support-shift-select
- In Emacs,
- kbd{S-
- kbd{S-
- code{org-support-shift-select} for customization. Org mode
- accommodates shift selection by (i) making it available outside of the
- special contexts where special commands apply, and (ii) extending an
- existing active region even if the cursor moves across a special context.
- file{CUA.el} by Kim. F. Storm
- file{CUA.el}
- vindex org-replace-disputed-keys
- Org key bindings conflict with
- code{org-replace-disputed-keys}. When set, Org moves the following key
- bindings in Org files, and in the agenda buffer (but not during date
- selection).
- result{} M-p S-DOWN
- result{} M-- S-RIGHT
- result{} M-S-- C-S-RIGHT
- end example
- code{org-disputed-keys}.
- file{ecomplete.el} by Lars Magne Ingebrigtsen
- cindex
- emph{not} follow the advice to automagically
- turn on Orgtbl mode in message buffers (see
- item
- cindex
- file{filladapt.el}
- and Org mode, so a safe thing to do is to disable filladapt like this:
- end lisp
- file{yasnippet.el}
- file{yasnippet.el}
- The way Org mode binds the code{[tab]} instead of
- lisp
- (add-hook 'org-mode-hook
- (lambda ()
- (setq-local yas/trigger-key [tab])
- (define-key yas/keymap [tab] 'yas/next-field-or-maybe-expand)))
- lisp
- (defun yas/org-very-safe-expand ()
- (let ((yas/fallback-behavior 'return-nil)) (yas/expand)))
- lisp
- (add-hook 'org-mode-hook
- (lambda ()
- (make-variable-buffer-local 'yas/trigger-key)
- (setq yas/trigger-key [tab])
- (add-to-list 'org-tab-first-hook 'yas/org-very-safe-expand)
- (define-key yas/keymap [tab] 'yas/next-field)))
- item
- cindex
- kbd{S-<cursor>} keys, so everything written
- in the paragraph above about CUA mode also applies here. If you want make
- the windmove function active in locations where Org mode does not have
- special functionality on key{cursor}}, add this to your
- configuration:
- end lisp
- file{viper.el} by Michael Kifer
- file{viper.el}
- kbd{C-c /} and therefore makes this key not access the
- corresponding Org mode command
- code{viper-vi-global-user-map} with
- end lisp
- node org-crypt
- cindex
- cindex
- samp{:crypt:} tag will be automatically
- be encrypted when the file is saved. To use a different tag, customize the
- lisp
- (require 'org-crypt)
- (org-crypt-use-before-save-magic)
- (setq org-tags-exclude-from-inheritance (quote ("crypt")))
- (setq org-crypt-key nil)
- ;; GPG key to use for encryption
- ;; Either the Key ID or set to nil to use symmetric encryption.
- (setq auto-save-default nil)
- ;; Auto-saving does not cooperate with org-crypt.el: so you need
- ;; to turn it off if you plan to use org-crypt.el quite often.
- ;; Otherwise, you'll get an (annoying) message each time you
- ;; start Org.
- ;; To turn it off only locally, you can insert this:
- ;;
- ;; # -*- buffer-auto-save-file-name: nil; -*-
- node Hacking
- cindex hacking
- This appendix covers some areas where users can extend the functionality of
- Org.
- LaTeX{} and other programs
- * Dynamic blocks:: Automatically filled blocks
- * Special agenda views:: Customized views
- * Speeding up your agendas:: Tips on how to speed up your agendas
- * Extracting agenda information:: Post-processing of agenda information
- * Using the property API:: Writing programs that use entry properties
- * Using the mapping API:: Mapping over all or selected entries
- node Hooks
- cindex hooks
- Org has a large number of hook variables for adding functionality. This
- appendix illustrates using a few. A complete list of hooks with
- documentation is maintained by the Worg project at
- node Add-on packages
- cindex add-on packages
- Various authors wrote a large number of add-on packages for Org.
- These packages are not part of Emacs, but they are distributed as contributed
- packages with the separate release available at
- file{contrib/README} file in the source code directory for a list of
- contributed files. Worg page with more information is at:
- node Adding hyperlink types
- cindex hyperlinks, adding new types
- Org has many built-in hyperlink types (
- file{org-man.el}, shows the
- process of adding Org links to Unix man pages, which look like this:
- lisp
- ;;; org-man.el - Support for links to manpages in Org
- (require 'org)
- (org-add-link-type "man" 'org-man-open)
- (add-hook 'org-store-link-functions 'org-man-store-link)
- (defcustom org-man-command 'man
- "The Emacs command to be used to display a man page."
- :group 'org-link
- :type '(choice (const man) (const woman)))
- (defun org-man-open (path)
- "Visit the manpage on PATH.
- PATH should be a topic that can be thrown at the man command."
- (funcall org-man-command path))
- (defun org-man-store-link ()
- "Store a link to a manpage."
- (when (memq major-mode '(Man-mode woman-mode))
- ;; This is a man page, we do make this link
- (let* ((page (org-man-get-page-name))
- (link (concat "man:" page))
- (description (format "Manpage for %s" page)))
- (org-store-link-props
- :type "man"
- :link link
- :description description))))
- (defun org-man-get-page-name ()
- "Extract the page name from the buffer name."
- ;; This works for both `Man-mode' and `woman-mode'.
- (if (string-match " \\(\\S-+\\)\\*" (buffer-name))
- (match-string 1 (buffer-name))
- (error "Cannot create link to this man page")))
- (provide 'org-man)
- ;;; org-man.el ends here
- noindent
- To activate links to man pages in Org, enter this in the init file:
- end lisp
- file{org-man.el}:
- item
- First, file{org.el} is loaded.
- code{org-add-link-type} defines a new link type with
- item
- code{org-store-link-functions} that records
- a useful link with the command
- end enumerate
- The rest of the file defines necessary variables and functions. First is the
- customization variable
- code{man} and
- code{org-man-command} to display the man page.
- kbd{C-c l} calls the function
- code{major-mode} is appropriate. If check fails, the function
- returns
- samp{man:} prefix with the man topic. The function then calls
- code{:type} and
- code{:description} property is an optional string that is displayed when the
- function inserts the link in the Org buffer.
- kbd{C-c C-l}. This function should not accept any arguments
- but return the appropriate prefix and complete link string.
- section Adding export back-ends
- code{org-export-define-backend} and
- file{ox-latex.el} for an example of defining a new back-end from scratch,
- and
- code{:menu-entry} keyword. For export
- options specific to this back-end, set the
- code{:translate-alist}
- to an alist of export functions. This alist replaces the parent back-end
- functions.
- For complete documentation, see
- node Context-sensitive commands
- cindex context-sensitive commands, hooks
- vindex org-ctrl-c-ctrl-c-hook
- Org has facilities for building context sensitive commands. Authors of Org
- add-ons can tap into this functionality.
- Some Org commands change depending on the context. The most important
- example of this behavior is the pxref{The very busy C-c C-c
- key}). Other examples are kbd{M-S-cursor}.
- These context sensitive commands work by providing a function that detects
- special context for that add-on and executes functionality appropriate for
- that context.
- section Tables and lists in arbitrary syntax
- cindex lists, in other modes
- LaTeX{}. This would be hard to do in a general way
- without complicated customization nightmares. Moreover, that would take Org
- away from its simplicity roots that Orgtbl has proven. There is, however, an
- alternate approach to accomplishing the same.
- This approach involves implementing a custom
- emph{source table} to produce a table in another
- format. This strategy would keep the excellently working Orgtbl simple and
- isolate complications, if any, confined to the translate function. To add
- more alien table formats, we just add more translate functions. Also the
- burden of developing custom translate functions for new table formats will be
- in the hands of those who know those formats best.
- For an example of how this strategy works, see Orgstruct mode. In that mode,
- Bastien added the ability to use Org's facilities to edit and re-structure
- lists. He did by turning
- LaTeX{} or Texinfo.
- LaTeX{} example:: Step by step, almost a tutorial
- * Translator functions:: Copy and modify
- * Radio lists:: Sending and receiving lists
- node Radio tables
- cindex radio tables
- Radio tables are target locations for translated tables that are not near
- their source. Org finds the target location and inserts the translated
- table.
- The key to finding the target location are the magic words
- example
- noindent
- At the location of source, Org needs a special line to direct Orgtbl to
- translate and to find the target for inserting the translated table. For
- example:
- example
- #+ORGTBL: SEND table_name translation_function arguments...
- noindent
- code{translation_function} is the Lisp function that
- translates. This line, in addition, may also contain alternating key and
- value arguments at the end. The translation function gets these values as a
- property list. A few standard parameters are already recognized and acted
- upon before the translation function is called:
- code
- item :skipcols (n1 n2 ...)
- List of columns to be skipped. First Org automatically discards columns with
- calculation marks and then sends the table to the translator function, which
- then skips columns as specified in
- end table
- itemize
- item
- Place the table in a block comment. For example, in C mode you could wrap
- the table between samp{*/} lines.
- samp{END} statement. For example
- TeX{} and {documentLaTeX{}.
- kbd{M-x
- orgtbl-toggle-comment RET} command makes toggling easy.
- node A
- subsection A
- cindex
- LaTeX{}, use the
- file{comment.sty}. To activate it, put
- {comment
- footnote{By default this works only for
- code{orgtbl-radio-table-templates} to
- install templates for other export formats.} with the command
- samp{salesfigures} is the name, the template inserts:
- example
- % BEGIN RECEIVE ORGTBL salesfigures
- % END RECEIVE ORGTBL salesfigures
- \begin}
- #+ORGTBL: SEND salesfigures orgtbl-to-latex
- | | |
- \end}
- noindent
- LaTeX{}-verbatim-environments
- The line
- code{orgtbl-to-latex} to convert the table to
- code{salesfigures}. Now
- the table is ready for data entry. It can even use spreadsheet
- featuressamp{#+TBLFM} line contains an odd number of dollar
- characters, this may cause problems with font-lock in
- code{comment} environment that is used to balance the dollar expressions.
- If you are using AUC
- code{comment} environment to the variable
- example
- % BEGIN RECEIVE ORGTBL salesfigures
- % END RECEIVE ORGTBL salesfigures
- \begin}
- #+ORGTBL: SEND salesfigures orgtbl-to-latex
- | Month | Days | Nr sold | per day |
- |-------+------+---------+---------|
- | Jan | 23 | 55 | 2.4 |
- | Feb | 21 | 16 | 0.8 |
- | March | 22 | 278 | 12.6 |
- #+TBLFM: $4=$3/$2;%.1f
- % $ (optional extra dollar to keep font-lock happy, see footnote)
- \end}
- noindent
- After editing,
- emph{splice} out the
- target table without the header and footer.
- {tabular{lrrr
- {1{c{Days
- {tabular
- {comment
- {comment
- end example
- The code{orgtbl-to-latex} is already part of
- Orgtbl mode and uses
- code{\hline}. For additional
- parameters to control output,
- table
- item :splice nil/t
- When non-
- code{nil}.
- code{%s} for the original
- field value. For example, to wrap each field value in dollar symbol, you
- could use
- code{:fmt (2 "$%s$" 4 "%s\\%%")}.
- In place of a string, a function of one argument can be used; the function
- must return a formatted string.
- code{%s} twice for
- inserting mantissa and exponent, for example {%s
- code{:efmt (2 "$%s\\times10^@{%s@}$" 4 "$%s\\cdot10^@{%s@}$")}. After
- code{fmt} will also be applied.
- Functions with two arguments can be supplied instead of strings. By default,
- no special formatting is applied.
- node Translator functions
- cindex HTML, and Orgtbl mode
- code{orgtbl-to-csv}
- (comma-separated values),
- code{orgtbl-to-latex}, code{orgtbl-to-texinfo},
- code{orgtbl-to-orgtbl}. They use the generic
- translator,
- samp{ORGTBL SEND} line take
- precedence over properties defined inside the function. For example, this
- overrides the default samp{\\}, with
- example
- #+ORGTBL: SEND test orgtbl-to-latex :lend " \\\\[2mm]"
- samp{!BTBL!} and
- samp{!BL!} and
- lisp
- (defun orgtbl-to-language (table params)
- "Convert the orgtbl-mode TABLE to language."
- (orgtbl-to-generic
- table
- (org-combine-plists
- '(:tstart "!BTBL!" :tend "!ETBL!" :lstart "!BL!" :lend "!EL!" :sep "\t")
- params)))
- noindent
- The documentation for the
- code{orgtbl-to-latex},
- code{hline}. The second argument is the property list consisting of
- parameters specified in the
- email{emacs-orgmodegnu.org}.
- subsection Radio lists
- cindex org-list-insert-radio-list
- Call the
- LaTeX{}, and Texinfo mode documents. Sending and
- receiving radio lists works is the same as for radio tables (
- cindex #+ORGLST
- minus
- item
- Use code{ORGTBL}.
- kbd{C-c C-c} works only on the first list item.
- code{org-list-to-latex},
- code{org-list-to-texinfo}. They use the
- LaTeX{} example:
- {comment
- {comment
- end example
- samp{a new house} inserts the translated
- node Dynamic blocks
- cindex dynamic blocks
- Org supports
- samp{src} code block, but the contents
- are updated automatically by a user function. For example,
- pxref{Clocking work
- time}).
- Dynamic blocks can have names and function parameters. The syntax is similar
- to
- cindex #+BEGIN:dynamic block
- end example
- These command update dynamic blocks:
- kbd
- orgkey{C-u C-c C-x C-u}
- Update all dynamic blocks in the current file.
- code{:content}, on the BEGIN line.
- To syntax for calling a writer function with a named block,
- code{org-dblock-write:myblock}. Parameters come from the BEGIN line.
- The following is an example of a dynamic block and a block writer function
- that updates the time when the function was last run:
- end example
- lisp
- (defun org-dblock-write:block-update-time (params)
- (let ((fmt (or (plist-get params :format) "%d. %m. %Y")))
- (insert "Last block update at: "
- (format-time-string fmt))))
- code{org-update-all-dblocks} in hook, such as
- code{org-update-all-dblocks} function does not run if the file is not in
- Org mode.
- Dynamic blocks, like any other block, can be narrowed with
- node Special agenda views
- cindex agenda views, user-defined
- vindex org-agenda-skip-function-global
- Org provides a special hook to further limit items in agenda views:
- code{agenda*}code{agenda*} view is the same as
- emph{appointments}, i.e.,
- scheduled and deadline items that have a time specification
- code{todo}, code{tags},
- code{tags-tree}. Specify a custom function that tests
- inclusion of every matched item in the view. This function can also
- skip as much as is needed.
- For a global condition applicable to agenda views, use the
- code{org-agenda-skip-function} for custom searching.
- This example defines a function for a custom view showing TODO items with
- WAITING status. Manually this is a multi step search process, but with a
- custom view, this can be automated as follows:
- The custom function searches the subtree for the WAITING tag and returns
- lisp
- (defun my-skip-unless-waiting ()
- "Skip trees that are not waiting"
- (let ((subtree-end (save-excursion (org-end-of-subtree t))))
- (if (re-search-forward ":waiting:" subtree-end t)
- nil ; tag found, do not skip
- subtree-end))) ; tag not found, continue after end of subtree
- lisp
- (org-add-agenda-custom-command
- '("b" todo "PROJECT"
- ((org-agenda-skip-function 'my-skip-unless-waiting)
- (org-agenda-overriding-header "Projects waiting for something: "))))
- vindex org-agenda-overriding-header
- Note that this also binds
- vindex org-odd-levels-only
- samp{LEVEL>0}
- code{org-odd-levels-only}, a level number corresponds to order in the
- hierarchy, not to the number of stars.}. Then to selectively pick the
- matched entries, use
- code{org-agenda-skip-entry-if} and
- table
- item (org-agenda-skip-entry-if 'scheduled)
- Skip current entry if it has been scheduled.
- item (org-agenda-skip-entry-if 'deadline)
- Skip current entry if it has a deadline.
- item (org-agenda-skip-entry-if 'todo '("TODO" "WAITING"))
- Skip current entry if the TODO keyword is TODO or WAITING.
- item (org-agenda-skip-entry-if 'timestamp)
- Skip current entry if it has any timestamp, may also be deadline or scheduled.
- item (org-agenda-skip-entry-if 'regexp "regular expression")
- Skip current entry if the regular expression matches in the entry.
- item (org-agenda-skip-subtree-if 'regexp "regular expression")
- Same as above, but check and skip the entire subtree.
- samp{WAITING} without the
- special function:
- end lisp
- section Speeding up your agendas
- enumerate
- item
- Reduce the number of
- item
- lisp
- (setq org-agenda-dim-blocked-tasks nil)
- item
- vindex org-agenda-inhibit-startup
- Stop preparing agenda buffers on startup:
- end lisp
- vindex org-agenda-show-inherited-tags
- lisp
- (setq org-agenda-use-tag-inheritance nil)
- end enumerate
- These options can be applied to selected agenda views. For more details
- about generation of agenda views, see the docstrings for the relevant
- variables, and this
- node Extracting agenda information
- cindex agenda, pipe
- vindex org-agenda-custom-commands
- Org provides commands to access agendas through Emacs batch mode. Through
- this command-line interface, agendas are automated for further processing or
- printing.
- code{org-agenda-custom-commands}. These are the same
- ones available through
- example
- emacs -batch -l ~/.emacs -eval '(org-batch-agenda "t")' | lpr
- samp{shop}, but excludes items tagged with
- example
- emacs -batch -l ~/.emacs \
- -eval '(org-batch-agenda "+shop-NewYork")' | lpr
- noindent
- An example showing on-the-fly parameter modifications:
- end example
- file{~/org/projects.org} file.
- For structured processing of agenda output, use
- example
- category
- r{The headline, without TODO keyword, TAGS and PRIORITY}
- type
- r{selected in TODO match}
- tagsmatch
- r{imported from diary}
- deadline
- r{scheduled}
- timestamp
- r{entry was closed on date}
- upcoming-deadline
- r{forwarded scheduled item}
- block
- r{The TODO keyword, if any}
- tags
- r{The relevant date, like 2007-2-14}
- time
- r{String with extra planning info}
- priority-l
- r{The computed numerical priority}
- noindent
- If the selection of the agenda item was based on a timestamp, including those
- items with samp{SCHEDULED} keywords, then Org includes
- date and time in the output.
- If the selection of the agenda item was based on a timestamp (or
- deadline/scheduled), then Org includes date and time in the output.
- Here is an example of a post-processing script in Perl. It takes the CSV
- output from Emacs and prints with a checkbox:
- {$cmd 2>/dev/null
- {
- # get the individual values
- ($category,$head,$type,$todo,$tags,$date,$time,$extra,
- $priority_l,$priority_n) = split(/,/,$line);
- # process and print
- print "[ ] $head\n";
- end example
- section Using the property API
- cindex properties, API
- Functions for working with properties.
- *
- This includes the TODO keyword, the tags, time strings for deadline,
- scheduled, and clocking, and any additional properties defined in the
- entry. The return value is an alist. Keys may occur multiple times
- if the property key was used several times.
- code{nil}, in which case the current entry is used.
- If WHICH is code{all}, get all properties. If WHICH is
- code{standard}, only get that subclass.
- vindex org-use-property-inheritance
- defun org-entry-get pom property &optional inherit
- Get value of code{POM}
- code{INHERIT} is non-
- code{INHERIT} is the
- symbol
- code{org-use-property-inheritance} selects
- end defun
- code{PROPERTY} from entry at point-or-marker POM.
- defun org-entry-put pom property value
- Set code{VALUE} for entry at point-or-marker POM.
- defun org-buffer-property-keys &optional include-specials
- Get all property keys in the current buffer.
- defun org-insert-property-drawer
- Insert a property drawer for the current entry.
- defun org-entry-put-multivalued-property pom property &rest values
- Set code{POM} to .
- end defun
- code{PROPERTY} as a whitespace-separated
- list of values and return the values as a list of strings.
- defun org-entry-add-to-multivalued-property pom property value
- Treat the value of the property
- code{VALUE} is in this list.
- defun org-entry-remove-from-multivalued-property pom property value
- Treat the value of the property
- code{VALUE} is
- end defun
- code{PROPERTY} as a whitespace-separated
- list of values and check if
- end defun
- samp{:ETC} is one of
- the values, use the values as completion help, but allow also other values
- to be entered. The functions must return
- end defopt
- section Using the mapping API
- cindex mapping entries, API
- Org has sophisticated mapping capabilities for finding entries. Org uses
- this functionality internally for generating agenda views. Org also exposes
- an API for executing arbitrary functions for each selected entry. The API's
- main entry point is:
- samp{FUNC} at each headline selected by code{SCOPE}.
- code{FUNC} in
- save-excursion form. After evaluation, Org moves the cursor to the end of
- the line that was just processed. Search continues from that point forward.
- This may not always work as expected under some conditions, such as if the
- current sub-tree was removed by a previous archiving operation. In such rare
- circumstances, Org skips the next entry entirely when it should not. To stop
- Org from such skips, make
- code{org-map-continue-from} to a specific buffer position.
- code{MATCH} is
- code{t}.
- example
- nil
- r{the subtree started with the entry at point}
- region
- r{the current buffer, without restriction}
- file-with-archives
-
- r{all agenda files}
- agenda-with-archives
-
- r{if this is a list, all files in the list will be scanned}
- noindent
- The remaining args are treated as settings for the scanner's skipping
- facilities. Valid args are:
- example
- archive
- r{skip trees with the COMMENT keyword}
- function or Lisp form
- code{org-agenda-skip-function},}
-
- r{will not be called for that entry and search will}
-
- end example
- pxref{Using the property API}).
- Here are some handy functions:
- code{ARG}.
- defun org-priority &optional action
- Change the priority of the entry. See the docstring of this function for the
- possible values for
- end defun
- code{TAG} in the current entry. Setting
- code{on} or
- end defun
- end defun
- end defun
- This example turns all entries tagged with
- code{UPCOMING}. Org ignores entries in comment trees and
- archive trees.
- end lisp
- The following example counts the number of entries with TODO keyword
- lisp
- (length (org-map-entries t "/+WAITING" 'agenda))
- node MobileOrg
- cindex iPhone
- uref{https://github.com/MobileOrg/, iOS implementation} for the
- uref{http://wiki.github.com/matburt/mobileorg-android/, MobileOrg
- Android} by Matt Jones. Though the two implementations are not identical,
- they offer similar features.
- This appendix describes Org's support for agenda view formats compatible with
- MobileOrg. It also describes synchronizing changes, such as to notes,
- between MobileOrg and the computer.
- To change tags and TODO states in MobileOrg, first customize the variables
- code{org-tag-alist}. These should cover all
- the important tags and TODO keywords, even if Org files use only some of
- them. Though MobileOrg has in-buffer settings, it understands TODO states
- pxref{Per-file keywords}) and
- pxref{Setting tags}) only for those set in these variables.
- end menu
- section Setting up the staging area
- MobileOrg needs access to a file directory on a server to interact with
- Emacs. With a public server, consider encrypting the files. MobileOrg
- version 1.5 supports encryption for the iPhone. Org also requires
- code{org-mobile-use-encryption}
- code{org-mobile-encryption-password}; please read the docstring of that
- variable.}. Note that even after MobileOrg encrypts the file contents, the
- file names will remain visible on the file systems of the local computer, the
- server, and the mobile device.
- For a server to host files, consider options like
- footnote{An alternative is to
- use webdav server. MobileOrg documentation has details of webdav server
- configuration. Additional help is at
- file{MobileOrg/} on
- Dropbox. Pass its location to Emacs through an init file variable as
- follows:
- end lisp
- Org copies files to the above directory for MobileOrg. Org also uses the
- same directory for sharing notes between Org and MobileOrg.
- section Pushing to MobileOrg
- Org pushes files listed in
- code{org-mobile-directory}. Files include agenda files (as listed in
- code{org-mobile-files} to add other
- files. File names will be staged with paths relative to
- footnote{Symbolic links in
- file{agendas.org} with custom agenda views
- defined by the user
- code{org-mobile-force-id-on-agenda-items} to
- file{index.org}, containing links to other files.
- MobileOrg reads this file first from the server to determine what other files
- to download for agendas. For faster downloads, MobileOrg will read only
- those files whose checksums
- file{checksums.dat}.} have changed.
- section Pulling from MobileOrg
- When MobileOrg synchronizes with the server, it pulls the Org files for
- viewing. It then appends to the file
- enumerate
- file{mobileorg.org}file{mobileorg.org} will be empty after this
- operation.} and appends them to the file pointed to by the variable
- item
- After moving the entries, Org attempts changes to MobileOrg. Some changes
- are applied directly and without user interaction. Examples include changes
- to tags, TODO state, headline and body text. Entries for further action are
- tagged as
- item
- Org generates an agenda view for flagged entries for user intervention to
- clean up. For notes stored in flagged entries, MobileOrg displays them in
- the echo area when the cursor is on the corresponding agenda item.
- kbd
- item ?
- Pressing
- kbd{? z C-y C-c C-c}. Pressing
- code{:FLAGGED:} tag; second, it removes the flagged note from
- the property drawer; third, it signals that manual editing of the flagged
- entry is now finished.
- end enumerate
- kbd{C-c a ?} returns to the agenda view to finish processing flagged
- entries. Note that these entries may not be the most recent since MobileOrg
- searches files that were last pulled. To get an updated agenda view with
- changes since the last pull, pull again.
- appendix History and acknowledgments
- cindex history
- section From Carsten
- Org was born in 2003, out of frustration over the user interface of the Emacs
- Outline mode. I was trying to organize my notes and projects, and using
- Emacs seemed to be the natural way to go. However, having to remember eleven
- different commands with two or three keys per command, only to hide and show
- parts of the outline tree, that seemed entirely unacceptable. Also, when
- using outlines to take notes, I constantly wanted to restructure the tree,
- organizing it paralleling my thoughts and plans.
- emph{structure editing} were originally implemented in the package
- file{org.el}.
- As this environment became comfortable for project planning, the next step
- was adding emph{timestamps}, and
- email{emacs-orgmodegnu.org} have provided a constant stream of bug
- reports, feedback, new ideas, and sometimes patches and add-on code.
- Many thanks to everyone who has helped to improve this package. I am
- trying to keep here a list of the people who had significant influence
- in shaping one or more aspects of Org. The list may not be
- complete, if I have forgotten someone, please accept my apologies and
- let me know.
- Before I get to this list, a few special mentions are in order:
- i
- LaTeX{} exporter and the
- plain list parser. His support during the early days was central to the
- success of this project. Bastien also invented Worg, helped establishing the
- Web presence of Org, and sponsored hosting costs for the orgmode.org website.
- Bastien stepped in as maintainer of Org between 2011 and 2013, at a time when
- I desperately needed a break.
- item John Wiegley
- John has contributed a number of great ideas and patches directly to Org,
- including the attachment system (
- file{org-mac-message.el}), hierarchical dependencies of TODO
- items, habit tracking (
- file{org-crypt.el}). Also, the capture system is really an extended copy
- of his great
- item Sebastian Rose
- Without Sebastian, the HTML/XHTML publishing of Org would be the pitiful work
- of an ignorant amateur. Sebastian has pushed this part of Org onto a much
- higher level. He also wrote
- end table
- section From Bastien
- I (Bastien) have been maintaining Org between 2011 and 2013. This appendix
- would not be complete without adding a few more acknowledgments and thanks.
- I am first grateful to Carsten for his trust while handing me over the
- maintainership of Org. His unremitting support is what really helped me
- getting more confident over time, with both the community and the code.
- When I took over maintainership, I knew I would have to make Org more
- collaborative than ever, as I would have to rely on people that are more
- knowledgeable than I am on many parts of the code. Here is a list of the
- persons I could rely on, they should really be considered co-maintainers,
- either of the code or the community:
- i
- item Nicolas Goaziou
- Nicolas is maintaining the consistency of the deepest parts of Org. His work
- on file{ox.el} has been outstanding, and it opened
- the doors for many new ideas and features. He rewrote many of the old
- exporters to use the new export engine, and helped with documenting this
- major change. More importantly (if that's possible), he has been more than
- reliable during all the work done for Org 8.0, and always very reactive on
- the mailing list.
- emph{ad hoc} tools
- into a flexible and conceptually clean process. He patiently coped with the
- many hiccups that such a change can create for users.
- end table
- I received support from so many users that it is clearly impossible to be
- fair when shortlisting a few of them, but Org's history would not be
- complete if the ones above were not mentioned in this manual.
- itemize
- item
- item
- item
- file{ox-man.el}.
- i{Thomas Baumann} wrote file{org-mhe.el}.
- i{Michael Brand} helped by reporting many bugs and testing many features.
- He also implemented the distinction between empty fields and 0-value fields
- in Org's spreadsheets.
- i{Christophe Bataillon} created the great unicorn logo that we use on the
- Org mode website.
- i{Alex Bochannek} provided a patch for rounding timestamps.
- i{Jan Böcker} wrote
- item
- item
- file{org-choose.el}.
- i{Charles Cave}'s suggestion sparked the implementation of templates
- for Remember, which are now templates for capture.
- i{Pavel Chalmoviansky} influenced the agenda treatment of items with
- specified time.
- i{Gregory Chernov} patched support for Lisp forms into table
- calculations and improved XEmacs compatibility, in particular by porting
- item
- item
- item
- file{.texi}
- file to DocBook using
- item
- item
- item
- item
- item
- item
- file{org-taskjuggler.el}, which has been rewritten by Nicolas Goaziou as
- item
- item
- item
- item
- item
- item
- file{org-git-line.el}.
- i{Mikael Fornius} works as a mailing list moderator.
- i{Austin Frank} works as a mailing list moderator.
- i{Eric Fraga} drove the development of BEAMER export with ideas and
- testing.
- i{Barry Gidden} did proofreading the manual in preparation for the book
- publication through Network Theory Ltd.
- i{Niels Giesen} had the idea to automatically archive DONE trees.
- i{Nicolas Goaziou} rewrote much of the plain list code. He also wrote
- file{org-export.el}, which was a huge step forward
- in implementing a clean framework for Org exporters.
- i{Kai Grossjohann} pointed out key-binding conflicts with other packages.
- i{Brian Gough} of Network Theory Ltd publishes the Org mode manual as a
- book.
- i{Bernt Hansen} has driven much of the support for auto-repeating tasks,
- task state change logging, and the clocktable. His clear explanations have
- been critical when we started to adopt the Git version control system.
- i{Manuel Hermenegildo} has contributed various ideas, small fixes and
- patches.
- i{Phil Jackson} wrote
- item
- item
- i{MobileOrg Android}.
- i{Tokuya Kameshima} wrote file{org-mew.el}.
- i{Jonathan Leech-Pepin} wrote
- item
- LaTeX{} and tested it. He also
- provided frequent feedback and some patches.
- i{Matt Lundin} has proposed last-row references for table formulas and named
- invisible anchors. He has also worked a lot on the FAQ.
- i{David Maus} wrote
- item
- item
- item
- item
- item
- item
- item
- item
- item
- item
- file{orgcard2ref.pl}, a Perl program to create a text
- version of the reference card.
- i{Takeshi Okano} translated the manual and David O'Toole's tutorial
- into Japanese.
- i{Oliver Oppitz} suggested multi-state TODO items.
- i{Scott Otterson} sparked the introduction of descriptive text for
- links, among other things.
- i{Pete Phillips} helped during the development of the TAGS feature, and
- provided frequent feedback.
- i{Francesco Pizzolante} provided patches that helped speeding up the agenda
- generation.
- i{Martin Pohlack} provided the code snippet to bundle character insertion
- into bundles of 20 for undo.
- i{Rackspace.com} is hosting our website for free. Thank you Rackspace!
- i{T.V. Raman} reported bugs and suggested improvements.
- i{Matthias Rempe} (Oelde) provided ideas, Windows support, and quality
- control.
- i{Paul Rivier} provided the basic implementation of named footnotes. He
- also acted as mailing list moderator for some time.
- i{Kevin Rogers} contributed code to access VM files on remote hosts.
- i{Frank Ruell} solved the mystery of the
- file{allout.el}.
- i{Jason Riedy} generalized the send-receive mechanism for Orgtbl tables with
- extensive patches.
- i{Philip Rooke} created the Org reference card, provided lots
- of feedback, developed and applied standards to the Org documentation.
- i{Christian Schlauer} proposed angular brackets around links, among
- other things.
- i{Christopher Schmidt} reworked
- item
- file{org-ctags.el}.
- i{Tom Shannon}'s
- item
- item
- file{ditaa.jar} ASCII to PNG converter that is
- now packaged into Org's
- item
- item
- item
- item
- item
- LaTeX{}, UTF-8, Latin-1 and ASCII.
- i{Andy Stewart} contributed code to
- item
- file{org-publish.el} and drafted the manual
- chapter about publishing.
- i{Jambunathan K} contributed the ODT exporter and rewrote the HTML exporter.
- i{Sebastien Vauban} reported many issues with
- item
- item
- item
- item
- samp{QUOTE}
- keyword.
- i{David Wainberg} suggested archiving, and improvements to the linking
- system.
- i{Carsten Wimmer} suggested some changes and helped fix a bug in
- linking to Gnus.
- i{Roland Winkler} requested additional key bindings to make Org
- work on a tty.
- i{Piotr Zielinski} wrote
- item
- file{org-eww.el}.
- node GNU Free Documentation License
- include doclicense.texi
- unnumbered Concept index
- node Key Index
- printindex ky
- unnumbered Command and function index
- node Variable Index
- kbd{M-x org-customize
- printindex vr
- c Local variables:
- c indent-tabs-mode: nil
- [a-zA-Z]*[ \n]\\|^
- c paragraph-separate: "\\|^@[a-zA-Z]*[ \n]\\|^@x?org\\(key\\|cmd\\)\\|[ \f]*$"
- c LocalWords: webdavhost pre
|