Questions tagged [javascript]

JavaScript is a scripting language commonly implemented as part of a web browser, but also of some PDF viewers.

Filter by
Sorted by
Tagged with
43
votes
1answer
3k views

How to embed Javascript in LaTeX Beamer?

I'm wondering if it is possible to add javascript animations in LaTeX Beamer, e.g. figures created with C3 or D3? As far as I remember the animate packages uses javascript in order to display (and ...
37
votes
4answers
57k views

language option supported in listings

I am afraid that listing doesn't support javascript. \begin{lstlisting}[language=javascript] ... \end{lstlisting} What am I doing wrong?
33
votes
2answers
4k views

pdftex and javascript forms with automatic calculations

I would like to create a PDF document in TeX with a form. Some of the fields in the form will be calculated based on the values of other fields. Here is a MWE, thanks to Victor Ivrii on the pdftex ...
33
votes
3answers
6k views

Automatic “Zoom in” hypertext boxes in PDF

I remember long time ago, seeing PDF documents (such as online PDF versions of newspapers) that had hypertext boxes around paragraphs, such that when you clicked inside those boxes the surrounded ...
32
votes
2answers
32k views

\listings code style for HTML5 (CSS, HTML, JavaScript)

I would like to create a code style for HTML5 that can be used with the \listings package. An HTML5 document consists of three languages: CSS, HTML and JavaScript. That makes the whole thing a bit ...
24
votes
1answer
2k views

Move-around box in PDF display

