{scripts} is for questions involving external scripts (small programs in source code form) related to (La)TeX.

learn more… | top users | synonyms (1)

5
votes
3answers
8k views

OS X command-script to compile LaTeX

I'm trying to create a script that compiles LaTeX on OS X. Unfortunately I'm not familiar with the language and even though the code works, it has several flaws. Is it possible to close the terminal ...
1
vote
1answer
109 views

Create a script with multiple commands to compile a file in OS X

Suppose I want to compile a file with some Feynman diagrams, using feynmf package. To do this, I need to run the following commands: latex file_name.tex mpost diagram_1.mp mpost diagram_2.mp ... ...
2
votes
1answer
38 views

Redefining font sizes in LaTex

My intention is to set all font sizes to \normalsize. I can achieve this by redefining the command for each font size, using: \renewcommand{\Large}{\normalsize} In this example, why the scriptsize is ...
20
votes
4answers
2k views

texdiff for multi-file documents in subversion

I've been looking for a convenient way to highlight changes between subversion revisions of my Latex document in the generated PDF. I am working on a reasonably complex document that pulls together ...
35
votes
7answers
3k views

What are the advantages of Lua over other scripting languages for a TeX implementation?

The question is inspired by Martin Schröder's answer to I am new to TeX. Should I use LaTeX, XeLaTeX, …? as well as my two previous questions on this forum: Automatic document update Generate LaTeX ...
22
votes
8answers
2k views

Showcase of “programming your document” paradigm

A feature of latex is that you can "program your document". You can do this by using TeX/LaTeX directly (remember that it is Turing complete) or by other languages like lua or python (especially sage) ...
63
votes
5answers
13k views

Detecting all pages which contain color

In an larger LaTeX document there are often only some pages with color content (mainly figures) and the remaining ones are only black and white. Because printing costs for color pages are much higher ...
220
votes
20answers
125k views

Is there any way to do a correct word count of a LaTeX document?

Often assignments (or even papers) have a word count limit. That is not a big deal when using Word, but I don't know how to do that using LaTeX. My solution has been so far to compile the document and ...
2
votes
0answers
42 views

Kile script for regexp replace

