summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/lualatex/luainputenc
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-11-05 21:44:00 +0000
committerKarl Berry <karl@freefriends.org>2010-11-05 21:44:00 +0000
commit3141b647e6510357f3d740e770fbf703151c17d2 (patch)
treed631de68229d96f7e42c4ac921833ade4806a56a /Master/texmf-dist/source/lualatex/luainputenc
parentb956eda8106b9fabf03d804cd2e9a9737463f213 (diff)
luainputenc v0.971 (4nov10)
git-svn-id: svn://tug.org/texlive/trunk@20326 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/lualatex/luainputenc')
-rw-r--r--Master/texmf-dist/source/lualatex/luainputenc/Makefile28
-rw-r--r--Master/texmf-dist/source/lualatex/luainputenc/luainputenc.dtx141
2 files changed, 122 insertions, 47 deletions
diff --git a/Master/texmf-dist/source/lualatex/luainputenc/Makefile b/Master/texmf-dist/source/lualatex/luainputenc/Makefile
index 1ff57d2c8ef..b6916247b5c 100644
--- a/Master/texmf-dist/source/lualatex/luainputenc/Makefile
+++ b/Master/texmf-dist/source/lualatex/luainputenc/Makefile
@@ -13,8 +13,8 @@ GENERATED = $(COMPILED) $(UNPACKED)
# Files grouped by installation location
UNPACKED_DOC = inputenc.sty.diff
-RUNFILES = $(filter-out $(UNPACKED_DOC), $(UNPACKED))
-DOCFILES = $(DOC) $(UNPACKED_DOC) README NEWS
+RUNFILES = $(filter-out $(UNPACKED_DOC) test.tex, $(UNPACKED))
+DOCFILES = $(DOC) $(UNPACKED_DOC) test.tex README NEWS
SRCFILES = $(DTX) Makefile
# The following definitions should be equivalent
@@ -33,25 +33,25 @@ TDS_ZIP = $(NAME).tds.zip
ZIPS = $(CTAN_ZIP) $(TDS_ZIP)
DO_TEX = tex --interaction=batchmode $< >/dev/null
-DO_PDFLATEX = pdflatex --interaction=batchmode $< >/dev/null
-DO_MAKEINDEX = makeindex -s gind.ist $(subst .dtx,,$<) >/dev/null 2>&1
+DO_LATEXMK = latexmk -silent $< >/dev/null
all: $(GENERATED)
doc: $(COMPILED)
unpack: $(UNPACKED)
-ctan: $(CTAN_ZIP)
+ctan: check $(CTAN_ZIP)
tds: $(TDS_ZIP)
world: all ctan
+.PHONY: all doc unpack ctan tds world check
-$(COMPILED): $(DTX)
- $(DO_PDFLATEX)
- $(DO_MAKEINDEX)
- $(DO_PDFLATEX)
- $(DO_PDFLATEX)
+%.pdf: %.dtx
+ $(DO_LATEXMK)
$(UNPACKED): $(DTX)
$(DO_TEX)
+check: $(UNPACKED)
+ lualatex --interaction=batchmode test.tex >/dev/null
+
$(CTAN_ZIP): $(SOURCE) $(COMPILED) $(TDS_ZIP)
@echo "Making $@ for CTAN upload."
@$(RM) -- $@
@@ -84,9 +84,11 @@ manifest:
@echo "Derived files:"
@for f in $(GENERATED); do echo $$f; done
-clean:
- @$(RM) -- *.log *.aux *.toc *.idx *.ind *.ilg
+clean:
+ @latexmk -silent -c *.dtx >/dev/null
+ @# for tex-only runs:
+ @$(RM) -- *.log
mrproper: clean
- @$(RM) -- $(GENERATED) $(ZIPS)
+ @$(RM) -- $(GENERATED) $(ZIPS) test.*
diff --git a/Master/texmf-dist/source/lualatex/luainputenc/luainputenc.dtx b/Master/texmf-dist/source/lualatex/luainputenc/luainputenc.dtx
index 2e149c53daa..53af6207aca 100644
--- a/Master/texmf-dist/source/lualatex/luainputenc/luainputenc.dtx
+++ b/Master/texmf-dist/source/lualatex/luainputenc/luainputenc.dtx
@@ -1,6 +1,8 @@
% \iffalse meta-comment
%
-% Copyright (C) 2009 by Elie Roux <elie.roux@telecom-bretagne.eu>
+% Written in 2009, 2010 by Manuel Pégourié-Gonnard and Élie Roux.
+% <mpg@elzevir.fr>
+% <elie.roux@telecom-bretagne.eu>
%
% This work is under the CC0 license. As an exception, the files
% luainputenc.sty, lutf8.def and lutf8x.def have more restrictions.
@@ -23,11 +25,6 @@
% Documentation:
% pdflatex luainputenc.dtx
%
-% The class ltxdoc loads the configuration file ltxdoc.cfg
-% if available. Here you can specify further options, e.g.
-% use A4 as paper format:
-% \PassOptionsToClass{a4paper}{article}
-%
%<*ignore>
\begingroup
\def\x{LaTeX2e}%
@@ -39,10 +36,6 @@
%</ignore>
%<*install>
\input docstrip.tex
-\Msg{************************************************************************}
-\Msg{* Installation}
-\Msg{* Package: luainputenc 2010/05/10 v0.97 inputenc package for LuaTeX}
-\Msg{************************************************************************}
\keepsilent
\askforoverwritefalse
@@ -52,7 +45,7 @@
\preamble
This is a generated file.
-Copyright (C) 2009 by Elie Roux <elie.roux@telecom-bretagne.eu>
+Written in 2009, 2010 by Manuel Pegourie-Gonnard and Elie Roux.
This work is under the CC0 license. As an exception, the files
luainputenc.sty, lutf8.def and lutf8x.def have more restrictions.
@@ -81,8 +74,10 @@ and the derived files
\file{lutf8x.def}{\from{luainputenc.dtx}{defx}}%
}
-% The following hacks are to generate a lua file with lua comments starting by
-% -- instead of %%
+\generate{%
+ \usedir{doc/luatex/luainputenc}%
+ \file{test.tex}{\from{luainputenc.dtx}{test}}%
+}
\def\MetaPrefix{-- }
@@ -126,14 +121,25 @@ and the derived files
%<package>
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{luainputenc}
-%<package> [2010/05/10 v0.97 inputenc package for LuaTeX]
+%<package> [2010/10/05 v0.971 inputenc package for LuaTeX]
%<package>
% \fi
%<*driver>
\documentclass{ltxdoc}
+\usepackage[utf8]{inputenc}
+\usepackage[T1]{fontenc}
+\usepackage{textcomp}
+\usepackage{lmodern}
+\usepackage{metalogo}
\usepackage[lmargin=5cm, textwidth=14cm]{geometry}
-\EnableCrossrefs
-\CodelineIndex
+\usepackage[bookmarks=true, colorlinks=true]{hyperref}
+\usepackage{bookmark}
+\usepackage[english]{babel}
+\providecommand\eTeX{e\TeX}
+\newcommand\pf{\textsf}
+\newcommand\file{\texorpdfstring{\nolinkurl}{}}
+\newcommand\code{\texttt}
+\newcommand*\email[1]{\href{mailto:#1}{#1}}
\begin{document}
\DocInput{luainputenc.dtx}%
\end{document}
@@ -158,21 +164,74 @@ and the derived files
% Grave accent \` Left brace \{ Vertical bar \|
% Right brace \} Tilde \~}
%
-% \GetFileInfo{luainputenc.sty}
-%
% \title{The \textsf{luainputenc} package}
-% \date{2010/05/10 v0.97}
-% \author{Elie Roux \\ \texttt{elie.roux@telecom-bretagne.eu}}
+% \date{2010/10/05 v0.971}
+% \author{%
+% Manuel P\'egouri\'e-Gonnard \email{mpg@elzevir.fr} \\
+% \'Elie Roux \email{elie.roux@telecom-bretagne.eu}}
%
% \maketitle
%
% \begin{abstract}
-% Input encoding management for Lua\TeX . For an introduction on this package
-% (among others), please refer to \texttt{luatex-reference.pdf}.
+% Input encoding management for Lua\TeX, needed only for compatibility with
+% old documents. For new documents, using UTF-8 encoding and Unicode fonts is
+% \emph{strongly} recommended. You've been warned!
% \end{abstract}
%
% \tableofcontents
%
+% \section{Overview: When (not) to use this package}
+%
+% This package is strictly meant for compatibility. It is usefull in the two
+% (overlapping) following cases:
+% \begin{enumerate}
+% \item You source is not encoded in UTF-8 and you don't want to reencode it
+% for some reason.
+% \item Your document is using legacy 8-bit fonts (with \pf{fontenc}), as
+% opposed to modern Unicode fonts (most probably with \pf{fontspec} or
+% \pf{luaotfload} and \pf{fontenc} with option \code{EU2}).
+% \end{enumerate}
+% Surprisingly enough, in the second case \pf{luainputenc} is needed, due to
+% the way \LaTeX\ implements font encodings.
+%
+% From the user point of view, adapting an old document for \LuaTeX\ is really
+% easy: replacing \pf{inputenc} by \pf{luainputenc} in the preamble is
+% enough.
+%
+% Note that \pf{luainputenc} automatically loads \pf{inputenc} if called
+% with an old engine, so you will still be able to compile your documents with
+% pdf\TeX\ without changing them.
+%
+% \pf{luainputenc} has several modes of operation. By default, is basically
+% turns \LuaTeX\ into an 8-bit engine, which means you loose half of the
+% benefits from using \LuaTeX. If you are using only Unicode fonts, you can
+% activate a nicer mode of operation using the \code{unactivate} package
+% option. That way, \LuaTeX\ remains a true Unicode engine.
+%
+% Unicode fonts with \LuaTeX\ are handled using a new encoding: \code{EU2}. It
+% is used internally by the \pf{fontspec} package when loading Unicode fonts.
+% This encoding is special as it needs non-ASCII characters to be non-active
+% (unlike other font encodings), so you cannot mix old encodings and EU2. If
+% you're using only Unicode fonts, this isn't a problem: use the
+% \code{unactivate} package option mentioned in the previous paragraph.
+%
+% But if you
+% want to use both 8-bit fonts and Unicode fonts in your document, you need to
+% use another package option, \code{lutf8x}. This option
+% overrides \LaTeX's mechanism for font encoding switching, so that it
+% (un)activates non-ASCII characters on-the-fly. With this options, you'll be
+% able change the font encoding from/to \code{EU2}, for example:
+%
+% \begin{verbatim}
+% abc
+% {
+% \fontencoding{EU2}\usefont
+% \font\foo="MyOtfFont.otf"\foo
+% abc
+% }
+% abc
+% \end{verbatim}
+%
% \section{Documentation}
%
% \subsection{Introduction}
@@ -207,15 +266,16 @@ and the derived files
% can keep the default behaviour, which will be compatible with pdfTeX in
% most cases, but you can consider the machinery obsolete.
%
-% For these old versions, \textsf{luainputenc} only changes the input behaviour, it does not change
-% the ouput behaviour (when files are written for example). The consequence is
-% that files will still be written by Lua\TeX\ in UTF-8 (fake UTF-8 in this
-% case), even if the asked input encoding is a 8-bit encoding. In most cases
-% it's not a problem, as most files will be written in LICR, meaning ASCII,
-% which is both 8-bit and UTF-8. The problem comes when characters with a
-% number $>$ 128 are written in a 8-bit encoding. This may happen if you use
-% |\protect| in a section for example. In these cases, Lua\TeX\ will write
-% fake UTF-8, and try to read 8-bit encoding, so it will get confused.
+% For these old versions, \textsf{luainputenc} only changes the input
+% behaviour, it does not change the ouput behaviour (when files are written
+% for example). The consequence is that files will still be written by
+% Lua\TeX\ in UTF-8 (fake UTF-8 in this case), even if the asked input
+% encoding is a 8-bit encoding. In most cases it's not a problem, as most
+% files will be written in LICR, meaning ASCII, which is both 8-bit and UTF-8.
+% The problem comes when characters with a number $>$ 128 are written in a
+% 8-bit encoding. This may happen if you use |\protect| in a section for
+% example. In these cases, Lua\TeX\ will write fake UTF-8, and try to read
+% 8-bit encoding, so it will get confused.
%
% The proposed solution is to unactivate the input conversion when we read
% certain files or extentions. This package should work with no change for
@@ -371,22 +431,22 @@ and the derived files
\RequirePackage{ifxetex}
\ifxetex
- \RequirePackage{xetex-inputenc}
\DeclareOption{unactivate}{\PassOptionsToPackage{utf8}{xetex-inputenc}}
\DeclareOption{lutf8}{\PassOptionsToPackage{utf8}{xetex-inputenc}}
\DeclareOption{lutf8x}{\PassOptionsToPackage{utf8}{xetex-inputenc}}
\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{xetex-inputenc}}
\ProcessOptions*
+ \RequirePackage{xetex-inputenc}
\expandafter\endinput
\fi
\ifluatex\else
- \RequirePackage{inputenc}
\DeclareOption{unactivate}{\PassOptionsToPackage{utf8}{inputenc}}
\DeclareOption{lutf8}{\PassOptionsToPackage{utf8}{inputenc}}
\DeclareOption{lutf8x}{\PassOptionsToPackage{utf8}{inputenc}}
\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{inputenc}}
\ProcessOptions*
+ \RequirePackage{inputenc}
\expandafter\endinput
\fi
@@ -397,7 +457,9 @@ and the derived files
%
% \begin{macrocode}
-\RequirePackage{luatextra}
+\RequirePackage{luatexbase}
+\RequirePackage{luatexbase-mcb}
+\RequirePackage{luatexbase-modutils}
\luatexUseModule{luainputenc}
@@ -1383,5 +1445,16 @@ end
%</lua>
% \fi
%
+% \section{Test file}
+%
+% Very minimal, just check that the package correctly loads.
+%
+% \begin{macrocode}
+%<*test>
+\RequirePackage{luainputenc}
+\stop
+%</test>
+% \end{macrocode}
+%
% \Finale
\endinput