
Atualizei um pouco o texto, devido ao comentário do Mico (em relação a todas ou apenas algumas ligaduras)
estou usando o pacoteparacolcom XeLaTeX, tendo criado duas colunas, e estou usando ligaduras. Desejo desativar as ligaduras raras e históricas da segunda coluna e mantê-las na primeira (pelo menos por enquanto). As ligaduras comuns, comoaff,fi, e assim por diante, devem permanecer.
Pergunta: qual é a maneira mais rápida e fácil de conseguir isso?
Atualização extra: adicionada outra coisa específica que se enquadra na questão principal: Depois de resolvido o primeiro assunto (ou seja, na segunda coluna só são permitidas as ligaduras comuns),como então proceder para desabilitar certas ligaduras específicas na primeira coluna? Quero dizer o seguinte: sim, desejo ter ligaduras históricas e raras para a primeira coluna, exceto algumas específicas, como a duplaahmas especialmente aqueles com duas consoantes unidas (comogrekre assim por diante).
ATUALIZADO COM CÓDIGO (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}
Responder1
Aqui está uma maneira semiautomática de fazer isso. É semiautomático porque em alguns ambientes você precisará alterar a fonte manualmente. O paracol
pacote é muito complexo e não fornece ganchos para definir a fonte por coluna.
Este código funciona automaticamente para os seguintes ambientes:
- ambiente simples usando
\switchcolumn
{leftcolumm}
e{rightcolumn}
ambientes- versões com estrela desses comandos/ambientes
Para outros ambientes, como notas de rodapé, tabelas e figuras, forneci um comando que define automaticamente a fonte do número da coluna atual:
\setcolfont
Por exemplo:
\footnote{\setcolfont Footnote text}
Se eu descobrir uma maneira de fazer isso de forma mais automática, atualizarei a resposta.
\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}
Adaptando-se ao selnolig
pacote de uso
Se você deseja ter um controle mais preciso sobre as ligaduras no texto, você pode usar o selnolig
pacote do Mico para desativar seletivamente algumas ligaduras. Isso requer que o LuaTeX seja executado. Não há como desativar as ligaduras seletivamente por coluna, parece que os \nolig
comandos são efetivamente globais. (Veja os comentários de Mico abaixo.)
Responder2
A resposta a seguir baseia-se em uma versão anterior da resposta de @AlanMunn (excluída temporariamente e reinstaurada posteriormente). Ou seja, mantenho o uso de etoolbox
máquinas para empregar fontes separadas para as colunas da esquerda e da direita. Além disso, mudo de XeLaTeX para LuaLaTeX para poder fazer uso doselnoligpacote, que fornece um método para desabilitar globalmente algumas das ligaduras do Junicode , como aquelas para aa
, al
, an
e . (Divulgação completa: sou o autor principal deste pacote.)ar
av
Acredito que mudar de XeLaTeX para LuaLaTeX não será uma tarefa difícil para você.
\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}