I am trying to figure how to use OPmac for Spanish documents because the easy setting of the structure document in plain TeX. However, using pdfcsplain
or xetex
/luatex
engines, I have no luck with the hyphenation patterns and I not sure of the best way to manage some UTF8 symbols, as I have little experience in plain TeX.
According to their web site, CSplain is designed for Czech and Slovak languages but it "is ready to load hyphenation patterns of 54 languages". although is not clear for me what is next. I guess that should be something like \esUnicode
and/or \eslang
but all my attempts have failed.
So, the first question is how to add Spanish hyphenation for these both minimal working examples:
For xetex/luatex:
\input opmac
\input ucode
\input cs-schola
\margins/1 a5 (4,5,1,1)cm
\typosize[12/14]
\parindent10pt\parskip1em
Fantástico, seguro que mañana vendré a tiempo.
\bye
As showed the image, the problem here is the lack of a hyphen in "mañana" (it should be "ma-ñana" or "maña-na), causing a overfull \hbox
. The same problem using pdfcsplain
and the default font:
\input opmac
\input utf8lat1
\margins/1 a5 (4,5,1,1)cm
\typosize[12/14]
\parindent10pt\parskip1em
Fantástico, seguro que mañana vendré a tiempo.
\bye
On the other hand, as showed above, any approach support accents (á, é, í, ... ) but some commom UTF8 symbols in Spanish documents (as ñ
,Ñ
,€
) and some others (as →
) are not. As far I can see, with xetex
or luatex
this can be solved with \input ucode
and a TeX Gyre font (e.g. \input cs-schola
):
\input opmac
\input ucode
\input cs-schola
Uno → Dos → Tres. Me darán 50 € y 24 ¢.
\bye
Whereas in pdfcsplain
with \input utf8lat1
I can use ñ
instead of \~n
but not ohters symbols as €
. Although these might be mapped as explained in the CSplain
page, that seem a very hard task if a need map too many:
\input opmac
\input utf8lat1
% To avoid
%WARNING: unknown UTF-8 code: `→ = ^^e2^^86^^92'
%WARNING: unknown UTF-8 code: `€ = ^^e2^^82^^ac'
%WARNING: unknown UTF-8 code: `ñ = ^^c3^^b1'
% WARNING: unknown UTF-8 code: `¢ = ^^c2^^a2'
\mubyte\eurochar ^^e2^^82^^ac\endmubyte%
\def\eurochar{{\eurofont e}}%
\font\eurofont=feymr10%
\mubyte\flecha ^^e2^^86^^92\endmubyte%
\def\flecha{$\rightarrow$}%
\mubyte\Cent ^^c2^^a2\endmubyte%
\def\Cent{céntimos}%
Uno → Dos → Tres. Mañana me darán 50 € y 24 ¢.
\bye
Without mapping the result will be:
Then, I wonder if respect the encoding there are some solution less restrictive (i.e., not limited to TeX Gyre fonts) or less laborious (i.e,, without mapping) to have the widest UTF8 spectrum available.
pdfcsplain
. – egreg Sep 8 '15 at 22:12