Reubencf commited on
Commit
d0eea2e
·
1 Parent(s): ecd522a

Switch from node-pdflatex to external LaTeX API (latexbase.com)

Browse files
app/api/data/route.ts CHANGED
@@ -2,7 +2,6 @@ import { NextRequest, NextResponse } from 'next/server'
2
  import fs from 'fs'
3
  import path from 'path'
4
  import { writeFile, mkdir, unlink, readdir, stat } from 'fs/promises'
5
- import pdflatex from 'node-pdflatex'
6
 
7
  // Use /data for Hugging Face Spaces persistent storage, fallback to public/data for local dev
8
  const DATA_DIR = process.env.SPACE_ID
@@ -123,28 +122,59 @@ export async function POST(request: NextRequest) {
123
 
124
  // Auto-convert .tex files to PDF
125
  if (fileName.endsWith('.tex')) {
126
- console.log('✨ Detected .tex file, auto-converting to PDF using node-pdflatex...')
127
  try {
128
  console.log(`📄 LaTeX content length: ${content.length} characters`)
129
 
130
- // Compile LaTeX to PDF using node-pdflatex
131
- const pdfBuffer = await pdflatex(content)
132
-
133
- const pdfFileName = fileName.replace('.tex', '.pdf')
134
- const pdfFilePath = path.join(targetDir, pdfFileName)
135
-
136
- console.log(`💾 PDF size: ${pdfBuffer.byteLength} bytes`)
137
- console.log(`📁 Saving PDF to: ${pdfFilePath}`)
138
-
139
- await writeFile(pdfFilePath, pdfBuffer)
140
- console.log(`✅ PDF generated successfully: ${pdfFileName}`)
141
-
142
- return NextResponse.json({
143
- success: true,
144
- pdfGenerated: true,
145
- pdfFileName: pdfFileName,
146
- message: `LaTeX file saved and converted to ${pdfFileName}`
147
  })
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
148
  } catch (pdfError) {
149
  console.error('❌ Error generating PDF:', pdfError)
150
  console.error(' Error details:', pdfError instanceof Error ? pdfError.message : String(pdfError))
 
2
  import fs from 'fs'
3
  import path from 'path'
4
  import { writeFile, mkdir, unlink, readdir, stat } from 'fs/promises'
 
5
 
6
  // Use /data for Hugging Face Spaces persistent storage, fallback to public/data for local dev
7
  const DATA_DIR = process.env.SPACE_ID
 
122
 
123
  // Auto-convert .tex files to PDF
124
  if (fileName.endsWith('.tex')) {
125
+ console.log('✨ Detected .tex file, auto-converting to PDF using external API...')
126
  try {
127
  console.log(`📄 LaTeX content length: ${content.length} characters`)
128
 
129
+ // Compile LaTeX to PDF using external API
130
+ const compileResponse = await fetch('https://latexbase.com/api/v1/compile', {
131
+ method: 'POST',
132
+ headers: {
133
+ 'Content-Type': 'application/json',
134
+ },
135
+ body: JSON.stringify({
136
+ compiler: 'pdflatex',
137
+ content: content
138
+ }),
139
+ signal: AbortSignal.timeout(60000)
 
 
 
 
 
 
140
  })
141
+
142
+ if (compileResponse.ok) {
143
+ const result = await compileResponse.json()
144
+
145
+ if (result.status === 'success' && result.pdf) {
146
+ const pdfBuffer = Buffer.from(result.pdf, 'base64')
147
+ const pdfFileName = fileName.replace('.tex', '.pdf')
148
+ const pdfFilePath = path.join(targetDir, pdfFileName)
149
+
150
+ console.log(`💾 PDF size: ${pdfBuffer.byteLength} bytes`)
151
+ console.log(`📁 Saving PDF to: ${pdfFilePath}`)
152
+
153
+ await writeFile(pdfFilePath, pdfBuffer)
154
+ console.log(`✅ PDF generated successfully: ${pdfFileName}`)
155
+
156
+ return NextResponse.json({
157
+ success: true,
158
+ pdfGenerated: true,
159
+ pdfFileName: pdfFileName,
160
+ message: `LaTeX file saved and converted to ${pdfFileName}`
161
+ })
162
+ } else {
163
+ console.error('PDF compilation returned error:', result)
164
+ return NextResponse.json({
165
+ success: true,
166
+ pdfGenerated: false,
167
+ error: 'LaTeX file saved but PDF generation failed'
168
+ })
169
+ }
170
+ } else {
171
+ console.error('PDF compilation failed:', await compileResponse.text())
172
+ return NextResponse.json({
173
+ success: true,
174
+ pdfGenerated: false,
175
+ error: 'LaTeX file saved but PDF generation failed'
176
+ })
177
+ }
178
  } catch (pdfError) {
179
  console.error('❌ Error generating PDF:', pdfError)
180
  console.error(' Error details:', pdfError instanceof Error ? pdfError.message : String(pdfError))
app/api/latex/compile/route.ts CHANGED
@@ -1,5 +1,4 @@
1
  import { NextRequest, NextResponse } from 'next/server'
2
- import pdflatex from 'node-pdflatex'
3
 
4
  export async function POST(request: NextRequest) {
5
  try {
@@ -12,37 +11,69 @@ export async function POST(request: NextRequest) {
12
  )
13
  }
14
 
15
- console.log('📄 Compiling LaTeX to PDF using node-pdflatex...')
16
  console.log(` Content length: ${latex.length} characters`)
17
 
18
- // Compile LaTeX to PDF using node-pdflatex
19
- const pdfBuffer = await pdflatex(latex)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
 
21
- console.log(`✅ LaTeX compiled successfully! PDF size: ${pdfBuffer.byteLength} bytes`)
 
 
 
22
 
23
- // Return the PDF - convert Buffer to proper type for NextResponse
24
- const response = new NextResponse(Buffer.from(pdfBuffer))
25
- response.headers.set('Content-Type', 'application/pdf')
26
- response.headers.set('Content-Disposition', `attachment; filename="${filename || 'document.pdf'}"`)
27
 
28
- return response
 
 
 
 
 
 
 
 
 
 
 
29
 
30
  } catch (error) {
31
  console.error('❌ Error compiling LaTeX:', error)
32
  console.error(' Error type:', error instanceof Error ? error.constructor.name : typeof error)
33
  console.error(' Error message:', error instanceof Error ? error.message : String(error))
34
 
35
- // Extract more detailed error info if available
36
- let errorDetails = error instanceof Error ? error.message : String(error)
37
- if (error && typeof error === 'object' && 'stderr' in error) {
38
- errorDetails = (error as any).stderr || errorDetails
39
- }
40
-
41
  return NextResponse.json(
42
  {
43
  error: 'Failed to compile LaTeX',
44
- details: errorDetails,
45
- message: 'There may be a syntax error in your LaTeX code. Check the console for details.'
46
  },
47
  { status: 500 }
48
  )
 
1
  import { NextRequest, NextResponse } from 'next/server'
 
2
 
3
  export async function POST(request: NextRequest) {
4
  try {
 
11
  )
12
  }
13
 
14
+ console.log('📄 Compiling LaTeX to PDF using external API...')
15
  console.log(` Content length: ${latex.length} characters`)
16
 
17
+ // Try latexbase.com API (free, no auth required)
18
+ const compileResponse = await fetch('https://latexbase.com/api/v1/compile', {
19
+ method: 'POST',
20
+ headers: {
21
+ 'Content-Type': 'application/json',
22
+ },
23
+ body: JSON.stringify({
24
+ compiler: 'pdflatex',
25
+ content: latex
26
+ }),
27
+ signal: AbortSignal.timeout(60000) // 60 second timeout for large documents
28
+ })
29
+
30
+ if (!compileResponse.ok) {
31
+ const errorText = await compileResponse.text()
32
+ console.error('❌ LaTeX compilation failed:', errorText)
33
+ return NextResponse.json(
34
+ {
35
+ error: 'LaTeX compilation failed',
36
+ details: errorText.substring(0, 500),
37
+ message: 'The LaTeX compiler returned an error. Check your syntax.'
38
+ },
39
+ { status: 500 }
40
+ )
41
+ }
42
+
43
+ const result = await compileResponse.json()
44
 
45
+ if (result.status === 'success' && result.pdf) {
46
+ // The API returns base64-encoded PDF
47
+ const pdfBuffer = Buffer.from(result.pdf, 'base64')
48
+ console.log(`✅ LaTeX compiled successfully! PDF size: ${pdfBuffer.byteLength} bytes`)
49
 
50
+ const response = new NextResponse(pdfBuffer)
51
+ response.headers.set('Content-Type', 'application/pdf')
52
+ response.headers.set('Content-Disposition', `attachment; filename="${filename || 'document.pdf'}"`)
 
53
 
54
+ return response
55
+ } else {
56
+ console.error('❌ Compilation failed:', result)
57
+ return NextResponse.json(
58
+ {
59
+ error: 'Failed to compile LaTeX',
60
+ details: result.error || result.log || 'Unknown error',
61
+ message: 'The LaTeX compiler encountered an error.'
62
+ },
63
+ { status: 500 }
64
+ )
65
+ }
66
 
67
  } catch (error) {
68
  console.error('❌ Error compiling LaTeX:', error)
69
  console.error(' Error type:', error instanceof Error ? error.constructor.name : typeof error)
70
  console.error(' Error message:', error instanceof Error ? error.message : String(error))
71
 
 
 
 
 
 
 
72
  return NextResponse.json(
73
  {
74
  error: 'Failed to compile LaTeX',
75
+ details: error instanceof Error ? error.message : String(error),
76
+ message: 'Network error or compilation timeout. Please try again.'
77
  },
78
  { status: 500 }
79
  )
package-lock.json CHANGED
@@ -21,13 +21,11 @@
21
  "highlight.js": "^11.11.1",
22
  "html-pdf-node": "^1.0.8",
23
  "latex": "^0.0.1",
24
- "latex.js": "^0.12.6",
25
  "lucide-react": "^0.553.0",
26
  "mammoth": "^1.11.0",
27
  "monaco-editor": "^0.54.0",
28
  "next": "16.0.1",
29
  "node-fetch": "^3.3.2",
30
- "node-pdflatex": "^0.3.0",
31
  "officegen": "^0.6.5",
32
  "pdf-parse": "^2.4.5",
33
  "pdfkit": "^0.17.2",
@@ -2505,12 +2503,6 @@
2505
  "node": ">= 20"
2506
  }
2507
  },
2508
- "node_modules/@one-ini/wasm": {
2509
- "version": "0.1.1",
2510
- "resolved": "https://registry.npmjs.org/@one-ini/wasm/-/wasm-0.1.1.tgz",
2511
- "integrity": "sha512-XuySG1E38YScSJoMlqovLru4KTUNSjgVTIjyh7qMX6aNN5HY5Ct5LhRJdxO79JtTzKfzV/bnWpz+zquYrISsvw==",
2512
- "license": "MIT"
2513
- },
2514
  "node_modules/@phosphor-icons/react": {
2515
  "version": "2.1.10",
2516
  "resolved": "https://registry.npmjs.org/@phosphor-icons/react/-/react-2.1.10.tgz",
@@ -3933,15 +3925,6 @@
3933
  "node": ">=10.0.0"
3934
  }
3935
  },
3936
- "node_modules/abbrev": {
3937
- "version": "2.0.0",
3938
- "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-2.0.0.tgz",
3939
- "integrity": "sha512-6/mh1E2u2YgEsCHdY0Yx5oW+61gZU+1vXaoiHHrpKeuRNNgFvS+/jrwHiQhB5apAf5oB7UB7E19ol2R2LKH8hQ==",
3940
- "license": "ISC",
3941
- "engines": {
3942
- "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
3943
- }
3944
- },
3945
  "node_modules/accepts": {
3946
  "version": "2.0.0",
3947
  "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz",
@@ -5118,15 +5101,6 @@
5118
  "url": "https://github.com/sponsors/wooorm"
5119
  }
5120
  },
5121
- "node_modules/commander": {
5122
- "version": "8.3.0",
5123
- "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz",
5124
- "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==",
5125
- "license": "MIT",
5126
- "engines": {
5127
- "node": ">= 12"
5128
- }
5129
- },
5130
  "node_modules/compress-commons": {
5131
  "version": "4.1.2",
5132
  "resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-4.1.2.tgz",
@@ -5162,16 +5136,6 @@
5162
  "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==",
5163
  "license": "MIT"
5164
  },
5165
- "node_modules/config-chain": {
5166
- "version": "1.1.13",
5167
- "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.13.tgz",
5168
- "integrity": "sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==",
5169
- "license": "MIT",
5170
- "dependencies": {
5171
- "ini": "^1.3.4",
5172
- "proto-list": "~1.2.1"
5173
- }
5174
- },
5175
  "node_modules/content-disposition": {
5176
  "version": "1.0.0",
5177
  "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.0.0.tgz",
@@ -5738,69 +5702,6 @@
5738
  "safe-buffer": "^5.0.1"
5739
  }
5740
  },
5741
- "node_modules/editorconfig": {
5742
- "version": "1.0.4",
5743
- "resolved": "https://registry.npmjs.org/editorconfig/-/editorconfig-1.0.4.tgz",
5744
- "integrity": "sha512-L9Qe08KWTlqYMVvMcTIvMAdl1cDUubzRNYL+WfA4bLDMHe4nemKkpmYzkznE1FwLKu0EEmy6obgQKzMJrg4x9Q==",
5745
- "license": "MIT",
5746
- "dependencies": {
5747
- "@one-ini/wasm": "0.1.1",
5748
- "commander": "^10.0.0",
5749
- "minimatch": "9.0.1",
5750
- "semver": "^7.5.3"
5751
- },
5752
- "bin": {
5753
- "editorconfig": "bin/editorconfig"
5754
- },
5755
- "engines": {
5756
- "node": ">=14"
5757
- }
5758
- },
5759
- "node_modules/editorconfig/node_modules/brace-expansion": {
5760
- "version": "2.0.2",
5761
- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz",
5762
- "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==",
5763
- "license": "MIT",
5764
- "dependencies": {
5765
- "balanced-match": "^1.0.0"
5766
- }
5767
- },
5768
- "node_modules/editorconfig/node_modules/commander": {
5769
- "version": "10.0.1",
5770
- "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz",
5771
- "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==",
5772
- "license": "MIT",
5773
- "engines": {
5774
- "node": ">=14"
5775
- }
5776
- },
5777
- "node_modules/editorconfig/node_modules/minimatch": {
5778
- "version": "9.0.1",
5779
- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.1.tgz",
5780
- "integrity": "sha512-0jWhJpD/MdhPXwPuiRkCbfYfSKp2qnn2eOc279qI7f+osl/l+prKSrvhg157zSYvx/1nmgn2NqdT6k2Z7zSH9w==",
5781
- "license": "ISC",
5782
- "dependencies": {
5783
- "brace-expansion": "^2.0.1"
5784
- },
5785
- "engines": {
5786
- "node": ">=16 || 14 >=14.17"
5787
- },
5788
- "funding": {
5789
- "url": "https://github.com/sponsors/isaacs"
5790
- }
5791
- },
5792
- "node_modules/editorconfig/node_modules/semver": {
5793
- "version": "7.7.3",
5794
- "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz",
5795
- "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==",
5796
- "license": "ISC",
5797
- "bin": {
5798
- "semver": "bin/semver.js"
5799
- },
5800
- "engines": {
5801
- "node": ">=10"
5802
- }
5803
- },
5804
  "node_modules/ee-first": {
5805
  "version": "1.1.1",
5806
  "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
@@ -7956,28 +7857,6 @@
7956
  "node": ">= 6"
7957
  }
7958
  },
