Skip to content

Add tex2typst extension - #22667

Merged
raycastbot merged 6 commits into
raycast:mainfrom
nac-39:ext/tex2typst
Nov 7, 2025
Merged

raycastbot merged 6 commits into
raycast:mainfrom
nac-39:ext/tex2typst

Conversation

@nac-39

@nac-39 nac-39 commented Nov 5, 2025 •

Copy link
Copy Markdown
Contributor

Description

Adds two commands: one to convert TeX math expressions on the clipboard to Typst, and another to convert Typst math expressions to TeX.

Screencast

スクリーンショット 2025-11-07 11 48 51 スクリーンショット 2025-11-07 11 48 59

Checklist

- rm owner
- init
@raycastbot

ghost commented Nov 5, 2025

Copy link
Copy Markdown
Collaborator

Congratulations on your new Raycast extension! 🚀

You can expect an initial review within five business days.

Once the PR is approved and merged, the extension will be available on our Store.

- rename icon
- fix: ja 2 en
- add icon
@nac-39
nac-39 marked this pull request as ready for review November 7, 2025 03:03

ghost left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Overview

Greptile Summary

This PR adds a new "tex2typst" extension that provides bidirectional conversion between TeX and Typst mathematical notation formats. The extension includes two no-view commands that read mathematical expressions from the clipboard, convert them using the tex2typst npm library, and copy the results back to the clipboard with toast notifications for user feedback. The implementation follows standard Raycast patterns with proper error handling, TypeScript configuration, and development tooling. All configuration files (ESLint, Prettier, TypeScript) adhere to Raycast's extension templates. The extension targets users who work with both LaTeX and Typst typesetting systems and need quick conversion capabilities.

Important Files Changed

Filename Score Overview
extensions/tex2typst/src/convert-tex-to-typst.ts 4/5 Implements TeX-to-Typst conversion command with proper error handling and clipboard operations
extensions/tex2typst/src/convert-typst-to-tex.ts 3/5 Implements Typst-to-TeX conversion with Japanese error message inconsistency
extensions/tex2typst/README.md 4/5 Comprehensive Japanese documentation for the extension functionality
extensions/tex2typst/package.json 4/5 Extension configuration with proper metadata and dependencies
extensions/tex2typst/CHANGELOG.md 5/5 Standard changelog with correct template string format
extensions/tex2typst/.gitignore 5/5 Standard Raycast extension gitignore configuration
extensions/tex2typst/tsconfig.json 5/5 Standard TypeScript configuration for Raycast extensions
extensions/tex2typst/eslint.config.js 5/5 Standard ESLint configuration following Raycast template
extensions/tex2typst/.prettierrc 5/5 Standard Prettier configuration matching Raycast guidelines

Confidence score: 3/5

  • This PR contains a mixed language issue that affects user experience consistency
  • Score reduced due to the Japanese error message in the Typst-to-TeX converter while all other messages are in English, creating an inconsistent user experience
  • The convert-typst-to-tex.ts file needs attention to fix the localization inconsistency on line 26

9 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

Comment on lines +23 to +30
} catch (e: unknown) {
const message = e instanceof Error ? e.message : String(e);
await showToast({
title: "Conversion failed",
message,
style: Toast.Style.Failure,
});
}

ghost Nov 7, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Could simplify error handling with showFailureToast from @raycast/utils

ghost Nov 7, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in this commit: 41e79b4

nac-39 and others added 2 commits November 7, 2025 12:17
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
- Merge branch \'contributions/merge-1762485663071\'
- Pull contributions
- refactor: use `showFailureToast`
Comment thread extensions/tex2typst/README.md Outdated
Comment on lines +1 to +61
# tex2typst (Raycast Extension)

TeX と Typst の相互変換を、Raycast からワンアクションで行う拡張機能です。

## 機能

- TeX -> Typst 変換(クリップボードの TeX を Typst に変換してコピー)
- Typst -> TeX 変換(クリップボードの Typst を TeX に変換してコピー)
- 成功/失敗を Raycast のトーストで通知

変換ロジックは `tex2typst` ライブラリに依存しています。


## 使い方

1. 変換したいテキストをクリップボードにコピーします。
- TeX を Typst にしたい場合: TeX をコピーして「Convert TeX to Typst」を実行
- Typst を TeX にしたい場合: Typst をコピーして「Convert Typst to TeX」を実行
2. 実行後、結果はクリップボードへ上書きコピーされます。
3. 成功/失敗はトーストで表示されます。

補足:

- 本拡張は `no-view` モードで動作し、UI は表示しません(トーストのみ)。

## コマンド一覧

- Convert TeX to Typst (`convert-tex-to-typst`)
- Convert Typst to TeX (`convert-typst-to-tex`)

## 開発

インストールと開発サーバー起動:

```bash
npm install
npm run dev
```

ビルド:

```bash
npm run build
```

Lint:

```bash
npm run lint
npm run fix-lint
```

公開(Raycast Store へ):

```bash
npm run publish
```

## ライセンス

Apache License 2.0 No newline at end of file

ghost Nov 7, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the moment, Raycast doesn't support localization and only supports US English. Therefore, please avoid introducing your custom way to localize your extension. If the locale might affect functionality (e.g. using the correct unit of measurement), please use the preferences API.

ghost left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I converted this PR into a draft until it's ready for the review, please press the button Ready for review when it's ready and we'll have a look 😊

@pernielsentikaer
pernielsentikaer marked this pull request as draft November 7, 2025 08:28
@nac-39

ghost commented Nov 7, 2025

Copy link
Copy Markdown
Contributor Author

I apologize for having used a Japanese README due to a lack of thorough checking on my part. I have made the necessary corrections, so could you please review the Pull Request again? I am sorry for the inconvenience this has caused.

@nac-39
nac-39 marked this pull request as ready for review November 7, 2025 08:58

ghost left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Overview

Greptile Summary

This review covers only the changes made since the last review, not the entire PR. The developer has addressed the previous feedback by refactoring error handling to use showFailureToast from @raycast/utils instead of manually constructing toast notifications. Both conversion command files (convert-tex-to-typst.ts and convert-typst-to-tex.ts) now use this utility function, simplifying error handling code from 4 lines to 1 line per error case. Additionally, the README.md has been translated from Japanese to English to comply with Raycast's localization guidelines that require US English only. These changes improve code consistency, reduce boilerplate, and align with Raycast's recommended practices.

Important Files Changed

Filename Score Overview
extensions/tex2typst/src/convert-typst-to-tex.ts 5/5 Refactored error handling to use showFailureToast utility instead of manual toast construction
extensions/tex2typst/src/convert-tex-to-typst.ts 5/5 Simplified error handling by adopting showFailureToast from @raycast/utils
extensions/tex2typst/README.md 5/5 Translated documentation from Japanese to English for Raycast localization compliance

Confidence score: 5/5

  • This PR is safe to merge with minimal risk
  • Score reflects clean refactoring following Raycast best practices and compliance with localization guidelines
  • No files require special attention

3 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

ghost left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, approved 🔥

@raycastbot
raycastbot merged commit a92f1b8 into raycast:main Nov 7, 2025
@github-actions

ghost commented Nov 7, 2025

Copy link
Copy Markdown
Contributor

@raycastbot

ghost commented Nov 7, 2025

Copy link
Copy Markdown
Collaborator

🎉 🎉 🎉

We've rewarded your Raycast account with some credits. You will soon be able to exchange them for some swag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants