Revert Typst SyncTeX attempt; clean up diagnostic logging
Build and Deploy Verso / deploy (push) Has been cancelled
Build and Deploy Verso / deploy (push) Has been cancelled
Typst has no --synctex CLI option (open feature request #289 since 2023). Revert the frontend guard back to LaTeX-only and remove --synctex from the Typst compile command. Also remove the temporary logger.warn calls added for diagnosing the LaTeX synctex issue (now resolved). The official Typst binary installation in Dockerfile-base is kept as it is cleaner than using Quarto's modified fork for .typ compilation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -563,10 +563,6 @@ async function _runSynctex(projectId, userId, command, opts) {
|
||||
const compileGroup = runInOutputDir ? 'synctex-output' : 'synctex'
|
||||
const defaultImageName =
|
||||
Settings.clsi && Settings.clsi.docker && Settings.clsi.docker.image
|
||||
logger.warn(
|
||||
{ projectId, userId, buildId, editorId, directory, command, runInOutputDir },
|
||||
'synctex: starting request'
|
||||
)
|
||||
// eslint-disable-next-line @typescript-eslint/return-await
|
||||
return await OutputCacheManager.promises.queueDirOperation(
|
||||
outputDir,
|
||||
@@ -577,7 +573,6 @@ async function _runSynctex(projectId, userId, command, opts) {
|
||||
let downloadedFromCache = false
|
||||
try {
|
||||
await _checkFileExists(directory, 'output.synctex.gz')
|
||||
logger.warn({ directory }, 'synctex: output.synctex.gz found')
|
||||
if (compileFromClsiCache) {
|
||||
try {
|
||||
await _checkFileExists(directory, 'output.log')
|
||||
@@ -586,10 +581,6 @@ async function _runSynctex(projectId, userId, command, opts) {
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
logger.warn(
|
||||
{ err: err.message, directory },
|
||||
'synctex: output.synctex.gz not found'
|
||||
)
|
||||
if (
|
||||
err instanceof Errors.NotFoundError &&
|
||||
compileFromClsiCache &&
|
||||
@@ -627,13 +618,11 @@ async function _runSynctex(projectId, userId, command, opts) {
|
||||
compileGroup,
|
||||
null
|
||||
)
|
||||
logger.warn({ command, stdout }, 'synctex: command output')
|
||||
return {
|
||||
stdout,
|
||||
downloadedFromCache,
|
||||
}
|
||||
} catch (error) {
|
||||
logger.warn({ err: error.message, command }, 'synctex: command failed')
|
||||
throw OError.tag(error, 'error running synctex', {
|
||||
command,
|
||||
projectId,
|
||||
|
||||
@@ -8,10 +8,10 @@ import fs from 'node:fs'
|
||||
const ProcessTable = {}
|
||||
|
||||
// Compiles a standalone Typst document (.typ) straight to output.pdf using the
|
||||
// official Typst binary (installed separately from Quarto, which bundles a
|
||||
// modified fork that lacks --synctex). This is deliberately the simplest of
|
||||
// the three runners: Typst only ever produces a PDF, so there is no format
|
||||
// detection, no HTML asset directory and no extension merging (cf. QuartoRunner).
|
||||
// official Typst binary (installed separately — Quarto bundles a modified fork).
|
||||
// This is deliberately the simplest of the three runners: Typst only ever
|
||||
// produces a PDF, so there is no format detection, no HTML asset directory
|
||||
// and no extension merging (cf. QuartoRunner).
|
||||
function runTypst(compileName, options, callback) {
|
||||
const { directory, mainFile, image, environment, compileGroup } = options
|
||||
const timeout = options.timeout || 60000
|
||||
@@ -58,10 +58,8 @@ function _buildTypstCommand(mainFile) {
|
||||
// is merged into stdout (2>&1). LocalCommandRunner replaces $COMPILE_DIR
|
||||
// before the shell sees it; the output path is relative because the shell
|
||||
// CWD is already the compile directory.
|
||||
// --synctex generates output.synctex.gz alongside the PDF, enabling
|
||||
// bidirectional editor↔PDF sync (same infrastructure as LaTeX SyncTeX).
|
||||
const inputPath = `$COMPILE_DIR/${mainFile}`
|
||||
const cmd = `typst compile --synctex output.synctex.gz ${inputPath} output.pdf 2>&1`
|
||||
const cmd = `typst compile ${inputPath} output.pdf 2>&1`
|
||||
return ['/bin/sh', '-c', cmd]
|
||||
}
|
||||
|
||||
|
||||
@@ -176,12 +176,12 @@ export default function useSynctex(): {
|
||||
positionRef.current = position
|
||||
}, [position])
|
||||
|
||||
// SyncTeX works for LaTeX and Typst projects — both produce output.synctex.gz.
|
||||
// Quarto does not (its intermediate files make path mapping unreliable).
|
||||
const SYNCTEX_EXTENSIONS_RE = /\.(tex|ltx|Rtex|Rnw|typ)$/i
|
||||
// SyncTeX only works for LaTeX projects (requires output.synctex.gz).
|
||||
// Typst has no --synctex equivalent in its CLI; Quarto is also unsupported.
|
||||
const LATEX_EXTENSIONS_RE = /\.(tex|ltx|Rtex|Rnw)$/i
|
||||
const rootDocPath = rootDocId ? pathInFolder(rootDocId) : null
|
||||
const isSynctexRootDoc = rootDocPath
|
||||
? SYNCTEX_EXTENSIONS_RE.test(rootDocPath)
|
||||
? LATEX_EXTENSIONS_RE.test(rootDocPath)
|
||||
: false
|
||||
|
||||
const _syncToCode = useCallback(
|
||||
|
||||
Reference in New Issue
Block a user