7959
- "node_modules/hyphenation.de": {
7960
- "version": "0.2.1",
7961
- "resolved": "https://registry.npmjs.org/hyphenation.de/-/hyphenation.de-0.2.1.tgz",
7962
- "integrity": "sha512-s6Y4TFA8xWjRLneOPI6HV/+wzfm2c2yurTvFaXlznmsbeI6waZhMpxu94fSXGNGsrPxrzI1zTtYDEWeEeaANnw==",
7963
- "dependencies": {
7964
- "hypher": "*"
7965
- }
7966
- },
7967
- "node_modules/hyphenation.en-us": {
7968
- "version": "0.2.1",
7969
- "resolved": "https://registry.npmjs.org/hyphenation.en-us/-/hyphenation.en-us-0.2.1.tgz",
7970
- "integrity": "sha512-ItXYgvIpfN8rfXl/GTBQC7DsSb5PPsKh9gGzViK/iWzCS5mvjDebFJ6xCcIYo8dal+nSp2rUzvTT7BosrKlL8A==",
7971
- "dependencies": {
7972
- "hypher": "*"
7973
- }
7974
- },
7975
- "node_modules/hypher": {
7976
- "version": "0.2.5",
7977
- "resolved": "https://registry.npmjs.org/hypher/-/hypher-0.2.5.tgz",
7978
- "integrity": "sha512-kUTpuyzBWWDO2VakmjHC/cxesg4lKQP+Fdc+7lrK4yvjNjkV9vm5UTZMDAwOyyHTOpbkYrAMlNZHG61NnE9vYQ==",
7979
- "license": "BSD-3-Clause"
7980
- },
7981
  "node_modules/iconv-lite": {
7982
  "version": "0.6.3",
7983
  "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
@@ -8020,21 +7899,6 @@
8020
  "node": ">= 4"
8021
  }
