Skip to main content

SSML and LaTeX

Use SSML to control voice characteristics such as speech rate, pitch, and volume, and LaTeX to read mathematical formulas in Chinese. Learn about supported models, usage limits, API examples, tags, and symbols.

Feature overview

SSML is an XML-based speech synthesis markup language. It sets voice characteristics such as voice, speech rate, pitch, and volume, controls pauses, specifies pronunciation and reading styles, and adds background music and sound effects. The CosyVoice LaTeX feature converts mathematical formulas in text into Chinese speech. Use these features for audiobooks, customer service announcements, multilingual pronunciation, and online education. The following sections list the models, voices, and APIs for each feature. For model selection, see Speech synthesis.

Usage limits

  • SSML
  • LaTeX
  • Supported models: qwen-audio-3.0-tts-flash, qwen-audio-3.0-tts-plus, cosyvoice-v3.5-flash, cosyvoice-v3.5-plus, cosyvoice-v3-flash, cosyvoice-v3-plus, cosyvoice-v2
  • Voices: Only cloned voices and preset voices marked as SSML-compatible in CosyVoice Voice list are supported.
  • APIs:
    • Java SDK (version 2.20.3 or later): non-streaming and unidirectional streaming calls
    • Python SDK (version 1.23.4 or later): non-streaming and unidirectional streaming calls
    • WebSocket API: set the enable_ssml parameter to true, and send a single continue-task event

Usage

  • SSML
  • LaTeX
When using SSML, follow these rules:
  • Enclose all text in <speak></speak>. Multiple <speak> elements can appear in sequence, but cannot be nested.
  • Escape XML special characters inside tags: " → &quot;, ' → &apos;, & → &amp;, < → &lt;, and > → &gt;.

Quick start

The example below uses SSML to control speech rate during synthesis. Before running the code, complete these prerequisites:
  1. Obtain an API key
  2. Install the DashScope SDK (Python 1.23.4 or later, Java 2.20.3 or later). For details, see Install the SDK.
The cosyvoice-v3.5-plus and cosyvoice-v3.5-flash models are currently available only in the Beijing region and are designed exclusively for voice cloning scenarios (no preset voices are provided). Before using these models, create a target voice by following the instructions in Voice cloning.
  • Java SDK
  • Python SDK
  • WebSocket API
import com.alibaba.dashscope.audio.ttsv2.SpeechSynthesisParam;
import com.alibaba.dashscope.audio.ttsv2.SpeechSynthesizer;
import com.alibaba.dashscope.utils.Constants;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.ByteBuffer;

/**
 * SSML feature description:
 *     1. Only non-streaming calls and unidirectional streaming calls support the SSML feature
 * Use an SSML-compatible cloned or preset voice (such as longanyang for cosyvoice-v3-flash). See this page for supported models.
 */
public class Main {
    private static String model = "cosyvoice-v3-flash";
    private static String voice = "longanyang";

    public static void main(String[] args) {
        // Singapore region URL. Replace WorkspaceId with your actual workspace ID. The URL varies by region.
        Constants.baseWebsocketApiUrl = "wss://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api-ws/v1/inference";
        streamAudioDataToSpeaker();
        System.exit(0);
    }

