Latex-希腊语

Latex-希腊语

我想用希腊语写一篇作业。我添加了以下命令:

\newcommand{\textgreek}[1]{\begingroup\fontencoding{LGR}\selectfont#1\endgroup}

\section*{\textgreek{Κείμενο}}

但这是错误的。

我还能做什么?

%This is a LaTeX template for homework assignments
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}

\begin{document}

\newcommand{\textgreek}[1]{\begingroup\fontencoding{LGR}\selectfont#1\endgroup}

\section*{\textgreek{Κείμενο}}
Name: \line(1,0){120} %you can change the length of the lines by changing the number in the curly brackets
\\Date: \line(1,0){120}

\subsection*{Instructions} %Enter instruction text here
Answer {\bf all} the questions and return to the teacher by the end of the week. Section A questions shouldn't cause you any trouble. Section B is designed to be more challenging.

\subsection*{Section A}

\begin{enumerate}%starts the numbering

\item Define the term 'minimal polynomial'.
\\\line(1,0){300}

\item Evaluate the following integral 
\begin{equation*}
\int_{2}^{x} \sinh{2y}\, \mathrm{d}y
\end{equation*}
in the case where:
    \begin{enumerate}
    \item $x = 5$
    \\\line(1,0){250}
    \\\line(1,0){250}
    \\\line(1,0){250}
    \item $x = 9$
    \\\line(1,0){250}
    \\\line(1,0){250}
    \\\line(1,0){250}
    \end{enumerate}

\item Find the determinant of the following 3x3 matrix:
\begin{figure}[h!]%This example matrix has been enclosed in a figure to give us more positioning options
\centering
\begin{math}
\begin{pmatrix}
1 & 6 & 4 \\
3 & 1 & 7 \\
9 & 4 & 5
\end{pmatrix}
\end{math}
\end{figure}
\\\line(1,0){300}
\\\line(1,0){300}
\\\line(1,0){300}

\end{enumerate}%ends the numbering

\subsection*{Section B}

\begin{enumerate}

\item Determine the following limit:
\begin{equation*}
\lim_{x \to +\infty} \frac{\sin{x}}{x^2}
\end{equation*}
\\\line(1,0){300}
\\\line(1,0){300}
\\\line(1,0){300}

\item Prove Pythagoras' Theorem.
\\\line(1,0){300}
\\\line(1,0){300}
\\\line(1,0){300}

\item Describe the Gram-Schmidt Algorithm.
\\\line(1,0){300}
\\\line(1,0){300}
\\\line(1,0){300}

\end{enumerate}

\end{document}

答案1

您必须加载babel;然后\textgreek命令已经提供。

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[greek,english]{babel}
\usepackage{amsmath}

\begin{document}

\section*{\textgreek{Κείμενο}}
\begin{tabular}{@{}ll@{}}
Name: & \line(1,0){120} \\
Date: & \line(1,0){120}
\end{tabular}

\subsection*{Instructions} %Enter instruction text here

Answer \textbf{all} the questions and return to the teacher by the end of the week. Section~A
questions shouldn't cause you any trouble. Section~B is designed to be more challenging.

\subsection*{Section A}

\end{document}

注意:\bf已经过时二十多年了;使用\textbf{all}和 而不是{\bf all};应该将和连接~起来以避免不必要的换行。我还添加了以对齐标题中的两行。Section~ASection~Btabular

在此处输入图片描述

答案2

如果使用 Babel,最好实际切换语言,不仅仅是脚本(或者更准确地说,字体编码).¹

-\section*{\textgreek{Κείμενο}}
+\section*{\foreignlanguage{greek}{Κείμενο}}

如果文档中使用的唯一语言是英语加上一些希腊语术语,那么你也可以不用 Babel:

\documentclass{article}
\usepackage{textalpha} % support for the Greek script
\begin{document}
\section*{\ensuregreek{Κείμενο}}
\end{document}

有关详细信息,请参阅巴别塔希腊语希腊方丹克包。

\textcyrillic¹由于希腊语和希腊字母共享名称,因此在使用西里尔字母的众多语言中选择一种的命令之间没有区别。

相关内容