I tried using the fancytooltips package and like it a lot. One thing that I could imagine would be nice is to have the entry showing up as a movable box instead of just a tooltip. (Sometimes the ...
21
votes
1answer
10k views

How do you say Happy New Year with LaTeX?

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 ...
17
votes
1answer
2k views

Beamer and JavaScript in a web browser

I have written a talk in Beamer and to illustrate one of my points I've written a program in JavaScript (well actually Processing). You can view it here (it seems to run ok in Chrome and Firefox, and ...
14
votes
2answers
1k views

Insert web content dynamically (Javascript?)

This year in my field we have a large conference overlapping with the European soccer championship. Luckily my talk does not overlap with any match, but in case it will happen in the future I was ...
14
votes
2answers
4k views

What is the best way to insert document-level JavaScript in LaTeX documents

I have been toying with the idea of converting some forms at work to interactive forms. I have tried some of the routines that come with insdljs, but they seem a bit dated. The idea is very attractive....
12
votes
1answer
8k views

hyperref: how to format text in a forms text-field

I would like to pre-format the text in a form text-field, e.g. make it bold, italic or use a specific font. The following code generates a simple text-field: \documentclass{scrreprt} \usepackage{...
12
votes
1answer
875 views

Forming a “spoiler text” environment in LaTeX (via Javascript?)

I've been writing a mathematical text for some time, and seeing as it is the 21st century, I would like this text to be interactive and dynamic, probably in PDF format. The main function that I am ...
10
votes
2answers
765 views

How to create PSTricks animations on the web page with interactive control panels?

I just visited a cool site that showing PSTricks animations with interactive control panels. For more details, please visit this link (click). The question is how does the owner of the site make the ...
10
votes
2answers
5k views

Example of Javascript form within pdflatex

Can someone please show me an example of how to include a simple Javascript form within a pdflatex document? Can someone please show me an example of accessing and modifying the PDF file's DOM from ...
10
votes
1answer
1k views

Would it be possibile to advance Beamer at the level of the HTML presentations?

I use mostly Reveal.js for my presentations and lately I learned Beamer. As far as I see you can reproduce almost anything from a HTML pres. in Beamer with a little work, except for the animations/...
9
votes
1answer
5k views

Hello World in pdfLaTeX

After many years being silent, TeX can now talk! Almost minimal code below! It should be of particular interest to Physicists and Cosmologists. Need to have Adobe Reader installed. \documentclass{...
9
votes
2answers
4k views

texlive.js possible?

I just found about emscripten, texlive.js is it really a converted version of texlive in JavaScript or a server as Scribtex and many others? Is this really possible?
9
votes
1answer
309 views

Alternative text for Javascript (form) boxes for viewers that don't support Javascript?

I am using the tdclock package to display the current date and time. In looks pretty good in Acrobat, but in other viewers (like Evince) it looks terrible because they don't support Javascripts and ...
8
votes
1answer
2k views

Is it possible to embed a scrollable frame inside a PDF?

(This is an end-of-year crazy question) Is it possible to embed a (scrollable) frame or a PDF inside a PDF? If so, how to do it in (pdf)LaTeX? This is something pretty common in HTML (see for ...
8
votes
1answer
2k views

Hide LaTeX parts through JavaScript

I'm creating an interactive pdf form with the hyperref package. The form is quite comprehensive, so the current goal is to only show parts that are relevant to the specific user. For example, the user ...
7
votes
1answer
1k views

(La)TeX Web browser [closed]

I had an idea this morning and would like to share and to know if someone has already developed it somewhere! A Mozilla group is currently building a JavaScript Application able to transform any PDF ...
6
votes
2answers
671 views

How to check if a string is a valid LaTex rule?

I am using MathQuill lib for the formula input and trying to restrict a number of operations. Is there any way I can differentiate between a string and a LaTex rule? For example: def check('\sum') =&...
6
votes
2answers
1k views

timeline and animate package

I'm trying to make some pdf with animate package controlling a loop with the timeline. The purpose is to have a loop but reaching the last frame, the color of the dot should change. My main questions ...
5
votes
1answer
3k views

Two column layout with form

So here is the basic idea: 2 column Layout, 1 column with text and 1 column with a form you can fill in Acrobat Reader etc. I tried to use parallel and/or paracol package along with the hyperref \...
5
votes
1answer
1k views

Inject JavaScript with pdflatex etc. for page level events

I am experimenting a little bit with JavaScript in PDF documents generated via pdflatex. I wonder, whether there is a method to access the event handler of Adobe Acrobat or Acrobat Reader in order to ...
5
votes
2answers
1k views

Is there any solution to include Java Applets in presentations/beamers?

I am preparing a presentation on the compiler Texmaker "documentclass" in "beamer". I was fascinated with the package "multimedia" which is a solution to include movies in the presentation. Question: ...
4
votes
1answer
916 views

JavaScript library for producing TiKZ-like diagrams?

I can use mathjax for equations and symbols generally, but what about diagrams? Mathjax doesn't support TiKZ, so I'm looking for a JavaScript library which can be used in place of TiKZ. So far ...
4
votes
1answer
978 views

\pushbuttons with Icons with pdflatex (xobject reference)

I would like to create a pushbutton with icons instead of text. Like the text in the example below the icons should change with the mouse options. The manual of the eforms package (eformman.pdf) ...
4
votes
1answer
2k views

How do I place a simple javascript in the resulting PDF?

I would like to use LaTeX to produce a PDF document with forms with the following features: -One or two user-modifiable text fields -One output text field -A "run" button that, when pressed, will take ...
4
votes
1answer
780 views

Javascript application in latex

I would like to know if it is possible to add an interactive app created with Javascript to a Latex document. I would like to add some of the Javascripts that appear here. Like that one: EDIT I ...
4
votes
1answer
1k views

LaTeX 3D PDF with U3D file and media9: add a view at runtime

I am wondering if I could hack media9 package to achieve such a feature: end-users should be able to add a new view of an animated U3D file at runtime. So I'll be editing the VIEWS FILE from a ...
4
votes
0answers
654 views

How to get and process bitmap graphics at a pixel level on-the-fly?

We are trying to solve How to get intersection point(s) of two glyphs? and there are some interesting subtasks. In word cloud algorithms they are converting glyphs (a vector form) to a raster form and ...
3
votes
2answers
415 views

Can you influence any PDF element using JavaScript?

Using the package insDLJS, one can add JavaScript to PDF's generated by LaTeX. To reference a specific element, one can use this.getField("myElementName"). Can I give any element in LaTeX a field name?...
3
votes
1answer
772 views

Compiling my own mktexfmt

I'm trying to compile my own version of pdftex which works fine. However, I must compile my own format file (fmt) for that. This should be done with mktexfmt. My problem is that I don't know where to ...
3
votes
1answer
460 views

Is it possible to generate random numbers dynamically with javascript on a PDF?

PDFs can be used to manage javascript, such as the packages ocgtools, ocg-p, ocgx or ocgx2, which allow you to create interactive and clickable PDFs. The hyperref package allows you to insert URLs or ...
3
votes
1answer
112 views

Is TeXMaker capable of using a .js script made to work for TeXWorks? If not, how do I go about turning a .js into a .tms?

I'm trying to do the following: LaTeX -> (text selected, keyboard shortcut pressed) -> \hyperref[LaTeX]{LaTeX} I can't use user tags for this because it can't use selection twice, only once. I ...
3
votes
1answer
556 views

Including Javascript to flatten PDF form made in latex

The goal of this is to simplify a process at my work. Any advice would be very much appreciated. This is what we have been doing Using Latex I create a pdf and send it to person 2. Person 2 emails ...
3
votes
2answers
224 views

Texstudio script for deleting $ $

I was wondering how can create a texstudio script for removing the $ $ notation. what is the problem of following code. %SCRIPT txt = cursor.selectedText() txt.replace("$","") editor.write(txt) ...
3
votes
2answers
1k views

Include live remote image in Beamer presentation

From this question, I see that it is possible to include remote images within a PDF, via the media9 package. Can direct inclusion of Javascript--as in this question--be used to update the image (...
3
votes
1answer
210 views

TeXstudio readAllStandardOutputStr seems not to work

I try to insert automatic timestamps into a LaTeX file, to get id's for some items On a windows machine I have got the following macro (JavaScript): %SCRIPT var res=system("c:\\cygwin\\bin\\...
3
votes
1answer
894 views

How can I make toggle buttons with images using pdflatex?

I am currently designing an interactive PDF by means of the media9 package in Latex. I have three \mediabutton buttons that I would like to treat as toggle buttons. A picture of the buttons is shown ...
3
votes
1answer
171 views

Can we have viewer specific text in a pdf generated by pdfLaTex?

I am wondering if we could have a pdf file, which can tell what viewer its being viewed with. I was looking for some tex command, which says something like: If viewer is Acrobat, print "Hi You are ...
3
votes
1answer
108 views

Set precise time on a video using javascript

Hi i'm trying to get a button to set the video time a precise point. The code listed below is what i've made up till now but its not working. i think because it cant get the document.getElementById. ...
3
votes
1answer
651 views

Change Picture with Javascript

since months i cant find a way to change pictures by pressing a button in one field. With a text is is like: \documentclass[a4paper]{article} \usepackage{eforms} \begin{insDLJS}[test]{test}{...
3
votes
0answers
1k views

Latex forms, MakeTextField, LayoutTextField and javascript questions

I trying to do underlined TextField with label under the field (hyperref package). using Underlined text field in a fillable form i tried to renew MakeTextField: \renewcommand{\MakeTextField}[2]{{\...
2
votes
2answers
247 views

Beamer : after the last page — initiate a loop

I'd like that the presentation goes to a specific page after the last page, as it would be the natural next page. I know : \hypersetup{pdfstartpage=1} But it works only to go back to the first page. ...
2
votes
2answers
823 views

Input JS file within insDLJS environment

The eforms package provides the insDLJS environment to insert document-level JavaScript into a PDF file. It would be convenient (for code reuse and syntax highlighting, among other things) to put the ...
2
votes
1answer
355 views

Define Javascript function in Form with hyperref

I have TextFields with the environment Form from hyperref package. However I want to add the values of the TextFields and print the sum in another TextField. That works well with the following code: \...
2
votes
1answer
92 views

Do tooltips use javascript? Might that be a problem?

I am writing my CV in LaTeX and thought it'd be fun to add a little Easter Egg when hovering over LaTeX: That was created with package pdfcomment. However, I've seen some comments (for example, here)...
2
votes
1answer
53 views

Calculations in TextField do not work

I want to have some TextFields in my form where one can put numbers (shares) and the last TextField should be 100 - the sum of all other TextFields. I found this but it did not help, nothing happens. ...