8022
  },
8023
- "node_modules/image-size": {
8024
- "version": "1.2.1",
8025
- "resolved": "https://registry.npmjs.org/image-size/-/image-size-1.2.1.tgz",
8026
- "integrity": "sha512-rH+46sQJ2dlwfjfhCyNx5thzrv+dtmBIhPHk0zgRUukHzZ/kRueTJXoYYsclBaKcSMBWuGbOFXtioLpzTb5euw==",
8027
- "license": "MIT",
8028
- "dependencies": {
8029
- "queue": "6.0.2"
8030
- },
8031
- "bin": {
8032
- "image-size": "bin/image-size.js"
8033
- },
8034
- "engines": {
8035
- "node": ">=16.x"
8036
- }
8037
- },
8038
  "node_modules/immediate": {
8039
  "version": "3.0.6",
8040
  "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz",
@@ -8085,12 +7949,6 @@
8085
  "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
8086
  "license": "ISC"
8087
  },
8088
- "node_modules/ini": {
8089
- "version": "1.3.8",
8090
- "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz",
8091
- "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==",
8092
- "license": "ISC"
8093
- },
8094
  "node_modules/inline-css": {
8095
  "version": "3.0.0",
8096
  "resolved": "https://registry.npmjs.org/inline-css/-/inline-css-3.0.0.tgz",
@@ -8696,70 +8554,6 @@
8696
  "integrity": "sha512-a+bKEcCjtuW5WTdgeXFzswSrdqi0jk4XlEtZlx5A94wCoBpFjfFTbo/Tra5SpNCl/YFZPvcV1dJc+TAYeg6ROQ==",
8697
  "license": "MIT"
8698
  },
