You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何编写「anni '90」?以及如何在LaTeX中输出「anni '90」?

Hey there! Let's tackle your two questions about getting anni '90 just right—whether you're writing it as a regular string or typesetting it in LaTeX.

1. Writing the anni '90 string in general code/text

This is straightforward most of the time! The string itself is made of plain ASCII characters, so you can type it directly unless you're using a programming language where single quotes act as string delimiters.

  • For languages that use double quotes for strings (like Python, Java, C#), you can write it directly without any extra steps:
    favorite_decade = "anni '90"
    print(favorite_decade)  # Outputs: anni '90
    
  • For languages that use single quotes as string delimiters (like JavaScript, PHP), you'll need to escape the internal single quote with a backslash to avoid breaking the string:
    let favoriteDecade = 'anni \'90';
    console.log(favoriteDecade);  // Outputs: anni '90
    // Alternatively, wrap the string in double quotes to skip escaping entirely:
    let favoriteDecade2 = "anni '90";
    

No fancy hacks needed here—just keep an eye on how your programming language handles string boundaries!

2. Typesetting anni '90 correctly in LaTeX

LaTeX has a quirk with single quotes by default: it uses backticks (`) for left curly quotes and apostrophes (') for right curly quotes. But if you want the straight single quote from your original string, here's how to nail it:

  • Option 1: Direct input (works for modern engines)
    If you're using a modern LaTeX engine like XeLaTeX or LuaLaTeX (which handle UTF-8 natively), just typing anni '90 in your .tex file will usually output the straight single quote correctly.

  • Option 2: Force a straight single quote
    If you're using an older engine (like pdfLaTeX) or your default font keeps turning the quote curly, use the \textquotesingle command to explicitly output the exact character you want:

    anni \textquotesingle 90
    

    This guarantees no curly quotes sneak in where you don't want them.

Quick note: Avoid typing anni `90 (with a backtick)—that will produce a left curly quote, which isn't the formatting you're after.

内容的提问来源于stack exchange,提问作者andreYLLI

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.27 14:12:34