    public static void streamAudioDataToSpeaker() {
        SpeechSynthesisParam param =
                SpeechSynthesisParam.builder()
                        // The API Keys for the Singapore and Beijing regions are different. Get an API Key: https://www.alibabacloud.com/help/model-studio/get-api-key
                        // If you have not configured an environment variable, replace the following line with your Model Studio API Key: .apiKey("sk-xxx")
                        .apiKey(System.getenv("DASHSCOPE_API_KEY"))
                        .model(model)
                        .voice(voice)
                        .build();

        SpeechSynthesizer synthesizer = new SpeechSynthesizer(param, null);
        ByteBuffer audio = null;
        try {
            // Non-streaming call, blocks until audio is returned
            // Special characters need to be escaped
            audio = synthesizer.call("<speak rate=\"2\">My speaking rate is faster than a normal person's.</speak>");
        } catch (Exception e) {
            throw new RuntimeException(e);
        } finally {
            // Close the WebSocket connection when the task ends
            synthesizer.getDuplexApi().close(1000, "bye");
        }
        if (audio != null) {
            // Save audio data to local file "output.mp3"
            File file = new File("output.mp3");
            try (FileOutputStream fos = new FileOutputStream(file)) {
                fos.write(audio.array());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }

        // The first text transmission requires establishing a WebSocket connection, so the first packet latency includes the connection setup time
        System.out.println(
                "[Metric] requestId: "
                        + synthesizer.getLastRequestId()
                        + ", first packet latency (ms): "
                        + synthesizer.getFirstPackageDelay());
    }
}

SSML tags

The implementation is based on the W3C SSML 1.0 specification. Only the tags listed below are supported.

<speak>: Root element

<speak> is the root element for all SSML content. All text must be enclosed within <speak></speak> tags.
<speak>Text that requires SSML processing</speak>
  • Attributes
  • Examples
  • Tag relationships
AttributeTypeRequiredDescription
voiceStringNoSpecifies the voice.This attribute takes precedence over the voice parameter in the API request.
rateStringNoSpecifies the speech rate. This attribute takes precedence over the speech_rate parameter in the API request.
  • Valid values: a decimal number between 0.5 and 2 (inclusive)
  • Default value: 1
    • Values greater than 1 increase the speech rate
    • Values less than 1 decrease the speech rate
pitchStringNoSpecifies the pitch. This attribute takes precedence over the pitch_rate parameter in the API request.
  • Valid values: a decimal number between 0.5 and 2 (inclusive)
  • Default value: 1
    • Values greater than 1 raise the pitch
    • Values less than 1 lower the pitch
volumeStringNoSpecifies the volume. This attribute takes precedence over the volume parameter in the API request.
  • Valid values: an integer between 0 and 100 (inclusive)
  • Default value: 50
    • Values greater than 50 increase the volume
    • Values less than 50 decrease the volume
effectStringNoSpecifies the audio effect.
  • Valid values:
    • robot: robot voice effect
    • lolita: lolita voice effect
    • lowpass: low-pass filter effect
    • echo: echo effect
    • eq: equalizer (advanced)
    • lpfilter: low-pass filter (advanced)
    • hpfilter: high-pass filter (advanced)
    • eq, lpfilter, and hpfilter are advanced effect types. Use the effectValue parameter to customize specific effects.
    • Each SSML tag supports only one effect. Setting multiple effect attributes simultaneously is not allowed.
    • Enabling audio effects increases synthesis latency.
effectValueStringNoConfigures the specific behavior of the audio effect (the effect parameter). Applies to three advanced effect types: eq, lpfilter, and hpfilter.
  • Valid values:
    • eq (equalizer): the system supports 8 frequency bands by default, corresponding to the following frequencies: ["40 Hz","100 Hz", "200 Hz", "400 Hz", "800 Hz", "1600 Hz", "4000 Hz", "12000 Hz"]. Each band has a bandwidth of 1.0q. Use the effectValue parameter to specify the gain for each band. The parameter is a string of 8 integers ranging from -20 to 20, separated by spaces. A value of 0 means no gain adjustment for that frequency. Example: effectValue="1 1 1 1 1 1 1 1"
    • lpfilter (low-pass filter): specifies the cutoff frequency. Valid values: an integer in the range (0, target_sample_rate/2]. Example: effectValue="800".
    • hpfilter (high-pass filter): specifies the cutoff frequency. Valid values: an integer in the range (0, target_sample_rate/2]. Example: effectValue="1200".
bgmStringNoAdds background music to synthesized speech.Store the audio file in Alibaba Cloud OSS and make it accessible through an Internet URL. See Upload objects. For a private object, use a valid signed URL. Escape XML special characters in the URL, such as replacing & with &amp;.
  • Audio requirements: There is no upper limit on the background music file size, but larger files take longer to download. If the synthesized speech is longer than the background music, the music loops automatically.
    • Sample rate: 16 kHz
    • Channels: mono
    • Format: WAV To convert a non-WAV file, use ffmpeg:
      ffmpeg -i input_audio -acodec pcm_s16le -ac 1 -ar 16000 output.wav
      
    • Bit depth: 16-bit
The uploader bears legal responsibility for the copyright of uploaded audio.
backgroundMusicVolumeStringNoSpecifies the background music volume. Use this attribute together with the bgm attribute.

<break>: Control pauses

Inserts a silent pause during speech synthesis to simulate natural pauses in conversation. Supports seconds (s) and milliseconds (ms) as time units.
<!-- No attributes -->
<break/>
<!-- With time attribute -->
<break time="string"/>
  • Attributes
  • Examples
  • Tag relationships
AttributeTypeRequiredDescription
timeStringNoSpecifies the pause duration, in seconds or milliseconds (for example, "2s" or "50ms").
  • Valid values:
    • In seconds (s): an integer between 1 and 10 (inclusive)
    • In milliseconds (ms): an integer between 50 and 10000 (inclusive)
When multiple <break> tags are used consecutively, the total pause duration is the sum of all individual durations. If the total exceeds 10 seconds, only the first 10 seconds are applied.
Without attributes, <break> inserts a 1-second pause.

<sub>: Substitute text

Replaces specified text with content that's more suitable for speech. For example, reads "W3C" as "World Wide Web Consortium."
<sub alias="string"></sub>
  • Attributes
  • Examples
  • Tag relationships
AttributeTypeRequiredDescription
aliasStringYesSpecifies the replacement text to be read aloud.

<phoneme>: Specify pronunciation

Provides precise control over how text is pronounced. Chinese text supports pinyin notation, and English text supports CMU phonetic notation. This is useful for disambiguating polyphonic characters and handling foreign language pronunciation.
<phoneme alphabet="string" ph="string">Text</phoneme>
  • Attributes
  • Examples
  • Tag relationships
AttributeTypeRequiredDescription
alphabetStringYesSpecifies the pronunciation type: pinyin (for Chinese) or phonetic symbols (for English).Valid values:
phStringYesSpecifies the exact pinyin or phonetic notation. Usage rules:
  • Separate pinyin for multiple characters with spaces. The number of pinyin entries must match the number of characters.
  • Each pinyin entry consists of the pronunciation and a tone number. Tone numbers range from 1 to 5, where 5 represents the neutral tone.

<soundEvent>: Insert a sound effect

Inserts a sound effect file (such as an alert tone or ambient sound) at a specific point in the speech to enrich the audio output.
<soundEvent src="URL"/>
  • Attributes
  • Examples
  • Tag relationships
AttributeTypeRequiredDescription
srcStringYesSpecifies the URL of an external audio file.Store the audio file in Alibaba Cloud OSS and make it accessible through an Internet URL. See Upload objects. For a private object, use a valid signed URL. Escape XML special characters in the URL, such as replacing & with &amp;.
  • Audio requirements:
    • Sample rate: 16 kHz
    • Channels: mono
    • Format: WAV To convert a non-WAV file, use ffmpeg:
      ffmpeg -i input_audio -acodec pcm_s16le -ac 1 -ar 16000 output.wav
      
