From b985ad19f4f15d7240a767cfeb2c985cff3d7c53 Mon Sep 17 00:00:00 2001 From: Robert Alessi Date: Sat, 1 Aug 2020 21:42:45 +0200 Subject: added Makefile in samples/ --- Makefile | 21 ++---- ekdosis.dtx | 209 ++++++++++++++++++++++++++++++++++++++++++++++++------- samples/Makefile | 26 +++++++ 3 files changed, 214 insertions(+), 42 deletions(-) create mode 100644 samples/Makefile diff --git a/Makefile b/Makefile index 1026fae..8a9009c 100644 --- a/Makefile +++ b/Makefile @@ -6,19 +6,11 @@ VERS = $(shell ltxfileinfo -v $(NAME).dtx|sed -e 's/^v//') LOCAL = $(shell kpsewhich --var-value TEXMFLOCAL) UTREE = $(shell kpsewhich --var-value TEXMFHOME) HOMEDIR := $$HOME +SAMPLES := samples exts := md html ins dtx el -texsamples := $(basename $(wildcard $(PWD)/samples/*.tex)) -texsamplesout := $(notdir $(basename $(wildcard $(PWD)/samples/*.tex))) findopts := $(foreach ext,$(exts),-or -iname "*.$(ext)") -define dosamples - $(CMP) --output-dir=$(PWD)/TMP --shell-escape $1 >/dev/null - $(CMP) --output-dir=$(PWD)/TMP --shell-escape $1 >/dev/null - $(CMP) --output-dir=$(PWD)/TMP --shell-escape $1 >/dev/null - $(CMP) --output-dir=$(PWD)/TMP --shell-escape $1 >/dev/null -endef - all: sty $(NAME).pdf sty: clean @@ -26,10 +18,7 @@ sty: clean $(NAME).pdf: $(NAME).dtx @ echo "Make the sample files first..." - if [ ! -d $(PWD)/TMP ]; then mkdir $(PWD)/TMP; fi - $(foreach file,$(texsamples), $(call dosamples, $(file))) - mv TMP/*.pdf samples/ - mv $(texsamplesout)-tei.xml samples/ + $(MAKE) --directory=$(SAMPLES) @ echo "Build the documentation of $(NAME)..." $(CMP) --shell-escape --recorder --interaction=batchmode $(NAME).dtx >/dev/null biber $(NAME) >/dev/null @@ -42,15 +31,13 @@ $(NAME).pdf: $(NAME).dtx $(CMP) --shell-escape --recorder --interaction=nonstopmode $(NAME).dtx > /dev/null samples: clean sty - if [ ! -d $(PWD)/TMP ]; then mkdir $(PWD)/TMP; fi - $(foreach file,$(texsamples), $(call dosamples, $(file))) - mv TMP/*{\.pdf,-tei\.xml} samples/ + $(MAKE) --directory=$(SAMPLES) clean: rm -rf auto rm -f $(NAME).bib $(PWD)/TMP/*.bib rm -rf .backup - find -iname "*~" -or -iname "*.pdf" | xargs rm -rf + find -iname "*~" -or -iname "*.pdf" -or -iname "*_out*.tex" | xargs rm -rf find ./* -type f -iname "Makefile" $(findopts) > ls-R find ./* -type f -iname "*.tex" | grep '/samples/' >> ls-R rsync -aPr --files-from=ls-R . .backup diff --git a/ekdosis.dtx b/ekdosis.dtx index 09c1503..702e27b 100644 --- a/ekdosis.dtx +++ b/ekdosis.dtx @@ -148,6 +148,25 @@ along with this program. If not, see date = {2020-07-13}, version = {3.47} } + +@Software{arabluatex, + title = {The Arabluatex package}, + titleaddon = {ArabTeX for LuaLaTeX}, + author = {Alessi, Robert}, + url = {http://ctan.org/pkg/arabluatex}, + date = {2020-03-23}, + version = {1.20} +} + +@Software{arabtex, + title = {The Arabtex package}, + titleaddon = {Macros and fonts for typesetting Arabic}, + author = {Lagally, Klaus}, + url = + {http://baobab.informatik.uni-stuttgart.de/ifi/bs/research/arab_e.html}, + date = {2004-03-11}, + version = {4.00} +} \end{filecontents} \begin{filecontents}[overwrite]{\jobname-cfg.tex} \footnotelayout{m} @@ -492,17 +511,19 @@ along with this program. If not, see % \metapick[print]{titletext} % \end{tcolorbox} % -% \begin{tcolorbox}[title=Notice to the Gentle Reader] -% The current state of this documentation covers the basics of -% \pkg{ekdosis}, namely what should be enough to start a new -% document and see how it works. v1.0 with a full documentation -% should be out by the end of July. Until then, there is a web page -% that can be accessed,\footnote{% -% \url{http://www.robertalessi.net/ekdosis}} with a mailing list -% that one can subscribe to and a section entitled -% \enquote{Literature} where one will find some slides and a paper -% submitted to a journal. -% \end{tcolorbox} +% \begin{comment} +% \begin{tcolorbox}[title=Notice to the Gentle Reader] +% The current state of this documentation covers the basics of +% \pkg{ekdosis}, namely what should be enough to start a new +% document and see how it works. v1.0 with a full documentation +% should be out by the end of July. Until then, there is a web +% page that can be accessed,\footnote{% +% \url{http://www.robertalessi.net/ekdosis}} with a mailing list +% that one can subscribe to and a section entitled +% \enquote{Literature} where one will find some slides and a paper +% submitted to a journal. +% \end{tcolorbox} +% \end{comment} % % \tableofcontents % \listoflistings @@ -2540,7 +2561,7 @@ argument of the % for languages that are written and read from right to left, like % Arabic, Hebrew or Syriac. However, as \pkg{babel} is supported and % can be loaded concurrently with \pkg{polyglossia}, an easy way is to -% always use \pkg{babel} to print such languages. +% use \pkg{babel} to print such languages. % % \danger The reader is invited to refer to and become acquainted with % the relevant parts of the documentation of the \pkg{babel} @@ -2580,13 +2601,13 @@ argument of the % when \cs{babelfont} is used. % \item Line~3 loads \pkg{babel} and instructs it to use English as % the default language and ancient Greek as a second optional -% language. As can be seen, the built-in |bidi| mechanism provided -% by \pkg{babel} is not enabled. As a result, specific language -% switching commands for Arabic must be defined just as it must be -% for every other language. +% language. The built-in |bidi| mechanism provided by \pkg{babel} is +% not enabled. As a result, specific language switching commands for +% Arabic must be defined just as it must be for every other +% language. % \item Line~4 does not load any Arabic, but instructs \pkg{babel} -% that it should use the Arabic font that is set with \cs{babelfont} -% whenever an Arabic letter is encountered. +% that it should use the Arabic font that is set below with +% \cs{babelfont} whenever an Arabic letter is encountered. % \item Lines~6--8 select the fonts: |Old Standard| is the default % font to be used for Roman shape (l.~6); the same font is used for % Greek, with some additional Open Type features enabled; finally, @@ -2600,10 +2621,10 @@ argument of the % \item Finally, lines~13--14 define simple language switching % commands for Arabic. As can be seen, no commands other than the % \LuaTeX\ primitives \cs{pardir} and \cs{textdir} have been used -% for \pkg{babel} takes care of selecting the Arabic font. \cs{RL} -% is for short insertions of Arabic words in English paragraphs -% while \cs{begin}|{Arabic}| \dots\ \cs{end}|{Arabic}| is for -% running paragraphs of Arabic text. +% for \pkg{babel} already takes care of selecting the Arabic +% font. \cs{RL} is for short insertions of Arabic words in English +% paragraphs while \cs{begin}|{Arabic}| \dots\ \cs{end}|{Arabic}| is +% for running paragraphs of Arabic text. % \end{remarks} % % \paragraph{Changing the Writing Direction} @@ -2681,7 +2702,7 @@ argument of the % % It should be reminded that the writing direction of the apparatus % criticus itself is independent of that of the edition text and must -% be set either with \cs{Set(LTR{\textbar}RTL)app}, with the +% be set either with \cs{Set(LTR{\textbar}RTL)app} or with the % |direction| optional argument of \cs{SetApparatus} for single-layer % apparatus criticus, or by means of \cs{DeclareApparatus} for % multiple-layer apparatus criticus.\footnote{See above @@ -2689,7 +2710,7 @@ argument of the % \vref{sec:multilayer-apparatus} (multiple-layer apparatus % criticus).} % -% PDF output with left-to-right apparatus criticus:--- +% The PDF output with left-to-right apparatus criticus follows:--- % \medskip % \resetlinenumber % \begin{alignment}[flush,tcols=1,texts=specimen,apparatus=specimen] @@ -2703,7 +2724,7 @@ argument of the % \end{specimen} % \end{alignment} % -% PDF output with right-to-left apparatus criticus:--- +% And here is the PDF output with right-to-left apparatus criticus:--- % \medskip % \resetlinenumber % \begin{alignment}[flush,tcols=1,texts=specimen,apparatus=specimen] @@ -2720,6 +2741,94 @@ argument of the % % \subsection{Using \pkg{arabluatex}} % \label{sec:using-arabluatex} +% \pkg{arabluatex} is a \hologo{LuaLaTeX} package that provides +% commands and environments which return Arabic writing from an ASCII +% transliteration (either Arab\TeX\ or Buckwalter +% schemes).\footcite{arabluatex} It is particularly well-suited for +% complex documents such as critical editions where a lot of commands +% intertwine with Arabic writing. \pkg{arabluatex} can output Unicode +% Arabic in the same modes as \pkg{arabtex}\footcite{arabtex} or in +% different accepted standards of romanization. It is also able to +% produce a duplicate of the original |.tex| source file in which all +% |arabtex| or |buckwalter| strings will have been replaced with +% Unicode equivalents, either in Arabic script or in any accepted +% standard of transliteration.\footcite[See][\mkbibquote{Exporting +% Unicode Arabic to an External File}]{arabluatex} +% +% \pkg{arabluatex} is fully supported by \pkg{ekdosis}. The following +% example illustrates how \pkg{arabluatex} and \pkg{ekdosis} interact +% with each other to produce distinct \texttt{TEI xml} outputs from a +% single |.tex| source file:--- +% +% \captof{\pkg{ekdosis} and \pkg{arabluatex}}[\label{lst:arabluatex-ekd}] +% \iffalse +%<*example> +% \fi +\begin{minted}{latex} +% Preamble: +% load ekdosis and ask for TEI xml output: +\usepackage[teiexport]{ekdosis} +% load arabluatex and ask for LaTeX ouput with Unicode Arabic: +\usepackage[export,fullvoc]{arabluatex} + +% document: +\begin{arabexport} % export arabtex strings to Unicode Arabic + \begin{ekdosis} + \begin{arab} + 'inna 'abI kAna mina + \app{ + \lem{'l-muqAtilaTi} + \rdg{'l-muqAtilIna} + } + wa-kAnat 'ummI min `u.zamA'i buyUti 'l-zamAzimaTi. + \end{arab} + \end{ekdosis} +\end{arabexport} +\end{minted} +% \iffalse +% +% \fi +% +% The PDF output with left-to-right apparatus criticus is of course +% the same as above:--- +% \resetlinenumber +% \begin{alignment}[flush,tcols=1,texts=specimen,apparatus=specimen] +% \begin{specimen} +% \begin{arab}[fullvoc] +% 'inna 'abI kAna mina \app[type=ltr]{ +% \lem{'l-muqAtilaTi} +% \rdg{'l-muqAtilIna}} +% wa-kAnat 'ummI min `u.zamA'i buyUti 'l-zamAzimaTi. +% \end{arab} +% \end{specimen} +% \end{alignment} +% +% However, assuming that the source file is called |source.tex|, +% \pkg{ekdosis} produces as instructed from this file an additional +% |source-tei.xml| as follows:--- +% +% \iffalse +%<*example> +% \fi +\begin{minted}[linenos=false]{xml} +

'inna 'abI kAna mina + + 'l-muqAtilaTi + 'l-muqAtilIna +wa-kAnat 'ummI min `u.zamA'i buyUti +'l-zamAzimaTi.

+\end{minted} +% \iffalse +% +% \fi +% +% While \pkg{arabluatex} is instructed to produce on his own from the +% same |source.tex| an additional |source_out.tex| in which all +% |arabtex| strings found within \cs{begin}|{arabexport}| \dots\ +% \cs{end}|{arabexport}| (see \vref{lst:arabluatex-ekd}, ll.~9--19) +% are replaced with full-vocalized Arabic Unicode strings. +% % % % \section{To Be Continued...} @@ -6546,4 +6655,54 @@ end % \label{sec:caesar-gw-tei} % \inputminted[linenos=false]{xml}{samples/Caesar_BG-6-13-1-tei.xml} % +% \section{Arabic Sample File} +% \label{sec:arabic-sample} +% |arabic-sample.tex|:--- +% \iffalse +%<*example> +% \fi +\begin{minted}[linenos=false]{latex} +% Instructions: +% 1. Compile this file three times. +% - Open arabic-sample.pdf and arabic-sample-tei.xml and see the +% result. +% 2. Compile arabic-sample_out.tex three times. +% - Open arabic-sample_out.pdf and arabic-sample-out-tei.xml and +% see the result. +% +\documentclass{article} + +% The following three lines is only needed by the +% 'arabic-sample_out.tex' that arabluatex is instructed to produce: +\usepackage{babel} +\babelprovide[onchar=fonts]{arabic} +\babelfont[*arabic]{rm}{Amiri} + +% instruct ekdosis to output TEI xml (arabic-sample-tei.xml): +\usepackage[teiexport=tidy]{ekdosis} + +% instruct arabluatex to ouput sample-arabic_out.tex with Unicode +% Arabic strings in place of arabtex ASCII scheme: +\usepackage[fullvoc,export]{arabluatex} + +\begin{document} + +\begin{arabexport} % export arabtex strings to Unicode Arabic + \begin{ekdosis} + \begin{arab} + 'inna 'abI kAna mina + \app{ + \lem{'l-muqAtilaTi} + \rdg{'l-muqAtilIna} + } + wa-kAnat 'ummI min `u.zamA'i buyUti 'l-zamAzimaTi. + \end{arab} + \end{ekdosis} +\end{arabexport} +\end{document} +\end{minted} +% \iffalse +% +% \fi +% \endinput diff --git a/samples/Makefile b/samples/Makefile new file mode 100644 index 0000000..518ec87 --- /dev/null +++ b/samples/Makefile @@ -0,0 +1,26 @@ +SHELL = bash +CMP = lualatex-dev +PWD = $(shell pwd) + +exts := .tex .pdf -tei.xml +texsamples := $(basename $(wildcard $(PWD)/*.tex)) +findopts := $(foreach ext,$(exts),-or -iname "*$(ext)") + +define dosamples + $(CMP) --shell-escape $1 >/dev/null + $(CMP) --shell-escape $1 >/dev/null + $(CMP) --shell-escape $1 >/dev/null + $(CMP) --shell-escape $1 >/dev/null +endef + + +all: + cp ../ekdosis.{lua,sty} . + $(foreach file,$(texsamples), $(call dosamples, $(file))) + rm -rf auto + find -iname "*~" -or -iname "*_out*.tex" | xargs rm -rf + find ./* -type f -iname "Makefile" $(findopts) > ls-R + rsync -aPr --files-from=ls-R . .backup + rm -rf * + cp -p -r .backup/* . + rm -rf .backup -- cgit v1.2.3