How mha963/loctex works
LocTex is an offline-first LaTeX research studio. Users manage a project, edit TeX and assets, compile to PDF, inspect diagnostics, and use SyncTeX to move between source and output; optional local AI assists with chat and repairs. The backend also persists project state and supports ZIP exchange and snapshots. The graph follows documented capabilities and visible imports/calls; some feature internals were not sampled, so uncertain links are omitted or marked dashed.
Main entry points: App.tsx Studio Shell · index.ts HTTP API · api.ts API Client · tectonic-runner.ts TeX Compiler
Components 23
Writing Workspace
- Studio Shell
src/App.tsx - Project Dashboard
src/components/ProjectsDashboard.tsx - LaTeX Editor
src/components/EditorPane.tsx - Editor Toolbar
src/components/HeaderPill.tsx - TeX Formatting
src/utils/latex-format.ts - Document Statistics
src/utils/latex-stats.ts
Projects and Assets
- Asset Preview
src/components/AssetPreviewPane.tsx - File Explorer
src/components/Sidebar.tsx - Project Dialogs
src/components/Modals.tsx - ZIP Exchange
server/services/zip-service.ts
Compile and Review
- TeX Compiler
server/compiler/tectonic-runner.ts - Error Parser
server/compiler/error-parser.ts - Diagnostic Drawer
src/components/DiagnosticDrawer.tsx - PDF Canvas
src/components/PdfCanvas.tsx - SyncTeX Parser
server/services/synctex-parser.ts
AI Copilot
- Copilot Chat
src/components/QwenChatDrawer.tsx - AI Service
server/services/ollama-service.ts
Local Backend
- API Client
src/services/api.ts - HTTP API
server/index.ts - SQLite Store
server/db/database.ts
Other components
- Writer
- Ollama Runtime
- Local TeX Tools
Connections 27
- Writer → Studio Shell: uses
README.md - Studio Shell → Project Dashboard: renders
src/App.tsx - Studio Shell → LaTeX Editor: renders
src/App.tsx - Studio Shell → Editor Toolbar: renders
src/App.tsx - Studio Shell → Asset Preview: selects preview
src/App.tsx - Studio Shell → PDF Canvas: renders
src/App.tsx - Studio Shell → API Client: requests data
src/App.tsx - LaTeX Editor → TeX Formatting: formats text
src/components/EditorPane.tsx - Editor Toolbar → Document Statistics: displays stats
src/components/HeaderPill.tsx - Studio Shell → File Explorer: renders
src/App.tsx - Studio Shell → Project Dialogs: renders
src/App.tsx - Studio Shell → Diagnostic Drawer: renders
src/App.tsx - Studio Shell → Copilot Chat: renders
src/App.tsx - Copilot Chat → API Client: sends chat
src/services/api.ts - API Client → HTTP API: calls HTTP routes
src/services/api.ts - HTTP API → SQLite Store: reads and writes
server/index.ts - HTTP API → TeX Compiler: dispatches compile
server/index.ts - HTTP API → AI Service: dispatches AI
server/index.ts - HTTP API → ZIP Exchange: imports archives
server/index.ts - HTTP API → SyncTeX Parser: uses parser
server/index.ts - TeX Compiler → Error Parser: parses diagnostics
server/compiler/tectonic-runner.ts - Studio Shell → ZIP Exchange: imports and exports
README.md - HTTP API → SQLite Store: stores snapshots
README.md - TeX Compiler → Local TeX Tools: runs local tools
README.md - AI Service → Ollama Runtime: queries locally
README.md - PDF Canvas → SyncTeX Parser: jumps to source
README.md - Diagnostic Drawer → API Client: requests repair
README.md