Detailed process of installing MikTex and successfully compiling Chinese PPT template

Posted by bizshop on Sat, 29 Jan 2022 13:45:40 +0100

1 Introduction

This paper introduces in detail the whole process of installing MikTex to support Chinese in a new environment and successfully compiling ppt. Through reading this article, we can solve the problems of Chinese display and PPT compilation under LaTeX in a certain program.

2. Install MikTex

First, Download miktext( Official website download page ). The installation process is simple, and the next step is OK for normal installation.

3 compilation

Open TexWorks, enter the following, and then compile.

\documentclass[UTF8]{ctexart}
\author{UNION}
\title{This is a test}
\begin{document}
\maketitle
\end{document}

Due to the lack of many packages, the following dialog box will pop up to ask for installation.

Remove the Always show this dialog and click Install to install. Note that a dialog box requiring administrator permission will pop up. Click OK to install it automatically. The installation process will last for several minutes, and the contents displayed in the form will be as follows:

After the above configuration, the following contents can operate normally:

4. Configure PPT environment

Next, configure the PPT environment. First open TexWorks, enter the following content, and then compile.

\documentclass{beamer}
\usepackage[UTF8,noindent]{ctexcap}
% Warsaw
% PaloAlto
% AnnArbor
% Malmoe
\usepackage{CJKutf8}
\usetheme{Boadilla}
\useinnertheme{circles}
\useoutertheme[height=0\textwidth,width=0.18\textwidth,hideothersubsections]{sidebar}
% \useoutertheme{default}
\usecolortheme{whale}

% \newfontfamily\kaisu{STKaiti}       
%\setsansfont{TeX Gyre Termes}      
%\setCJKsansfont{SimSun}            
%\setCJKmonofont{STKaiti}
%\setmonofont{TeX Gyre Termes}   
%\setbeamerfont{frametitle}{family=\ttfamily}

\title{\LaTeX \texttt{A method of high speed operation}}
\subtitle{\textsc{--Symmetric encryption}}
\author{\texttt{Hao Wei}}
\institute{Anhui University of Technology}
\date{\texttt{\today}}
\begin{document}

\frame{\titlepage}

\begin{frame}{
	\textsc{Contents}}
    \tableofcontents
\end{frame}

\begin{frame}{Frame Title 1}{Subframe Title 1}
    \section{Frame Title 1}
    \subsection{Subframe Title 1} 

    \begin{block}{This is a formula}
        $$f(x)=\sum_{x=1}^N{\dfrac{1}{e^x(x+1)}}$$
    \end{block}
    Enter what you want to write here
\end{frame}

\begin{frame}{Frame Title 2}
    \section{Frame Title 2}
    \begin{proof}
        Write your proof process here
    \end{proof}
    Enter what you want to write here+1
\end{frame}

\begin{frame}{Frame title 3}
    \section{Frame title 3}
    Enter what you want to write here+1\par
    \begin{enumerate}
        \item<1->List your entries 1
        \item<2->List your entries 2
    \end{enumerate}
\end{frame}

\end{document}

Error in the first compilation. Check the log file C: \ users \ PC \ appdata \ local \ miktex \ miktex \ log \ miktex makepk Log, the last few lines are prompted as follows:

2021-06-16 07:28:29,447+0800 FATAL miktex-makepk - PK font mathkerncmssi8 could not be created.
2021-06-16 07:28:29,447+0800 FATAL miktex-makepk - PK font mathkerncmssi8 could not be created.
2021-06-16 07:28:29,447+0800 FATAL miktex-makepk - Info: 
2021-06-16 07:28:29,447+0800 FATAL miktex-makepk - Source: 
2021-06-16 07:28:29,447+0800 FATAL miktex-makepk - Line: 0

The font file mathkerncmssi8 should be missing. Check in the installation directory and find that the font file exists in the directory C: \ program files \ miktex \ fonts \ TFM \ public \ sansmathaccess. Obviously, the system font is not updated, so close TexWorks, open cmd (administrator permission), enter the program directory, and execute the following commands:

Microsoft Windows [Version 10.0.19042.804]
(c) 2020 Microsoft Corporation. All rights reserved.

C:\Users\pc>cd "C:\Program Files\MiKTeX\miktex\bin\x64"

C:\Program Files\MiKTeX\miktex\bin\x64>.\initexmf --mkmaps

C:\Program Files\MiKTeX\miktex\bin\x64>.\initexmf --update-fndb

C:\Program Files\MiKTeX\miktex\bin\x64>

After starting TexWorks again, it is compiled successfully.

5 Summary

This paper records in detail the main process of configuring MikTex in the new environment and the solutions to some problems. Through this article, I hope to solve problems for small partners who encounter the same problems.

reference material

[1] Error in latex compilation: PK font *** could not be created, https://www.cnblogs.com/kaikaikai/p/9014420.html
[2] MiKTeX Chinese supported solutions, https://blog.csdn.net/qq_34809033/article/details/80680280

Topics: Latex