It would be very handy to set a shortcut to script in Kile that replaces given instances of text, like for setting non-breaking spaces (~) around given words within selected text: (^|~|\s)(I|of|...
2
votes
1answer
180 views

How to remove LaTeX control sequences from a .tex document using plasTeX?

I need to get just the text and math expressions (ignoring tables, pictures and styling) from a set of LaTeX documents and represent them in html. Looks like plasTeX and MathJaX are enough for this ...
7
votes
2answers
144 views

How to insert a # via \immediate\write18 within a macro

It seems that using \immediate\write18{echo "\string#!/bin/bash (version 1)" > \jobname.command}% outside of a \newcommand works great. However, I want to invoke within a \newcommand: \...
1
vote
0answers
364 views

How can I make a beautiful form to input in latex? [closed]

I want to make a form, with multiple choice, or buttons or whatever... And I want that this form will give me an output that I can use in LaTex, but I don't know how make this. an output like: \...
1
vote
2answers
67 views

Tool to expand latex commands in text

Is there a script out there to expand LaTeX commands in a tex source? I am submitting a manuscript source and I need a tool that expands a LaTeX command because I do not want some commands to appear ...
5
votes
1answer
256 views

How to restrict TexStudio macro script to work only in text/normal mode?

I understand that you can write (?highlighted-as:numbers,math-delimiter,math-keyword) before your trigger and TexStudio will execute the macro only in Math mode. I already tested that in "scripts type"...
10
votes
3answers
358 views

`sed` command to remove highlights from text

I'm using the hl command from the soul package for highlighting. Is there a quick way, using sed or any better tool to remove all highlights? Keep in mind that the highlighted text may contain ...
1
vote
0answers
34 views

Randomly generate pdf on website [closed]

I have created a latex file which creates a pdf by randomly selecting 10 subfiles from a pool of files. This works fine, and I am able to generate a random PDF every time I run my script. A breakdown ...
4
votes
2answers
2k views

Unable to use python.sty package

When compiling a .tex file that uses python.sty package and contains: \begin{python} ... \end{python} I keep getting an error: ./main.tex:33:I can't find file 'bin/main.py.out' \end{python} ...
2
votes
0answers
62 views

search for and highlight words/numbers in pdfpages while only printing highlighted pages

I have a project where it would be very helpful to be able to include pdf pages with certain text and or number highlighted, and in addition limit the pages output to those which have the highlighted ...
0
votes
0answers
37 views

How can I programmatically normalize bibtex records across multiple .bib files?

I use bibdesk to manage a variety of .bib files, some of which have overlapping records. This is because the .bib files are generally oriented around a long-term project and tagging can be quite ...
13
votes
4answers
360 views

replace often used Tex-Literals ($ and $$) for math regions into \( or \) and \[ or \]

Is there an editor or IDE (or a script) for substituting the TeX-Commands $ and $$ for opening and closing math regions into the corresponding LaTeX-Commands \(,\) and \[,\]? I'm sure there is a tool -...
0
votes
1answer
57 views

for shell script containing the whole latex document, adding a file name choosing capability [closed]

I ran across this post Possible to have a shell script containing the whole LaTeX document? The solution in that post works perfectly as written. However I wanted to be able to choose the name ...
2
votes
1answer
81 views

Cursor in TexStudio Macro

I have a Macro in TexStudio that does the following: %SCRIPT txt = cursor.selectedText() editor.write("\\underbrace{"+txt+"}_{}") cursor.clearSelection() That is I select a text, it will be ...
1
vote
1answer
60 views

Format code listing package

I am documenting a script which has almost 43+ keywords. The output I want is something on the below lines... and the latex code I have is \documentclass[a4paper, onesided]{article} \usepackage{...
30
votes
1answer
991 views

Why shouldn't I use getnonfreefonts to install additional fonts? Why shouldn't I use updmap when installing or removing fonts?

This question and answer is a response to a request from Joseph Wright. Why shouldn't I use getnonfreefonts to install additional fonts? Why shouldn't I use updmap when installing or removing fonts? ...
2
votes
1answer
118 views

Google docs to TeX and pdf shell script produces a blank first page, and gives me a “! LaTeX Error: Missing \begin{document}.” error

I made a shell script, Ubuntu 14.04 (taking ideas from google docs as team editor) to grab a google docs file and convert it to LaTeX, compile with LaTeXmk to PDF and then open the pdF with evince as ...
1
vote
0answers
77 views

Output document in Times new romans and french script [closed]

\documentclass{article} \usepackage{fontspec} \setmainfont{Times New Roman} \setsansfont{Arial} \setmonofont{Courier New} \newfontfamily{\frmtfont}{French Script MT} \newcommand{\frmt}[1]{{\frmtfont #...
4
votes
1answer
54 views

Script to remove curly brackets around a single token. How legitimate would that be?

I work on a script that tries to bring LaTeX input into a more canonical form. One of the things I would like to do is remove curly brackets around single tokens, which could be either a single ...
1
vote
0answers
372 views

LaTeX for automatic report generation

I accept that this question might be a bit outside the scope of this page, but please bear with me! At work I'm going to set up a framework for generating some pretty basic reports, which could be on ...
4
votes
2answers
275 views

Automatically validate and format ISBNs

Is there any way to get Biblatex to automatically validate and format ISBNs? That is, I would like to be able to enter a field such as isbn = {9789549090666}, in my .bib file—not worrying about ...
2
votes
0answers
41 views

How to run TexShop scripts from the terminal on OSX

I wish to run the following scripts/commands from the command line: pdflatexmk, the command that cleans the directory, i.e. only keeps the .tex, .pdf, .bib files. Any help is appreciated, Thank you ...
0
votes
0answers
29 views

Using different fonts based on scripts type in XeTeX?

In XeTex and XePersian, I can choose different fonts for normal Persian font, and text which is explicitly defined as Latin separately. But what if I want to typeset other scripts beyond Arabic and ...
1
vote
1answer
153 views

XeLaTex, Biber, XeLaTeX mac terminal mactex2015

Want to compile with terminal. Currently options that work in texmaker are "/usr/local/texlive/2015/bin/x86_64-darwin/xelatex" -interaction=nonstopmode %.tex| "/usr/local/texlive/2015/bin/x86_64-...
1
vote
1answer
50 views

Retrieve zentralblatt (zbMATH) bib reference from script

I want to start using scrips to organize my bibtex file and I would love to use zbMATH's database for that. I already know how to create an URL to search for a paper by fields, such as in: https://...
1
vote
1answer
58 views

Passing details (commands) between two

I'm working on my CV and the covering letter and I would like to compile both documents (two different document classes) in one run (more or less). Either way, I followed the example as shown in this ...
1
vote
0answers
26 views

Weird behaviour runing pdflatex on terminal

I'll try to summarize the problem. Consider the MWE below at /home/user/main.tex and also a pdf file at /home/user/new.pdf. MWE \documentclass{report} \usepackage{graphicx} \begin{document} \sbox0{\...
4
votes
1answer
104 views

Automatic generation of custom coordinate system in tikz (syntax problem?)

I am writing a Python script to draw large diagrams with TikZ. These diagrams require a (d+1)-dimensional coordinate system with coordinates say a0,a1,...,ad. How can I define a coordinate system in ...
1
vote
0answers
86 views

Collecting Beamer frames from multiple tex files

I now have several dozens of beamer TeX files with hundreds of slides. I am wondering is there an easy way of collecting all frames into one document? I think it can be done with any of the scripting ...
18
votes
1answer
14k views

MiKTeX and Perl scripts (and one Python script)

Again and again here on TeX.SX users of MiKTeX ask a question having a problem with a package or included program, where it turns out, that a Perl script is involved, in particular glossaries (because ...
5
votes
3answers
428 views

TeXstudio: Can a script read its trigger?

I would like to write a macro with a trigger #[a-z] that, dependent on the character in the trigger, writes the corresponding Greek letter. That is, the trigger #a should produce \alpha, the trigger #...
4
votes
1answer
483 views

Run a shell script (with parameters) from a PDF generated by LaTeX

I want to have a link in my PDF generated by pdflatex which executes a shell script, and this part works great. The problem I am running into is that I need the link in the PDF to be able to pass ...
0
votes
0answers
62 views

scripts.ini no such file or directory

I have a problem with usage of tex4th package. I installed it, however when I want to check if it works I receive the following error: ht: No such file or directory: C:\Program Files (x86)...\MiKTeX\...
1
vote
0answers
114 views

Good looking LaTeX code [duplicate]

I'm looking for some script (program) which would help in editing LaTeX code. Usually I have a mess in my .tex code, so it would be good if the script could align tabulars and so on. It would also be ...
0
votes
0answers
106 views

Make TeX output look as input wrt script/language?

I have several languages/keyboard layouts on my Mac-pro (Yosemite). I want to write in Armenian/Bengali/Hebrew and so on. These keyboards/languages are formally part of Mac's Yosemite so I have no ...
1
vote
0answers
117 views

Something like \tikzexternalize[prefix=tikztmp/] for LuaLaTeX

My aim is to compile a *.tex file that contains quite a number of tikz-environments and to create for every tikz-environment one pdf-file. Under LaTeX I would use something like \usetikzlibrary{...
4
votes
2answers
114 views

N ary switchs (selectors / conditionnals / toggles) to handle mailling list

Suppose I want to address the same letter to 10 persons. The letters should be the same, except of course for the recipient's name and address. Moreover, I want to enclose the name of all the other ...
0
votes
1answer
178 views

Organiser Refills/Inlays using LaTeX

Every year I need to refill my beloved organiser. But the refills on simple A5 paper are sold for incredible prices around $20. Is there a way to create organiser inlays using LaTeX (e.g. one week ...
2
votes
0answers
96 views

Call “cmd” from within latex

As I asked here, I'm trying to add a link to an image, which already works this way: \documentclass{article} \usepackage{graphicx} \usepackage{hyperref} \let\oldincludegraphics=\includegraphics \...
36
votes
2answers
1k views

How can I make a TeX file executable?

Under UNIX, to my knowledge, any regular file can be made executable with the addition of a shebang: #! /path/to/executing-program --with --options How can I apply the same principle to a TeX file ...
0
votes
0answers
87 views

Run an external script from within lyx

Is it possible to run external scripts from within lyx, passing information about the current file as arguments? I am thinking of usecases like Interacting with file versioning software not ...
7
votes
1answer
252 views

Splitting a huge `.tex` file to chapter files on TeX/LaTeX level [closed]

Inspired by (although a possible duplicate) Outputting each chapter of a LaTeX document to a separate PDF, I wonder whether there is a possibility to extract the chapter (or whatever sectioning level) ...