8699
- "node_modules/js-beautify": {
8700
- "version": "1.14.11",
8701
- "resolved": "https://registry.npmjs.org/js-beautify/-/js-beautify-1.14.11.tgz",
8702
- "integrity": "sha512-rPogWqAfoYh1Ryqqh2agUpVfbxAhbjuN1SmU86dskQUKouRiggUTCO4+2ym9UPXllc2WAp0J+T5qxn7Um3lCdw==",
8703
- "license": "MIT",
8704
- "dependencies": {
8705
- "config-chain": "^1.1.13",
8706
- "editorconfig": "^1.0.3",
8707
- "glob": "^10.3.3",
8708
- "nopt": "^7.2.0"
8709
- },
8710
- "bin": {
8711
- "css-beautify": "js/bin/css-beautify.js",
8712
- "html-beautify": "js/bin/html-beautify.js",
8713
- "js-beautify": "js/bin/js-beautify.js"
8714
- },
8715
- "engines": {
8716
- "node": ">=14"
8717
- }
8718
- },
8719
- "node_modules/js-beautify/node_modules/brace-expansion": {
8720
- "version": "2.0.2",
8721
- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz",
8722
- "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==",
8723
- "license": "MIT",
8724
- "dependencies": {
8725
- "balanced-match": "^1.0.0"
8726
- }
8727
- },
8728
- "node_modules/js-beautify/node_modules/glob": {
8729
- "version": "10.5.0",
8730
- "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz",
8731
- "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==",
8732
- "license": "ISC",
8733
- "dependencies": {
8734
- "foreground-child": "^3.1.0",
8735
- "jackspeak": "^3.1.2",
8736
- "minimatch": "^9.0.4",
8737
- "minipass": "^7.1.2",
8738
- "package-json-from-dist": "^1.0.0",
8739
- "path-scurry": "^1.11.1"
8740
- },
8741
- "bin": {
8742
- "glob": "dist/esm/bin.mjs"
8743
- },
8744
- "funding": {
8745
- "url": "https://github.com/sponsors/isaacs"
8746
- }
8747
- },
8748
- "node_modules/js-beautify/node_modules/minimatch": {
8749
- "version": "9.0.5",
8750
- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz",
8751
- "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==",
8752
- "license": "ISC",
8753
- "dependencies": {
8754
- "brace-expansion": "^2.0.1"
8755
- },
8756
- "engines": {
8757
- "node": ">=16 || 14 >=14.17"
8758
- },
8759
- "funding": {
8760
- "url": "https://github.com/sponsors/isaacs"
8761
- }
8762
- },
8763
  "node_modules/js-tokens": {
8764
  "version": "4.0.0",
8765
  "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
@@ -8930,53 +8724,6 @@
8930
  "through": "~2.1.0"
8931
  }
