package tex
import "strings"
func (p *parser ) readEnvironmentName (name string ) (string , error ) {
env , _ , err := p .readArgument (name , false )
if err != nil {
return "" , err
}
if strings .Contains (env , `\` ) {
return "" , texError ("InvalidEnv" , "Invalid environment name '%s'" , env )
}
return env , nil
}
func (p *parser ) countEnvironment () error {
p .state .macroCount ++
if p .state .macroCount > maxMacros {
return texError ("MaxMacroSub2" , "MathJax maximum substitution count exceeded; is there a recursive latex environment?" )
}
return nil
}
func (p *parser ) sourceEndReturnsItem (name string ) bool {
_ , item := p .sourceEndDefinition (name )
return item
}
func (p *parser ) sourceEndDefinition (name string ) (bool , bool ) {
if _ , defined := p .state .environments [name ]; defined {
return true , false
}
for _ , table := range mjSourceMaps {
if table .Kind != mjSourceEnvironmentMap || (!p .state .augmentedPackages && strings .Contains (table .Source , "/empheq/" )) {
continue
}
for _ , entry := range table .Entries {
if entry .Name == name {
args , _ := entry .Value .(mjSourceList )
if len (args ) < 2 {
return true , true
}
_ , undefined := args [1 ].(mjSourceUndefined )
return true , undefined || !limitsTruthy (args [1 ])
}
}
}
return false , false
}
The pages are generated with Golds v0.8.7 . (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu .
PR and bug reports are welcome and can be submitted to the issue list .
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds .