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
0
votes
2answers
182 views

LaTeX PDF form: Detect CheckBox changed event

I use LaTeX to create a fillable PDF document. How can I detect that a \CheckBox has been clicked? It seems to react only to onfocus={...}, not to onclicked={...} or onchanged{...}. Do I need to ...
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 ...
0
votes
0answers
14 views

Make ChoiceMenu not fillable in hyperref form dependent on other ChoiceMenu

I have a form and there is a ChoiceMenu with three different possibilities. For two of them I have a further ChoiceMenu and it does not make sense to fill them out if the belonging option of the first ...
2
votes
1answer
33 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. ...
2
votes
1answer
101 views

How do you create a date field with hyperref's pdf forms?

Some PDF readers might support a date picker for a text field that contains a date format, as explained here: How to create datepicker using JavaScript in Acrobat DC Pro? This article gave me the ...
3
votes
1answer
330 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 ...
3
votes
1answer
84 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. ...
4
votes
1answer
617 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 ...
1
vote
0answers
34 views

Hide fields from hyperref forms and delete the space they were taking when visible

I wanted to have a "hide/show" PushButton to hide a certain field, which I managed (see MWE). However, when the field is hidden, it still takes "space". Is there a way to not only hide the field ...
0
votes
1answer
81 views

Form: Height of TextField until the end of page