8932
  },
8933
- "node_modules/latex.js": {
8934
- "version": "0.12.6",
8935
- "resolved": "https://registry.npmjs.org/latex.js/-/latex.js-0.12.6.tgz",
8936
- "integrity": "sha512-spMTeSq9cP4vidMQuPgoYGKmsQTMElZhDtNF3NyLIRc03XkuuPvMA0tzb0ShS/otaIJrB7DIHDk0GL3knCisEw==",
8937
- "license": "MIT",
8938
- "dependencies": {
8939
- "commander": "8.x",
8940
- "fs-extra": "10.x",
8941
- "hyphenation.de": "*",
8942
- "hyphenation.en-us": "*",
8943
- "js-beautify": "1.14.x",
8944
- "stdin": "*",
8945
- "svgdom": "^0.1.8"
8946
- },
8947
- "bin": {
8948
- "latex.js": "bin/latex.js"
8949
- },
8950
- "engines": {
8951
- "node": ">= 14.0"
8952
- }
8953
- },
8954
- "node_modules/latex.js/node_modules/fs-extra": {
8955
- "version": "10.1.0",
8956
- "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz",
8957
- "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==",
8958
- "license": "MIT",
8959
- "dependencies": {
8960
- "graceful-fs": "^4.2.0",
8961
- "jsonfile": "^6.0.1",
8962
- "universalify": "^2.0.0"
8963
- },
8964
- "engines": {
8965
- "node": ">=12"
8966
- }
8967
- },
8968
- "node_modules/latex.js/node_modules/jsonfile": {
8969
- "version": "6.2.0",
8970
- "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.0.tgz",
8971
- "integrity": "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==",
8972
- "license": "MIT",
8973
- "dependencies": {
8974
- "universalify": "^2.0.0"
8975
- },
8976
- "optionalDependencies": {
8977
- "graceful-fs": "^4.1.6"
8978
- }
8979
- },
8980
  "node_modules/lazystream": {
8981
  "version": "1.0.1",
8982
  "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.1.tgz",
@@ -10625,12 +10372,6 @@
10625
  "marked": "14.0.0"
10626
  }
