Back to list
dev_to 2026年3月14日

VS Code と MiKTeX を使用してローカルで完全に自主 LaTeX 論文ワークフローの構築

Building a Fully Local LaTeX Thesis Workflow with VS Code and MiKTeX

Translated: 2026/3/14 11:21:43
latexvscodemiktexwritingthesis

Japanese Translation

私は最初に Word を使用して執筆しましたが、小規模ドキュメントにとっては十分機能しますが、論文が大きくなると管理が困難になります。フォーマット、図、目次を更新する際に、他のセクションが予期せぬように移動することがあります。小さなレイアウトの問題を修正する作業は、実際の執筆よりも多くの時間を取ってしまいます。 長い学術ドキュメント、参考文献、番号付けされた図、厳格なフォーマット要件を持つものには、より構造化されたツールが必要です。 Overleaf は LaTeX 初心者の標準的な推奨事項です。ブラウザ上で動作し、インストールが不要で、生 PDF プレビューを持っています。迅速なドキュメントにはこれで十分です。 しかし、完全な論文には現実的な制限があります: セキュリティ上の理由から、研究や発表されていない作業を公開プラットフォームに保存したくない場合があります。 無料ティアには制限があります。 データは彼らのサーバーに存置します。 オフラインでは作業できません。 代替案?すべてをローカルで実行する。あなたのマシン、あなたのファイル、あなたの Git リポジトリ。無料で永遠に。オフラインで動作。デフォルトでプライベート。 LaTeX — ドキュメント準備システム。マークアップでプレーンテキストで書きますし、LaTeX は完全にフォーマットされた PDF を生成します。 MiKTeX — Windows 用の LaTeX ディストリビューションです。必要なすべてのパッケージを管理し、必要に応じて自動的にインストールします。 VS Code — コードエディタです。ここでは LaTeX エディタとして、LaTeX Workshop 拡張機能と共に使用されます。 XeLaTeX — コンパイラです。pdfLaTeX よりも現代的なフォントと Unicode に優れています。 Biber — 引用書管理ツールです。BibTeX .bib ファイルと動作します。 Makeglossaries — 略号リストと略語を処理します。 Python + Pygments — minted パッケージのためにシンタックスハイライト付きコードブロックが必要なため必須です。 始める前に:このガイドは Windows を対象としています。同じツールは macOS と Linux でも存在し、インストール手順に少しの違いがあります。 MiKTeX は LaTeX エンジンです。XeLaTeX、Biber、Makeglossaries が含まれており、最初にコンパイルするたびに欠けている LaTeX パッケージを自動的にダウンロードします。 miktex.org/download に進んでください。 Windows インストーラーをダウンロードして実行してください。 管理者権限がある場合は、すべてのユーザー用にインストールを選択してください。そうでなければ、あなた自身用にインストールしてください。 インストール後、ターミナルを開いて検証してください: xelatex --version biber --version makeglossaries --version もし何か欠けているなら、MiKTeXのパッケージマネージャでインストールできます。 テンプレートはコードのシンタックスハイライトのために minted パッケージを使用します。Python が既にインストールされているか確認してください: python --version pygmentize -V もしそうではないなら、python.org/downloads からダウンロードしてください。次に Pygments をインストールしてください: pip install pygments code.visualstudio.com からダウンロードしてください。 インストールして VS Code を開いてください。 拡張機能パネルから LaTeX Workshop 拡張機能を検索してインストールしてください。 git clone https://github.com/007bsd/metropolia-thesis-latex.git cd metropolia-thesis-latex code . または GitHub から ZIP を直接ダウンロードして、フォルダを VS Code で開いてください。 プロジェクトにはすでに LaTeX Workshop を構成する .vscode/settings.json が含まれています: XeLaTeX をコンパイラとして使用する。 main.tex をルートドキュメントとして設定する。 ビルド後に補助ファイルを検証して削除する。 main.tex を開いてください。右上の緑色の ▶ Build LaTeX project ボタンをクリックするか、Ctrl+Alt+B を押してください。 LaTeX Workshop はフルコンパイルシーケンスを実行します: xelatex -shell-escape -8bit main biber main makeglossaries main xelatex -shell-escape -8bit main xelatex -shell-escape -8bit main 最初のコンパイルは、MiKTeX が欠けているパッケージをダウンロードするため、数分かかります。成功すると、main.pdf がプロジェクトルートに現れて自動的に VS Code PDF プレビューパネルで開かれます。 chapters/ フォルダー内の任意のファイルを開いて編集を始めてください。毎回保存(Ctrl+S)するたびに、LaTeX Workshop は自動再コンパイルし、PDF がリアルタイムで更新されます。 プロジェクト構造: my-thesis/ ├── main.tex ← マスターファイル ├── chapters/ ← 1 つの章あたり 1 つの.tex ファイル ├── biblio.bib ← 参考文献 ├── illustration/ ← 画像と図 ├── code/ ← minted スニペット用のコードファイル └── style/ ← フォーマットルール 参考文献を Zotero で管理します。Zotero で収集し、参考文献を整理し、直接エクスポートし...

