Re: ギリシャ語の簡便な出力法(追加:キリル文字)

名前: 稲垣
日時: 2006-03-19 00:22:58
IPアドレス: 59.85.161.*

>>42117 41983 を少し拡張してみました。いずれも,ギリシア文字,キリル文字を利用するための 最低限の定義です。 コマンドは \mygreek,\mycyrillic で,それぞれの環境も定義しています。 X2 エンコーディングを使うことにより実質的に T2A,T2B,T2C を利用できるのではないか と思うのですがいかがでしょうか。\mytextxtwo このような方法で他の言語も Babel を介さずとも,基本的な機能を備えた多言語環境を築く ことも可能でしょうが,やはり,素直に Babel を利用するのがベストではないでしょうか。 % mygrcyr.sty % \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{mygrcyr}[2006/03/18] % Greek Computer Modern font definitions \newcommand*\mysetgreek{% \@ifundefined{l@greek}{% \PackageWarning{Mygrcyr}{Greek hyphenation undefined;\MessageBreak% Using no hyphenation \MessageBreak}% \let\l@greek\l@nohyphenation}{}% \usefont{MLGR}{cmr}{m}{n}% \language=\l@greek \lefthyphenmin\@ne \righthyphenmin\@ne% \catcode`\~=12% } \DeclareFontEncoding{MLGR}{}{} \DeclareFontFamily{MLGR}{cmr}{} \DeclareFontShape{MLGR}{cmr}{m}{n}{<-> grmn1000 }{} \DeclareFontShape{MLGR}{cmr}{m}{it}{<-> grmo1000 }{} \DeclareFontShape{MLGR}{cmr}{bx}{n}{<-> grxn1000 }{} \DeclareFontSubstitution{MLGR}{cmr}{m}{n} \DeclareTextFontCommand{\mytextgreek}{\mysetgreek} \newenvironment{mygreek}{\mysetgreek}{} % wnr Computer Modern Cyrillic font definitions \newcommand*\mysetcyrillic{% \@ifundefined{l@russian}{% \PackageWarning{Mygrcyr}{Russian hyphenation undefined;\MessageBreak% Using no hyphenation \MessageBreak}% \let\l@russian\l@nohyphenation}{}% \usefont{OT2}{cmr}{m}{n}% \language=\l@russian \lefthyphenmin\tw@ \righthyphenmin\tw@% \frenchspacing } \DeclareFontEncoding{OT2}{}{}% X2 \DeclareFontFamily{OT2}{cmr}{} \DeclareFontShape{OT2}{cmr}{m}{n}{<-> wnr10 }{} \DeclareFontShape{OT2}{cmr}{m}{it}{<-> wnti10 }{} \DeclareFontShape{OT2}{cmr}{bx}{n}{<-> wnbx10 }{} \DeclareFontSubstitution{OT2}{cmr}{m}{n} \DeclareTextFontCommand{\mytextcyrillic}{\mysetcyrillic} \newenvironment{mycyrillic}{\mysetcyrillic}{} % x2cmr Computer Modern Cyrillic font definitions \newcommand*\mysetxtwocyrillic{% \usefont{X2}{cmr}{m}{n}% } \IfFileExists{x2enc.def}{% \input{x2enc.def}}% {\PackageWarning{Mygrcyr}{Missing Encoding definition file `x2end.def'\MessageBreak}% } \DeclareFontEncoding{X2}{}{}% \DeclareFontFamily{X2}{cmr}{}% \DeclareFontShape{X2}{cmr}{m}{n}{<-> rxrm1000 }{} \DeclareFontShape{X2}{cmr}{m}{it}{<-> rxti1000 }{} \DeclareFontShape{X2}{cmr}{bx}{n}{<-> rxbx1000 }{} \DeclareFontSubstitution{X2}{cmr}{m}{n} \DeclareTextFontCommand{\mytextxtwo}{\mysetxtwocyrillic} \endinput サンプルです。 \documentclass{jsarticle} \usepackage[T1]{fontenc} \usepackage{mygrcyr} \begin{document} \section{英語} \begin{minipage}{.7\textwidth} \narrowbaselines \textbf{\large In} the beginning was the \textit{Word}, and the Word was with God, and the Word was God. He was in the beginning with God. All things came into being through him, and without him not one thing came into being. What has come into being in him was life, and the life was the light of all people. The light shines in the darkness, and the darkness did not overcome it. \end{minipage} \section{ギリシア語} \begin{minipage}{.7\textwidth} \narrowbaselines \begin{mygreek} \textbf{\large >En} >arq~h| ~>hn <o \textit{l'ogos}, ka`i <o l'ogos ~>hn pr`os t`on je'on, ka`i je`os ~>hn <o l'ogos. o~<utos ~>hn >en >arq~h| pr`os t`on je'on. p'anta di'' a>uto~u >eg'eneto, ka`i qwr`is a>uto~u >eg'eneto o>ud`e <'en. <`o g'egonen >en a>ut~w| zw`h ~>hn, ka`i <h zw`h ~>hn t`o f~ws t~wn >anjr'wpwn; ka`i t`o f~ws >en t~h| skot'ia| fa'inei, ka`i <h skot'ia a>ut`o o>u kat'elaben. \end{mygreek} \end{minipage} \section{ロシア語} \begin{minipage}{.7\textwidth} \narrowbaselines \begin{mycyrillic} \textbf{\large V} naqale bylo \textit{Slovo}, i Slovo bylo u Boga, i Slovo bylo Bog. Ono bylo v naqale u Boga. Vse qrez Nego n\'aqalo byt{p1}, i bez Nego niqto ne n\'aqalo byt{p1}, qto n\'aqalo byt{p1}. V Nem byla {zh}izn{p1}, i {zh}izn{p1} byla svet qelovekov. I svet vo t{p1}me svetit, i t{p1}ma ne ob{p2}{ya}la ego. \end{mycyrillic} \end{minipage} \bigskip \mytextxtwo{\CYRGUP{} \cyrgup} \end{document}

この書き込みへの返事:

お名前
題名 
メッセージ(タグは <a href="...">...</a> だけ使えます)