Generalmaking macros

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
webhead
Posts: 26
Joined: Sat Jul 19, 2008 5:29 pm

making macros

Post by webhead »

There is a macro under Macros--Applescript for creating a bibliography, but I'd like to make one to create an index and glossary. Presently I'm going into Terminal and typing something like this:

Code: Select all

cd path/to/directory
makeindex filename.idx
makeindex filename.glo -s filename.ist -t filename.glg -o filename.gls
Thanks in advance for any help.
Keep to the Code.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

webhead
Posts: 26
Joined: Sat Jul 19, 2008 5:29 pm

making macros

Post by webhead »

Okay, so I never did get it to work. But where there's a will there's a relative, and I decided to forget the LaTex macros and just do it all in Applescript

Code: Select all

set this_file to "myfilename"
set this_dir to choose folder
set mydir to POSIX path of this_dir
do shell script "cd " & mydir & "; 
ls; 
/usr/texbin/makeindex " & this_file & ".idx; 
/usr/texbin/makeindex " & this_file & ".glo -s " & this_file & ".ist -t " & this_file & ".glg -o " & this_file & ".gls"


set frontName to "myfile.tex"

tell document frontName of application "TeXShop"
	
	latexinteractive
	
	repeat
		delay 2
		if taskdone then
			exit repeat
		end if
	end repeat
	
	bibtex
	
	repeat
		delay 2
		if taskdone then
			exit repeat
		end if
	end repeat
	
	latex
	
	repeat
		delay 2
		if taskdone then
			exit repeat
		end if
	end repeat
	
	latex
	
	repeat
		delay 2
		if taskdone then
			exit repeat
		end if
	end repeat
	
end tell
This does a glossary, an index, and a bibliography.
Keep to the Code.
Post Reply