fix table of contents button
update some ways of setting environemtn variable