Commit 26824da8 authored by Dennis Müller's avatar Dennis Müller
Browse files

update

parent e09b3c14
......@@ -11,7 +11,7 @@ import info.kwarc.mmt.api.utils.{File, JSONArray, JSONInt, JSONObject, JSONStrin
val home = File("/home/jazzpirate/work/Scala/ML/data")
val mmt = MyMMT()
val macros = StexChecker.collect(mmt.archivepath / "smglom",true)
val macros = StexChecker.collect(mmt.archivepath / "smglom")(true)._1.getMacros
val proc = new LaTeXProcessor
proc.addCommands(Commands.defaults:_*)
proc.addCommands(macros:_*)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
\begin{mhmodnl}[creators=miko]{sequences}{de}
\begin{definition}[id=sequences.def]
Eine \defi[name=sequence]{Folge}, \notatiendum{$\sequenceon{a}nS$}, ist eine
\mtrefi[functions?function]{Funktion} von einer
\mtrefi[countable?countable]{abz"ahlbaren},
\mtrefiii[linear-order?linearly-ordered-set]{total}{geordneten}{Menge} $S$
(z.B. $\NaturalNumbers$, dann schreiben wir oft $\sequence{a}i$). Ist $S$
\mtrefi[countable?countably-infinite]{unendlich}, so nennen wir eine Folge
$\sequenceon{a}i{S}$ auf $S$ eine \defii[name=infinite-sequence]{unendliche}{Folge}, sonst
eine \defii[name=finite-sequence]{endliche}{Folge}. Die \defi[name=length]{L"ange} von
$\sequenceon{a}i{S}$ ist definiert als die
\mtrefi[finite-cardinality?cardinality]{Kardinalit"at} von $S$.
Folgen werden auf verschiedene Weise geschrieben:
\begin{itemize}
\item $\seq{1,2,3,4}$ f"ur eine konkrete endliche Folge
\item $\seqfromto{1,2,3,4}{10}$ f"ur eine endliche Folge mit Ellipse
\item $\nsequi{x}1n$ und $\nseqli{x}1n$ f"ur Folgen von Variablen
\item $\infseq{1,2,3,4}$ f"ur eine unendliche Folge
\item $\infsequi{x}12$ und $\infseqli{x}12$ f"ur
\mtrefii[?infinite-sequence]{unendliche}{Folgen} mit Variablen
\end{itemize}
Gegeben einen Folge $\fun{a}{S}T$ und ein Element $\inset{i}S$
schreiben wir das $i$-te Element von $a$ als $\seqsel{a}i$.
\end{definition}
\end{mhmodnl}
%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End:
% LocalWords: gimport mhmodnl miko defi notatiendum sequenceon mtrefi abz ahlbaren defii
% LocalWords: mtrefiii mtrefii inifinite-sequence Kardinalit itemize seq seqfromto
% LocalWords: nsequi nseqli infseq infsequi infseqli seqsel
......@@ -366,6 +366,7 @@ def server(tokenizer,gpt):
input_ids=input.unsqueeze(0).to(device),
max_length=500)[0]
ret = tokenizer.decode(ret[input.size(0):-2]).replace("\n","")
ret = ret.split("<s>")[0]
logger.info("Result: " + ret)
returns += [ret]
returns = "<s>".join(returns) + "\r\n"
......
......@@ -142,9 +142,9 @@ $k$
\[\intplus{\inttimes{\intpower a{\natplus{n,1}},\intpower b0},\Sumfromto k1n{\inttimes{\binomcoeff {\natplus{n,1}}k,\intpower ak,\intpower b{\natplus{\natminus{n,k},1}}}},\inttimes{\intpower a0,\intpower b{\natplus{n,1}}}}\]
\[\Sumfromto k0{\natplus{n,1}}{\inttimes{\binomcoeff {\natplus{n,1}}k,\intpower ak,\intpower b{\natminus{\natplus{n,1},k}}}}\]
$\magmaset$
$\magmaOp$
$\magmaopOp$
$\unitalunit$
$\magmaOp$
$\magmaopOp$
$\unitalunit$
\[ \foral{a,b,c}{\eq{\magmaop{\magmaop ab}c,\magmaop a{\magmaop bc}}} \]
\[ \foral{a}{\eq{\magmaop a\unitalunit,\magmaop \unitalunit a,\unitalunit}} \]
......
This diff is collapsed.
package com.jazzpirate.latex
import com.jazzpirate.latex.syntax.{Expanded, Token}
import com.jazzpirate.latex.syntax.{Expanded, Reference, Token}
object Normalize {
import bindings.Basic._
......@@ -15,6 +15,7 @@ object Normalize {
Modifier(colon,co => Token(":",0,Expanded(co)) :: Nil),
Modifier(vert,co => Token("|",0,Expanded(co)) :: Nil),
Modifier(mid,co => Token("|",0,Expanded(co)) :: Nil),
Modifier(_ne,co => neq.simpleObject(Reference(Expanded(co),0,0)) :: Nil),
Modifier(rule,{co =>
co.children.map(_.asString) match {
case "{.3ex}" :: "{.3ex}" :: Nil =>
......
......@@ -154,7 +154,8 @@ object Math {
val cdot = Simple("cdot")
val sum = Simple("sum")
val prod = Simple("prod")
val ne = Simple("ne")
val _ne = Simple("ne")
val neq = Simple("neq")
val sup = Simple("sup")
val inf = Simple("inf")
val sqrt = Simple("sqrt",true,1)
......@@ -206,7 +207,7 @@ object Math {
val all_math = List(rightarrow,Rightarrow,to,leftarrow,Leftarrow,longrightarrow,Longrightarrow,
leftrightarrow,Leftrightarrow,in,subseteq,subset,supseteq,supset,times,rightharpoonup,forall,exists,lim,leq,geq,
mapsto,top,bot,vee,wedge,neg,circ,langle,rangle,not,mathtt,mathop,operatorname,mathord,mathrel,displaystyle,
mathbf,mathbb,mathcal,mathfrak,mathsf,frac,cdot,sum,prod,ne,sup,inf,sqrt,bar,widebar,overline,overset,underset,
mathbf,mathbb,mathcal,mathfrak,mathsf,frac,cdot,sum,prod,_ne,sup,inf,sqrt,bar,widebar,overline,overset,underset,
cup,cap,bigcup,bigcap,emptyset,sim,simeq,infty,atop,equiv,oplus,bigoplus,ominus,bigominus,stackrel,triangleleft,
triangleright,setminus,log,ln,cos,sin,cosh,sinh,int,downarrow,uparrow,searrow,nearrow,pm,dot,nabla,partial,
limsup,liminf,varlimsup,varliminf,ell,underline
......
......@@ -5,10 +5,11 @@ import info.kwarc.mmt.api.frontend.Logger
import info.kwarc.mmt.api.modules.Theory
import info.kwarc.mmt.api.notations.{CommonMarkerProperties, Delim, Precedence, SimpArg, SimpSeqArg, TextNotation}
import info.kwarc.mmt.api.{CPath, DPath, GlobalName, LocalName, ParsingNotationComponent}
import info.kwarc.mmt.api.objects.{Context, OMA, OMID, OMS, OMV, Obj, StatelessTraverser, Sub, Substitution, Term, Traverser, VarDecl}
import info.kwarc.mmt.api.objects.{Context, OMA, OMID, OMLIT, OMS, OMV, Obj, StatelessTraverser, Sub, Substitution, Term, Traverser, VarDecl}
import info.kwarc.mmt.api.ontology.LogicalReference
import info.kwarc.mmt.api.presentation.{NotationBasedPresenter, ObjectPresenter, PresentationContext, RenderingHandler}
import info.kwarc.mmt.api.symbols.Constant
import info.kwarc.mmt.api.uom.{RealizedType, StandardDouble, StandardInt, StandardNat, StandardPositive, StandardRat}
import info.kwarc.mmt.api.utils.URI
import info.kwarc.mmt.lf.{ApplySpine, Lambda, Pi, Typed}
......@@ -31,24 +32,68 @@ object Generator {
private val natlit = (MitM.mitmpath / "Foundation") ? "NatLiterals" ? "nat_lit"
private val poslit = (MitM.mitmpath / "Foundation") ? "NatLiterals" ? "pos_lit"
private val nonnegreallit = (MitM.mitmpath / "core" / "arithmetics") ? "RealArithmetics" ? "NonNegativeRealNumbers"
private val universe = (DPath(URI.http colon "gl.mathhub.info") / "MMT" / "LFX" / "TypedHierarchy") ? "Symbols" ? "TypeLevel" // http://gl.mathhub.info/MMT/LFX/TypedHierarchy
def mitmSubTp(tp : Term) : List[Term] = tp match {
case OMS(`reallit`) =>
List(OMS(reallit), OMS(ratlit), OMS(intlit), OMS(natlit), OMS(poslit))
List(OMS(reallit), OMS(reallit), OMS(reallit), OMS(reallit), OMS(reallit), OMS(nonnegreallit), OMS(ratlit), OMS(intlit), OMS(natlit), OMS(poslit))
case OMS(`ratlit`) =>
List(OMS(ratlit), OMS(intlit), OMS(natlit), OMS(poslit))
List(OMS(ratlit), OMS(ratlit), OMS(ratlit), OMS(ratlit), OMS(intlit), OMS(natlit), OMS(poslit))
case OMS(`intlit`) =>
List(OMS(intlit), OMS(natlit), OMS(poslit))
List(OMS(intlit), OMS(intlit), OMS(intlit), OMS(natlit), OMS(poslit))
case OMS(`nonnegreallit`) =>
List(OMS(nonnegreallit), OMS(nonnegreallit), OMS(natlit), OMS(poslit))
case OMS(`natlit`) =>
List(OMS(natlit), OMS(poslit))
List(OMS(natlit), OMS(natlit), OMS(poslit))
case OMA(OMS(`universe`),_) => OMS(Typed.ktype) :: Nil
case _ =>
List(tp)
}
private val mitmdouble = RealizedType(OMS(reallit),StandardDouble)
private val mitmrat = RealizedType(OMS(ratlit),StandardRat)
private val mitmint = RealizedType(OMS(intlit),StandardInt)
private val mitmnat = RealizedType(OMS(natlit),StandardNat)
private val mitmpos = RealizedType(OMS(poslit),StandardPositive)
private def getInt = (scala.util.Random.nextGaussian() * 10).round
def mitmLiterals(tp : Term) : Option[Unit => OMLIT] = tp match {
case OMS(`reallit`) =>
Some(_ => {
mitmdouble.of(scala.util.Random.nextGaussian() * 10)
})
case OMS(`nonnegreallit`) =>
Some(_ => {
mitmdouble.of(math.abs(scala.util.Random.nextGaussian()) * 10)
})
case OMS(`ratlit`) =>
Some(_ => {
val a = BigInt(getInt)
val b = BigInt(math.abs(getInt))
mitmrat.of((a,b))
})
case OMS(`intlit`) =>
Some(_ => {
mitmint.of(BigInt(getInt))
})
case OMS(`natlit`) =>
Some(_ => {
mitmnat.of(BigInt(math.abs(getInt)))
})
case OMS(`poslit`) =>
Some(_ => {
mitmpos.of(BigInt(math.abs(getInt)) + 1)
})
case _ =>
None
}
}
class Generator(mmt : MMT, use_symbols : List[GlobalName], subTp : Term => List[Term] = tm => List(tm)) extends Logger {
class Generator(mmt : MMT, use_symbols : List[GlobalName], subTp : Term => List[Term] = tm => List(tm), literals : Term => Option[Unit => OMLIT]) extends Logger {
val logPrefix = "generator"
val report = mmt.controller.report
......@@ -103,9 +148,77 @@ class Generator(mmt : MMT, use_symbols : List[GlobalName], subTp : Term => List[
(args.reverse,ret)
}
def checkTypeArg(tm : Term,tp : Term) : Option[Continuation] = {
val map : mutable.HashMap[LocalName,Term] = mutable.HashMap.empty
def matches(tm1 : Term, tm2 : Term) : Boolean = (tm1,tm2) match {
case _ if tm1 == tm2 =>
true
case (a,b) if subTp(a) contains b =>
true
case (OMID(_),OMID(_)) =>
map.clear()
false // TODO potentially check equality?
case (OMA(t1,args1),OMA(t2,args2)) =>
val crit = args1.length == args2.length && matches(t1,t2) && args1.indices.forall(i => matches(args1(i),args2(i)))
if (!crit) map.clear()
crit
case (OMV(n),t) if !map.isDefinedAt(n) =>
map(n) = t
true
case (OMV(n),t) =>
matches(t,map(n))
case _ =>
map.clear()
false
}
val fits = return_type._1.find(p => {matches(p._2,tp)})
fits match {
case Some((name,_)) =>
val cont = new Continuation(return_type._1.map{ case (ln,t) =>
new Argument(ln,t,if (map.isDefinedAt(ln)) Some(map(ln)) else None)
},this)
cont.arguments.find(_.ln == name).foreach(_.set(tm))
Some(cont)
case _ =>
None
}
/*
if (return_type._1.exists(_._2 == tp)) {
//Some(return_type)
val cont = getContinuation
cont.arguments.find(_.tp == tp).foreach(_.set(tm))
Some(cont)
} else
if (return_type._1.exists(_._2.isInstanceOf[OMV])) {
val cont = getContinuation
cont.arguments.find(_.tp.isInstanceOf[OMV]).foreach { _.tp match {
case OMV(name) =>
cont.arguments.find(_.ln == name).foreach(_.set(tp))
cont.arguments.find(_.tp == OMV(name)).foreach(_.set(tm))
return Some(cont)
}
}
None
/*
val ln = return_type._1.collectFirst {
case (_,OMV(n)) =>
n
}.get
import info.kwarc.mmt.api.objects.Conversions._
val sub = ln / tp
(return_type._1.map{case (n,t) => (n, t ^? sub)},return_type._2 ^? sub)
*/
} else None
*/
}
def applicable(tm : Term) = {
val map : mutable.HashMap[LocalName,Term] = mutable.HashMap.empty
def matches(tm1 : Term, tm2 : Term) : Boolean = (tm1,tm2) match {
case (a,b) if subTp(a) contains b =>
true
case (OMID(p1),OMID(p2)) =>
p1 == p2 // TODO potentially check equality?
case (OMA(t1,args1),OMA(t2,args2)) =>
......@@ -185,12 +298,13 @@ class Generator(mmt : MMT, use_symbols : List[GlobalName], subTp : Term => List[
val options = symbols.flatMap(_.applicable(tp))
val immediates = options.filter(_.nextTerm.isEmpty)
val lits = literals(tp)
val others = options.filter(!immediates.contains(_))
val vars = variables.collect {
case VarDecl(ln,_,Some(t),_,_) if t==tp => ln
}
val base = (imm_multiplier * immediates.length) + (decay * fun_multiplier * others.length) + (ex_var_multiplier * vars.length)
val base = (imm_multiplier * (immediates.length + (if (lits.isDefined) 1 else 0))) + (decay * fun_multiplier * others.length) + (ex_var_multiplier * vars.length)
val var_multiplyer = tp match {
case OMS(Typed.ktype) => type_decay
......@@ -216,6 +330,15 @@ class Generator(mmt : MMT, use_symbols : List[GlobalName], subTp : Term => List[
return OMV(name)
}
random -= p_newvar
lits match {
case Some(l) if random < p_imm =>
val ret = l(())
log("=> Picked Literal " + ret.value.toString)
return ret
case Some(_) =>
random -= p_imm
case _ =>
}
immediates.foreach {sym =>
if (random < p_imm){
log("=> Picked " + sym.symbol.path)
......@@ -259,6 +382,17 @@ class Generator(mmt : MMT, use_symbols : List[GlobalName], subTp : Term => List[
while (continue) {
decay = decay * decay_multiplier
val tp = inferType(tm)
var contOpt : Option[Continuation] = None
scala.util.Random.shuffle(symbols).collectFirst {
case sym if {contOpt = sym.checkTypeArg(tm,tp); contOpt.isDefined} =>
contOpt.get
} match {
case None => continue = false
case Some(cont) =>
tm = getFromContinuation(cont,decay)
continue = getRandom < p_ascend
}
/*
symbols.find(s => s.return_type._1.exists(_._2 == tp)) match {
case None => continue = false
case Some(sym) =>
......@@ -267,6 +401,8 @@ class Generator(mmt : MMT, use_symbols : List[GlobalName], subTp : Term => List[
tm = getFromContinuation(cont,decay)
continue = getRandom < p_ascend
}
*/
}
(variables,tm)
}
......
......@@ -64,6 +64,14 @@ object Translator {
OMV(a.toString() + "_" + i.toString())
case OMA(OMS(`superscript`),List(a,i)) =>
OMV(a.toString() + "^" + i.toString())
case OMV(n) if n.toString() == "\uD835\uDC5B" =>
OMV("n")
case OMV(n) if n.toString() == "\uD835\uDC4E" =>
OMV("a")
case OMV(n) if n.toString() == "\uD835\uDC4F" =>
OMV("b")
case OMV(n) if n.toString() == "\uD835\uDC58" =>
OMV("k")
case _ =>
Traverser(this,t)
}
......@@ -342,9 +350,11 @@ object Translator {
// Collect all sTeX-Macros ---------------------------------------------------------------------------------------
val macros = mmt match {
case Some(mmt) => STeX.getAllMacros(mmt)
case _ => Nil
val (store,macros) = mmt match {
case Some(mmt) =>
val r = STeX.getAllMacros()(mmt)._1
(Some(r),r.getMacros)
case _ => (None,Nil)
}
val proc = new LaTeXProcessor
......@@ -451,13 +461,21 @@ object Translator {
}.getOrElse(("$" + Console.RED + Console.BOLD + st.drop(1).dropRight(1) + Console.RESET + "$",false))
}
assert(p.maths.length == nrets.length)
mmt match {
case Some(_) =>
println("---------------------------------------------------------")
println("---------------------------------------------------------")
println("Normalized sentence:")
println(p.sentence)
case _ =>
}
p.maths.indices.foreach {m =>
eval_map('total) += 1
// Evaluating ----------------------------------------------------------------------------------------------
mmt match {
case Some(immt) =>
println("---------------------------------------------------------")
val input = Latex.print(Latex.normalize(p.maths_tex(m) :: Nil))
val input = Latex.print(Latex.normalize(proc.expand(p.maths_tex(m),Normalize.cleanups) :: Nil))
.replace("$$","$")
.replace("\\[","$")
.replace("\\]","$")
......@@ -584,7 +602,8 @@ object CheckSTeX {
} else smglom
println("Collecting symdefs...")
val macros = StexChecker.collect(smglom)(true)
val (store,_) = StexChecker.collect(smglom)(true)
val macros = store.getMacros
println(macros.length + " symbols found.")
val files = if (target.toString.endsWith(".tex")) List(target) else StexChecker.filter(target)
......@@ -634,7 +653,8 @@ object DesTeXify {
} else smglom
println("Collecting symdefs...")
val macros = StexChecker.collect(smglom)(true)
val (store,_) = StexChecker.collect(smglom)(true)
val macros = store.getMacros
println(macros.length + " symbols found.")
val files = if (target.toString.endsWith(".tex")) List(target) else StexChecker.filter(target)
......
......@@ -13,6 +13,8 @@ import info.kwarc.mmt.api.objects.{Context, OMA, OMS, OMV, Obj, StatelessTravers
import info.kwarc.mmt.api.symbols.Constant
import info.kwarc.mmt.api.utils.{File, URI}
import scala.collection.mutable
object STeX {
val smglompath = DPath(URI.http colon "mathhub.info") / "smglom"
......@@ -49,7 +51,7 @@ object STeX {
case vd : VarDecl => VarDecl(vd.name,vd.feature,vd.tp.map(t => trav(t)),vd.df.map(t => trav(t)),vd.not)
case tm : Term => traverser(tm,())
}).asInstanceOf[o.ThisType]
def postproc(s : String) : String = {
def postproc(s : String)(implicit map : mutable.HashMap[String,Option[String]]) : String = {
var index = 0
var ret = ""
while (s.isDefinedAt(index) && s(index) != '\\') {
......@@ -73,8 +75,11 @@ object STeX {
}
macros.find(_.key == cmd) match {
case Some(symdef) =>
val opts = scala.util.Random.shuffle(None :: symdef.options.keys.toList.map(Some(_)))
opts.head match {
val opt = map.getOrElseUpdate(symdef.key,{
val opts = scala.util.Random.shuffle(None :: symdef.options.keys.toList.map(Some(_)))
opts.head
})
opt match {
case Some(str) =>
ret + "[" + str + "]" + postproc(s.drop(index))
case None =>
......@@ -85,19 +90,28 @@ object STeX {
}
}
(o => postproc(mmt.controller.presenter.objectLevel.asString(trav(o)).replace("(","").replace(")","")))
(o => {
val str = mmt.controller.presenter.objectLevel.asString(trav(o)).replace("(","").replace(")","")
try {
postproc(str)(mutable.HashMap.empty)
} catch {
case t : Throwable =>
println(str)
throw t
}
})
}
def getAllMacros(implicit mmt: MMT) = {
if ((mmt.archivepath / "MiKoMH").exists())
def getAllMacros(usemikomh : Boolean = true)(implicit mmt: MMT) = {
if ((mmt.archivepath / "MiKoMH").exists() && usemikomh)
StexChecker.collect(mmt.archivepath / "MiKoMH",mmt.archivepath / "smglom")(true)
else StexChecker.collect(mmt.archivepath / "smglom")(true)
}
def getParagraphs(files : List[File],macrosOpt : List[SymdefMacro] = Nil, crosscheck : Boolean = false)(implicit mmt: MMT) = {
val macros = if (macrosOpt.isEmpty) getAllMacros(mmt) else macrosOpt
val (_,sds) = Symdefs.getSymdefs
def getParagraphs(files : List[File],macrosOpt : Option[SymStore] = None, crosscheck : Boolean = false)(implicit mmt: MMT) = {
val macros = if (macrosOpt.isEmpty) getAllMacros()(mmt)._1.getMacros else macrosOpt.get.getMacros
val (_,sds) = Symdefs.getSymdefs(macrosOpt)
val proc = new LaTeXProcessor
proc.addCommands(sds:_*)
......@@ -147,9 +161,9 @@ object STeX {
(stexs,nomath,nostex)
}
def removesTeX(paragraphs:List[LatexObject], macrosOpt : List[SymdefMacro] = Nil)(implicit mmt: MMT) = {
val macros = if (macrosOpt.isEmpty) getAllMacros(mmt) else macrosOpt
val (_,sds) = Symdefs.getSymdefs
def removesTeX(paragraphs:List[LatexObject], macrosOpt : Option[SymStore] = None)(implicit mmt: MMT) = {
val macros = if (macrosOpt.isEmpty) getAllMacros()(mmt)._1.getMacros else macrosOpt.get.getMacros
val (_,sds) = Symdefs.getSymdefs(macrosOpt)
val proc = new LaTeXProcessor
proc.addCommands(Commands.defaults:_*)
......
......@@ -17,12 +17,12 @@ object StexChecker {
.filter(!_.name.toString.startsWith("all."))
def collect(f : File*)(printlog:Boolean=false) = {
collectAnd(f:_*)(printlog)._1.getMacros
collectAnd(f:_*)(printlog)
}
def collectAnd(files : File*)(printlog:Boolean=false) = {
val texs = files.flatMap(filter).filterNot(_.toString().contains(".en."))
val (store,sds) = Symdefs.getSymdefs
val (store,sds) = Symdefs.getSymdefs(None)
texs.foreach {f =>
//val parser = new FileParser(f,Commands.defaults ::: sds,Environment.defaults ::: Notations.envs)
val proc = new LaTeXProcessor
......
......@@ -85,14 +85,15 @@ class SymStore {
orig.addOption(opt,symdef)
}
}
def knows(s : String) = comms.isDefinedAt(s)
def getMacros = comms.values.toList
}
object Symdefs {
val mhCurrentRepos = new LatexCommand("mhcurrentrepos",false,1)
def getSymdefs = {
val store = new SymStore
def getSymdefs(storeOpt : Option[SymStore]) = {
val store = storeOpt.getOrElse(new SymStore)
(store,List(mhCurrentRepos,Symdef(store),Abbrdef(store),Symvariant(store),Vardef(store)))
}
}
......@@ -117,13 +118,14 @@ case class Symdef(store:SymStore) extends SymdefCommand("symdef",true,1,store) {
case o => o.asString
}
val nnotation = readArgument
val macr = new SymdefMacro(name,narity,store, parser.asInstanceOf[FileParser].file) {
override val notation: LatexObject = nnotation
val optstring = beginning.optArgs
if (!store.knows(name) && parser.isInstanceOf[FileParser]) {
val macr = new SymdefMacro(name, narity, store, parser.asInstanceOf[FileParser].file) {
override val notation: LatexObject = nnotation
val optstring = beginning.optArgs
}
store.add(macr)
addCommand(macr)
}
store.add(macr)
addCommand(macr)
new SymdefO(Reference(Filestring.getRefSource,beginning.ref.start,Filestring.getIndex-1),
beginning.children ::: List(nnotation),beginning.optArgs,narity)
......@@ -159,13 +161,14 @@ case class Vardef(store:SymStore) extends SymdefCommand("vardef",true,1,store) {
case o => o.asString
}
val nnotation = readArgument
val macr = new SymdefMacro(name,narity,store, parser.asInstanceOf[FileParser].file) {
override val notation: LatexObject = nnotation
val optstring = beginning.optArgs
if (parser.isInstanceOf[FileParser]) {
val macr = new SymdefMacro(name, narity, store, parser.asInstanceOf[FileParser].file) {
override val notation: LatexObject = nnotation
val optstring = beginning.optArgs
}
store.add(macr)
addCommand(macr)
}
store.add(macr)
addCommand(macr)