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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

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