10627
  },
10628
- "node_modules/monolite": {
10629
- "version": "0.4.6",
10630
- "resolved": "https://registry.npmjs.org/monolite/-/monolite-0.4.6.tgz",
10631
- "integrity": "sha512-iVm3qzFvDKxF3B3bFTZG5Knu6knL83wCmXBhFT/bOKTT1JU5LAk5Fq+4R/abYA6mYmDNmlXlq1CIeSC/UQ9bOg==",
10632
- "license": "MIT"
10633
- },
10634
  "node_modules/motion-dom": {
10635
  "version": "12.23.23",
10636
  "resolved": "https://registry.npmjs.org/motion-dom/-/motion-dom-12.23.23.tgz",
@@ -10853,28 +10594,6 @@
10853
  "node": ">= 12"
10854
  }
10855
  },
10856
- "node_modules/node-pdflatex": {
10857
- "version": "0.3.0",
10858
- "resolved": "https://registry.npmjs.org/node-pdflatex/-/node-pdflatex-0.3.0.tgz",
10859
- "integrity": "sha512-hVMAmFpETyZbwdo3LPthqliu73I3O6tblQggljwdsQQjyByI6Cv8t4ytDEI7ZnfhgKMvPvDXaCo9yxHkQ0j7CQ==",
10860
- "license": "MIT",
10861
- "dependencies": {
10862
- "monolite": "^0.4.5",
10863
- "tmp": "0.0.33"
10864
- }
10865
- },
10866
- "node_modules/node-pdflatex/node_modules/tmp": {
10867
- "version": "0.0.33",
10868
- "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz",
10869
- "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==",
10870
- "license": "MIT",
10871
- "dependencies": {
10872
- "os-tmpdir": "~1.0.2"
10873
- },
10874
- "engines": {
10875
- "node": ">=0.6.0"
10876
- }
10877
- },
10878
  "node_modules/node-releases": {
10879
  "version": "2.0.27",
10880
  "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.27.tgz",
@@ -10882,21 +10601,6 @@
10882
  "dev": true,
10883
  "license": "MIT"
10884
  },
10885
- "node_modules/nopt": {
10886
- "version": "7.2.1",
10887
- "resolved": "https://registry.npmjs.org/nopt/-/nopt-7.2.1.tgz",
10888
- "integrity": "sha512-taM24ViiimT/XntxbPyJQzCG+p4EKOpgD3mxFwW38mGjVUrfERQOeY4EDHjdnptttfHuHQXFx+lTP08Q+mLa/w==",
10889
- "license": "ISC",
10890
- "dependencies": {
10891
- "abbrev": "^2.0.0"
10892
- },
10893
- "bin": {
10894
- "nopt": "bin/nopt.js"
10895
- },
10896
- "engines": {
10897
- "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
10898
- }
10899
- },
10900
  "node_modules/normalize-path": {
10901
  "version": "3.0.0",
10902
  "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
@@ -11163,15 +10867,6 @@
11163
  "node": ">= 0.8.0"
11164
  }
11165
  },
11166
- "node_modules/os-tmpdir": {
11167
- "version": "1.0.2",
11168
- "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
11169
- "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==",
11170
- "license": "MIT",
11171
- "engines": {
11172
- "node": ">=0.10.0"
11173
- }
11174
- },
11175
  "node_modules/own-keys": {
11176
  "version": "1.0.1",
11177
  "resolved": "https://registry.npmjs.org/own-keys/-/own-keys-1.0.1.tgz",
@@ -11835,12 +11530,6 @@
11835
  "url": "https://github.com/sponsors/wooorm"
11836
  }
11837
  },
11838
- "node_modules/proto-list": {
11839
- "version": "1.2.4",
11840
- "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz",
11841
- "integrity": "sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==",
11842
- "license": "ISC"
11843
- },
11844
  "node_modules/proxy-addr": {
11845
  "version": "2.0.7",
11846
  "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
@@ -12063,15 +11752,6 @@
12063
  "url": "https://github.com/sponsors/ljharb"
12064
  }
12065
  },
