feat: export LaTeX project as Typst (.typ) via pandoc
Build and Deploy Verso / deploy (push) Successful in 9m58s

Adds a new "Export as Typst" option in the project title dropdown and
File menu, mirroring the existing docx/markdown/html export pipeline.

Changes:
- CLSI ConversionManager: add 'typst' to LATEX_EXPORT_CONFIGS
  (compressOutput: false, pandoc --from latex --to typst)
- Web controller: register 'typst' → 'typ' in SUPPORTED_CONVERSION_TYPES
- Frontend: extend conversionType union and add ExportProjectWithConversionButton
- File menu: add 'export-as-typst' to the download group command structure
- Locales: add export_as_typst key to all 18 locale files

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
claude
2026-06-17 08:24:54 +00:00
parent f7d0369213
commit 32aec14c41
24 changed files with 53 additions and 15 deletions
+12
View File
@@ -175,6 +175,18 @@ const LATEX_EXPORT_CONFIGS = {
'--standalone',
],
},
typst: {
fileExtension: 'typ',
compressOutput: false,
getPandocArgs: ({ outputPath }) => [
'--output',
outputPath,
'--from',
'latex',
'--to',
'typst',
],
},
}
async function convertLaTeXToDocumentInDirWithLock(
@@ -20,6 +20,7 @@ const SUPPORTED_CONVERSION_TYPES = new Map([
['docx', 'docx'],
['markdown', 'zip'],
['html', 'zip'],
['typst', 'typ'],
])
const exportProjectConversionSchema = z.object({
@@ -9,7 +9,7 @@ import { useEditorManagerContext } from '@/features/ide-react/context/editor-man
type ExportProjectWithConversionProps = {
featureFlag?: string
conversionType: 'docx' | 'markdown' | 'html'
conversionType: 'docx' | 'markdown' | 'html' | 'typst'
label: string
menuBarId: string
}
@@ -97,6 +97,7 @@ export const ToolbarMenuBar = () => {
'export-as-docx',
'export-as-markdown',
'export-as-html',
'export-as-typst',
],
},
],
@@ -95,6 +95,12 @@ export const ToolbarProjectTitle = () => {
label={t('export_as_html')}
menuBarId="export-as-html"
/>
<ExportProjectWithConversionButton
featureFlag="export-typst"
conversionType="typst"
label={t('export_as_typst')}
menuBarId="export-as-typst"
/>
<DropdownDivider />
<DuplicateProject />
<OLDropdownMenuItem
@@ -16,7 +16,7 @@ import { OpenDocuments } from '../editor/open-documents'
const SLOW_CONVERSION_THRESHOLD = 2000
export default function useConvertProject(
type: 'docx' | 'markdown' | 'html',
type: 'docx' | 'markdown' | 'html' | 'typst',
openDocs: OpenDocuments,
getRootDocInfo: () => RootDocInfo
) {
+2 -1
View File
@@ -339,5 +339,6 @@
"your_subscription_has_expired": "Vaše předplatné vypršelo.",
"top_bottom_split_view": "Horní/dolní rozdělené zobrazení",
"your_subscriptions": "Vaše předplatná",
"editor_settings": "Nastavení editoru"
"editor_settings": "Nastavení editoru",
"export_as_typst": "Exportovat jako Typst"
}
+2 -1
View File
@@ -2167,5 +2167,6 @@
"zotero_reference_loading_error_forbidden": "Kunne ikke indlæse referencer fra Zotero, genforbind venligst din konto og prøv igen",
"top_bottom_split_view": "Øverste/nedre delt visning",
"zotero_sync_description": "Via Zotero-integrationen kan du importere dine referencer fra Zotero ind i dine __appName__-projekter.",
"editor_settings": "Editorindstillinger"
"editor_settings": "Editorindstillinger",
"export_as_typst": "Eksportér som Typst"
}
+1
View File
@@ -892,6 +892,7 @@
"explore_plans": "Produkte entdecken",
"export_as_docx": "Export als Word-Dokument (.docx)",
"export_as_html": "Export als HTML (.html)",
"export_as_typst": "Als Typst exportieren",
"export_as_markdown": "Als Markdown exportieren (.md)",
"export_csv": "CSV-Datei exportieren",
"export_project_to_github": "Projekt nach GitHub exportieren",
+1
View File
@@ -877,6 +877,7 @@
"explore_plans": "Explore plans",
"export_as_docx": "Export as Word document (.docx)",
"export_as_html": "Export as HTML (.html)",
"export_as_typst": "Export as Typst",
"export_as_markdown": "Export as Markdown (.md)",
"export_csv": "Export CSV",
"export_project_to_github": "Export Project to GitHub",
+1
View File
@@ -878,6 +878,7 @@
"explore_plans": "Explorar planes",
"export_as_docx": "Exportar como documento de Word (.docx)",
"export_as_html": "Exportar como HTML (.html)",
"export_as_typst": "Exportar como Typst",
"export_as_markdown": "Exportar como Markdown (.md)",
"export_csv": "Exportar CSV",
"export_project_to_github": "Exportar proyecto a GitHub",
+2 -1
View File
@@ -345,5 +345,6 @@
"your_subscriptions": "Tilauksesi tilaukset",
"top_bottom_split_view": "Ylä/alakerros jaettu näkymä",
"zh-CN": "Kiina",
"editor_settings": "Editorin asetukset"
"editor_settings": "Editorin asetukset",
"export_as_typst": "Vie Typst-muotoon"
}
+1
View File
@@ -880,6 +880,7 @@
"explore_plans": "Découvrir les offres",
"export_as_docx": "Exporter sous forme de document Word (.docx)",
"export_as_html": "Exporter au format HTML (.html)",
"export_as_typst": "Exporter en Typst",
"export_as_markdown": "Exporter en Markdown (.md)",
"export_csv": "Exporter en CSV",
"export_project_to_github": "Exporter le projet vers GitHub",
+1
View File
@@ -877,6 +877,7 @@
"explore_plans": "Esplora i piani",
"export_as_docx": "Esporta come documento Word (.docx)",
"export_as_html": "Esporta come HTML (.html)",
"export_as_typst": "Esporta come Typst",
"export_as_markdown": "Esporta come Markdown (.md)",
"export_csv": "Esporta CSV",
"export_project_to_github": "Esporta Progetto in GitHub",
+2 -1
View File
@@ -489,5 +489,6 @@
"zotero_reference_loading_error_forbidden": "Zoteroのリファレンスを読み込むことができませんでした。アカウントを再リンクして、再度お試しください",
"top_bottom_split_view": "上下分割ビュー",
"zotero_sync_description": "Zoteroを統合すると、Zoteroから__appName__プロジェクトにリファレンスをインポートすることができます。",
"editor_settings": "エディタ設定"
"editor_settings": "エディタ設定",
"export_as_typst": "Typstとしてエクスポート"
}
+2 -1
View File
@@ -550,5 +550,6 @@
"your_subscriptions": "나의 구독 목록",
"top_bottom_split_view": "상하 분할 보기",
"zh-CN": "中國語",
"editor_settings": "편집기 설정"
"editor_settings": "편집기 설정",
"export_as_typst": "Typst로 내보내기"
}
+2 -1
View File
@@ -560,5 +560,6 @@
"zotero_reference_loading_error_expired": "Zotero token verlopen, gelieve je account opnieuw te koppelen",
"top_bottom_split_view": "Boven/onder gesplitst",
"zotero_reference_loading_error_forbidden": "Kon referenties niet laden vanaf Zotero, gelieve je account opnieuw te koppelen en nogmaals te proberen",
"editor_settings": "Editor-instellingen"
"editor_settings": "Editor-instellingen",
"export_as_typst": "Exporteren als Typst"
}
+2 -1
View File
@@ -391,5 +391,6 @@
"your_subscriptions": "Dine abonnementer",
"top_bottom_split_view": "Øvre/nedre delt visning",
"zh-CN": "Kinesisk",
"editor_settings": "Redaktørinnstillinger"
"editor_settings": "Redaktørinnstillinger",
"export_as_typst": "Eksporter som Typst"
}
+2 -1
View File
@@ -230,5 +230,6 @@
"your_projects": "Twoje projekty",
"top_bottom_split_view": "Widok podzielony góra/dół",
"your_subscriptions": "Twoje subskrypcje",
"editor_settings": "Ustawienia edytora"
"editor_settings": "Ustawienia edytora",
"export_as_typst": "Eksportuj jako Typst"
}
+2 -1
View File
@@ -660,5 +660,6 @@
"zotero_reference_loading_error_forbidden": "Não foi possível carregar as referências do Zotero, por favor, revincule sua conta e tente novamente",
"top_bottom_split_view": "Divisão superior/inferior",
"zotero_sync_description": "A integração Zotero permite você importar as referências do zotero para seus projetos no __appName__.",
"editor_settings": "Configurações do editor"
"editor_settings": "Configurações do editor",
"export_as_typst": "Exportar como Typst"
}
+2 -1
View File
@@ -465,5 +465,6 @@
"your_subscriptions": "Ваши подписки",
"top_bottom_split_view": "Разделить сверху/снизу",
"zh-CN": "Китайский",
"editor_settings": "Настройки редактора"
"editor_settings": "Настройки редактора",
"export_as_typst": "Экспорт в Typst"
}
+2 -1
View File
@@ -937,5 +937,6 @@
"zotero_reference_loading_error_forbidden": "Kunde inte ladda referenser från Zotero, vänligen återkoppla ditt konto och försök igen",
"top_bottom_split_view": "Övre/nedre delad vy",
"zotero_sync_description": "Med Zotero integrering kan du importera dina referenser direkt från Zotero till ditt __appName__ projekt.",
"editor_settings": "Editorinställningar"
"editor_settings": "Editorinställningar",
"export_as_typst": "Exportera som Typst"
}
+2 -1
View File
@@ -377,5 +377,6 @@
"your_subscriptions": "Abonelikleriniz",
"top_bottom_split_view": "Yukarı/aşağı bölünmüş görünüm",
"zh-CN": "Çince",
"editor_settings": "Düzenleyici ayarları"
"editor_settings": "Düzenleyici ayarları",
"export_as_typst": "Typst olarak dışa aktar"
}
+2 -1
View File
@@ -2533,5 +2533,6 @@
"zotero_reference_loading_error_forbidden": "无法加载Zotero的参考文献,请重新关联您的账户后重试",
"zotero_sync_description": "集成 Zotero 后,您可以将 Zotero 的参考文献导入__appName__项目。",
"zotero_upgrade_prompt_content": "关联您的 Zotero 帐户,即可直接在项目中搜索并添加 Zotero 中的参考文献——它们将自动添加到您的 .bib 文件中。或者,您也可以将它们作为文件导入到您的 __appName__ 项目中。",
"zotero_upgrade_prompt_title": "引用自 Zotero"
"zotero_upgrade_prompt_title": "引用自 Zotero",
"export_as_typst": "导出为 Typst"
}