📚 The CoCalc Library - books, templates and other resources
License: OTHER
\documentclass{scrartcl}1\usepackage[T1]{fontenc}2\usepackage[scaled =.92]{helvet}3\setlength{\paperwidth}{5.2075in}4\setlength{\paperheight}{4.90in}5\renewcommand*{\familydefault}{phv}6\usepackage[pdftex,margin=0.5in]{geometry}7\usepackage{soul}8\usepackage{fancyhdr}9\lhead{Sound and TeX}\chead{}10\rhead{Can you hear me?}11\lfoot{}\cfoot{}\rfoot{}12\pagestyle{fancy}13\usepackage{graphicx}14\usepackage{xcolor}15\usepackage[pdftex,pdfpagelayout=SinglePage,16pdftitle={Hello world},pdfsubject={Invest your new year improving your TeX skills}%17]{hyperref}18\definecolor{background}{rgb}{0.99,0.98,0.90}19\pagecolor{background}20\setlength{\parindent}{0.0cm}21\usepackage[pdftex]{insdljs}2223\begin{insDLJS}[test]{test}{JavaScript}24function Hello()25{26var cSpeaker = tts.getNthSpeakerName(0);27tts.speaker = cSpeaker;28tts.qText ("Hello, Tex Stack Exchange. Helloooo, can anybody hear me? Helloooo?");29tts.talk();30}313233function HelloWorld()34{35var cSpeaker = tts.getNthSpeakerName(0);36tts.speaker = cSpeaker;37tts.qText ("Hello, Tex Stack Exchange. Helloooo, can anybody hear me?");38tts.qText("This is a new and alien TeX world.");39tts.talk();40}4142function WhatsUp()43{44var cSpeaker = tts.getNthSpeakerName(0);45tts.speaker = cSpeaker;46tts.qText ("Humans are not proud of their ancestors, and rarely invite them round to dinner.");47tts.qText("What\'s up?");48tts.talk();49}5051function Universe()52{53var cSpeaker = tts.getNthSpeakerName(0);54tts.speaker = cSpeaker;55tts.qText ("In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.In those days spirits were brave, the stakes were high, men were real men, women were real women and small furry creatures from Alpha Centauri were real small furry creatures from Alpha Centauri. There is a theory which states that if ever anybody discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable. There is another theory which states that this has already happened. I am Douglas Adams");56tts.qText("Who are you? I may be a sorry case, but I don't write jokes in base 13");57tts.talk();58}596061\end{insDLJS}6263%% This must be here64\OpenAction{/S/JavaScript/JS(Hello();)}6566%% Short hand commands67\newcommand{\textforlabel}[2]{%68\TextField[name={#1}, value={#2}, width=9em,align=2,%69bordercolor={0.990 .980 .85},%70readonly=true]{}%71}727374%% Define the heading75\newcommand{\heading}[1]{\so{#1}}7677\begin{document}78\phantom{0}79\begin{center}80\vspace{2cm}81\textbf{\Huge Hello World!\\[0.2cm] Can you hear me?}82\end{center}83\vfill84\newpage8586\begin{Form}87\begin{center}88%% Push button is defined here89\PushButton[name=hello,%90onclick={HelloWorld();}, bordercolor={0.650 .790 .94}%91]{Hello World!}92\\[10pt]9394\PushButton[name=hello,%95onclick={WhatsUp();}, bordercolor={0.650 .790 .94}%96]{What's Up?}97\\[10pt]9899\PushButton[name=hello,%100onclick={Universe();}, bordercolor={0.650 .790 .94}%101]{What's with the Universe?}102\\[2cm]103\heading{Press a button!}\\104\end{center}105\end{Form}106107108\end{document}109110