12066
- "node_modules/queue": {
12067
- "version": "6.0.2",
12068
- "resolved": "https://registry.npmjs.org/queue/-/queue-6.0.2.tgz",
12069
- "integrity": "sha512-iHZWu+q3IdFZFX36ro/lKBkSvfkztY5Y7HMiPlOUjhupPcG2JMfst2KKEpu5XndviX/3UhFbRngUPNKtgvtZiA==",
12070
- "license": "MIT",
12071
- "dependencies": {
12072
- "inherits": "~2.0.3"
12073
- }
12074
- },
12075
  "node_modules/queue-microtask": {
12076
  "version": "1.2.3",
12077
  "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
@@ -13177,11 +12857,6 @@
13177
  "node": ">= 0.8"
13178
  }
13179
  },
13180
- "node_modules/stdin": {
13181
- "version": "0.0.1",
13182
- "resolved": "https://registry.npmjs.org/stdin/-/stdin-0.0.1.tgz",
13183
- "integrity": "sha512-2bacd1TXzqOEsqRa+eEWkRdOSznwptrs4gqFcpMq5tOtmJUGPZd10W5Lam6wQ4YQ/+qjQt4e9u35yXCF6mrlfQ=="
13184
- },
13185
  "node_modules/stop-iteration-iterator": {
13186
  "version": "1.1.0",
13187
  "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.1.0.tgz",
@@ -13510,21 +13185,6 @@
13510
  "url": "https://github.com/sponsors/ljharb"
13511
  }
13512
  },
13513
- "node_modules/svgdom": {
13514
- "version": "0.1.22",
13515
- "resolved": "https://registry.npmjs.org/svgdom/-/svgdom-0.1.22.tgz",
13516
- "integrity": "sha512-NPf43Dha2ocSjgyVSDWrKuY5XfV6+nngTzeVypRFNj+OjKUNwWr4eWx9IrWQ8wXdaHguOTHvzEji0v46z0iwKQ==",
13517
- "license": "MIT",
13518
- "dependencies": {
13519
- "fontkit": "^2.0.4",
13520
- "image-size": "^1.2.1",
13521
- "sax": "^1.4.1"
13522
- },
13523
- "funding": {
13524
- "type": "github",
13525
- "url": "https://github.com/sponsors/Fuzzyma"
13526
- }
13527
- },
13528
  "node_modules/tailwindcss": {
13529
  "version": "4.1.17",
13530
  "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.1.17.tgz",
@@ -14197,15 +13857,6 @@
14197
  "integrity": "sha512-TmnEAEAsBJVZM/AADELsK76llnwcf9vMKuPz8JflO1frO8Lchitr0fNaN9d+Ap0BjKtqWqd/J17qeDnXh8CL2A==",
14198
  "license": "ISC"
14199
  },
14200
- "node_modules/universalify": {
14201
- "version": "2.0.1",
14202
- "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz",
14203
- "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==",
14204
- "license": "MIT",
14205
- "engines": {
14206
- "node": ">= 10.0.0"
14207
- }
14208
- },
14209
  "node_modules/unpipe": {
14210
  "version": "1.0.0",
14211
  "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
 
21
  "highlight.js": "^11.11.1",
22
  "html-pdf-node": "^1.0.8",
23
  "latex": "^0.0.1",
 
24
  "lucide-react": "^0.553.0",
25
  "mammoth": "^1.11.0",
26
  "monaco-editor": "^0.54.0",
27
  "next": "16.0.1",
28
  "node-fetch": "^3.3.2",
 
29
  "officegen": "^0.6.5",
30
  "pdf-parse": "^2.4.5",
31
  "pdfkit": "^0.17.2",
 
2503
  "node": ">= 20"
2504
  }
2505
  },
 
 
 
 
 
 
2506
  "node_modules/@phosphor-icons/react": {
2507
  "version": "2.1.10",
2508
  "resolved": "https://registry.npmjs.org/@phosphor-icons/react/-/react-2.1.10.tgz",
 
3925
  "node": ">=10.0.0"
3926
  }
3927
  },
 
 
 
 
 
 
 
 
 
3928
  "node_modules/accepts": {
3929
  "version": "2.0.0",
3930
  "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz",
 
5101
  "url": "https://github.com/sponsors/wooorm"
5102
  }
5103
  },
 
 
 
 
 
 
 
 
 
5104
  "node_modules/compress-commons": {
5105
  "version": "4.1.2",
5106
  "resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-4.1.2.tgz",
 
5136
  "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==",
5137
  "license": "MIT"
5138
  },
 
 
 
 
 
 
 
 
 
 
5139
  "node_modules/content-disposition": {
5140
  "version": "1.0.0",
5141
  "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.0.0.tgz",
 
5702
  "safe-buffer": "^5.0.1"
5703
  }
5704
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5705
  "node_modules/ee-first": {
5706
  "version": "1.1.1",
5707
  "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
 
7857
  "node": ">= 6"
7858
  }
