Skip to content
| Marketplace
Sign in
Visual Studio Code>Language Packs>LaTeX IME SwitcherNew to Visual Studio Code? Get it now.
LaTeX IME Switcher

LaTeX IME Switcher

MKJP Dev

|
1 install
| (0) | Free
Automatically switches Japanese IME ON/OFF based on LaTeX document context
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

LaTeX IME Switcher

Version Installs Rating

Automatically switch Japanese IME ON/OFF based on LaTeX context — No more manual IME toggling while writing LaTeX documents with mixed Japanese and English!

English | 日本語


🌟 Features

Smart Context-Aware IME Switching

Writing LaTeX documents with Japanese text requires constant IME switching between:

  • English mode for commands (\section, \cite, $...$)
  • Japanese mode for text content

LaTeX IME Switcher analyzes your cursor context in real-time and switches IME automatically:

Context Action Example
Typing \ or ¥ Switch to English ¥section → \section ✨
After \section Switch to Japanese \section → 序論 📝
Opening { in text commands Switch to Japanese \section{ → 序論
Opening { in ref commands Stay in English \cite{ → ref2025
After } or newline Switch to Japanese } → 続きの文章

🎯 Key Highlights

  • ✅ Zero Configuration — Works out of the box with sensible defaults
  • ✅ Smart Argument Detection — Distinguishes text args (\section{...}) from labels (\cite{...})
  • ✅ ¥ → \ Conversion — Type ¥section in Japanese mode → auto-converts to \section
  • ✅ Ultra-Low Latency — <30ms response time, imperceptible lag
  • ✅ Customizable Patterns — Configure regex patterns for your workflow
  • ✅ Conflict Detection — Warns about VSCodeVim/im-select conflicts

📦 Installation

From VS Code Marketplace (Recommended)

  1. Open VS Code
  2. Press Ctrl+Shift+X (Windows/Linux) or Cmd+Shift+X (Mac)
  3. Search for "LaTeX IME Switcher"
  4. Click Install

Manual Installation

code --install-extension latex-ime-switcher-0.1.0.vsix

🚀 Quick Start

  1. Open any .tex file
  2. Start typing — IME switches automatically!

Example Workflow

これは本文です。¥section{序論}

この拡張機能は、日本語と英数字を混在させた文書を執筆する際のIME切替を自動化します。

¥cite{ref2025}によると、自動切替は生産性を向上させます。

¥end{document}

What happens:

  • ¥ → automatically converts to \ and switches to English
  • \section{ → switches to Japanese inside {...}
  • After } or newline → switches back to Japanese
  • \cite{ → stays in English for reference labels

⚙️ Configuration

All settings are optional. Default values work great for most users.

Settings

Setting Default Description
imeSwitch.enabled true Enable/disable the extension
imeSwitch.languages ["latex", "tex"] Target document languages
imeSwitch.offRegex ["\\[a-zA-Z]*", "¥[a-zA-Z]*", "\\$"] Patterns to trigger English mode
imeSwitch.onRegex ["\\{", "。|、|!|?", "\\}", "\\n"] Patterns to trigger Japanese mode
imeSwitch.smartArgDetection true Distinguish text vs label arguments
imeSwitch.debounceMs 25 Debounce delay (milliseconds)

Commands

Command Description
LaTeX IME Switch: Toggle Enable Toggle extension on/off
LaTeX IME Switch: Force IME ON Manually force Japanese mode
LaTeX IME Switch: Force IME OFF Manually force English mode

🖥️ System Requirements

Component Requirement
VS Code 1.70.0 or higher
OS Windows 10/11 (macOS/Linux coming soon)
IME Microsoft IME, Google Japanese Input, etc.

OS Support Roadmap

  • ✅ Windows 10/11 — Fully supported (v1.0)
  • 🚧 macOS — Planned for v1.2
  • 🚧 Linux — Planned for v1.3

🛠️ How It Works

  1. Context Analysis: Monitors last 100 characters before cursor
  2. Pattern Matching: Matches against configurable regex patterns
  3. IME Control: Calls OS-specific IME API via native helper (PowerShell on Windows)
  4. Text Replacement: Converts ¥ to \ automatically

Privacy: All processing is 100% local. No data sent to external servers.


🤝 Contributing

Contributions welcome! See DEVELOPER_GUIDE.md for details.


📄 License

MIT License - see LICENSE


🌟 機能(日本語)

スマートなコンテキスト認識型IME切替

LaTeX文書で日本語を書く際、IMEを頻繁に切り替える必要があります:

  • 英数モード: コマンド入力 (\section, \cite, $...$)
  • 日本語モード: 本文入力

LaTeX IME Switcher はカーソル位置の文脈をリアルタイムで解析し、IMEを自動切替:

文脈 動作 例
\ または ¥ を入力 英数に切替 ¥section → \section ✨
\section の後 日本語に切替 \section → 序論 📝
テキストコマンドで { 日本語に切替 \section{ → 序論
参照コマンドで { 英数のまま \cite{ → ref2025
} や改行の後 日本語に切替 } → 続きの文章

🎯 主な特長

  • ✅ 設定不要 — デフォルト設定ですぐ使える
  • ✅ スマート引数検出 — テキスト引数(\section{...})とラベル(\cite{...})を自動判別
  • ✅ ¥ → \ 自動変換 — 日本語モードで¥sectionと入力→自動的に\sectionに変換
  • ✅ 超低レイテンシ — 30ms以下の応答速度、遅延を感じない
  • ✅ カスタマイズ可能 — 正規表現パターンで切替条件を設定
  • ✅ 競合検出 — VSCodeVim/im-select との競合を警告

📦 インストール

VS Code Marketplace から(推奨)

  1. VS Code を開く
  2. Ctrl+Shift+X を押す(Windowsの場合)
  3. "LaTeX IME Switcher" を検索
  4. インストール をクリック

🚀 クイックスタート

  1. .tex ファイルを開く
  2. タイピング開始 — IMEが自動的に切り替わります!

使用例

これは本文です。¥section{序論}

この拡張機能は、日本語と英数字を混在させた文書を執筆する際のIME切替を自動化します。

¥cite{ref2025}によると、自動切替は生産性を向上させます。

¥end{document}

何が起こるか:

  • ¥ → 自動的に \ に変換され、英数モードに切替
  • \section{ → {...} 内で日本語モードに切替
  • } や改行の後 → 日本語モードに戻る
  • \cite{ → 参照ラベル用に英数モードのまま

📄 ライセンス

MIT License - LICENSE を参照


🙏 謝辞

LaTeX文書執筆の生産性向上のために開発されました。フィードバックやコントリビューションをお待ちしています!

例:

これは本文です。\section{序論}
  • これは本文です → 日本語モード(IME ON)
  • \section → 英数モード(IME OFF)
  • {序論} → 日本語モード(IME ON)

設定

settings.json で以下の設定が可能です:

{
  // 拡張機能の有効/無効
  "imeSwitch.enabled": true,
  
  // 対象言語
  "imeSwitch.languages": ["latex", "tex"],
  
  // IME OFFにする正規表現パターン(LaTeXコマンドなど)
  "imeSwitch.offRegex": [
    "\\\\[a-zA-Z]*",  // \section, \cite など
    "\\$"             // 数式モード $
  ],
  
  // IME ONにする正規表現パターン(開き括弧、句読点など)
  "imeSwitch.onRegex": [
    "\\{",           // 開き括弧
    "。|、|.|,"    // 日本語句読点
  ],
  
  // スマート引数検出(\section{...} と \cite{...} を区別)
  "imeSwitch.smartArgDetection": true,
  
  // デバウンス時間(ms)
  "imeSwitch.debounceMs": 25,
  
  // レート制限(ms)
  "imeSwitch.rateLimitMs": 200,
  
  // 解析する文脈サイズ(文字数)
  "imeSwitch.contextWindowSize": 100
}

コマンド

  • IME Switch: Toggle ON/OFF - 拡張機能の有効/無効を切り替え
  • IME Switch: Force IME ON - 手動でIMEをON
  • IME Switch: Force IME OFF - 手動でIMEをOFF

ステータスバーのキーボードアイコンをクリックしても切り替え可能です。

トラブルシューティング

IMEが切り替わらない

  1. 設定を確認: imeSwitch.enabled が true か確認
  2. 対象言語を確認: .tex ファイルで動作しているか確認
  3. 出力ログを確認: View > Output > LaTeX IME Switcher でログを確認

VSCodeVimとの競合

拡張機能は自動的にVSCodeVimを検出し、警告を表示します。両方を使用する場合は、以下のいずれかを選択してください:

  • LaTeX IME Switcherを無効化
  • VSCodeVimの vim.autoSwitchInputMethod を無効化

パフォーマンスの問題

デバウンス時間を調整してください:

{
  "imeSwitch.debounceMs": 50  // デフォルト: 25
}

開発

ビルド

npm install
npm run compile

監視モード

npm run watch

テスト

npm test

パッケージング

npm install -g vsce
vsce package

ロードマップ

  • v1.0 (2025 Q4): Windows対応、LaTeX基本機能
  • v1.1 (2026 Q1): Markdown/Typst対応
  • v1.2 (2026 Q2): macOS対応
  • v1.3 (2026 Q3): Linux対応

詳細は requirements-specification.md を参照してください。

貢献

Issue、Pull Requestを歓迎します!

ライセンス

MIT License - 詳細は LICENSE を参照してください。

謝辞

このプロジェクトは、LaTeX文書執筆の生産性向上を目指すすべてのユーザーのために開発されています。


開発者: LaTeX IME Switcher Team
サポート: GitHub Issues

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft