
Mico의 의견에 따라 텍스트를 약간 업데이트했습니다(합자 전체 또는 일부에만 관련).
패키지를 사용하고 있어요파라콜XeLaTeX를 사용하여 두 개의 열을 만들었고 합자를 사용하고 있습니다. 나는 두 번째 열에 대한 희귀하고 역사적인 합자를 비활성화하고 첫 번째 열에 대해 이를 유지하고 싶습니다(적어도 지금은). 다음과 같은 공통 합자ff,fi등은 그대로 유지되어야 합니다.
질문: 이를 달성하는 가장 빠르고 쉬운 방법은 무엇입니까?
추가 업데이트: 주요 질문에 해당하는 또 다른 구체적인 내용을 추가했습니다.: 첫 번째 문제가 해결된 후(즉, 두 번째 열에서는 공통 합자만 허용됨)그러면 첫 번째 열에서 특정 특정 합자를 비활성화하려면 어떻게 진행합니까?? 내 말은 이렇습니다: 예, 이중 열과 같은 몇 가지 특정 항목을 제외하고 첫 번째 열에 대해 역사적이고 희귀한 합자를 갖고 싶습니다.아아특히 두 개의 자음이 결합된 것(예:gr그리고크르기타 등등).
코드로 업데이트됨(29-4-17):
\documentclass[12pt, a4paper, titlepage]{book}
\usepackage{paracol}
\usepackage{lipsum}
\usepackage{polyglossia}
\setmainlanguage{english}
\setmainfont[Ligature=Historic,Ligature=Rare]{Junicode}
\title{Title}
\author{Author}
\begin{document}
\frontmatter
\begin{titlepage}
\maketitle
\thispagestyle{empty}
\end{titlepage}
\chapter{Foreword}
\begin{paracol}{2}
%% here starts the first column; while I wish to use the rare and
% historic ligatures in this first column, here I wish to disable e.g.
% „gr” and „kr”
\lipsum
\switchcolumn
%% having switched, here, for the second column, I want to disable the
% rare and historic ligatures, keep the common ones (ff, fi, etc.), and still use the
% same font as in the first, while the first column keeps all ligatures
% as it is
\lipsum
\end{paracol}
\end{document}
답변1
이를 수행하는 반자동 방법이 있습니다. 일부 환경에서는 글꼴을 수동으로 변경해야 하기 때문에 반자동입니다. 패키지 paracol
는 매우 복잡하며 열별로 글꼴을 설정하는 후크를 제공하지 않습니다.
이 코드는 다음 환경에서 자동으로 작동합니다.
- 간단한 환경을 사용하여
\switchcolumn
{leftcolumm}
및{rightcolumn}
환경- 이 명령/환경의 별표 표시된 버전
각주, 표, 그림과 같은 다른 환경의 경우 현재 열 번호의 글꼴을 자동으로 설정하는 명령을 제공했습니다.
\setcolfont
예를 들어:
\footnote{\setcolfont Footnote text}
더 자동으로 수행하는 방법을 찾으면 답변을 업데이트하겠습니다.
\documentclass{article}
\usepackage{paracol}
\usepackage{fontspec}
\usepackage{etoolbox}
% Define font families for Col 0 and Col 1
% Add more for more column documents if needed
\expandafter\newfontfamily\csname juni0\endcsname[Ligatures={Historic,Rare}]{Junicode}
\expandafter\newfontfamily\csname juni1\endcsname[]{Junicode}
% The following commands are added for convenience in case each font is needed elsewhere
% They also make the environment patching code more readable
\newfontfamily\junicodeHistoric[Ligatures={Historic,Rare}]{Junicode}
\newfontfamily\junicodeNoLig[]{Junicode}
% Patch the right and left column environments
\AtBeginEnvironment{leftcolumn}{\junicodeHistoric}
\AtBeginEnvironment{leftcolumn*}{\junicodeHistoric}
\AtBeginEnvironment{rightcolumn}{\junicodeNoLig}
\AtBeginEnvironment{rightcolumn*}{\junicodeNoLig}
\makeatletter
% Define a command to set the font to the current column number
\newcommand{\setcolfont}{%
\csname juni\number\pcol@currcol\endcsname%
}
%% Optional code for use with selnolig
%\usepackage{selnolig}
%% Define global noligs
%\nolig{aa}{a|a} % Examples change as needed
%\nolig{al}{a|l}
%\nolig{an}{a|n}
%\nolig{ar}{a|r}
%\nolig{av}{a|v}
%% End optional code for selnolig
% Patch the \switchcolumn command and paracol environments to set the column font
\appto{\pcol@switchcol}{\setcolfont}{}{}
\preto{\paracol}{\setcolfont}{}{}
\makeatother
\usepackage[]{kantlipsum}
\begin{document}
\begin{paracol}{2}
% Test with switchcolumn
Ideal\kant[1]
\switchcolumn
After\kant[1]
% Test with leftcolumn/rightcolumn
\begin{leftcolumn}
\kant[2]%
% Footnotes need to have explicit \setcolfont commands
\footnote{\setcolfont
This is a left column footnote.}
\end{leftcolumn}
\begin{rightcolumn}
\kant[2]%
\footnote{\setcolfont
This is a right column footnote.}
\end{rightcolumn}
\switchcolumn*
\kant[3]
% Tables/figures need to have explicit \setcolfont commands
\begin{table}[tbp]
\setcolfont
This is a left column table. Ideal It is set in the left font.
\end{table}
\switchcolumn
\kant[3]
\end{paracol}
\end{document}
selnolig
패키지 사용에 적응
텍스트의 합자를 더 세밀하게 제어하려면 Mico selnolig
패키지를 사용하여 일부 합자를 선택적으로 끌 수 있습니다. 이를 실행하려면 LuaTeX가 필요합니다. 열별로 합자를 선택적으로 끌 수 있는 방법은 없습니다. \nolig
명령이 사실상 전역적으로 적용되는 것 같습니다. (아래 Mico의 의견을 참조하세요.)
답변2
다음 답변은 @AlanMunn의 (일시적으로 삭제되었다가 나중에 복원됨) 답변의 초기 버전을 기반으로 작성되었습니다. 즉, etoolbox
왼쪽 열과 오른쪽 열에 별도의 글꼴을 사용하기 위해 기계 사용을 유지합니다 . 또한 XeLaTeX를 LuaLaTeX로 전환하여셀놀릭aa
, al
, an
및 ar
와 같은 일부 Junicode 합자를 전역적으로 비활성화하는 방법을 제공하는 패키지입니다 av
. (전체 공개: 저는 이 패키지의 주요 작성자입니다.)
나는 XeLaTeX에서 LuaLaTeX로 전환하는 것이 여러분에게 큰 작업이 아닐 것이라고 믿습니다.
\documentclass{article}
\usepackage{polyglossia}
\setmainlanguage{english}
\usepackage{paracol,fontspec}
\newfontfamily\junicodeHistoric[Ligatures={Historic,Rare}]{Junicode}
\newfontfamily\junicodeNoLig[]{Junicode}
\usepackage{etoolbox}
\AtBeginEnvironment{leftcolumn}{\junicodeHistoric}
\AtBeginEnvironment{rightcolumn}{\junicodeNoLig}
\usepackage{kantlipsum}
\usepackage{selnolig} % must be used with LuaLaTeX
\debugon % optional -- leave an activity trail in log file
% Globally suppress the following ligatures:
\nolig{aa}{a|a}
\nolig{al}{a|l}
\nolig{an}{a|n}
\nolig{ar}{a|r}
\nolig{av}{a|v}
% feel free to provide further \nolig directives...
\begin{document}
\begin{paracol}{2}
\begin{leftcolumn}
\kant[1]
\end{leftcolumn}
\begin{rightcolumn}
\kant[1]
\end{rightcolumn}
\end{paracol}
\end{document}