Title says it all. How do you wish "Happy New Year" to a TeXie? Compile the code below with pdfLaTeX, view it with "PDF Reader" or "Adobe Acrobat Pro" and press the "Happy New Year" button on the second page. Please suggest ways to internationalize the "Happy New Year" string by adding translations in the comments in your language.

\usepackage[scaled =.92]{helvet}
\lhead{A Sample Calculation}\chead{}
\rhead{Area of Circle}
pdftitle={Wishing you a happy year},pdfsubject={Invest your new year improving your TeX skills}%



function doCalculation()
var radius=0.0 + this.getField("radius").value;
 this.getField("areacircle").value=  Math.PI * Math.pow(radius, 2);

function HappyNewYear()
 app.alert("Happy New Year!",3);


%% This must be here

%% Short hand commands
\TextField[name={#1}, value={#2}, width=9em,align=2,%
    bordercolor={0.990 .980 .85},%

%% Define the heading

\textbf{\Huge Have a Happy New Year\\ with JavaScript\\*[4pt] and LateX!}


\heading{Area of Circle}}\\

%%% Input field radius

&\\*[-0.8em]\textforlabel{l01}{Radius:}&\TextField[name=radius,width=10em, bordercolor={0.650 .790 .94}]{}%

&\\ \hline

%% Push button is defined here
\PushButton[name=start,onclick={doCalculation();},bordercolor={0.650 .790 .94}%

%% Push button is defined here
onclick={HappyNewYear();}, bordercolor={0.650 .790 .94}%
]{Happy New Year!} 



%% Diameter
\multicolumn{2}{|c|}{}\\*[-0.8em]\textforlabel{name=l04, bordercolor={0.650 0.790 0.94}}{%
Diameter :}&\TextField[name=diameter,width=10em,bordercolor={0.650 .790 .94},%

\textforlabel{name=l05, bordercolor={0.650 0.790 0.94}}{Area:} & \TextField[name=areacircle,width=10em,%
bordercolor={0.650 .790 .94},readonly=true]{}~m$^2$\\*[-0.8em]

As proved by Archimedes, the area enclosed by a circle is $\pi$ multiplied by the radius squared \(\pi r^2\). Apollonius of Perga showed that a circle may also be defined as the set of points in a plane having a constant ratio (other than 1) of distances to two fixed foci, A and B.

Early science, particularly geometry and astrology and astronomy, was connected to the divine for most medieval scholars, and many believed that there was something intrinsically \textit{divine} or \textit{perfect} that could be found in circles. Some people still believe that the earth is still flat and is circular.

Some highlights in the history of the circle are:
\item 1700 BC -- The Rhind papyrus gives a method to find the area of a circular field. The result corresponds to \(\frac{256}{81}\) (3.16049\dots) as an approximate value of $\pi$.
\item 300 BC -- Book 3 of Euclid's Elements deals with the properties of circles.
In Plato's Seventh Letter there is a detailed definition and explanation of the circle. Plato explains the perfect circle, and how it is different from any drawing, words, definition or explanation.
\item 1880 -- Lindemann proves that $\pi$ is transcendental, effectively settling the millennia-old problem of squaring the circle
\item 1978 -- Donald Knuth develops \TeX\ in order to enable future generations to typeset Mathematics in a beautiful way, including all the equations that one can associate with circles.

  • 1
    It is interesting! All javascript libraries can work with LaTeX ? Commented Dec 28, 2010 at 17:49
  • @xport Not all. You cannot use jQuery or any of the libraries that handle the XHTML document model. Adobe has its own model, but Adobe's JS is based on ECMA so you can pretty much use any other routines you may have. Don't forget to add Happy New Year in your \language!
    – yannisl
    Commented Dec 28, 2010 at 17:53
  • 1
    @Yiannis, if you have time, please show me how animation can work in pdf using Adobe ECMA javascript. Commented Dec 28, 2010 at 18:05
  • 5
    Someone should have posted xii.tex a few days ago.
    – TH.
    Commented Dec 28, 2010 at 18:23
  • 1
    I tried to pdfLaTeX the above code but I get the error message: ! LaTeX Error: File `insdljs.sty' not found. I have the TeXLive 2010. Anyone getting this error message? Commented Jan 3, 2011 at 20:54

1 Answer 1


AdobeReader comes in about 15 different languages. This is the number of possible translations of your new year's wishes. The language version of the Reader in which the PDF is opened can be accessed using the JavaScript object app.language. See:


It can be used to choose the matching greeting. I did this for French and German and some default language which appears to be the most widespread one (according to the number of speakers). However, it may require an additional font pack to be installed ;-) :


Just replace your definition of the function HappyNewYear() with the following code:

function HappyNewYear()
    case "FRA":
    hny="Bonne Ann"+String.fromCharCode(233)+"e !";break;;
    case "DE":
    hny="Gl"+String.fromCharCode(252)+"ckliches Neues Jahr!";break;;

Note that some non-ascii characters had to be replaced by their Unicode representation.

  • It's the first "e" in "Année" that should be accented...
    – Seamus
    Commented Jan 13, 2011 at 15:24
  • @Seamus: Of course, you are right.
    – AlexG
    Commented Jan 13, 2011 at 15:31
  • @Seamus: And as far as I know, French typography wants a space before the exclamation mark while German typography forbids it.
    – AlexG
    Commented Jan 13, 2011 at 15:37
  • @Alexander I'm not sure about the details of typography conventions, but basic spelling I can manage...
    – Seamus
    Commented Jan 13, 2011 at 17:35
  • @Alexander tts.qText("Thanks, and have a Happy New Year");. Default made my other half very happy:)
    – yannisl
    Commented Jan 13, 2011 at 19:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .