절차의 첫 번째 부분

절차의 첫 번째 부분

저는 매크로 패키지 AmS-TeX와 함께 TeX를 사용하고 있습니다. 단어가 올바른 방식으로 하이픈으로 연결되도록 이탈리아어에서 사용하고 싶습니다(예: 이탈리아어 단어 'distante'는 di-sante로 끊어야 합니다. 대신 TeX는 dis-tante로 끊어야 합니다. 영어 단어 '먼').

또한, 동일한 문서 내에서 다른 언어로 전환할 수 있나요? 그렇다면 어떻게?

나는 LaTeX에 대해서만 이 문제에 대한 해결책을 찾았습니다. 대신 TeX용 솔루션이 필요합니다.

답변1

절차의 첫 번째 부분

이 절차에서는 Unix 상자에서 TeX Live를 실행하고 있다고 가정합니다.

  1. 아무것도 덮어쓰지 않도록 작업 디렉토리로 이동하세요.

  2. bplain.cnf다음 줄을 포함하는 파일을 준비합니다.

    bplain pdftex language.dat -translate-file=cp227.tcx *bplain.ini
    
  3. 다음 명령줄을 실행하세요.

    fmtutil --cnffile bplain.cnf --fmtdir . --all
    
  4. 명령을 수행

    mv pdftex/bplain.fmt .
    
  5. matteo.tex아래에 표시된 테스트 파일을 처리하십시오 .

    pdftex -fmt bplain -output-format pdf matteo
    

여기 테스트 파일이 있습니다

% test file matteo.tex
% activate italian
\language\csname l@italian\endcsname
\lccode`'=`'
\righthyphenmin=2
%%%

\overfullrule=0pt % just for the example

\input amstex
\documentstyle{amsppt}

\topmatter
\title A paper\endtitle
\author Matteo\endauthor
\endtopmatter

\document

\vbox{\hsize=3pt\hskip0pt % show some hyphenations
 distante
 amicizia
 dell'amicizia
 ricordo
}

\enddocument

그리고 여기에 출력이 있습니다.

여기에 이미지 설명을 입력하세요

bplain.fmt이제 TeX Live가 찾을 수 있는 곳으로 이동할 수 있습니다 . 예를 들어

~/texmf/web2c/pdftex

(또는 ~/Library/texmf/web2c/pdftexMac OS X의 경우). 위의 명령줄은 모든 디렉터리에서 작동합니다.

굵게 말하면 3, 4단계와 마지막 bplain.fmt파일 이동까지 한 단계로 끝낼 수 있습니다.

fmtutil --cnffile bplain.cnf --fmtdir $(kpsewhich -var-value TEXMFHOME) --all

절차의 두 번째 부분

이제 작업 설정이 완료되었습니다. 파일 에 다음 별칭을 추가합니다 .bashrc.

alias bpdftex='pdftex -fmt bplain -output-format pdf'

그리고 새 셸을 열면 다음을 실행할 수 있습니다.

bpdftex matteo

언어 전환 방법을 보여주는 더 복잡한 예제 파일:

\catcode`@=11
\def\italian{%
  \language\l@italian
  \lccode`'=`'
  \righthyphenmin=2
}
\def\english{%
  \language\l@english
  \lccode`'=0
  \righthyphenmin=3
}
% you can add other languages, if you want
\catcode`@=12
\english % initialization
%%%

\overfullrule=0pt % just for the example

\input amstex
\documentstyle{amsppt}

\topmatter
\title A paper\endtitle
\author Matteo\endauthor
\endtopmatter

\document

% this will use English hyphenation
\vbox{\hsize=3pt\hskip0pt % show some hyphenations
 distance
 pleasure
 confidential
 record
}

\medskip\hrule\smallskip

\italian % this will use Italian hyphenation
\vbox{\hsize=3pt\hskip0pt % show some hyphenations
 distante
 amicizia
 dell'amicizia
 ricordo 
}

\enddocument

여기에 이미지 설명을 입력하세요

절차의 세 번째 부분

LaTeX로 전환

답변2

egreg를 시도해 볼 수도 있습니다.하이플레인Plain TeX의 형식입니다. 설치하는 데는 세 개의 파일만 필요하며 설명서는 두 페이지 분량의 전단지입니다.

관련 정보