<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">% !TeX root = ../install-latex-guide-zh-cn.tex

\chapter{Windows 11 ç³»ç»Ÿ}

\section{å®‰è£… \TeX~Live}\label{sec:windows:install}

åœ¨å®‰è£… \TeX~Live ä¹‹å‰,
åœ¨æ–‡ä»¶å¤¹èœå•æ&nbsp; \menu{æŸ¥çœ‹ &gt; æ˜¾ç¤º} ä¸­é€‰æ‹© \menu{æ–‡ä»¶æ‰©å±•å}.

ç”¨æˆ·å¯ä»¥ä»Žæœ€è¿‘çš„ CTAN æº\footnote{è¿™é‡Œæ‰€è°“çš„æœ€è¿‘, å…¶å®žæ˜¯ç”±ç³»ç»Ÿåˆ¤å®šçš„, å®žé™…ä¸Šç³»ç»Ÿå¯èƒ½ä¼šè¯¯åˆ¤}ä¸‹è½½ \TeX~Live çš„
\href{https://mirrors.ctan.org/systems/texlive/Images/texlive2025.iso}{\texttt{iso} é•œåƒæ–‡ä»¶},
ä¹Ÿå¯ä»¥æ‰¾å¤§é™†åœ°åŒºçš„æºè‡ªè¡Œä¸‹è½½\footnote{æ–°ç‰ˆæœ¬å‘å¸ƒæ—¶, å„é•œåƒç½‘ç«™åŒæ­¥çš„è¿›åº¦ä¼šæœ‰ä¸åŒ}.
é€šè¿‡å¤§é™†åœ°åŒºçš„æºä¸‹è½½ \texttt{iso} æ–‡ä»¶çš„æ–¹æ³•è¯·å‚è€ƒé™„å½•~\ref{chp:appendix:mirror}.

å‡è®¾é•œåƒæ–‡ä»¶è¢«ä¸‹è½½åˆ°æœ¬åœ°åŽ,
å…¶å­˜æ”¾è·¯å¾„ä¸º \path{X:\Y}%
\footnote{è¿™é‡Œ, \path{X} è¡¨ç¤ºç›˜ç¬¦,
å¦‚ \path{C}ã€\path{D}ã€\path{E} ç­‰;
\path{Y} è¡¨ç¤ºæ–‡ä»¶å¤¹;
é»˜è®¤è·¯å¾„åç§°ä¸ºä¸å¸¦ç©ºæ&nbsp;¼çš„è‹±æ–‡}.
ä¸‹è½½å®Œæ¯•åŽ, ç”¨æˆ·æ‰“å¼€ \textsf{cmd} çª—å£%
\footnote{æŒ‰ \keys{\faWindows},
æˆ–åœ¨ä»»æ„æ–‡ä»¶å¤¹ä¸­æŒ‰ \keys{\ctrl + L},
è¾“å…¥ \textsf{cmd},
ç‚¹å‡» \keys{\enter}},
å°†ä¼šè§åˆ°è¯¸å¦‚ä»¥ä¸‹å†…å®¹
\begin{lstlisting}
  C:\Users\username&gt;
\end{lstlisting}
%\begin{lstlisting}
%  PS C:\Users\username&gt;
%\end{lstlisting}
å®ƒæ˜¾ç¤ºäº†å½“å‰æ‰€åœ¨è·¯å¾„å¹¶ç­‰å¾…ç”¨æˆ·ä¸‹ä¸€æ­¥æ“ä½œ,
é€šå¸¸åœ¨å¼€å¯ \textsf{cmd} æˆ–ä¸Šä¸€ç¨‹åºè¿è¡Œç»“æŸæ—¶ä¼šæ˜¾ç¤º.

åœ¨ \textsf{cmd} æ‰§è¡Œ
\begin{lstlisting}
  echo %path:;=&amp;echo.%
\end{lstlisting}
%\begin{lstlisting}
%  $env:Path -split ';'
%\end{lstlisting}
æŸ¥çœ‹çŽ¯å¢ƒå˜é‡. 
è‹¥ \path{C:\Windows\system32}
ä¸åœ¨ç»“æžœä¸­\footnote{è¿™é‡Œé»˜è®¤ç³»ç»Ÿç›˜ä¸º \path{C} ç›˜},
åˆ™å…³é—­ \textsf{cmd} çª—å£,
å°† \path{C:\Windows\system32}
æ·»åŠ&nbsp;åˆ°çŽ¯å¢ƒå˜é‡ä¸­\footnote{åœ¨ \menu{æ¡Œé¢ &gt; æ­¤ç”µè„‘ &gt; å±žæ€§ &gt; é«˜çº§ç³»ç»Ÿè®¾ç½® &gt; çŽ¯å¢ƒå˜é‡ &gt; ç³»ç»Ÿå˜é‡ &gt; Path} ä¸­æ·»åŠ&nbsp;}.
\textbf{æ&nbsp;¹æ®ä»¥å¾€ç»éªŒ, å®‰è£…è€ç‰ˆ C\TeX\ å¥—è£…çš„ç”¨æˆ·å¾€å¾€ä¼šæœ‰} \path{system32} \textbf{ä¸¢å¤±çš„é—®é¢˜}. 

å¦å¤–, å¦‚æžœçŽ¯å¢ƒå˜é‡ä¸­æœ‰ \texttt{mingw}ã€\texttt{jdk}ã€\texttt{Cygwin} ç›¸å…³çš„å†…å®¹,
ä¹Ÿè¯·æš‚æ—¶åˆ&nbsp;é™¤\footnote{å‰ä¸¤è€…å…·ä½“åŽŸå›&nbsp;å‚è§
\href{https://tex.stackexchange.com/questions/445086/error-installing-latest-version-of-tex-live-on-windows-10}{\textsf{Stack\textbf{Exchange}}}
çš„è§£é‡Š, å¾…å®‰è£…ç»“æŸåŽ, å†å°†çŽ¯å¢ƒå˜é‡é‡æ–°æ·»åŠ&nbsp;è‡³ \TeX~Live çš„çŽ¯å¢ƒå˜é‡ä¹‹åŽ}.
åŒæ—¶å›½å†…å¸¸è§çš„ 2345 å¥½åŽ‹ä¹Ÿä¼šå¯¹å®‰è£…æž„æˆå½±å“,
å»ºè®®åˆ&nbsp;é™¤å®ƒå¹¶åœ¨å®‰è£… \TeX~Live åŽæ›´æ¢å…¶ä»–åŒç±»è½¯ä»¶%
\footnote{æŽ¨è \href{http://www.winrar.com.cn}{WinRAR}
æˆ– \href{https://www.7-zip.org}{7-Zip}}.
\textbf{æœ€é‡è¦çš„æ˜¯, ä¸è¦å®‰è£…ç¬¬ä¸‰æ–¹å®‰å…¨è½¯ä»¶}\footnote{Windows 11 ä¸­å·²ç»å†…ç½®äº†å®‰å…¨è½¯ä»¶,
ç”¨æˆ·å°¤å…¶æ²¡æœ‰å¿…è¦å®‰è£…å›½äº§çš„ç¬¬ä¸‰æ–¹æ€æ¯’è½¯ä»¶,
æ&nbsp;¹æ®ç»éªŒ,
å®ƒä»¬ä¼šå¹²æ‰° \TeX~Live å®‰è£…}.

ä¸‹é¢æˆ‘ä»¬è¦ç¡®ä¿ä¸‹è½½åˆ°çš„ \texttt{iso} æ–‡ä»¶æ²¡æœ‰æŸå, ä¸€ç§å¸¸ç”¨åšæ³•æ˜¯æ£€æŸ¥å…¶ MD5 å€¼.
å½“ç„¶, å¦‚æžœç¡®ä¿¡è‡ªå·±ä¸‹è½½åˆ°çš„æ–‡ä»¶æ²¡æœ‰é—®é¢˜, ä¹Ÿå¯ä»¥è·³è¿‡è¿™ä¸€æ­¥.
æ‰“å¼€ \textsf{cmd} çª—å£ä¾æ¬¡æ‰§è¡Œä»¥ä¸‹ä»£ç&nbsp;
\begin{lstlisting}
  cd /d X:\Y
  certutil -hashfile texlive2025.iso md5
\end{lstlisting}
%\begin{lstlisting}
%  (Get-FileHash 'X:\Y\texlive2025.iso' -Algorithm MD5).Hash
%\end{lstlisting}
è‹¥ç³»ç»Ÿæ˜¾ç¤º
\begin{lstlisting}[language = {}]
  MD5 çš„ texlive2025.iso å“ˆå¸Œ:
  69b4a8882983d9ea521730b5f42175e7
  CertUtil: -hashfile å‘½ä»¤æˆåŠŸå®Œæˆ.
\end{lstlisting}
åˆ™è¡¨æ˜Žä¸‹è½½çš„é•œåƒæ–‡ä»¶æ­£å¸¸.
é™¤ MD5 å€¼å¤–,
è¿˜å¯æ£€æŸ¥ SHA512 å€¼.
ä¾ç„¶æ˜¯åœ¨ \textsf{cmd} æ‰§è¡Œ
\begin{lstlisting}
  cd /d X:\Y
  certutil -hashfile texlive2025.iso sha512
\end{lstlisting}
%\begin{lstlisting}
%  (Get-FileHash 'X:\Y\texlive2025.iso' -Algorithm SHA512).Hash
%\end{lstlisting}
è‹¥ç³»ç»Ÿæ˜¾ç¤º
\begin{lstlisting}[literate={a}{a}{1} {b}{b}{1} {c}{c}{1} {d}{d}{1} {e}{e}{1} {f}{f}{1}]
  SHA512 çš„ texlive2025.iso å“ˆå¸Œ:
  1fd9a2234d086f50c832ab3ac8b83477bbc39b1138a3c4a2351244c1fd4b8bea6d1ac81d4a5b0cba95f2e82c00f0d9df5b33189eb222e4bae5dae1523ef0da0e
  CertUtil: -hashfile å‘½ä»¤æˆåŠŸå®Œæˆ.
\end{lstlisting}
å³ä¸ºéªŒè¯æˆåŠŸ.

æŽ¥ä¸‹æ¥å¼€å§‹å®‰è£….
æŽ¨èç”¨æˆ·å…ˆæ‰‹åŠ¨å»ºç«‹ \TeX~Live çš„å®‰è£…è·¯å¾„ (æ–‡ä»¶å¤¹) å†è¿›è¡Œå®‰è£…,
æ³¨æ„è·¯å¾„çš„åç§°æ˜¯\textbf{ä¸å¸¦ç©ºæ&nbsp;¼çš„è‹±æ–‡},
é»˜è®¤è·¯å¾„ä¸º \path{C:\texlive\2025}.
å‡å¦‚ç³»ç»Ÿç”¨äº†ä¸­æ–‡ä½œä¸ºç”¨æˆ·å,
é‚£ä¹ˆç”¨æˆ·éœ€è¦å…ˆæŒ‰ç…§ \ref{sec:chinesename} èŠ‚çš„æ–¹æ³•æ›´æ”¹ä¸´æ—¶çŽ¯å¢ƒå˜é‡åŽå†å®‰è£….
å°†é•œåƒæ–‡ä»¶è£…è½½è‡³è™šæ‹Ÿå…‰é©±\footnote{Windows 11 é»˜è®¤åŒå‡»é•œåƒæ–‡ä»¶ä¾¿å¯è£…è½½;
å—æŸäº›åŽ‹ç¼©è½¯ä»¶å½±å“åŒå‡»å¤±æ•ˆæ—¶,
å¯åœ¨æ–‡ä»¶å¤¹èœå•æ&nbsp;
\menu{è£…è½½};
ç¬¬ä¸‰æ–¹è™šæ‹Ÿå…‰é©±è½¯ä»¶å¯è€ƒè™‘ WinCDEmu æˆ– UltraISO;
ä¸é¼“åŠ±è§£åŽ‹ç¼©é•œåƒæ–‡ä»¶}.
å‡è®¾åŠ&nbsp;è½½åŽçš„è·¯å¾„ä¸º \path{Z:\}.
æ‰“å¼€ \textsf{cmd} çª—å£å¹¶æ‰§è¡Œ
\begin{lstlisting}
  Z:\install-tl-windows.bat --no-gui
\end{lstlisting}
%\begin{lstlisting}
%  &amp; 'Z:\install-tl-windows.bat' --no-gui
%\end{lstlisting}
å³å¯çœ‹åˆ°å¦‚ä¸‹ç»“æžœ
\begin{lstlisting}[language = {}, deleteemph = set]
  ======================&gt; TeX Live installation procedure &lt;=====================

  ======&gt;   Letters/digits in &lt;angle brackets&gt; indicate   &lt;=======
  ======&gt;   menu items for actions or customizations      &lt;=======
  = help&gt;   https://tug.org/texlive/doc/install-tl.html   &lt;=======

   Detected platform: Windows (64-bit)

   &lt;B&gt; set binary platforms: 1 out of 15

   &lt;S&gt; set installation scheme: scheme-full

   &lt;C&gt; set installation collections:
       41 collections out of 41, disk space required: 9033 MB (free: 261418 MB)

   &lt;D&gt; set directories:
     TEXDIR (the main TeX directory):
       C:/texlive/2025
     TEXMFLOCAL (directory for site-wide local files):
       C:/texlive/texmf-local
     TEXMFSYSVAR (directory for variable and automatically generated data):
       C:/texlive/2025/texmf-var
     TEXMFSYSCONFIG (directory for local config):
       C:/texlive/2025/texmf-config
     TEXMFVAR (personal directory for variable and automatically generated data):
       ~/.texlive2025/texmf-var
     TEXMFCONFIG (personal directory for local config):
       ~/.texlive2025/texmf-config
     TEXMFHOME (directory for user-specific files):
       ~/texmf

   &lt;O&gt; options:
     [ ] use letter size instead of A4 by default
     [X] allow execution of restricted list of programs via \write18
     [X] create all format files
     [X] install macro/font doc tree
     [X] install macro/font source tree
     [X] adjust search path
     [1] add menu items, shortcuts, etc.
     [1] update file associations
     [X] install TeXworks front end
     [X] after install, set CTAN as source for package updates

   &lt;V&gt; set up for portable installation

  Actions:
   &lt;I&gt; start installation to hard disk
   &lt;P&gt; save installation profile to 'texlive.profile' and exit
   &lt;Q&gt; quit

  Enter command:
\end{lstlisting}
è¿™æ—¶, ç”¨æˆ·å¯ç›´æŽ¥æŒ‰é”®ç›˜ \keys{I} åœ¨é»˜è®¤è·¯å¾„ä¸­ç›´æŽ¥å®‰è£… \TeX~Live,
ä¹Ÿå¯æŒ‰é”®ç›˜ \keys{D} æ¥æ›´æ”¹å®‰è£…è·¯å¾„.
æŒ‰ \keys{D} åŽ, ç”¨æˆ·å¯çœ‹åˆ°
\begin{lstlisting}[language = {}]
  ==============================================================================
  Directories customization:
  
  &lt;1&gt; TEXDIR:       C:/texlive/2025
      main tree:    C:/texlive/2025/texmf-dist
  
  &lt;2&gt; TEXMFLOCAL:     C:/texlive/texmf-local
  &lt;3&gt; TEXMFSYSVAR:    C:/texlive/2025/texmf-var
  &lt;4&gt; TEXMFSYSCONFIG: C:/texlive/2025/texmf-config
  
  &lt;5&gt; TEXMFVAR:       ~/.texlive2025/texmf-var
  &lt;6&gt; TEXMFCONFIG:    ~/.texlive2025/texmf-config
  &lt;7&gt; TEXMFHOME:      ~/texmf
  
  Note: ~ will expand to %USERPROFILE%
  
  Actions:
  &lt;R&gt; return to main menu
  &lt;Q&gt; quit
  
  Enter command:
\end{lstlisting}
è¿™æ—¶æŒ‰é”®ç›˜ \keys{1}, å°†çœ‹åˆ°
\begin{lstlisting}[language = {}]
  New value for TEXDIR [C:/texlive/2025]:
\end{lstlisting}
è¿™æ—¶å¯æ›´æ”¹è·¯å¾„, å¦‚ \path{D:/texlive/2025}.
æŽ¥ä¸‹æ¥, æŒ‰é”®ç›˜ \keys{R} å³å¯å›žåˆ°åˆå§‹çš„å®‰è£…ç•Œé¢,
å†æŒ‰é”®ç›˜ \keys{I} ä¾¿å¯åœ¨åˆšæ‰æŒ‡å®šçš„è·¯å¾„å®‰è£….
ç”¨æˆ·å¯é€šè¿‡é˜…è¯»è‹±æ–‡æ‰§è¡Œå…¶ä»–æ“ä½œ, è¿™é‡Œä¸å†èµ˜è¿°. 
è‡³æ­¤, ç”¨æˆ·åªéœ€è€å¿ƒç­‰å¾…å®‰è£…å®Œæˆ, å¹¶ä¸”ä¸è¦ç‚¹å‡» \textsf{cmd} çª—å£%
\footnote{Windows 11 é»˜è®¤é‡‡å–å¿«é€Ÿç¼–è¾‘æ¨¡å¼, ä¸€æ—¦ç‚¹å‡» \textsf{cmd} çª—å£,
å°†æ˜¾ç¤º``é€‰æ‹©å‘½ä»¤æç¤ºç¬¦''è€Œå¯¼è‡´è¿›ç¨‹æš‚åœ}. 
å®‰è£…å®ŒæˆåŽ, å…³é—­å†æ‰“å¼€ \textsf{cmd} çª—å£%
\footnote{æ­£å¸¸å®‰è£… \TeX~Live åŽ, çŽ¯å¢ƒå˜é‡ä¼šå˜åŒ–,
å…³é—­åŽŸ \textsf{cmd} çª—å£å†é‡æ–°æ‰“å¼€æ‰èƒ½èŽ·å–æ–°çš„çŽ¯å¢ƒå˜é‡},
æ‰§è¡Œ
\begin{lstlisting}
  tex -v
\end{lstlisting}
æ˜¾ç¤º
\begin{lstlisting}[language = {}]
  TeX 3.141592653 (TeX Live 2025)
  kpathsea version 6.4.1
  Copyright 2025 D.E. Knuth.
  There is NO warranty.  Redistribution of this software is
  covered by the terms of both the TeX copyright and
  the Lesser GNU General Public License.
  For more information about these matters, see the file
  named COPYING and the TeX source.
  Primary author of TeX: D.E. Knuth.
\end{lstlisting}
å³å¯è®¤ä¸ºå®‰è£…é¡ºåˆ©å®Œæˆ%
\footnote{è‹¥æœªèƒ½æ­£ç¡®æ˜¾ç¤ºç»“æžœ, åˆ™å¯èƒ½æ˜¯å›&nbsp;ä¸ºçŽ¯å¢ƒå˜é‡æœªæ”¹å˜,
ç”¨æˆ·å¯æ‰‹åŠ¨æ·»åŠ&nbsp; \path{&lt;TEXDIR&gt;\bin\windows} è‡³çŽ¯å¢ƒå˜é‡,
\path{&lt;TEXDIR&gt;} éœ€ä¸Žä½&nbsp;æ–¹æ‰çš„å®‰è£…è·¯å¾„ä¸€è‡´}.
å¼¹å‡ºå‰é¢è£…è½½çš„å…‰ç›˜é•œåƒ,
å®‰è£…åˆ°æ­¤ç»“æŸ.

\subsection{ä¸‹è½½é•œåƒä¸€ç›´ä¸æˆåŠŸçš„å¤„ç†åŠžæ³•}

ç›®å‰å‘çŽ°æœ‰äº›ç”¨æˆ·ä½¿ç”¨æŸäº›æµè§ˆå™¨æ—¶æ—&nbsp;æ³•æ­£å¸¸ä¸‹è½½é•œåƒæ–‡ä»¶.
è¿™æ—¶,
ç”¨æˆ·å¯ä»¥é€‰æ‹©ä½¿ç”¨ \href{https://eternallybored.org/misc/wget/}{\textsf{wget}} å¯¹é•œåƒè¿›è¡Œä¸‹è½½.
å…·ä½“ç”¨æ³•æ˜¯:
å°† \textsf{wget} æ‰€åœ¨ç›®å½•æ·»åŠ&nbsp;åˆ°çŽ¯å¢ƒå˜é‡ä¸­.
æ‰“å¼€ \textsf{cmd} çª—å£æ‰§è¡Œä»¥ä¸‹ä»£ç&nbsp;
\begin{lstlisting}[escapechar = |]
  wget |\url{http://mirrors.ctan.org/systems/texlive/Images/texlive2025.iso}|
\end{lstlisting}
%\begin{lstlisting}
%  Invoke-WebRequest -Uri 'http://mirrors.ctan.org/systems/texlive/Images/texlive2025.iso' -OutFile 'texlive2025.iso'
%\end{lstlisting}
å³å¯ä¸‹è½½æœ€è¿‘çš„é•œåƒ.
ç±»ä¼¼åœ°,
ä¹Ÿå¯ä»¥æŒ‡å®šå›½å†…çš„æºè¿›è¡Œä¸‹è½½,
ä¾‹å¦‚é€‰æ‹©æ¸…åŽå¤§å­¦é•œåƒ
\begin{lstlisting}[escapechar = |]
  wget |\url{https://mirrors.tuna.tsinghua.edu.cn/CTAN/systems/texlive/Images/texlive2025.iso}|
\end{lstlisting}
%\begin{lstlisting}
%  Invoke-WebRequest -Uri 'https://mirrors.tuna.tsinghua.edu.cn/CTAN/systems/texlive/Images/texlive2025.iso' -OutFile 'texlive2025.iso'
%\end{lstlisting}
å…¶ä»–å›½å†…é•œåƒåªéœ€è¦å°†é“¾æŽ¥æ›¿æ¢å³å¯,
é“¾æŽ¥å’Œæ–¹æ³•è¯·å‚è€ƒé™„å½•~\ref{chp:appendix:mirror}.

\subsection{éœ€è¦ç®¡ç†å‘˜æƒé™çš„å¤„ç†åŠžæ³•}

æœ‰äº›ç”¨æˆ·åé¦ˆå®‰è£…è¿‡ç¨‹ä¸­éœ€è¦ç®¡ç†å‘˜æƒé™.
ä»¥ç®¡ç†å‘˜èº«ä»½æ‰“å¼€ \textsf{cmd} çª—å£çš„æ–¹æ³•æ˜¯ç‚¹å‡» \keys{\faWindows},
è¾“å…¥ \textsf{cmd},
æŒ‰ \keys{\ctrl + \shift + \enter} ä¸‰ä¸ªé”®.
ä¸€èˆ¬è€Œè¨€,
åœ¨ç³»ç»Ÿç›˜å†…ç›´æŽ¥å®‰è£… \TeX~Live ä¼šç¢°åˆ°æ­¤ç±»é—®é¢˜,
å›&nbsp;æ­¤é¼“åŠ±ç”¨æˆ·åœ¨å®‰è£…å‰å…ˆæ‰‹åŠ¨å»ºç«‹å®‰è£…è·¯å¾„.
ç›´æŽ¥ä½¿ç”¨ç®¡ç†å‘˜èº«ä»½æ‰“å¼€ \textsf{cmd} çª—å£è¿›è¡Œå®‰è£…å¯èƒ½ä¼šå¯¹ä»¥åŽçš„å‡çº§é€&nbsp;æˆå½±å“.

\subsection{ç³»ç»Ÿç”¨ä¸­æ–‡ä½œä¸ºç”¨æˆ·å}\label{sec:chinesename}

å¾ˆå¤šä¸­æ–‡ Windows ç”¨æˆ·ä¹&nbsp;æƒ¯äºŽç”¨ä¸­æ–‡ä½œä¸ºç”¨æˆ·å,
ä½†æ˜¯è¿™æ&nbsp;·ä¼šå¯¼è‡´ \TeX~Live å®‰è£…å¤±è´¥.
æ›´æ”¹ç³»ç»Ÿçš„ \texttt{TEMP} å’Œ \texttt{TMP} è¿™ä¸¤ä¸ªçŽ¯å¢ƒå˜é‡å¯ä»¥é¿å…è¿™æ&nbsp;·çš„é—®é¢˜.
åœ¨ \textsf{cmd} ä¸­æ‰§è¡Œ
\begin{lstlisting}
  mkdir C:\temp
  set TEMP=C:\temp
  set TMP=C:\temp
\end{lstlisting}
%\begin{lstlisting}
%  New-Item -ItemType Directory -Path 'C:\temp' -Force
%  $env:TEMP = 'C:\temp'
%  $env:TMP = 'C:\temp'
%\end{lstlisting}
ä¾¿å¯æ›´æ”¹è¿™ä¸¤ä¸ªçŽ¯å¢ƒå˜é‡ä¸º \path{C:\temp}.
æ›´æ”¹åŽæŒ‰ç…§å‰è¿°å†…å®¹å®‰è£… \TeX~Live å³å¯.
è¿™æ&nbsp;·çš„æ›´æ”¹æ˜¯ä¸´æ—¶çš„,
å¾… \textsf{cmd} çª—å£å…³é—­,
çŽ¯å¢ƒå˜é‡å°†æ¢å¤ä¸ºåŽŸå§‹çŠ¶æ€.

\section{å‡çº§å®åŒ…}\label{sec:windows:update}

å®‰è£…å®ŒæˆåŽ, ç”¨æˆ·å¯ä»¥å‡çº§å®åŒ…ä»¥èŽ·å¾—æ›´å¥½çš„ä½¿ç”¨ä½“éªŒ. 
ä¸‹é¢å°†ä»‹ç»ä½¿ç”¨å‘½ä»¤è¡Œå‡çº§å®åŒ…çš„æ–¹æ³•. 
æ‰“å¼€ \textsf{cmd} çª—å£, é¦–å…ˆæ‰§è¡Œä¸‹é¢å‘½ä»¤æŒ‡å®šå‡çº§ä½¿ç”¨çš„é•œåƒæº. 
\texttt{ctan} è¡¨ç¤ºç³»ç»Ÿåœ¨å‡çº§æ—¶å°†è‡ªåŠ¨å¯»æ±‚æœ€è¿‘çš„æºè¿›è¡Œä¸‹è½½. 
\begin{lstlisting}
  tlmgr option repository ctan
\end{lstlisting}
ç”¨æˆ·åŒæ&nbsp;·å¯ä»¥æŒ‡å®šå…¶ä»–çš„é•œåƒæº,
æ–¹æ³•è§é™„å½•~\ref{chp:appendix:mirror}.

æŽ¥ä¸‹æ¥, ç”¨æˆ·æ‰§è¡Œå‘½ä»¤
\begin{lstlisting}
  tlmgr update --list
\end{lstlisting}
å¯æŸ¥çœ‹ç›®å‰æºä¸Šå¯å‡çº§çš„å®åŒ…éƒ½æœ‰å“ªäº›. 
é«˜çº§ç”¨æˆ·å¯ä»¥æ&nbsp;¹æ®è‡ªå·±çš„éœ€æ±‚é€‰æ‹©å‡çº§ç‰¹å®šå®åŒ….
å»ºè®®åˆçº§ç”¨æˆ·ç›´æŽ¥å‡çº§å…¨éƒ¨å®åŒ…. 
ç”¨æˆ·åªéœ€æ‰§è¡Œ
\begin{lstlisting}
  tlmgr update --self --all
\end{lstlisting}
åŒæ—¶å‡çº§ "tlmgr" æœ¬èº«å’Œå…¨éƒ¨å®åŒ…. 

\subsection{\texttt{tlmgr} æœ¬èº«æ—&nbsp;æ³•æˆåŠŸå‡çº§}

é‡åˆ°è¿™ç§æƒ…å†µæ—¶, ç”¨æˆ·éœ€è‡ªè¡Œä¸‹è½½å¹¶è¿è¡Œ
\href{https://mirrors.ctan.org/systems/texlive/tlnet/update-tlmgr-latest.exe}{\texttt{update-tlmgr-latest.exe}},
ç„¶åŽå†æ‰§è¡Œå‡çº§å‘½ä»¤å³å¯%
\footnote{è¿™é‡Œä¾æ—§è®©ç³»ç»Ÿè‡ªåŠ¨é€‰æ‹©é•œåƒæº,
ç”¨æˆ·å¯ä»¥è‡ªè¡Œé€‰æ‹©å›½å†…é•œåƒä»¥åŠ&nbsp;å¿«ä¸‹è½½é€Ÿåº¦}. 

\subsection{å‡çº§åˆ°ä¸€åŠåœæ­¢}

è¿™ç§æƒ…å†µä¸‹, ç”¨æˆ·éœ€è¦æ‰§è¡Œå¦å¤–ä¸€ä¸ªå‘½ä»¤ç»§ç»­å‡çº§
\begin{lstlisting}
  tlmgr update --reinstall-forcibly-removed --all
\end{lstlisting}

\subsection{å‡çº§å®åŒ…çš„å¿…è¦æ€§}

è‡ªæœ¬æ‰‹å†Œæ’°å†™ä»¥æ¥,
æ¯å¹´é•œåƒæ–‡ä»¶æ‰“åŒ…æ—¶éƒ½å¯èƒ½å­˜åœ¨ä¸€äº›é—®é¢˜,
å…·ä½“è®¨è®ºè§%
\href{https://github.com/CTeX-org/ctex-kit/issues/569}{è¿™é‡Œ}.
ç”¨æˆ·å®‰è£…å®Œæ¯•åŽ,
è¯·æŒ‰ç…§æœ¬èŠ‚æä¾›çš„æ–¹æ³•å‡çº§.

\section{å®‰è£…å®åŒ…}

åœ¨é»˜è®¤çŠ¶æ€ä¸‹, ç”¨æˆ·å°†å®Œæ•´å®‰è£… \TeX~Live, å›&nbsp;æ­¤ç”¨æˆ·æžå°‘ç¢°åˆ°éœ€è¦æ‰‹åŠ¨å®‰è£…å®åŒ…çš„æƒ…å½¢. 
åŒæ—¶, åœ¨
\href{http://mirrors.ctan.org/info/lshort/chinese/lshort-zh-cn.pdf}{\textsf{lshort-zh-cn}}
ä¸­ä¹Ÿæ˜Žç¡®æåˆ°, \textbf{å¦‚éžä¸‡ä¸å¾—å·², å°½é‡ä¸è¦æ‰‹åŠ¨å®‰è£…å®åŒ…}. 
å›&nbsp;æ­¤åœ¨è¿™é‡Œæˆ‘åªä»‹ç»ä»Žæºå¤„å®‰è£…å®åŒ…çš„å‘½ä»¤. 
å‡è®¾ç”¨æˆ·æƒ³å®‰è£… \texttt{mcmthesis} å®åŒ…, åªéœ€åœ¨ \textsf{cmd} æ‰§è¡Œ
\begin{lstlisting}
  tlmgr install mcmthesis
\end{lstlisting}
éœ€è¦æ³¨æ„çš„æ˜¯, ç”¨æˆ·ä¸€å®šè¦æ¸…æ¥šæ‰€è¦å®‰è£…çš„å®åŒ…åç§°, å¹¶ä¸”åœ¨å®‰è£…å®åŒ…å‰å…ˆç¡®ä¿é•œåƒæºè®¾ç½®æ­£ç¡®.

\section{è°ƒå‡ºå®åŒ…æ‰‹å†Œ}

å½“æ­£ç¡®å®‰è£…åŽ,
ç”¨æˆ·å¯ä»¥è°ƒå‡ºå®åŒ…æ‰‹å†Œä»¥æŸ¥é˜…ç›¸åº”å†…å®¹.
ä¾‹å¦‚åœ¨ \textsf{cmd} æ‰§è¡Œ
\begin{lstlisting}
  texdoc texlive-zh-cn
\end{lstlisting}
æˆ–
\begin{lstlisting}
  texdoc lshort-zh-cn
\end{lstlisting}
å°±å¯åˆ†åˆ«è°ƒå‡º \texttt{texlive-zh-cn.pdf} å’Œ \texttt{lshort-zh-cn.pdf},
è¿™ä¸¤æœ¬æ‰‹å†Œä¸­éƒ½æœ‰è®²è§£å®‰è£…çš„ç›¸å…³å†…å®¹,
å»ºè®®ç”¨æˆ·é˜…è¯».

æœ¬æ‰‹å†Œä¸šå·²è¢« \TeX~Live æ”¶å½•,
è°ƒå‡ºæœ¬æ‰‹å†Œçš„å‘½ä»¤ä¸º
\begin{lstlisting}
  texdoc install-latex-guide-zh-cn
\end{lstlisting}

\section{ç¼–è¯‘æ–‡æ¡£}\label{sec:windows:compile}

å‡çº§å®åŒ…å®ŒæˆåŽ, ç”¨æˆ·å¯ä»¥ç¼–è¯‘æ–‡æ¡£. 
è¿™é‡Œä¾æ—§ä½¿ç”¨å‘½ä»¤è¡Œæ¥å®Œæˆè¿™ä¸€è¿‡ç¨‹. 

é¦–å…ˆ, ç”¨æˆ·éœ€è¦åœ¨æŒ‡å®šä½ç½®\footnote{ä»¥ä¸‹ç§°å·¥ä½œè·¯å¾„}å»ºç«‹ä¸€ä¸ª \texttt{tex} æ–‡ä»¶ï¼š
\begin{lstlisting}[deletekeywords = tex]
  mkdir D:\work-latex
  cd /d D:\work-latex
  notepad main.tex
\end{lstlisting}
%\begin{lstlisting}
%  Set-Location (New-Item -ItemType Directory -Path 'D:\work-latex' -Force)
%  notepad.exe main.tex
%\end{lstlisting}
ç¬¬ 1 è¡Œè¡¨ç¤ºåˆ›å»ºä¸€ä¸ªå·¥ä½œè·¯å¾„ \path{D:\work-latex},
ç¬¬ 2 è¡Œè¡¨ç¤ºè¿›å…¥å·¥ä½œè·¯å¾„, ç¬¬ 3 è¡Œè¡¨ç¤ºç”¨è®°äº‹æœ¬æ‰“å¼€ \texttt{main.tex} æ–‡ä»¶,
è‹¥æ–‡ä»¶ä¸å­˜åœ¨, ç³»ç»Ÿå°†è¯¢é—®ç”¨æˆ·æ˜¯å¦åˆ›å»ºè¯¥æ–‡ä»¶%
\footnote{Windows 11 å¯¹ä¸­æ–‡åå˜å¾—å‹å¥½ä¸€äº›äº†,
ä½†è¿™é‡Œä¸å»ºè®®ç”¨æˆ·ä½¿ç”¨ä¸­æ–‡å‘½åå·¥ä½œè·¯å¾„å’Œæ–‡ä»¶å}.
åœ¨æ‰“å¼€çš„è®°äº‹æœ¬ä¸­ç¼–å†™ä¸€ä¸ªæœ€å°ç¤ºä¾‹
\begin{lstlisting}[language = mwe]
  \documentclass{article}
  \begin{document}
    Hello \LaTeX\ World!
  \end{document}
\end{lstlisting}
ä¿å­˜å¹¶é€€å‡º. 
æŽ¥ä¸‹æ¥æ‰§è¡Œ
\begin{lstlisting}
  pdflatex main
\end{lstlisting}
ç­‰å¾…ç³»ç»Ÿå®Œæˆç¼–è¯‘è¿‡ç¨‹. 
å¾…ç¼–è¯‘å®ŒæˆåŽ, æˆ‘ä»¬å³å¯çœ‹åˆ°åœ¨ \path{D:\work-latex}
ä¸­å‡ºçŽ°äº† \texttt{main.pdf} æ–‡ä»¶å’Œå…¶ä»–åŒåçš„è¾…åŠ©æ–‡ä»¶
\texttt{main.aux} ä¸Ž \texttt{main.log}. 

å¯¹äºŽä¸­æ–‡æ–‡æ¡£, å¯ä»¥åœ¨è®°äº‹æœ¬ä¸­ç¼–å†™ä»¥ä¸‹æœ€å°ç¤ºä¾‹%
\footnote{è‡ª Windows 10 1903 ç‰ˆæœ¬å¼€å§‹, è®°äº‹æœ¬é»˜è®¤ä½¿ç”¨ UTF-8 ç¼–ç&nbsp;;
Windows 11 ç»§æ‰¿äº†è¿™ä¸ªç‰¹æ€§.
è‹¥ä½¿ç”¨å…¶ä»–ç¼–è¾‘å™¨,
è¯·æ³¨æ„è§„å®šæ–‡æ¡£ç¼–ç&nbsp;ä¸º UTF-8,
è¿™ä¸Ž
\href{http://mirrors.ctan.org/language/chinese/ctex/ctex.pdf#page6}{C\TeX\ å®é›†é»˜è®¤ä½¿ç”¨ \texttt{UTF8} é€‰é¡¹}%
æœ‰å…³}%
\begin{lstlisting}[language = mwe]
  \documentclass[fontset = windows]{ctexart}
  \begin{document}
    ä½&nbsp;å¥½ \LaTeX\ ä¸–ç•Œï¼
  \end{document}
\end{lstlisting}
ä¿å­˜å¹¶é€€å‡º.
æŽ¥ä¸‹æ¥æ‰§è¡Œ
\begin{lstlisting}
  xelatex main
\end{lstlisting}
ç­‰å¾…ç³»ç»Ÿå®Œæˆç¼–è¯‘è¿‡ç¨‹.
"xelatex" ç¼–è¯‘å‘½ä»¤é…åˆ UTF-8 ç¼–ç&nbsp;å’Œ "ctex"
å®é›†å·²ç»æ˜¯\textbf{ç›®å‰ä¸»æµçš„ä¸­æ–‡å¤„ç†æ‰‹æ®µ}.
"xelatex" å¯ä»¥ä½¿ç”¨ç³»ç»Ÿå†…å®‰è£…çš„å­—ä½“,
ç”¨æˆ·åœ¨å®‰è£…å­—ä½“æ—¶éœ€å³é”®å­—ä½“æ–‡ä»¶çš„å¿«æ·èœå• \menu{æ˜¾ç¤ºæ›´å¤šé€‰é¡¹ &gt; ä¸ºæ‰€æœ‰ç”¨æˆ·å®‰è£…}.

æ€»ç»“ä¸€ä¸‹, åœ¨ä½¿ç”¨ \LaTeX\ æ—¶, ç”¨æˆ·é¦–å…ˆè¦åœ¨å·¥ä½œè·¯å¾„%
\footnote{å»ºè®®ä¸åŒçš„å·¥ç¨‹æ”¾å…¥ä¸åŒçš„å·¥ä½œè·¯å¾„}%
ä¸­å»ºç«‹ä¸€ä¸ªå®Œæ•´çš„ \texttt{tex} æ–‡ä»¶%
\footnote{è¯¥æ–‡ä»¶å¿…é¡»åŒ…å« "\documentclass",
"\begin{document}" å’Œ
"\end{document}",
è¿™é‡Œä¸è®¨è®ºåŒ…å«å­æ–‡ä»¶çš„æƒ…å†µ,
æ–‡ä»¶åéœ€ä¸ºä¸å«ç©ºæ&nbsp;¼çš„è‹±æ–‡}.
å½“ \texttt{tex} æ–‡ä»¶å†…å®¹ç¡®å®šåŽ, å†ä¿å­˜æ–‡ä»¶å¹¶ä½¿ç”¨ç¼–è¯‘å‘½ä»¤%
\footnote{ç›®å‰å¸¸ç”¨çš„ç¼–è¯‘å‘½ä»¤ä¸º "pdflatex" å’Œ "xelatex"},
å°† \texttt{tex} æ–‡ä»¶ç¼–è¯‘æˆ \texttt{pdf} æ–‡ä»¶. 

ç¼–è¯‘å‘½ä»¤æœ‰å¾ˆå¤šå¯é€‰å‚æ•°, å¦‚ç”¨æˆ·èƒ½å¤Ÿä»Ž \texttt{pdf} æ–‡ä»¶è·³å›ž \texttt{tex} æ–‡ä»¶,
ä¾¿æ˜¯å›&nbsp;ä¸ºæ‰§è¡Œç¼–è¯‘æ—¶æ·»åŠ&nbsp;äº†å‚æ•°
\begin{lstlisting}
  pdflatex -synctex=1 main
\end{lstlisting}
æœ‰äº›ç¼–è¯‘è¿˜éœ€è¦é¢å¤–è°ƒç”¨ç³»ç»Ÿå‘½ä»¤,
ä¾‹å¦‚ä½¿ç”¨ \textsf{minted} åŒ…å°±æœ‰è¿™ç±»è¦æ±‚,
å›&nbsp;æ­¤å¯ä»¥åœ¨æ‰§è¡Œç¼–è¯‘æ—¶æ·»åŠ&nbsp;å‚æ•°
\begin{lstlisting}
  pdflatex -shell-escape main
\end{lstlisting}
æ­¤å¤–è¿˜æœ‰å¾ˆå¤šå…¶ä»–å‚æ•°, ç”¨æˆ·è‹¥æ„Ÿå…´è¶£, å¯è‡ªè¡Œé˜…è¯»æ‰‹å†Œ. 

åœ¨å¾ˆå¤šæ—¶å€™, æˆ‘ä¸ªäººæ›´å€¾å‘äºŽä½¿ç”¨ "latexmk" æ¥ç¼–è¯‘ \texttt{tex} æ–‡æ¡£,
å¦‚æ‰§è¡Œ
\begin{lstlisting}
  latexmk -pdf -synctex=1 -interaction=nonstopmode main
\end{lstlisting}
æ„å‘³ç€ä½¿ç”¨ 
\begin{lstlisting}
  pdflatex -synctex=1 -interaction=nonstopmode main
\end{lstlisting}
æ¥ç¼–è¯‘æ–‡æ¡£ \texttt{main.tex}, å¹¶åœ¨æœ‰éœ€è¦æ—¶å®Œæˆå…¶ä»–æ­¥éª¤%
\footnote{å¦‚ä½¿ç”¨ "bibtex" æˆ– "biblatex" å¤„ç†å‚è€ƒæ–‡çŒ®æ—¶éœ€è¦å¤šæ¬¡ç¼–è¯‘,
è¯¦æƒ…è§ç›¸å…³æ–‡æ¡£}. 

\subsection{\LaTeXe\ ç‰ˆæœ¬ä¸åŒ¹é…å¯¼è‡´ \texttt{xelatex} å¤±è´¥}

ä½¿ç”¨ "xelatex" ç¼–è¯‘æ–‡æ¡£,
ç³»ç»Ÿæœ‰æ—¶ä¼šæç¤ºç›®å‰ \LaTeXe\ çš„ç‰ˆæœ¬ä½ŽäºŽæŸå®åŒ…çš„è¦æ±‚ç‰ˆæœ¬.
è¿™ç§æƒ…å†µæ˜¯ç”±äºŽ \textsf{fmt} æ–‡ä»¶æœªèƒ½æ›´æ–°æ‰€å¯¼è‡´.
æ­¤æ—¶å¯è€ƒè™‘åœ¨å‘½ä»¤è¡Œè¿è¡Œ
\begin{lstlisting}
  fmtutil-user --byfmt xelatex
\end{lstlisting}
å¾…ç»“æŸåŽå†ç”¨ "xelatex" ç¼–è¯‘æ–‡æ¡£.
æ›´å¤šå†…å®¹å‚è€ƒ
\href{https://github.com/CTeX-org/forum/issues/70}{GitHub ä¸Šçš„è®¨è®º}.

å¦å¤–ä¹Ÿå¯è€ƒè™‘é‡è£… "xetex".
åœ¨å‘½ä»¤è¡Œæ‰§è¡Œ
\begin{lstlisting}
  tlmgr install --reinstall xetex
\end{lstlisting}

\subsection{ç¼–è¯‘å‡ºçŽ° \texttt{l3backend-*} é—®é¢˜}

è¿™æ˜¯ \texttt{fmt} æ–‡ä»¶æœªèƒ½æ›´æ–°æ‰€å¯¼è‡´çš„é—®é¢˜.
å¯ä»¥ç”¨
\begin{lstlisting}
  fmtutil-sys --all
\end{lstlisting}
åˆ·æ–° \texttt{fmt} æ–‡ä»¶åŽå†ç¼–è¯‘ \texttt{tex} æ–‡ä»¶.

\section{å¸è½½ \TeX~Live}

åœ¨è·¨ç‰ˆæœ¬å‡çº§ \TeX~Live æ—¶, é€šå¸¸éœ€è¦å¸è½½æ—§ç‰ˆ \TeX~Live.
ä¸‹é¢ä»‹ç»å‡&nbsp;ç§å¸è½½æ–¹æ³•.

\subsection{ä½¿ç”¨æ‰¹å¤„ç†æ–‡ä»¶}

åœ¨å‘½ä»¤è¡Œæ‰§è¡Œ
\begin{lstlisting}
  kpsewhich -var-value TEXMFROOT
\end{lstlisting}
å¯ä»¥æŸ¥çœ‹ \path{TEXMFROOT} çš„å€¼,
è¯¥å€¼å³ä¸º \TeX~Live çš„å®‰è£…è·¯å¾„%
\footnote{%
  é™¤è¿™é‡Œæä¾›çš„ \path{TEXMFROOT}, è¿˜æœ‰å¾ˆå¤šå…¶ä»–å˜é‡, å¯åœ¨
  \href{https://www.tug.org/texlive/doc/texlive-zh-cn/texlive-zh-cn.pdf}{texlive-zh-cn}
  ç¬¬ 2.3 èŠ‚å¤„æ‰¾åˆ°
}. 
æŽ¥ä¸‹æ¥,
ç”¨æˆ·åªéœ€æ‰§è¡Œ%
\footnote{åŒå‡»æˆ–åœ¨ \textsf{cmd} ä¸­è¿è¡Œ}%
å®‰è£…è·¯å¾„ä¸­çš„å¸è½½æ‰¹å¤„ç†æ–‡ä»¶å³å¯å®žçŽ°å¸è½½, å¦‚é»˜è®¤å®‰è£…æ—¶æ‰§è¡Œ
\begin{lstlisting}
  C:\texlive\2025\tlpkg\installer\uninst.bat
\end{lstlisting}
%\begin{lstlisting}
%  &amp; 'C:\texlive\2025\tlpkg\installer\uninst.bat'
%  Remove-Item -Recurse -Force -Path '$env:USERPROFILE\.texlive2025'
%\end{lstlisting}
ç»“æŸä»¥ä¸Šæ­¥éª¤åŽ,
æ‰‹åŠ¨åˆ&nbsp;é™¤ç”¨æˆ·æ–‡ä»¶å¤¹ä¸­çš„ \texttt{.texlive2025}.
å¦‚æžœç”¨æˆ·å®‰è£… \TeX~Live æ—¶éœ€è¦ç®¡ç†å‘˜æƒé™,
é‚£ä¹ˆåœ¨å¸è½½æ—¶åŒæ&nbsp;·éœ€è¦ç®¡ç†å‘˜æƒé™.

å¸è½½åŽ,
ç”¨æˆ·éœ€è¦æ¸…ç†æ³¨å†Œè¡¨
\begin{lstlisting}[language = {}]
  HKEY_CURRENT_USER\Software\Classes\TL.DVIOUT.view.2025
  HKEY_CURRENT_USER\Software\Classes\TL.TeXworks.edit.2025
  HKEY_CURRENT_USER\Software\Classes\TL.PSViewer.view.2025
  HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts\TL.TeXworks.edit.2025_.tex
\end{lstlisting}
ä½†è‹¥åœ¨å®‰è£…æ—¶ä½¿ç”¨ç®¡ç†å‘˜æƒé™``ä¸ºæ‰€æœ‰äººå®‰è£…'',
åˆ™æ³¨å†Œè¡¨ä½ç½®å°†å˜ä¸º
\begin{lstlisting}[language = {}]
  HKEY_LOCAL_MACHINE\SOFTWARE\Classes\TL.DVIOUT.view.2025
  HKEY_LOCAL_MACHINE\SOFTWARE\Classes\TL.TeXworks.edit.2025
  HKEY_LOCAL_MACHINE\SOFTWARE\Classes\TL.PSViewer.view.2025
\end{lstlisting}

\subsection{æ‰‹åŠ¨å¸è½½}

å¦‚æžœæ‰§è¡Œæ‰¹å¤„ç†æ–‡ä»¶ \texttt{uninst.bat} å‡ºé”™,
ç”¨æˆ·ä¹Ÿå¯æ‰‹åŠ¨åˆ&nbsp;é™¤å®‰è£…æ–‡ä»¶å¤¹,
ä¹‹åŽå†æ¸…ç† \TeX~Live çš„çŽ¯å¢ƒå˜é‡,
å¹¶ä¸”æ¸…ç†æ³¨å†Œè¡¨.

\section{è·¨ç‰ˆæœ¬å‡çº§ \TeX~Live}

ç›®å‰åœ¨ \href{https://www.tug.org/texlive/upgrade.html}{\texttt{tug.org}}
ä¸Šé¢æä¾›çš„è¯´æ³•æ˜¯:
Windows æ²¡æœ‰ç±»ä¼¼ Unix çš„å‡çº§ç¨‹åº,
éœ€è¦è¿›è¡Œæ–°å®‰è£…%
\footnote{åŽŸæ–‡æ˜¯: There is no comparable upgrade procedure for Windows.
  Doing a new installation is necessary.}.
</pre></body></html>