### Run Web Sample (JS) Source: https://github.com/darriousliu/ratex-cmp/blob/master/README-en.md Run the web sample application compiled to JavaScript using Gradle. This command starts a development server for the JS version. ```bash ./gradlew :example:jsBrowserDevelopmentRun ``` -------------------------------- ### Prepare All JVM Desktop Rust Artifacts Source: https://github.com/darriousliu/ratex-cmp/blob/master/README-en.md Prepare all supported JVM Desktop Rust artifacts for the current machine. This command is useful for comprehensive testing or setup. ```bash bash prepare-jvm-rust.sh --all ``` -------------------------------- ### Run Web Sample (WasmJS) Source: https://github.com/darriousliu/ratex-cmp/blob/master/README-en.md Run the web sample application compiled to WebAssembly using Gradle. This command starts a development server for the WasmJS version. ```bash ./gradlew :example:wasmJsBrowserDevelopmentRun ``` -------------------------------- ### Install iOS Rust Targets Source: https://github.com/darriousliu/ratex-cmp/blob/master/README-en.md Install the necessary Rust targets for building iOS applications. This is required before building for iOS. ```bash rustup target add aarch64-apple-ios aarch64-apple-ios-sim x86_64-apple-ios ``` -------------------------------- ### Install Android Rust Targets Source: https://github.com/darriousliu/ratex-cmp/blob/master/README-en.md Install the necessary Rust targets for building Android applications. This is required before building for Android. ```bash rustup target add aarch64-linux-android armv7-linux-androideabi x86_64-linux-android i686-linux-android ``` -------------------------------- ### Run JVM Desktop Sample on Windows Source: https://github.com/darriousliu/ratex-cmp/blob/master/README-en.md Execute the JVM Desktop sample application using Gradle on Windows. This uses the Windows-specific Gradle wrapper script. ```bash .\gradlew.bat :example:run ``` -------------------------------- ### Run JVM Desktop Sample Source: https://github.com/darriousliu/ratex-cmp/blob/master/README-en.md Execute the JVM Desktop sample application using Gradle. This command is used to run the main desktop sample. ```bash ./gradlew :example:run ``` -------------------------------- ### Run Web Sample Source: https://github.com/darriousliu/ratex-cmp/blob/master/README-en.md Executes the Gradle tasks to run the web samples for both JavaScript and WebAssembly targets. ```bash ./gradlew :example:jsBrowserDevelopmentRun ./gradlew :example:wasmJsBrowserDevelopmentRun ``` -------------------------------- ### Clone Repository and Initialize Submodules Source: https://github.com/darriousliu/ratex-cmp/blob/master/README-en.md Clone the RaTeX-CMP repository and initialize its Git submodules. This is the first step for setting up the project locally. ```bash git clone https://github.com/darriousliu/RaTeX-CMP.git cd RaTeX-CMP git submodule update --init --recursive ``` -------------------------------- ### Prepare JVM Desktop Rust Artifacts Source: https://github.com/darriousliu/ratex-cmp/blob/master/README-en.md Prepare the local Rust artifacts for JVM Desktop development. Run this command if you are working on the Kotlin/Compose layer and need to update artifacts. ```bash bash prepare-jvm-rust.sh ``` -------------------------------- ### Initialize Git Submodules Source: https://github.com/darriousliu/ratex-cmp/blob/master/README-en.md Use this command to initialize and update all git submodules recursively. This is typically the first step after cloning the repository. ```bash git submodule update --init --recursive ``` -------------------------------- ### Publish Library to Maven Local Source: https://github.com/darriousliu/ratex-cmp/blob/master/README-en.md Publishes the KMP main library and supported Desktop native submodules to the local Maven repository. This is the recommended path for local verification. ```bash ./gradlew publishToMavenLocal ``` -------------------------------- ### Prepare iOS Rust Artifacts Source: https://github.com/darriousliu/ratex-cmp/blob/master/README-en.md Prepare the local Rust artifacts for iOS development. Run this command if you are working on the Kotlin/Compose layer and need to update artifacts. ```bash bash prepare-ios-rust.sh ``` -------------------------------- ### Prepare Android Rust Artifacts Source: https://github.com/darriousliu/ratex-cmp/blob/master/README-en.md Prepare the local Rust artifacts for Android development. Run this command if you are working on the Kotlin/Compose layer and need to update artifacts. ```bash bash prepare-android-rust.sh ``` -------------------------------- ### Publish Supported Desktop Native Libraries to Maven Local Source: https://github.com/darriousliu/ratex-cmp/blob/master/README-en.md Publishes all JVM Desktop native libraries supported by the current machine to the local Maven repository. This process automatically runs preparation scripts and verifies artifact creation. ```bash ./gradlew publishSupportedDesktopNativePublicationsToMavenLocal ``` -------------------------------- ### Assemble Android Debug Package on Windows Source: https://github.com/darriousliu/ratex-cmp/blob/master/README-en.md Build the debug version of the Android application package using Gradle on Windows. This uses the Windows-specific Gradle wrapper script. ```bash .\gradlew.bat :androidApp:assembleDebug ``` -------------------------------- ### Publish Library to Maven Central Source: https://github.com/darriousliu/ratex-cmp/blob/master/README-en.md Publishes all artifacts supported by the current machine to Maven Central. Ensure publishing credentials and signing configurations are correctly set up beforehand. ```bash ./gradlew publishAndReleaseToMavenCentral ``` -------------------------------- ### Render Basic LaTeX Formula Source: https://github.com/darriousliu/ratex-cmp/blob/master/README-en.md Use the RaTeX composable to render a LaTeX string directly. Customize font size, display mode, and color. ```kotlin import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.unit.sp import io.ratex.compose.RaTeX @Composable fun FormulaSample(modifier: Modifier = Modifier) { RaTeX( latex = "\frac{-b \pm \sqrt{b^2 - 4ac}}{2a}", modifier = modifier, fontSize = 28.sp, displayMode = true, color = Color(0xFF1565C0), ) } ``` -------------------------------- ### Publish Supported Desktop Native Libraries to Maven Central Source: https://github.com/darriousliu/ratex-cmp/blob/master/README-en.md Publishes all JVM Desktop native libraries supported by the current machine to Maven Central. This task includes running preparation scripts and verifying artifact generation. ```bash ./gradlew publishSupportedDesktopNativePublicationsToMavenCentralRepository ``` -------------------------------- ### Render Basic LaTeX Formula Source: https://github.com/darriousliu/ratex-cmp/blob/master/README.md Use the RaTeX composable to render a LaTeX formula. Set displayMode to true for block formulas. ```kotlin import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.unit.sp import io.ratex.compose.RaTeX @Composable fun FormulaSample(modifier: Modifier = Modifier) { RaTeX( latex = """\frac{-b \pm \sqrt{b^2 - 4ac}}{2a}""", modifier = modifier, fontSize = 28.sp, displayMode = true, color = Color(0xFF1565C0), ) } ``` -------------------------------- ### Assemble Android Debug Package Source: https://github.com/darriousliu/ratex-cmp/blob/master/README-en.md Build the debug version of the Android application package using Gradle. This command is used to create an APK for debugging. ```bash ./gradlew :androidApp:assembleDebug ``` -------------------------------- ### Add Desktop Native Runtime Dependency Source: https://github.com/darriousliu/ratex-cmp/blob/master/README.md For JVM Desktop applications, include the platform-specific native runtime dependency for Ratex. ```kotlin kotlin { sourceSets { jvmMain.dependencies { implementation("io.github.darriousliu:ratex:0.1.11") runtimeOnly("io.github.darriousliu:ratex-native-darwin-aarch64:0.1.11") } } } ``` -------------------------------- ### Add Local Maven Repository Source: https://github.com/darriousliu/ratex-cmp/blob/master/README.md Include mavenLocal() if you are testing locally before publishing to a remote repository. ```kotlin repositories { mavenLocal() mavenCentral() } ``` -------------------------------- ### Add Ratex Dependency to CommonMain Source: https://github.com/darriousliu/ratex-cmp/blob/master/README.md Add the main Ratex KMP library dependency to your commonMain source set. ```kotlin implementation("io.github.darriousliu:ratex:0.1.11") ``` -------------------------------- ### Synchronously Parse LaTeX for Measurement Source: https://github.com/darriousliu/ratex-cmp/blob/master/README.md Use rememberBlockingRaTeXDisplayList for synchronous parsing, suitable for scenarios like text embedding or pre-calculating dimensions. Note: This is not recommended for JS/Wasm due to asynchronous WASM initialization. ```kotlin import androidx.compose.runtime.Composable import androidx.compose.ui.unit.sp import io.ratex.compose.RaTeX import io.ratex.compose.rememberBlockingRaTeXDisplayList @Composable fun InlineFormulaSample(latex: String) { val parseResult = rememberBlockingRaTeXDisplayList( latex = latex, displayMode = false, ) RaTeX( displayList = parseResult.getOrNull(), fontSize = 18.sp, ) } ``` -------------------------------- ### Add Maven Central Repository Source: https://github.com/darriousliu/ratex-cmp/blob/master/README.md Include mavenCentral() in your project's repositories block if you are using Maven Central. ```kotlin repositories { mavenCentral() } ``` -------------------------------- ### Publish Only KMP Main Library to Maven Central Source: https://github.com/darriousliu/ratex-cmp/blob/master/README-en.md Publishes exclusively the KMP main library to Maven Central. This command targets a specific publication for the main library module. ```bash ./gradlew :library:publishKotlinMultiplatformPublicationToMavenCentralRepository ``` -------------------------------- ### Render Inline LaTeX Formula Source: https://github.com/darriousliu/ratex-cmp/blob/master/README.md Set displayMode to false in the RaTeX composable to render formulas inline with text. ```kotlin RaTeX( latex = """e^{i\pi}+1=0""", fontSize = 20.sp, displayMode = false, ) ``` -------------------------------- ### Reuse Parsed LaTeX DisplayList Source: https://github.com/darriousliu/ratex-cmp/blob/master/README.md Use rememberRaTeXDisplayList to parse LaTeX once and reuse the result across multiple composables. This is suitable for asynchronous rendering. ```kotlin import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.material3.MaterialTheme import androidx.compose.ui.unit.sp import io.ratex.compose.RaTeX import io.ratex.compose.rememberRaTeXDisplayList @Composable fun ParsedFormulaSample(latex: String) { val parseResult by rememberRaTeXDisplayList( latex = latex, displayMode = true, color = MaterialTheme.colorScheme.primary, ) RaTeX( displayList = parseResult?.getOrNull(), fontSize = 28.sp, ) } ``` -------------------------------- ### Add Ratex Dependency to Kotlin Multiplatform Project Source: https://github.com/darriousliu/ratex-cmp/blob/master/README.md Declare the Ratex dependency within the commonMain source set of your Kotlin Multiplatform project. ```kotlin kotlin { sourceSets { commonMain.dependencies { implementation("io.github.darriousliu:ratex:0.1.11") } } } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.