API Reference
LatexDocument
Parsed LaTeX document with lossless syntax and bounded profile semantics.
Inheritance
- Object
- LatexDocument
Usage
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by
- Method LatexDocument.Load
- Method LatexDocument.Load
- Method LatexDocument.LoadAsync
- Method LatexDocument.LoadAsync
- Method LatexDocument.Parse
- Method LatexDocument.Parse
- Method LatexParseResult.RequireValue
- Property LatexParseResult.Document
- Property LatexParseResult.Value
Methods
public LatexMacroExpansionResult ExpandSimpleMacros(String value) #LatexMacroExpansionResultExplicitly expands structurally safe simple definitions when enabled by parse options.
Parameters
- value System.String
public static LatexDocument Load(String path, LatexParseOptions options = null, Encoding encoding = null) #LatexDocumentLoads decoded text using Unicode BOM detection when no encoding is specified.
Parameters
- path System.String
- options OfficeIMO.Latex.LatexParseOptions = null
- encoding System.Text.Encoding = null
public static LatexDocument Load(Stream stream, LatexParseOptions options = null, Encoding encoding = null) #LatexDocumentLoads and parses a LaTeX document from a caller-owned stream.
Parameters
- stream System.IO.Stream
- options OfficeIMO.Latex.LatexParseOptions = null
- encoding System.Text.Encoding = null
public static async Task<LatexDocument> LoadAsync(String path, LatexParseOptions options = null, Encoding encoding = null, CancellationToken cancellationToken = default) #Task<LatexDocument>Asynchronously loads and parses a LaTeX file.
Parameters
- path System.String
- options OfficeIMO.Latex.LatexParseOptions = null
- encoding System.Text.Encoding = null
- cancellationToken System.Threading.CancellationToken = default
public static async Task<LatexDocument> LoadAsync(Stream stream, LatexParseOptions options = null, Encoding encoding = null, CancellationToken cancellationToken = default) #Task<LatexDocument>Asynchronously loads and parses a LaTeX document from a caller-owned stream.
Parameters
- stream System.IO.Stream
- options OfficeIMO.Latex.LatexParseOptions = null
- encoding System.Text.Encoding = null
- cancellationToken System.Threading.CancellationToken = default
public static LatexParseResult LoadResult(String path, LatexParseOptions options = null, Encoding encoding = null) #LatexParseResultLoads decoded text with syntax and recovery diagnostics using Unicode BOM detection when no encoding is specified.
Parameters
- path System.String
- options OfficeIMO.Latex.LatexParseOptions = null
- encoding System.Text.Encoding = null
public static LatexParseResult LoadResult(Stream stream, LatexParseOptions options = null, Encoding encoding = null) #LatexParseResultLoads a LaTeX document from a caller-owned stream with syntax and recovery diagnostics.
Parameters
- stream System.IO.Stream
- options OfficeIMO.Latex.LatexParseOptions = null
- encoding System.Text.Encoding = null
public static async Task<LatexParseResult> LoadResultAsync(String path, LatexParseOptions options = null, Encoding encoding = null, CancellationToken cancellationToken = default) #Task<LatexParseResult>Asynchronously loads a LaTeX file with syntax and recovery diagnostics.
Parameters
- path System.String
- options OfficeIMO.Latex.LatexParseOptions = null
- encoding System.Text.Encoding = null
- cancellationToken System.Threading.CancellationToken = default
public static async Task<LatexParseResult> LoadResultAsync(Stream stream, LatexParseOptions options = null, Encoding encoding = null, CancellationToken cancellationToken = default) #Task<LatexParseResult>Asynchronously loads a LaTeX stream with syntax and recovery diagnostics.
Parameters
- stream System.IO.Stream
- options OfficeIMO.Latex.LatexParseOptions = null
- encoding System.Text.Encoding = null
- cancellationToken System.Threading.CancellationToken = default
public static LatexDocument Parse(String source, LatexParseOptions options = null) #LatexDocumentParses LaTeX source into the typed document model without executing it.
Parameters
- source System.String
- options OfficeIMO.Latex.LatexParseOptions = null
public static LatexDocument Parse(String source, LatexParseOptions options, CancellationToken cancellationToken) #LatexDocumentParses LaTeX source into the typed model without executing it and cooperatively observes cancellation.
Parameters
- source System.String
- options OfficeIMO.Latex.LatexParseOptions
- cancellationToken System.Threading.CancellationToken
public static LatexParseResult ParseResult(String source, LatexParseOptions options = null) #LatexParseResultParses LaTeX source with syntax and recovery diagnostics without executing it.
Parameters
- source System.String
- options OfficeIMO.Latex.LatexParseOptions = null
public static LatexParseResult ParseResult(String source, LatexParseOptions options, CancellationToken cancellationToken) #LatexParseResultParses LaTeX source with diagnostics and cooperatively observes cancellation.
Parameters
- source System.String
- options OfficeIMO.Latex.LatexParseOptions
- cancellationToken System.Threading.CancellationToken
public Void Save(String path, LatexWriterOptions options = null, Encoding encoding = null) #VoidSaves the current document text to a file.
Parameters
- path System.String
- options OfficeIMO.Latex.LatexWriterOptions = null
- encoding System.Text.Encoding = null
public Void Save(Stream stream, LatexWriterOptions options = null, Encoding encoding = null) #VoidWrites the current document text to a caller-owned stream.
Parameters
- stream System.IO.Stream
- options OfficeIMO.Latex.LatexWriterOptions = null
- encoding System.Text.Encoding = null
public async Task SaveAsync(String path, LatexWriterOptions options = null, Encoding encoding = null, CancellationToken cancellationToken = default) #TaskAsynchronously saves the current document text to a file.
Parameters
- path System.String
- options OfficeIMO.Latex.LatexWriterOptions = null
- encoding System.Text.Encoding = null
- cancellationToken System.Threading.CancellationToken = default
public Task SaveAsync(Stream stream, LatexWriterOptions options = null, Encoding encoding = null, CancellationToken cancellationToken = default) #TaskAsynchronously writes the current document text to a caller-owned stream.
Parameters
- stream System.IO.Stream
- options OfficeIMO.Latex.LatexWriterOptions = null
- encoding System.Text.Encoding = null
- cancellationToken System.Threading.CancellationToken = default
public Byte[] ToBytes(LatexWriterOptions options = null, Encoding encoding = null) #Byte[]Encodes the current document text.
Parameters
- options OfficeIMO.Latex.LatexWriterOptions = null
- encoding System.Text.Encoding = null
public MemoryStream ToStream(LatexWriterOptions options = null, Encoding encoding = null) #MemoryStreamEncodes the current document in a new writable memory stream positioned at the beginning.
Parameters
- options OfficeIMO.Latex.LatexWriterOptions = null
- encoding System.Text.Encoding = null
Inherited Methods
public override Boolean Equals(Object obj) #BooleanParameters
- obj Object
Properties
public LatexSourceText Source { get; } #Original decoded source.
public LatexSyntaxTree SyntaxTree { get; } #Lossless syntax tree.
public LatexDocumentProfile Profile { get; } #Selected bounded profile.
public IReadOnlyList<LatexToken> Tokens { get; } #All exact tokens.
public IReadOnlyList<LatexDiagnostic> Diagnostics { get; } #Parser and recovery diagnostics.
public IReadOnlyList<LatexCommand> Commands { get; } #Commands including unknown commands.
public IReadOnlyList<LatexEnvironment> Environments { get; } #Nested environments.
public IReadOnlyList<LatexMath> Math { get; } #Inline and display math regions.
public IReadOnlyList<LatexHeading> Headings { get; } #Part/chapter/section headings.
public IReadOnlyList<LatexParagraph> Paragraphs { get; } #Paragraph source regions in the document body.
public IReadOnlyList<LatexList> Lists { get; } #Itemize, enumerate, and description lists.
public IReadOnlyList<LatexFigure> Figures { get; } #Figure environments and included graphics.
public IReadOnlyList<LatexTable> Tables { get; } #Tabular environments.
public IReadOnlyList<LatexCitation> Citations { get; } #Citation commands.
public IReadOnlyList<LatexReference> References { get; } #Cross-reference commands.
public IReadOnlyList<LatexLabel> Labels { get; } #Label declarations.
public IReadOnlyList<LatexTheorem> Theorems { get; } #Theorem-like environments.
public IReadOnlyList<LatexMacroDefinition> MacroDefinitions { get; } #Document-local new/renew/provide command definitions.
public LatexCommand DocumentClassCommand { get; } #Document class command, when present.
public LatexEnvironment Body { get; } #Main document environment, when present.
public String DocumentClassName { get; } #Document class name.
public Boolean IsRecognizedProfile { get; } #True for article, report, or book documents with a document environment.
public Boolean IsModified { get; } #True when an editable semantic region changed.