wxMaxima
Loading...
Searching...
No Matches
TypstMarkup.h
Go to the documentation of this file.
1// -*- mode: c++; c-file-style: "linux"; c-basic-offset: 2; indent-tabs-mode: nil -*-
2//
3// Copyright (C) 2026 Gunter Königsmann <wxMaxima@physikbuch.de>
4//
5// This program is free software; you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation; either version 2 of the License, or
8// (at your option) any later version.
9//
10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15//
16// You should have received a copy of the GNU General Public License
17// along with this program; if not, write to the Free Software
18// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19//
20// SPDX-License-Identifier: GPL-2.0+
21
49#ifndef TYPSTMARKUP_H
50#define TYPSTMARKUP_H
51
52#include <wx/string.h>
53
54namespace wxm::typst {
55
57wxString String(const wxString &text);
58
65wxString MathText(const wxString &text);
66
72bool IsAtom(const wxString &math);
73
75bool IsParenGroup(const wxString &math);
76
82wxString Script(const wxString &math);
83
89wxString Arg(const wxString &math);
90
102wxString Attach(const wxString &base, const wxString &sup,
103 const wxString &sub = {}, const wxString &preSup = {},
104 const wxString &preSub = {});
105
107wxString Join(const wxString &a, const wxString &b);
108
115wxString Markup(const wxString &text, bool keepBullets = false);
116
122wxString RawBlock(const wxString &code, const wxString &lang = {});
123
124} // namespace wxm::typst
125
126#endif // TYPSTMARKUP_H
wxString Arg(const wxString &math)
Makes a piece of maths usable as an argument of a function like sqrt()
Definition: TypstMarkup.cpp:201
bool IsParenGroup(const wxString &math)
True if math is one group in round parentheses from start to end.
Definition: TypstMarkup.cpp:136
wxString Script(const wxString &math)
Makes a piece of maths usable as a script: x^Script(...)
Definition: TypstMarkup.cpp:191
wxString Attach(const wxString &base, const wxString &sup, const wxString &sub, const wxString &preSup, const wxString &preSub)
A base with scripts attached.
Definition: TypstMarkup.cpp:239
wxString Markup(const wxString &text, bool keepBullets)
Escapes text for Typst markup (prose, not maths)
Definition: TypstMarkup.cpp:274
wxString Join(const wxString &a, const wxString &b)
Two pieces of maths, separated by a space if both are there.
Definition: TypstMarkup.cpp:264
wxString RawBlock(const wxString &code, const wxString &lang)
A raw (verbatim) block, fenced with more backticks than the code contains.
Definition: TypstMarkup.cpp:335
bool IsAtom(const wxString &math)
True if Typst reads this piece of maths as one unit.
Definition: TypstMarkup.cpp:143
wxString MathText(const wxString &text)
A piece of text in maths: bare if Typst reads it as what it shows, else a string.
Definition: TypstMarkup.cpp:121
A String class.
Definition: relates.cpp:6