
Mico のコメントにより、テキストを少し更新しました (すべての合字または一部の合字について)
私はパッケージを使用していますパラコルXeLaTeXで2つの列を作成し、合字を使用しています。2番目の列では珍しい合字と歴史的な合字を無効にし、最初の列では(少なくとも今のところは)そのままにしておきたいと思います。一般的な合字、例えばff、フィ、などは残っていなければなりません。
質問: それを達成する最も速くて簡単な方法は何ですか?
追加アップデート: メインの質問に該当する別の具体的な事項を追加しました最初の問題が解決された後(つまり、2列目では一般的な合字のみが許可されます)、では、最初の列の特定の合字を無効にするにはどうすればよいでしょうか。? つまり、最初の列には、ダブルなどのいくつかの特定のものを除いて、歴史的で珍しい合字を使いたいのです。ああしかし、特に2つの子音が結合したもの(例えばグラムそして韓国語など)。
コードを更新しました (2017 年 4 月 29 日):
\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
のJunicode の合字の一部をグローバルに無効にする方法を提供します。(完全な開示: 私はこのパッケージの主な作成者です。)al
an
ar
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}