import { Atom , ToLatexOptions } from '../core/atom-class' ; import { Box } from '../core/box' ; import { Context } from '../core/context' ; import { Style } from '../public/core' ; export class SubsupAtom extends Atom { constructor ( options ? ) { super ( 'msubsup' , { style : options ?. style } ) ; } render ( context ) { console . assert ( ! this . subsupPlacement ) ; const phantomContex = new Context ( context , { isPhantom : true } ) ; const base = this . leftSibling . render ( phantomContex ) ?? new Box ( null ) ; const phantom = new Box ( null , { height : base . height , depth : base . depth } ) ; return this . attachSupsub ( context , { base : phantom , isCharacterBox : this . leftSibling . isCharacterBox ( ) , type : 'supsub' , } ) ; } serialize ( options ) { return this . supsubToLatex ( options ) ; } }