7859
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7860
  "node_modules/iconv-lite": {
7861
  "version": "0.6.3",
7862
  "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
 
7899
  "node": ">= 4"
7900
  }
7901
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7902
  "node_modules/immediate": {
7903
  "version": "3.0.6",
7904
  "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz",
 
7949
  "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
7950
  "license": "ISC"
7951
  },
 
 
 
 
 
 
7952
  "node_modules/inline-css": {
7953
  "version": "3.0.0",
7954
  "resolved": "https://registry.npmjs.org/inline-css/-/inline-css-3.0.0.tgz",
 
8554
  "integrity": "sha512-a+bKEcCjtuW5WTdgeXFzswSrdqi0jk4XlEtZlx5A94wCoBpFjfFTbo/Tra5SpNCl/YFZPvcV1dJc+TAYeg6ROQ==",
8555
  "license": "MIT"
8556
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8557
  "node_modules/js-tokens": {
8558
  "version": "4.0.0",
8559
  "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
 
8724
  "through": "~2.1.0"
8725
  }
8726
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8727
  "node_modules/lazystream": {
8728
  "version": "1.0.1",
8729
  "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.1.tgz",
 
10372
  "marked": "14.0.0"
10373
  }
10374
  },
 
 
 
 
 
 
10375
  "node_modules/motion-dom": {
10376
  "version": "12.23.23",
10377
  "resolved": "https://registry.npmjs.org/motion-dom/-/motion-dom-12.23.23.tgz",
 
10594
  "node": ">= 12"
10595
  }
10596
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10597
  "node_modules/node-releases": {
10598
  "version": "2.0.27",
10599
  "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.27.tgz",
 
10601
  "dev": true,
10602
  "license": "MIT"
10603
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10604
  "node_modules/normalize-path": {
10605
  "version": "3.0.0",
10606
  "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
 
10867
  "node": ">= 0.8.0"
10868
  }
10869
  },
 
 
 
 
 
 
 
 
 
10870
  "node_modules/own-keys": {
10871
  "version": "1.0.1",
10872
  "resolved": "https://registry.npmjs.org/own-keys/-/own-keys-1.0.1.tgz",
 
11530
  "url": "https://github.com/sponsors/wooorm"
11531
  }
11532
  },
 
 
 
 
 
 
11533
  "node_modules/proxy-addr": {
11534
  "version": "2.0.7",
11535
  "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
 
11752
  "url": "https://github.com/sponsors/ljharb"
11753
  }
11754
  },
 
 
 
 
 
 
 
 
 
11755
  "node_modules/queue-microtask": {
11756
  "version": "1.2.3",
11757
  "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
 
12857
  "node": ">= 0.8"
12858
  }
12859
  },
 
 
 
 
 
12860
  "node_modules/stop-iteration-iterator": {
12861
  "version": "1.1.0",
12862
  "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.1.0.tgz",
 
13185
  "url": "https://github.com/sponsors/ljharb"
13186
  }
13187
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13188
  "node_modules/tailwindcss": {
13189
  "version": "4.1.17",
13190
  "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.1.17.tgz",
 
13857
  "integrity": "sha512-TmnEAEAsBJVZM/AADELsK76llnwcf9vMKuPz8JflO1frO8Lchitr0fNaN9d+Ap0BjKtqWqd/J17qeDnXh8CL2A==",
13858
  "license": "ISC"
13859
  },
 
 
 
 
 
 
 
 
 
13860
  "node_modules/unpipe": {
13861
  "version": "1.0.0",
13862
  "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
package.json CHANGED
@@ -25,13 +25,11 @@
25
  "highlight.js": "^11.11.1",
26
  "html-pdf-node": "^1.0.8",
27
  "latex": "^0.0.1",
28
- "latex.js": "^0.12.6",
29
  "lucide-react": "^0.553.0",
30
  "mammoth": "^1.11.0",
31
  "monaco-editor": "^0.54.0",
32
  "next": "16.0.1",
33
  "node-fetch": "^3.3.2",
34
- "node-pdflatex": "^0.3.0",
35
  "officegen": "^0.6.5",
36
  "pdf-parse": "^2.4.5",
37
  "pdfkit": "^0.17.2",
 
25
  "highlight.js": "^11.11.1",
26
  "html-pdf-node": "^1.0.8",
27
  "latex": "^0.0.1",
 
28
  "lucide-react": "^0.553.0",
29
  "mammoth": "^1.11.0",
30
  "monaco-editor": "^0.54.0",
31
  "next": "16.0.1",
32
  "node-fetch": "^3.3.2",
 
33
  "officegen": "^0.6.5",
34
  "pdf-parse": "^2.4.5",
35
  "pdfkit": "^0.17.2",