Original Content

Why I Didn't Use Word I tried writing in Word at first. It works fine for small documents, but once the thesis started growing, it became harder to manage. Formatting, figures, and updating the table of contents sometimes caused other sections to shift unexpectedly. Fixing small layout issues was taking more time than actual writing. For a long academic document with references, numbered figures, and strict formatting requirements, I wanted something more structured. Overleaf is the go-to recommendation for LaTeX beginners, it runs in the browser, there's nothing to install, and it has a live PDF preview. For a quick document, it's fine. But for a full thesis, it has real limitations: For security reasons, you may not want your research or unpublished work stored on a public platform The free tier has limits Your data lives on their servers You can't work offline The alternative? Run everything locally. Your machine, your files, your Git repository. Free forever. Works offline. Private by default. LaTeX — the document preparation system. You write in plain text with markup, and LaTeX produces a perfectly formatted PDF MiKTeX — a LaTeX distribution for Windows that manages all the packages you need, installing them automatically when required VS Code — the code editor, used here as a LaTeX editor with the LaTeX Workshop extension XeLaTeX — the compiler. Better than pdfLaTeX for modern fonts and Unicode Biber — bibliography manager, works with BibTeX .bib files Makeglossaries — handles abbreviation lists and acronyms Python + Pygments — required for the minted package for syntax-highlighted code blocks Before you start: This guide covers Windows. The same tools exist for macOS and Linux with slightly different installation steps. MiKTeX is the LaTeX engine. It comes with XeLaTeX, Biber, and Makeglossaries, and it will automatically download any missing LaTeX packages the first time you compile. Go to miktex.org/download Download the Windows installer and run it Choose Install for all users if you have admin rights, otherwise install for yourself After installation, open a terminal and verify: xelatex --version biber --version makeglossaries --version If anything is missing, MiKTeX's package manager can install them. The template uses the minted package for code syntax highlighting. Check if Python is already installed: python --version pygmentize -V If not, download from python.org/downloads. Then install Pygments: pip install pygments Download from code.visualstudio.com Install and open VS Code Search and install the LaTeX Workshop extension from the Extensions panel git clone https://github.com/007bsd/metropolia-thesis-latex.git cd metropolia-thesis-latex code . Or download the ZIP from GitHub directly and open the folder in VS Code. The project includes a .vscode/settings.json that already configures LaTeX Workshop to: Use XeLaTeX as the compiler Set main.tex as the root document Auto-clean auxiliary files after building Open main.tex. Click the green ▶ Build LaTeX project button in the top right, or press Ctrl+Alt+B. LaTeX Workshop will run the full compilation sequence: xelatex -shell-escape -8bit main biber main makeglossaries main xelatex -shell-escape -8bit main xelatex -shell-escape -8bit main The first compile may take a minute as MiKTeX downloads any missing packages. When it succeeds, main.pdf appears in the project root and opens automatically in the VS Code PDF preview panel. Open any file in the chapters/ folder and start editing. Every time you save (Ctrl+S), LaTeX Workshop auto-recompiles and the PDF updates in real time. Project structure: my-thesis/ ├── main.tex ← Master file ├── chapters/ ← One .tex file per chapter ├── biblio.bib ← Bibliography ├── illustration/ ← Images and figures ├── code/ ← Code files for minted snippets └── style/ ← Formatting rules Manage references with Zotero. Collect and organize references in Zotero, export directly as a .bib file into biblio.bib. Works seamlessly with Biber and saves a lot of manual formatting. Keep your Git commits small. Commit chapter by chapter, not just at the end. You will want to roll back if you rewrite a section and change your mind. Don't edit your style files. These contain the formatting rules. If you change them and something breaks, debugging is painful. After compilation succeeds you have a properly formatted PDF — table of contents, numbered figures, bibliography, and acronym list all generated automatically. No style settings touched manually. No Word. No cloud. For students in technical fields, getting used to LaTeX means getting comfortable with plain text and structured writing. That mindset helps beyond just thesis work. The setup took me around 30–45 minutes. After that, it was just writing. Template repository: github.com/007bsd/metropolia-thesis-latex MiKTeX: miktex.org VS Code: code.visualstudio.com LaTeX Workshop extension: Search "LaTeX Workshop" in VS Code Extensions Pygments: pip install pygments Zotero: zotero.org If you run into any issues setting this up, feel free to leave a comment — happy to help based on my experience.