Prerequisites
Before installing Typeset, ensure you have the following installed:Node.js 20.x or later
Download from nodejs.org or use a version manager like nvm.
Clone the repository
Clone the Typeset repository to your local machine:Replace
yourusername/typeset with the actual repository URL.Install dependencies
Install all required npm packages:package.json, including:
Core dependencies
- next (15.3.8) - React framework
- react (19.1.0) - UI library
- typescript (5.8.3) - Type safety
Authentication
- @clerk/nextjs (6.25.5) - User authentication
- @clerk/themes (2.4.0) - Clerk UI components
Real-time collaboration
- @liveblocks/client (3.2.0) - Liveblocks client
- @liveblocks/react (3.2.0) - React bindings
- @liveblocks/yjs (3.2.0) - Yjs integration
- yjs (13.6.27) - CRDT library
AI integration
- @ai-sdk/openai (1.3.23) - OpenAI integration
- @ai-sdk/google (1.2.22) - Google AI integration
- ai (4.3.19) - Vercel AI SDK
LaTeX editor
- codemirror (6.0.2) - Code editor
- codemirror-lang-latex (0.1.0-alpha.0) - LaTeX syntax
- react-pdf (9.2.1) - PDF rendering
- katex (0.16.22) - Math rendering
UI components
- @radix-ui/react-* - Radix UI primitives
- lucide-react (0.516.0) - Icon library
- tailwindcss (4.1.11) - Styling
package.json.
Install Tectonic
Tectonic is the LaTeX compiler used by Typeset. Installation depends on your platform:Verify installation
Verify all components are installed correctly:Development setup
Before running the development server, you need to configure environment variables.Environment configuration is covered in detail in Configuration.
.env.local file in the project root:
.env.local
Run the development server
Start the Next.js development server:The dev server uses Turbopack for faster builds. To use webpack instead, remove
--turbopack from the dev script in package.json.Build for production
Create an optimized production build:- Type-check your TypeScript code
- Compile MDX files with remark-gfm plugin
- Bundle assets with webpack
- Generate optimized static pages
- Create server functions for API routes
.next/.
Start production server
Run the production server locally:Troubleshooting
Tectonic not found
If you see “Tectonic binary not found”:-
Verify the binary exists:
-
Check file permissions:
-
Verify the path in
app/api/compile/route.ts:22-25
Package installation fails
Ifpnpm install fails:
-
Clear the pnpm cache:
-
Delete
node_modulesandpnpm-lock.yaml: -
Ensure you’re using Node.js 20.x or later:
Port already in use
If port 3000 is already in use:LaTeX compilation timeout
If LaTeX compilation times out:-
Check Tectonic can download packages:
-
Increase the timeout in
app/api/compile/route.ts(default is 30 seconds) - Pre-cache common packages by compiling a comprehensive test document
Next steps
Now that Typeset is installed, continue with:Configure services
Set up Clerk, Liveblocks, and AI API keys in Configuration.
Deploy to production
Deploy to Vercel or your preferred platform using Deployment.