I have a tabular arrangement of Textfields. Is there a simple method to enlarge the text field down below -dynamically- until the end of the page? \documentclass[fontsize=14pt]{scrreprt} \usepackage[...
0
votes
1answer
189 views

Form: How to change the font into TextFields globally

I would like to have typewriter-font into my pdf-form. So I find out the mechanism \TextField[width=5cm, name=NAME,value=Font manually changed, format = { var f = this.getField('NAME'); f.textFont =...
0
votes
1answer
47 views

Form: 'TextField's and digsigfield in a table

Note: Question is kin to Form: Tabular arrangement of 'TextField's and digsigfield I use digsig.sty from Martin Lottermoser http://home.htp-tel.de/lottermose2/tex/dist/digsig.sty How can I ...
1
vote
1answer
184 views

put last modified date on the PDF form generated by markdown + hyperref + javascript + fancyhdr?

This is my pandoc version: pandoc --version pandoc 2.3.1 Compiled with pandoc-types 1.17.5.1, texmath 0.11.1.1, skylighting 0.7.3 Default user data directory: /Users/vle/.pandoc Copyright (C) 2006-...
0
votes
5answers
2k views

latexdiff script for texstudio

I'm trying to use latexdiff script in the texstudio. What is the problem with the following script. %SCRIPT var cf = app.getCurrentFileName(); var ld = new String(cf); ld=ld.substring(0,ld....
0
votes
1answer
101 views

Convert TeX to a standard equation string [closed]

I'm currently programming in Javascript, I figured this would be the best place to put it. I'm very very new to TeX, in fact I discovered it within the past hour. I was wondering if I could convert ...
1
vote
0answers
92 views

convert laTeX to semantic LaTeX Format [closed]

I'm very new in Math,LaTex and all those Related things. Recently I worked on Guppy.js . And they have option to export laTex. But when I try to Import the LaTex it gives an Error. Reading docs ...
1
vote
1answer
58 views

How to perform calculations(Not just display) [closed]

I have almost zero knowledge of TEX. I want an easy way to take common algorithms and use them to calculate values. This would ideally be done in the browser, but if not appropriate I could run on a ...
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 ...
1
vote
1answer
199 views

Can I disable \setminted for a code?

in order to apply a minted style globally and not to copy paste these styles in every \begin{minted} I will use in my paper, I am using \documentclass{article} \usepackage[utf8]{inputenc} \...
3
votes
1answer
108 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 ...
2
votes
1answer
3k views

Javascript LaTeX to HTML interpreter? [duplicate]

Is there a possibility to 'render' latex code with your browser? I have some *.tex files which I would like to render a HTML version of (with HTML-navigation, hyperlinks, etc). However - running some ...
2
votes
1answer
299 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: \...
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 ...
6
votes
2answers
577 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') =&...
1
vote
1answer
400 views

Autocomplete Texstudio macro script

Is it possible to use autocomplete in creating a macro script for Texstudio. The reason I need this is that I want to see what classes with what features can I reach when creating an script. For a ...
1
vote
0answers
135 views

submitForm error with javascript on a PDF

MWE \documentclass{article} \usepackage[pdfpagemode=None,pdfstartview=FitH,pdfview=FitH,colorlinks=true]{hyperref} \usepackage[pdftex]{insdljs} \usepackage[pdftex]{eforms} \begin{document} \...
3
votes
1answer
399 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 ...
0
votes
1answer
482 views

Define the graphics path in the header for TeXstudio

TeXstudio opens a preview, when the mouse cursor hovers the \includegraphics command. Unfortunately this does not work, if a graphicspath is set for the document. It seems that TeXstudio 2.12.4 does ...
1
vote
0answers
599 views

embedding overleaf dokument into website [closed]

is it possible to dynamically embed a overleaf document into a simple (bootstraping-theme, html5) website using the "Read Only Link" ? either with embedding the latest version of the document as a pdf ...
1
vote
1answer
287 views

Include JavaScript code in HTML using tex4ht

I have trouble including JavaScript code in the HTML header generated by tex4ht. The script I want to include is: <script type="text/javascript"> var _gaq = _gaq || []; var pluginUrl = ...
1
vote
0answers
151 views

mediabutton won't control animateinline [closed]

I am displaying an animateinline animation which loops through some frames. I now would like to have a "continue"-button to jump the animation to the next cycle of frames. If I understand the animate ...
1
vote
1answer
152 views

timeline (animate package) flickers to first tranparency when using JavaScript

This is somehow a follow-up to this question. I am using some tikz drawing which I would like to animate using the animate package. The animation should start at the beginning, run through to the end ...
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 ...
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 ...
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{...
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 ...
3
votes
1answer
856 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 ...
29
votes
2answers
30k 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 ...
36
votes
4answers
54k 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?
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 ...
3
votes
2answers
368 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
504 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 ...
0
votes
0answers
53 views

Blacking out a created PDF after a given date with javascript

With the recent CJEU ruling, libraries can lend ebooks like normal books if the book cannot be used after the lending period. Therefore I wanted to try building a PDF with Javascript which blacks out ...
1
vote
0answers
144 views

PDF-Form \textfield output with comma instead of dot (AFNumber-Format)

I build a pdf-form with the package hyperref. I am using this form to calcualate two sums and the difference between this sums. Therefore I am using the package insdljs. Everything works fine as long ...
2
votes
1answer
89 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)...
0
votes
2answers
120 views

eforms's textField covers pop-up tooltip of fancytooltips

I'm trying to create a small fillable form and I have a small z-ordering problem, which I'm not able to solve on my own. I create a 'tooltip' and the 'movetips' option is defined, so the tooltip will ...
2
votes
1answer
194 views

Javascript does not work from button click

I have this very simple LaTeX file that uses the media9 package to insert 3D objects. I want to animate parts of the 3D object using Javascript, preferably on a button click. My problem is that when ...
1
vote
1answer
82 views

javascript script for automatic labeling of equations inside the tex file

What is wrong with the following code for script of the texstudio var linenumber = 0; var keynumber = 1; dialog = UniversalInputDialog(["a","b","c","d","e","g","h","i","j","k"],"Insert The Postfix:",...
0
votes
1answer
147 views

invoking mathtype from texsudio

Any idea how can I automatically invoke Mathtype from texstudio using macro (javascript) and put the formula back onto texstudio automatically. It can be done manually, but I want to know is it ...
3
votes
2answers
209 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) ...