triadamoms.blogg.se

Mathmod scripts
Mathmod scripts







mathmod scripts
  1. #Mathmod scripts pdf#
  2. #Mathmod scripts code#
  3. #Mathmod scripts free#

Var body = DocumentApp.getActiveDocument(). mathMod.py Write a user-defined module that contains three functions. Get the body section of the active document. MATHMOD 2022: 10th Vienna International Conference on Mathematical Modelling. Replaces all occurrences of a given text pattern with a given replacement string, using regular Merges the element with the preceding sibling of the same type. Retrieves the contents of the element as a text string.ĭetermines whether the element is at the end of the Document. Retrieves the element's previous sibling element. Retrieves the element's next sibling element. Retrieves the child index for the specified child element. Retrieves the child element at the specified child index. Searches the contents of the element for the specified text pattern, starting from a given Searches the contents of the element for the specified text pattern using regular expressions. Searches the contents of the element for a descendant of the specified type, starting from the Searches the contents of the element for a descendant of the specified type. Obtains a Text version of the current element, for editing. Outfile:write("%%% calendar for the year ".year.", produced by the lua script\n%%% a on ".os.date().Returns a detached, deep copy of the current element. Outfile = io.open("kalender".year.".tex","w") If juliansunday + 39 120 then ascensionday,ascensionmonth = (juliansunday - 81),5 If juliansunday + 60 151 then corpusday,corpusmonth = (juliansunday - 91),6 If juliansunday + 50 151 then pentecostmonday,pentecostmonth = (juliansunday - 101),6 If juliansunday + 39 121 then ascensionday,ascensionmonth = (juliansunday - 82),5 If juliansunday + 60 152 then corpusday,corpusmonth = (juliansunday - 92),6 If juliansunday + 50 152 then pentecostmonday,pentecostmonth = (juliansunday - 102),6 If eastersundaymonth = 4 then juliansunday = 91 + eastersundayĮlseif eastersundaymonth = 3 then juliansunday = 60 + eastersunday endĮlse if eastersundaymonth = 4 then juliansunday = 90 + eastersundayĮlseif eastersundaymonth = 3 then juliansunday = 59 + eastersunday end We will also create a histogram for all these numbers. Goodfriday,goodfridaymonth = (eastersunday - 2),eastersundaymonthĮlse goodfriday,goodfridaymonth = (eastersunday + 29),(eastersundaymonth - 1) In this example we will create a script that will generate 5000 random numbers between 0 and 100.

mathmod scripts

now, calculate other Christian holidays which depend on Easter Sunday

mathmod scripts

calculate easter sunday, according to Meeus/Jones/Butcher

#Mathmod scripts code#

Neither the lua code nor the TeX code is particularly beautiful (hey, this was my first day with lua), but it may be interesting for someone out there.

#Mathmod scripts pdf#

We have a simple version in black and white which we print on colored paper and into which real pictures are glued, and a digital version which we send to friends via e-mail where the pages of the typeset pdf have colored backgrounds and the pictures are included. The names of the months are in German, but that should be easy to modify. The result will be a calendar for the year XXXX, with every month on one page Sundays and German official holidays are in boldface the first day of the week is Monday. This file can then be typeset with ConTeXt.

#Mathmod scripts free#

Apart from visualizing the actual shape, you are also free to edit. You invoke the script from the command line: lua a XXXX, and it will produce a file kalenderXXXX.tex, where XXXX is a number between 19. To make things a bit more comprehensive, MathMod offers you a very large database of model samples that can be generated with it. Without the convenience of a precooked date module, I had to do all the calculations of holidays and days of the week myself, taking my cues mostly from wikipedia, but it was relatively easy. Then, I tried to achieve the same result with a lua script. I first did it in perl, with the Date::Calc module. There is a number of precooked scripts to produce various calendars for LaTeX, but nothing for ConTeXt, as far as I could see. Of course, I wanted to do that with ConTeXt. The background: we produce a calendar with pictures of our kids every year. I also wanted to get to know a bit more about lua. I decided not to spoil the first day of the new year by doing real work.









Mathmod scripts