    • File size: 2 MB maximum
    • Bit depth: 16-bit
The uploader bears legal responsibility for the copyright of uploaded audio.

<say-as>: Set text interpretation

Specifies the content type of text (such as numbers, dates, or phone numbers) so the system reads it according to the appropriate rules for that type.
<say-as interpret-as="string">Text</say-as>
  • Attributes
  • Examples
  • Tag relationships
AttributeTypeRequiredDescription
interpret-asStringYesSpecifies the content type of the text within the tag.Valid values:
  • cardinal: reads as a standard integer or decimal number
  • digits: reads each digit individually (for example, 123 is read as "one two three")
  • telephone: reads digit by digit in the standard phone number format
  • name: reads using standard name pronunciation rules
  • address: reads using standard address pronunciation rules
  • id: reads using standard identifier (account name, nickname) pronunciation rules
  • characters: reads each character in the text individually
  • punctuation: reads the name of each punctuation mark
  • date: reads using standard date pronunciation rules
  • time: reads using standard time pronunciation rules
  • currency: reads using standard monetary amount pronunciation rules
  • measure: reads using standard unit of measurement pronunciation rules
cardinal
  • Chinese
  • English
FormatExampleChinese outputNotes
Digit string145一百四十五Positive and negative integers up to 20 digits: [-99999999999999999999,99999999999999999999]. Decimal places have no specific limit; 10 or fewer are recommended.
Minus sign+Digit string-145负一百四十五
Comma-separated groups of 3 digits10,000一万
Minus sign+Comma-separated groups of 3 digits-10,124负一万一百二十四
Digit string+Decimal point+Two zeros10.00十
Minus sign+Digit string+Decimal point+Two zeros-110.00负一百一十
Digit string+Decimal point+Digit string79.090七十九点零九零
Minus sign+Digit string+Decimal point+Digit string-79.001负七十九点零零一
digits
  • Chinese
  • English
FormatExampleChinese outputNotes
Digit string129090909一二九零九零九零九Digit string length has no specific limit; 20 digits or fewer are recommended. A pause follows each digit when the string has more than 10 digits.
telephone
  • Chinese
  • English
FormatExampleChinese outputNotes
Landline number4930286四九三 零二八六Supports 7- or 8-digit landline numbers separated by spaces or hyphens (-). Group 7 digits as 3-4 and 8 digits as 4-4.
493 0286四九三 零二八六
493-0286四九三 零二八六
62552560六二五五 二五六零
6255 2560六二五五 二五六零
6255-2560六二五五 二五六零
Landline number+Extension4930286-109四九三 零二八六 转幺零九Supports 1- to 4-digit extensions.
4930286转109四九三 零二八六 转幺零九
4930286分机109四九三 零二八六 分机幺零九
4930286分机号109四九三 零二八六 分机号幺零九
Area code+Landline number01062552560零幺零 六二五五 二五六零Supported area codes: 010, 02x, 03xx, 04xx, 05xx, 07xx, 08xx, 09xx.
010 62552560零幺零 六二五五 二五六零
010 6255 2560零幺零 六二五五 二五六零
010 6255-2560零幺零 六二五五 二五六零
010-62552560零幺零 六二五五 二五六零
010-6255-2560零幺零 六二五五 二五六零
(010)62552560零幺零 六二五五 二五六零
03198907098零三幺九 八九零 七零九八
0319-8907098三幺九 八九零 七零九八
Area code+Landline number+Extension010 62552560-109零幺零 六二五五 二五六零 转幺零九None
010-62552560-109零幺零 六二五五 二五六零 转幺零九
(010)62552560-109零幺零 六二五五 二五六零 转幺零九
(010)62552560转109零幺零 六二五五 二五六零 转幺零九
(010)62552560分机109零幺零 六二五五 二五六零 分机幺零九
(010)62552560分机号109零幺零 六二五五 二五六零 分机号幺零九
Country code+Area code+Landline number86-010-62791627八六 零幺零 六二七九 幺六二七Country codes 86, (86), +86, (+86), and 0086 are all read as “八六” (eight six).
(86)10-62791627八六 幺零 六二七九 幺六二七
+86-010-62791627八六 零幺零 六二七九 幺六二七
0086-10-62791627八六 幺零 六二七九 幺六二七
(+86)-10-6279 1627八六 幺零 六二七九 幺六二七
Country code+Area code+Landline number+Extension(86)21-58118818-207八六 二幺 五八幺幺 八八幺八 转二零七None
(86)021-5811-8818-207八六 零二幺 五八幺幺 八八幺八 转二零七
(86)021-58118818转207八六 零二幺 五八幺幺 八八幺八 转二零七
(86)21-5811-8818分机207八六 二幺 五八幺幺 八八幺八 分机二零七
+86-021-58118818分机号207八六 零二幺 五八幺幺 八八幺八分机号二零七
Mobile number139 0000 5678幺三九 零零零零 五六七八Supports 11-digit mobile numbers grouped as 3-3-5 or 3-4-4.
139-000-05678幺三九 零零零 零五六七八
139 000 05678幺三九 零零零 零五六七八
Country code+Mobile number+86-13900005678八六 幺三九 零零零零 五六七八None
(+86)-139-0000-5678八六 幺三九 零零零零 五六七八
+8613900005678八六 幺三九 零零零零 五六七八
0086-139 000 05678八六 幺三九 零零零 零五六七八
Service number123幺二三Supports common service numbers, 10-digit numbers starting with 400/800 grouped as 3-3-4, and 16-digit numbers starting with 12530/17951/12593.
95678九五六七八
4008110510四零零 八幺幺 零五幺零
800-810-8888八零零 八幺零 八八八八
1253013520638377幺二五三零 幺三五 二零六三 八三七七
Other(86)(21)9899-80800-0909八六 二幺 九八九九 八零八零零 零九零九Supports digit strings with separators (parentheses or hyphens).
address
  • Chinese
  • English
FormatExampleChinese outputNotes
Common address format元和镇嘉元30-9元和镇嘉元三十杠九Supports common address formats. An address here means a standard postal address.
市台路388弄1107-1108号市台路三八八弄幺幺零七杠幺幺零八号
华润二十四城六期锦云府3-1-3205华润二十四城六期锦云府三杠一杠三二零五
圣华名都大厦2幢2006室圣华名都大厦二幢二零零六室
五常街道庭院5幢4单元201五常街道庭院五幢四单元二零幺
芙蓉江路150弄19号芙蓉江路幺五零弄十九号
id
  • Chinese
  • English
FormatExampleChinese outputNotes
Stringdell0101D E L L 零 一 零 一Supports uppercase and lowercase English letters, digits 0-9, and underscores. Spaces in the output indicate pauses between individually read characters.
myid_1998M Y I D 下划线 一 九 九 八
AiTestA I T E S T
characters
  • Chinese
  • English
FormatExampleChinese outputNotes
StringISBN 1-001-099098-1I S B N 一 杠 零 零 一 杠 零 九 九 零 九 八 杠 一Supports Chinese characters, uppercase and lowercase English letters, digits 0-9, and some full-width and half-width characters. Spaces indicate pauses between individually read characters. Escape XML special characters in the text.
x10b2345_ux 一 零 b 二 三 四 五 下划线 u
v1.0.1v 一 点 零 点 一
版本号2.0版本号二 点 零
苏M MA000苏M M A 零 零 零
空中客车A330空中客车A 三 三 零
型号s01 s02和s03型号s 零 一 s 零二 和s 零 三
空中客车A330空中客车A 三 三 零
αβγ阿尔法 贝塔 伽玛
punctuation
  • Chinese
  • English
FormatExampleChinese outputNotes
Punctuation…省略号Supports common Chinese and English punctuation. Spaces indicate pauses between individually read characters. Escape XML special characters in the text.
……省略号
!"#$%&叹号 双引号 井号 dollar 百分号 and
‘()*+单引号 左括号 右括号 星号 加号
,-./:;逗号 杠 点 斜杠 冒号 分号
<=>?@小于 等号 大于 问号 at
[\]^_左方括号 反斜线 右方括号 脱字符 下划线
date
  • Chinese
  • English
FormatExampleChinese outputNotes
xx年71年七一年Supports 2-digit years in 60-99, 00-09, and 10-19, and 4-digit years in 1000-1999 and 2000-2099.
04年零四年
19年一九年
1011年一零一一年
1998年一九九八年
2008年二零零八年
xx年xx月98年4月九八年四月Months 1-9 can have a leading zero or omit it, for example “1908年4月” and “1908年04月”.
1998年04月一九九八年四月
08年8月零八年八月
2008年8月二零零八年八月
xx年xx月xx日xx年xx月xx号98年4月23日九八年四月二十三日Days 1-9 can have a leading zero or omit it, for example “1908年4月8日” and “1908年04月08日”.
1998年04月23日一九九八年四月二十三日
08年8月8号零八年八月八号
2008年08月08号二零零八年八月八号
xx年xx月xx日xx年xx月xx号98年4月23日九八年四月二十三日Days 1-9 can have a leading zero or omit it, for example “1908年4月8日” and “1908年04月08日”.
1998年04月23日一九九八年四月二十三日
08年8月8号零八年八月八号
2008年08月08号二零零八年八月八号
xx月xx号3月20日三月二十日None
08月07号八月七号
Year/month abbreviation2018/08二零一八年八月Supports /, -, and . as separators.
2018-08二零一八年八月
2018.08二零一八年八月
Year/month/day abbreviation2018/08/08二零一八年八月八日
2018-8-8二零一八年八月八日
2018.08.08二零一八年八月八日
xx年xx月xx日~xx年xx月xx日xx年xx月xx号~xx年xx月xx号04年9月1日~30日零四年九月一日至三十日Supports ~ and - to indicate “to”.
2004年09月01号-2008年06月08号二零零四年九月一号至二零零八年六月八号
xx年xx月xx日~xx日xx年xx月xx号~xx号04年9月1日~30日零四年九月一日至三十日
2004年09月01号-2008年06月08号二零零四年九月一号至二零零八年六月八号
xx年xx月~xx年xx月01年04月~10年04月零一年四月至一零年四月
2001年04月~2010年04月二零零一年四月至二零一零年四月
xx月xx日~xx月xx日xx月xx号~xx月xx号10月1日~10月7日十月一日至十月七日
10月01号~10月07号十月一号至十月七号
xx月xx日~xx日xx月xx号~xx号10月1日~7日十月一日至七日
10月01号~07号十月一号至七号
Year/month/day abbreviation~Year/month/day abbreviation2018/03/03~2019/01/01二零一八年三月三日至二零一九年一月一日Supports / and . as separators, and ~ and - to indicate “to”.
1997.9.9~1998.9.9一九九七年九月九日至一九九八年九月九日
Month/day abbreviation~Month/day abbreviation10/20~10/31十月二十日至十月三十一日
xx~xx月xx月~xx月1~10月一至十月
1月~10月一月至十月
Month/day/year abbreviation10/20/2018二零一八年十月二十日Only 4-digit years, / separators, and month/day/year order are supported.
time
  • Chinese
  • English
FormatExampleChinese outputNotes
Time12:00十二点Supports common time and time range formats.
12:00:00点十二点
10:20分十点二十分
10:20:30十点二十分三十秒
09:18:14九点十八分十四秒
Time~Time11:00~12:00十一点到十二点
09:00-14:00九点到十四点
11:00~11:30十一点到十一点三十分
11:00-12:18十一点到十二点十八分
10:30~11:00十点三十分到十一点
09:28-10:00九点二十八分到十点
10:20~11:20十点二十分到十一点二十分
06:00~08:00六点到八点
上午10:20~下午13:30上午十点二十分到下午十三点三十分
Time abbreviation5:00 am凌晨五点整
5:30 am凌晨五点半
5:20:12 am凌晨五点二十分十二秒
7:00 am上午七点整
7:30 AM上午七点半
7:20:12 a.m.上午七点二十分十二秒
07:08:12 A.M.上午七点零八分十二秒
5:00 pm下午五点整
5:30 PM下午五点半
5:20:12 p.m.下午五点二十分十二秒
05:09:12 P.M.下午五点零九分十二秒
9:00 pm晚上九点整
9:30 pm晚上九点半
9:20:12 PM晚上九点二十分十二秒
9:02:12 P.M.晚上九点零二分十二秒
12:00 pm中午十二点整
12:30 p.m.中午十二点半
12:20:12 PM中午十二点二十分十二秒
currency
  • Chinese
  • English
FormatExampleChinese outputNotes
Number+Currency identifier12.00 RMB十二人民币Supports AUD (Australian dollar), CAD (Canadian dollar), HKD (Hong Kong dollar), JPY (Japanese yen), USD (US dollar), CHF (Swiss franc), NOK (Norwegian krone), SEK (Swedish krona), GBP (British pound), RMB (renminbi), CNY (yuan), and EUR (euro). Numbers can be integers, decimals, or comma-separated international notation.
12.50 RMB十二点五零人民币
12,000,000 RMB一千二百万人民币
12,000,000.00 RMB一千二百万人民币
12,000.35 RMB一万两千点三五人民币
Currency identifier+Number$12十二美元Supports CAD (Canadian dollar), $ (US dollar), Fr (franc), kr (Danish krone), £ (British pound), ¥ (yuan), and € (euro). Numbers can be integers, decimals, or comma-separated international notation.
$12.00十二美元
$12.12二点一二美元
$12,000一万两千美元
$12,000.00一万两千美元
$12,000.99一万两千点九九美元
Other default readings1213一千二百一十三None
1213 KML一千二百一十三K M L
1213.00 KML一千二百一十三K M L
1213.9 KML一千二百一十三点九K M L
1,000 KML一千K M L
1,000.00 KML一千K M L
1,000.98 KML一千点九八K M L
12,000一万两千
measure
  • Chinese
  • English
FormatExampleChinese outputNotes
Number+Chinese unit2片两片Supports common Chinese units and unit abbreviations.
120公顷一百二十公顷
100多毫克一百多毫克
100来米一百来米
100余人一百余人
1厘米20毫米一厘米二十毫米
120.00平方公里一百二十平方公里
Number+Unit abbreviation120.56 cm²一百二十点五六平方厘米
120 ㎡ 56 cm²一百二十平方米五十六平方厘米
100 m 12 cm 6 mm一百米十二厘米六毫米
Range10~15 kg十至十五千克
10.24~789.82亩十点二四至七百八十九点八二亩
10米~15米十米至十五米
10.24 cm~19.08 cm十点二四厘米至十九点零八厘米
Number+Unit+"/"+Unit10元/斤十元每斤
199~299元/件一百九十九至二百九十九元每件
299.99元/g~399.99元/g二百九十九点九九元每克至三百九十九点九九元每克
Other default readings12扎十二扎
30 rm三十r m
4万万同胞四万万同胞
12.897微克十二点八九七微克
Common symbols
SymbolChinese readingEnglish reading
!叹号exclamation mark
“双引号double quote
#井号pound
$dollardollar
%百分号percent
&andand
‘单引号left quote
(左括号left parenthesis
)右括号right parenthesis
*星asterisk
+加plus
,逗号comma
-杠dash
.点dot
/斜杠slash
:零冒号solon
;分号semicolon
<小于less than
=等号equals
>大于greater than
?问号question mark
@atat
[左方括号left bracket
\反斜线back slash
]右方括号right bracket
^脱字符caret
_下划线underscore
`反引号back quote
{左花括号left brace
|竖线vertical bar
}右花括号right brace
~波浪线tilde
!叹号exclamation mark
“左双引号left double quote
”右双引号right double qute
‘左单引号left quote
’右单引号right quote
(左括号left parenthesis
)右括号right parenthesis
,逗号comma
。句号full stop
—杠em dash
:冒号colon
;分号semicolon
?问号question mark
、顿号enumeration comma
…省略号ellipsis
……省略号ellipsis
《左书名号left guillemet
》右书名号right guillemet
¥人民币符号yuan
≥大于等于greater than or equal to
≤小于等于less than or equal to
≠不等于not equal
≈约等于approximately equal
±加减plus or minus
×乘times
π派pi
Α阿尔法alpha
Β贝塔beta
Γ伽玛gamma
Δ德尔塔delta
Ε艾普西龙epsilon
Ζ捷塔zeta
Θ西塔theta
Ι艾欧塔iota
Κ喀帕kappa
∧拉姆达lambda
Μ缪mu
Ν拗nu
Ξ克西ksi
Ο欧麦克轮omicron
∏派pi
Ρ柔rho
∑西格玛sigma
Τ套tau
Υ宇普西龙upsilon
Φfaiphi
Χ器chi
Ψ普赛psi
Ω欧米伽omega
α阿尔法alpha
β贝塔beta
γ伽玛gamma
δ德尔塔delta
ε艾普西龙epsilon
ζ捷塔zeta
η依塔eta
θ西塔theta
ι艾欧塔iota
κ喀帕kappa
λ拉姆达lambda
μ缪mu
ν拗nu
ξ克西ksi
ο欧麦克轮omicron
π派pi
ρ柔rho
σ西格玛sigma
τ套tau
υ宇普西龙upsilon
φfaiphi
χ器chi
ψ普赛psi
ω欧米伽omega
Common units
FormatCategoryChinese examplesEnglish examples
AbbreviationLengthnm(纳米)、μm(微米)、 mm(毫米)、cm(厘米)、m(米)、km(千米)、ft(英尺)、in(英寸)nm (nanometre), μm (micrometre), mm (millimetre), cm (centimetre), m (metre), km (kilometre), ft (foot), in (inch)
Areacm²(平方厘米)、㎡(平方米)、km²(平方千米)、SqFt(平方英尺)cm² (square centimetre), ㎡ (square metre), km2 (square kilometre), SqFt (square foot)
Volumecm³(立方厘米)、m³(立方米)、km³(立方千米)、mL(毫升)、L(升)、gallon(加仑)cm³ (cubic centimetre), m³ (cubic metre), km3 (cubic kilometre), mL (millilitre), L (millilitre), gal (gallon)
Weightμg(微克)、mg(毫克)、g(克)、kg(千克)μg (microgram), mg (microgram), g (gram), kg (kilogram)
Timemin(分)、sec(秒)、ms(毫秒)min (minute), sec (second), ms (millisecond)
ElectromagnetismμA(微安)、mA(毫安)、Ω(欧姆)、Hz(赫兹)、kHz(千赫兹)、MHz(兆赫兹)、GHz(吉赫兹)、V(伏)、kV(千伏)、kWh(千瓦时)μA (microamp), mA (milliamp), Hz (hertz), kHz (kilohertz), MHz (megahertz), GHz (gigahertz), V (volt), kV (kilovolt), kWh (kilowatt hour)
SounddB(分贝)dB (decibel)
PressurePa(帕)、kPa(千帕)、Mpa(兆帕)Pa (pascal), kPa (kilopascal), MPa (megapascal)
Other common unitsAlso supports Chinese units beyond these categories, such as “米”, “秒”, “美元”, and “毫升每瓶”, and Chinese measure words such as “架”, “场”, “头”, “部”, and “盆”.Also supports other units, such as tsp (teaspoon), rpm (round per minute), KB (kilobyte), and mmHg (millimetre of mercury).

LaTeX tags and symbols

Select a category to view supported tags and symbols. Input text examples include delimiters. Example readings remain in Chinese because this feature produces Chinese speech.

Basic mathematics

Tag or symbolMeaningFormula source exampleInput text exampleExample reading
+Addition2 + 3 = 5$2 + 3 = 5$二加三等于五
-Subtraction3 - 2 = 1$3 - 2 = 1$三减二等于一
\pmPlus or minus\pm 1 \pm 2$\pm 1\pm 2$正负一加减二
Positive or negative
\timesMultiplication2 \times 3 = 6$2 \times 3 = 6$二乘三等于六
×2 × 3 = 6$$2 × 3 = 6$$
*2 * 3 = 6\(2 * 3 = 6\)
\divDivision6\div2=3\[6\div2=3\]六除二等于三
÷6÷2=3$6÷2=3$
/6/2=3$6/2=3$
=Equals3+5=8$3+5=8$三加五等于八
<Less than1< 2$1< 2$一小于二
≤Less than or equal to3≤5$3≤5$三小于等于五
<=3<=5$3<=5$
\leq3\leq5$3\leq 5$
\le3\le5$3\le 5$
\leqq3\leqq5$3\leqq 5$
\leqslant3\leqslant5$3\leqslant 5$
>Greater than2>1$2>1$二大于一
≥Greater than or equal to5≥3$5≥3$五大于等于三
>=5>=3$5>=3$
\geq5\geq3$5\geq 3$
\ge5\ge3$5\ge 3$
\geqq5\geqq3$5\geqq 3$
\geqslant5\geqslant3$5\geqslant 3$
\fracFraction2\frac3$\frac {2}{3}$三分之二
^Power2^1$2^{1}$二的一次方
\sqrtRoot\sqrt{9} = 3$\sqrt {9} = 3$根号下九等于三
\sqrt[3]{8} = 2$\sqrt[3]{8} = 2$三次根号下八等于二
\%Percentage5\%$5\%$百分之五
|Absolute value∣3∣=3$|3| =3$绝对值三的绝对值等于三
\vert3\vert=3$\vert 3\vert =3$绝对值三绝对值等于三
\lgLogarithmlg {10}$\lg {10}$log十
\logLogarithm\log{5}$\log{5}$log五
\lnNatural logarithm\lnX$ln {10}$LN十
!Factorial5!$5!$五的阶乘
()Brackets(2+1)$(2+1)$括号内二加一
\{ \}$\{2+1\}$大括号二加一反大括号

Special mathematical symbols

Tag or symbolMeaningFormula source exampleInput text exampleExample reading
\alphaalpha\alpha$\alpha$α
\Alpha\Alpha$\Alpha$
\betabeta\beta$\beta$β
\Beta\Beta$\Beta$
\gammagamma\gamma$\gamma$γ
\Gamma\Gamma$\Gamma$
\deltadelta\delta$\delta$Δ
\Delta\Delta$\Delta$
\inftyInfinity (Chinese)\infty$\infty$无穷大
∞infty (English)∞$∞$

Geometry

Tag or symbolMeaningFormula source exampleInput text exampleExample reading
\piPi\pi=3.14159$\pi =3.14159$派等于三点一四一五九
\sin (sine)Trigonometric function\sin 30^\circ =\frac {1}{2}$\sin 30^\circ =\frac {1}{2}$sine三十度等于二分之一
\cos (cosine)\cos 45^\circ =\frac {\sqrt {2}}{2}$\cos 45^\circ =\frac {\sqrt {2}}{2}$cosine四十五度等于二分之根号下二
\tan (tangent)\tan 30^\circ =\frac {\sin 30^\circ}{\cos 30^\circ}$\tan 30^\circ =\frac {\sin 30^\circ}{\cos 30^\circ}$tangent三十度等于cosine三十度分之sine三十度
\csc (cosecant)\csc A$\csc A$cosecant A
\sec (secant)\sec A$\sec A$secant A
\cot (cotangent)\cot A$\cot A$cotangent A
\angleAngle\angle AB$\angle AB$角A B
∠∠AB$∠AB$
^\circDegree∠AB = 30^\circ$∠AB = 30^\circ$角A B 等于三十度
\odotCircle\odot$\odot$圆
\overset\frownArc\overset\frown {BC}$\overset\frown {BC}$弧BC
\rm{Rt}Right angle\because \rm{Rt}\triangle ABC$\because \rm{Rt}\triangle ABC$因为直角三角形ABC
\mathrm{Rt}\therefore AB \perp BC$\therefore AB \perp BC$所以AB垂直于BC
\triangleTriangle\triangleABC$\triangle ABC$三角形ABC
△△ABC$△ABC$
\parallelogramParallelogram\parallelogramABCD$\parallelogram ABCD$平行四边形ABCD
\perpPerpendicularAB \perp BC$AB \perp BC$A B 垂直于 B C
\botAB \bot BC$AB \bot BC$
⊥AB ⊥ BC$AB ⊥ BC$
\parallelParallelA\parallel B$A\parallel B$A平行于B
\equalparallelParallel and equalA\equalparallel B$A\equalparallel B$A平行且相等于B
\congCongruent△ABC\cong△DEF$△ABC\cong△DEF$三角形ABC全等于三角形DEF

Conditions

Tag or symbolMeaningFormula source exampleInput text exampleExample reading
\impliesImplies\implies 1+1=2$\implies 1+1=2$推出一加一等于二
\iffEquivalentp\iffq$p\iffq$p等价q
\becauseBecause\because a = b \therefore b=a$\because a = b \therefore b=a$因为a等于b所以b等于a
\thereforeTherefore

Units

Wrap units in \unit, \quantity, \mathit, \mathrm, or \rm, for example \unit{cm}.
Tag or symbolMeaningFormula source exampleInput text exampleExample reading
mmMillimetre5\quantity{mm}$5\quantity{mm}$五毫米
cmCentimetre5\quantity{cm}$5\quantity{cm}$五厘米
dmDecimetre5\quantity{dm}$5\quantity{dm}$五分米
mMetre5\quantity{m}$5\quantity{m}$五米
kmKilometre5\quantity{km}$5\quantity{km}$五千米
gGram5\quantity{g}$5\quantity{g}$五克
kgKilogram5\quantity{kg}$5\quantity{kg}$五千克
tTonne5\quantity{t}$5\quantity{t}$五吨
mm^2Square millimetre5\quantity{mm^2}$5\quantity{mm^2}$五平方毫米
cm^2Square centimetre5\quantity{cm^2}$5\quantity{cm^2}$五平方厘米
dm^2Square decimetre5\quantity{dm^2}$5\quantity{dm^2}$五平方分米
m^2Square metre5\quantity{m^2}$5\quantity{m^2}$五平方米
km^2Square kilometre5\quantity{km^2}$5\quantity{km^2}$五平方千米
mm^3Cubic millimetre5\quantity{mm^3}$5\quantity{mm^3}$五立方毫米
cm^3Cubic centimetre5\quantity{cm^3}$5\quantity{cm^3}$五立方厘米
dm^3Cubic decimetre5\quantity{dm^3}$5\quantity{dm^3}$五立方分米
m^3Cubic metre5\quantity{m^3}$5\quantity{m^3}$五立方米
km^3Cubic kilometre5\quantity{km^3}$5\quantity{km^3}$五立方千米
mlMillilitre5\quantity{ml}$5\quantity{ml}$五毫升
sSecond5\quantity{s}$5\quantity{s}$五秒
minMinute5\quantity{min}$5\quantity{min}$五分
hHour5\quantity{h}$5\quantity{h}$五小时
km/hKilometres per hour5\quantity{km/h}$5\quantity{km/h}$五千米每小时
g/lGrams per litre5\quantity{g/l}$5\quantity{g/l}$五克每升

FAQ

Why is a formula not read correctly?

  1. Check that the formula is enclosed in $...$, $$...$$, \(...\), or \[...\].
  2. Check for unsupported tags or symbols.
  3. Check that each \ is escaped as \\ in the request string.

How do I handle backslashes in code?

See the escaping instructions under Usage. Formula source and code strings use different notation: write \frac as \\frac in a regular string.
Token Plan
Model Playground
Statistics and Monitoring
Asset Center
Support
SSML and LaTeX - Alibaba Cloud Model Studio