TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
It is interesting! All javascript libraries can work with LaTeX ? – xport Dec 28 '10 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! – Yiannis Lazarides Dec 28 '10 at 17:53
@Yiannis, if you have time, please show me how animation can work in pdf using Adobe ECMA javascript. – xport Dec 28 '10 at 18:05
Someone should have posted xii.tex a few days ago. – TH. Dec 28 '10 at 18:23
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? – yCalleecharan Jan 3 '11 at 20:54
up vote 12 down vote accepted

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.

share|improve this answer
It's the first "e" in "Année" that should be accented... – Seamus Jan 13 '11 at 15:24
@Seamus: Of course, you are right. – AlexG Jan 13 '11 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 Jan 13 '11 at 15:37
@Alexander I'm not sure about the details of typography conventions, but basic spelling I can manage... – Seamus Jan 13 '11 at 17:35
@Alexander tts.qText("Thanks, and have a Happy New Year");. Default made my other half very happy:) – Yiannis Lazarides Jan 13 '11 at 19:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.