diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /info/examples/lwc/apc |
Initial commit
Diffstat (limited to 'info/examples/lwc/apc')
-rw-r--r-- | info/examples/lwc/apc/ISOcyr1.pen | 84 | ||||
-rw-r--r-- | info/examples/lwc/apc/README.apc | 33 | ||||
-rw-r--r-- | info/examples/lwc/apc/invitation.sty | 46 | ||||
-rw-r--r-- | info/examples/lwc/apc/invitationfr.dtd | 14 | ||||
-rw-r--r-- | info/examples/lwc/apc/invitationfr.tex | 25 | ||||
-rw-r--r-- | info/examples/lwc/apc/invitationfr.xml | 30 | ||||
-rw-r--r-- | info/examples/lwc/apc/invitationfrraw.tex | 25 | ||||
-rw-r--r-- | info/examples/lwc/apc/invlat1fr.xsl | 66 | ||||
-rw-r--r-- | info/examples/lwc/apc/utf8.html | 39 | ||||
-rw-r--r-- | info/examples/lwc/apc/utf8.xml | 33 | ||||
-rw-r--r-- | info/examples/lwc/apc/utf8.xsl | 39 | ||||
-rw-r--r-- | info/examples/lwc/apc/utf8raw.html | 35 |
12 files changed, 469 insertions, 0 deletions
diff --git a/info/examples/lwc/apc/ISOcyr1.pen b/info/examples/lwc/apc/ISOcyr1.pen new file mode 100644 index 0000000000..e8248d41b7 --- /dev/null +++ b/info/examples/lwc/apc/ISOcyr1.pen @@ -0,0 +1,84 @@ +<!-- (C) International Organization for Standardization 1986 + Permission to copy in any form is granted for use with + conforming SGML systems and applications as defined in + ISO 8879, provided this notice is included in all copies. +--> +<!-- Character entity set. Typical invocation: + <!ENTITY % ISOcyr1 PUBLIC + "ISO 8879-1986//ENTITIES Russian Cyrillic//EN//XML"> + %ISOcyr1; +--> +<!-- This version of the entity set can be used with any SGML document + which uses ISO 10646 as its document character set. + This includes XML documents and ISO HTML documents. + + Version created from ISO set on 11/11/98 (mg) +--> +<!ENTITY acy "а"> <!--small a, Cyrillic --> +<!ENTITY Acy "А"> <!--capital A, Cyrillic --> +<!ENTITY bcy "б"> <!--small be, Cyrillic --> +<!ENTITY Bcy "Б"> <!--capital BE, Cyrillic --> +<!ENTITY vcy "в"> <!--small ve, Cyrillic --> +<!ENTITY Vcy "В"> <!--capital VE, Cyrillic --> +<!ENTITY gcy "г"> <!--small ghe, Cyrillic --> +<!ENTITY Gcy "Г"> <!--capital GHE, Cyrillic --> +<!ENTITY dcy "д"> <!--small de, Cyrillic --> +<!ENTITY Dcy "Д"> <!--capital DE, Cyrillic --> +<!ENTITY iecy "е"> <!--small ie, Cyrillic --> +<!ENTITY IEcy "Е"> <!--capital IE, Cyrillic --> +<!ENTITY iocy "ё"> <!--small io, Russian --> +<!ENTITY IOcy "Ё"> <!--capital IO, Russian --> +<!ENTITY zhcy "ж"> <!--small zhe, Cyrillic --> +<!ENTITY ZHcy "Ж"> <!--capital ZHE, Cyrillic --> +<!ENTITY zcy "з"> <!--small ze, Cyrillic --> +<!ENTITY Zcy "З"> <!--capital ZE, Cyrillic --> +<!ENTITY icy "и"> <!--small i, Cyrillic --> +<!ENTITY Icy "И"> <!--capital I, Cyrillic --> +<!ENTITY jcy "й"> <!--small short i, Cyrillic --> +<!ENTITY Jcy "Й"> <!--capital short I, Cyrillic --> +<!ENTITY kcy "к"> <!--small ka, Cyrillic --> +<!ENTITY Kcy "К"> <!--capital KA, Cyrillic --> +<!ENTITY lcy "л"> <!--small el, Cyrillic --> +<!ENTITY Lcy "Л"> <!--capital EL, Cyrillic --> +<!ENTITY mcy "м"> <!--small em, Cyrillic --> +<!ENTITY Mcy "М"> <!--capital EM, Cyrillic --> +<!ENTITY ncy "н"> <!--small en, Cyrillic --> +<!ENTITY Ncy "Н"> <!--capital EN, Cyrillic --> +<!ENTITY ocy "о"> <!--small o, Cyrillic --> +<!ENTITY Ocy "О"> <!--capital O, Cyrillic --> +<!ENTITY pcy "п"> <!--small pe, Cyrillic --> +<!ENTITY Pcy "П"> <!--capital PE, Cyrillic --> +<!ENTITY rcy "р"> <!--small er, Cyrillic --> +<!ENTITY Rcy "Р"> <!--capital ER, Cyrillic --> +<!ENTITY scy "с"> <!--small es, Cyrillic --> +<!ENTITY Scy "С"> <!--capital ES, Cyrillic --> +<!ENTITY tcy "т"> <!--small te, Cyrillic --> +<!ENTITY Tcy "Т"> <!--capital TE, Cyrillic --> +<!ENTITY ucy "у"> <!--small u, Cyrillic --> +<!ENTITY Ucy "У"> <!--capital U, Cyrillic --> +<!ENTITY fcy "ф"> <!--small ef, Cyrillic --> +<!ENTITY Fcy "Ф"> <!--capital EF, Cyrillic --> +<!ENTITY khcy "х"> <!--small ha, Cyrillic --> +<!ENTITY KHcy "Х"> <!--capital HA, Cyrillic --> +<!ENTITY tscy "ц"> <!--small tse, Cyrillic --> +<!ENTITY TScy "Ц"> <!--capital TSE, Cyrillic --> +<!ENTITY chcy "ч"> <!--small che, Cyrillic --> +<!ENTITY CHcy "Ч"> <!--capital CHE, Cyrillic --> +<!ENTITY shcy "ш"> <!--small sha, Cyrillic --> +<!ENTITY SHcy "Ш"> <!--capital SHA, Cyrillic --> +<!ENTITY shchcy "щ"> <!--small shcha, Cyrillic --> +<!ENTITY SHCHcy "Щ"> <!--capital SHCHA, Cyrillic --> +<!ENTITY hardcy "ъ"> <!--small hard sign, Cyrillic --> +<!ENTITY HARDcy "Ъ"> <!--capital HARD sign, Cyrillic --> +<!ENTITY ycy "ы"> <!--small yeru, Cyrillic --> +<!ENTITY Ycy "Ы"> <!--capital YERU, Cyrillic --> +<!ENTITY softcy "ь"> <!--small soft sign, Cyrillic --> +<!ENTITY SOFTcy "Ь"> <!--capital SOFT sign, Cyrillic --> +<!ENTITY ecy "э"> <!--small e, Cyrillic --> +<!ENTITY Ecy "Э"> <!--capital E, Cyrillic --> +<!ENTITY yucy "ю"> <!--small yu, Cyrillic --> +<!ENTITY YUcy "Ю"> <!--capital YU, Cyrillic --> +<!ENTITY yacy "я"> <!--small ya, Cyrillic --> +<!ENTITY YAcy "Я"> <!--capital YA, Cyrillic --> +<!ENTITY numero "№"><!--numero sign --> +
\ No newline at end of file diff --git a/info/examples/lwc/apc/README.apc b/info/examples/lwc/apc/README.apc new file mode 100644 index 0000000000..0e42d1eaaa --- /dev/null +++ b/info/examples/lwc/apc/README.apc @@ -0,0 +1,33 @@ +Files in Appendix C of the LaTeX Graphics Companion + +Section C.3.1 ++++++++++++++ + +invitationfr.xml XML source of French version of invitation example +invitationfr.dtd Corresponding DTD + +invlat1fr.xsl XSL file to transform the above to LaTeX + +invitationfrraw.tex Raw (UTF-8) resulting LaTeX file after running with xt +invitationfr.tex Filtered resulting LaTeX file (Latin 1) +invitation.sty Augmented package file to run the above with LaTeX + +utf8tolatin1.java A java program to translate a UTF-8 file into Latin 1 + (used to invitationfrraw.tex -> invitationfr.tex) +Section C.3.2 ++++++++++++++ + +For the following a Unicode editor is, such as Yudit on Linux, is +useful to visualize the files. + +utf8.xml XML example with UTF8 characters +utf8.xsl accompanying XSL file to generate HTML output +ISOcyr1.pen entity definitions for Cyrillic in utf8.xml + +utf8raw.html resulting HTML file (after xt) +utf8.html HTML file after processing utf8raw.html with tidy + "tidy -utf8 utf8raw.html utf8.html" + + + + diff --git a/info/examples/lwc/apc/invitation.sty b/info/examples/lwc/apc/invitation.sty new file mode 100644 index 0000000000..a27c8a05fc --- /dev/null +++ b/info/examples/lwc/apc/invitation.sty @@ -0,0 +1,46 @@ +% invitation.sty +% Package to format invitation.xml +\setlength{\textwidth}{22pc} +\setlength{\parskip}{1ex} +\setlength{\parindent}{0pt} +\pagestyle{empty}%% Turn off page numbering +\RequirePackage{array,calc} +\newcommand{\ToTitle}{To whom} +\newcommand{\WhyTitle}{Occasion} +\newcommand{\WhereTitle}{Venue} +\newcommand{\DateTitle}{When} +\newcommand{\SignatureTitle}{From} +\DeclareOption{francais}{% French text for fixed texts + \renewcommand{\ToTitle}{} + \renewcommand{\WhyTitle}{ l'occasion de} + \renewcommand{\WhereTitle}{O} + \renewcommand{\DateTitle}{Quand} + \renewcommand{\SignatureTitle}{De la part de}} +\newenvironment{Front}% + {\begin{center} + \Huge\sffamily INVITATION + \end{center} + } + {\begin{flushleft} + \rule{\linewidth}{1pt}\\[2mm] + \begin{tabular}{@{}>{\bfseries}ll@{}} + \ToTitle: & \@To \\ + \WhyTitle: & \@Why \\ + \WhereTitle: & \@Where \\ + \DateTitle: & \@Date + \end{tabular}\\[2mm] + \rule{\linewidth}{1pt} + \end{flushleft} + } +\newenvironment{Body}{\vspace*{\parskip}}{\vspace*{\parskip}} +\newenvironment{Back} + {\begin{flushleft}} + {\hspace*{.5\linewidth}\fbox{\SignatureTitle: \emph{\@Sig}} + \end{flushleft} + } +\newcommand{\To}[1]{\gdef\@To{#1}} +\newcommand{\Date}[1]{\gdef\@Date{#1}} +\newcommand{\Where}[1]{\gdef\@Where{#1}} +\newcommand{\Why}[1]{\gdef\@Why{#1}} +\newcommand{\Signature}[1]{\gdef\@Sig{#1}} +\ProcessOptions diff --git a/info/examples/lwc/apc/invitationfr.dtd b/info/examples/lwc/apc/invitationfr.dtd new file mode 100644 index 0000000000..51ad42db85 --- /dev/null +++ b/info/examples/lwc/apc/invitationfr.dtd @@ -0,0 +1,14 @@ +<?xml version='1.0' encoding="ISO-8859-1"?> +<!-- DTD invitation (version franaise) --> +<!-- 11 novembre 1998 mg --> +<!ELEMENT invitation (entte, corps, fin) > +<!ELEMENT entte (, date, o, pourquoi?) > +<!ELEMENT date (#PCDATA) > +<!ELEMENT (#PCDATA) > +<!ELEMENT o (#PCDATA) > +<!ELEMENT pourquoi (#PCDATA) > +<!ELEMENT corps (par+) > +<!ELEMENT par (#PCDATA|emph)* > +<!ELEMENT emph (#PCDATA) > +<!ELEMENT fin (signature) > +<!ELEMENT signature (#PCDATA) > diff --git a/info/examples/lwc/apc/invitationfr.tex b/info/examples/lwc/apc/invitationfr.tex new file mode 100644 index 0000000000..1c3f19980e --- /dev/null +++ b/info/examples/lwc/apc/invitationfr.tex @@ -0,0 +1,25 @@ +\documentclass[francais]{article} +\usepackage{invitation} +\usepackage[T1]{fontenc} +\begin{document} +\begin{Front} +\To{Anna, Bernard, Didier, Johanna} +\Date{Vendredi prochain 20 heures} +\Where{Le Caf du Web} +\Why{Mon premier bb XML} +\end{Front} +\begin{Body} +\par +J'ai le plaisir de vous inviter la clbration +de la naissance d'\emph{Invitation}, mon +premier enfant document XML. +\par +S'il vous plat, faites tout votre possible pour me rejoindre +vendredi prochain. Et n'oubliez pas d'emmener vos amis. +\par +Je me rjouis \emph{vraiment} d'avance de votre prsence. +\end{Body} +\begin{Back} +\Signature{Michel} +\end{Back} +\end{document} diff --git a/info/examples/lwc/apc/invitationfr.xml b/info/examples/lwc/apc/invitationfr.xml new file mode 100644 index 0000000000..cb504038ed --- /dev/null +++ b/info/examples/lwc/apc/invitationfr.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE invitation SYSTEM "invitationfr.dtd"> +<invitation> +<!-- ++++ Partie entte ++++ --> +<entte> +<>Anna, Bernard, Didier, Johanna</> +<date>Vendredi prochain 20 heures</date> +<o>Le Caf du Web</o> +<pourquoi>Mon premier bb XML</pourquoi> +</entte> +<!-- ++++ Partie corps ++++ --> +<corps> +<par> +J'ai le plaisir de vous inviter la clbration +de la naissance d'<emph>Invitation</emph>, mon +premier enfant document XML. +</par> +<par> +S'il vous plat, faites tout votre possible pour me rejoindre +vendredi prochain. Et n'oubliez pas d'emmener vos amis. +</par> +<par> +Je me rjouis <emph>vraiment</emph> d'avance de votre prsence. +</par> +</corps> +<!-- ++++ Partie finale ++++ --> +<fin> +<signature>Michel</signature> +</fin> +</invitation> diff --git a/info/examples/lwc/apc/invitationfrraw.tex b/info/examples/lwc/apc/invitationfrraw.tex new file mode 100644 index 0000000000..36a8f1a300 --- /dev/null +++ b/info/examples/lwc/apc/invitationfrraw.tex @@ -0,0 +1,25 @@ +\documentclass[francais]{article} +\usepackage{invitation} +\usepackage[T1]{fontenc} +\begin{document} +\begin{Front} +\To{Anna, Bernard, Didier, Johanna} +\Date{Vendredi prochain à 20 heures} +\Where{Le Café du Web} +\Why{Mon premier bébé XML} +\end{Front} +\begin{Body} +\par +J'ai le plaisir de vous inviter à la célébration +de la naissance d'\emph{Invitation}, mon +premier enfant document XML. +\par +S'il vous plaît, faites tout votre possible pour me rejoindre +vendredi prochain. Et n'oubliez pas d'emmener vos amis. +\par +Je me réjouis \emph{vraiment} d'avance de votre présence. +\end{Body} +\begin{Back} +\Signature{Michel} +\end{Back} +\end{document} diff --git a/info/examples/lwc/apc/invlat1fr.xsl b/info/examples/lwc/apc/invlat1fr.xsl new file mode 100644 index 0000000000..fce6e7f64c --- /dev/null +++ b/info/examples/lwc/apc/invlat1fr.xsl @@ -0,0 +1,66 @@ +<?xml version='1.0' encoding="ISO-8859-1"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform/1.0" + xmlns="http://www.tug.org/latex" + default-space="strip" + indent-result="no" + result-ns=""> + +<xsl:template match="/"> +<xsl:text>\documentclass[francais]{article} +\usepackage{invitation} +\usepackage[T1]{fontenc} +\begin{document} +</xsl:text> +<xsl:apply-templates/> +<xsl:text>\end{document} +</xsl:text> +</xsl:template> + +<xsl:template match="invitation/entte"> +<xsl:text>\begin{Front} +\To{</xsl:text> +<xsl:value-of select=""/> +<xsl:text>} +\Date{</xsl:text> +<xsl:value-of select="date"/> +<xsl:text>} +\Where{</xsl:text> +<xsl:value-of select="o"/> +<xsl:text>} +\Why{</xsl:text> +<xsl:value-of select="pourquoi"/> +<xsl:text>} +\end{Front} +</xsl:text> +</xsl:template> + +<xsl:template match="invitation/corps"> +<xsl:text>\begin{Body} +</xsl:text> + <xsl:apply-templates/> +<xsl:text>\end{Body} +</xsl:text> +</xsl:template> + +<xsl:template match="invitation/corps/par"> +<xsl:text>\par</xsl:text> +<xsl:apply-templates/> +</xsl:template> + +<xsl:template match="invitation/corps/par/emph"> +<xsl:text>\emph{</xsl:text> +<xsl:apply-templates/> +<xsl:text>}</xsl:text> +</xsl:template> + +<xsl:template match="invitation/fin"> +<xsl:text>\begin{Back} +\Signature{</xsl:text> +<xsl:value-of select="signature"/> +<xsl:text>} +\end{Back} +</xsl:text> +</xsl:template> + +</xsl:stylesheet> + diff --git a/info/examples/lwc/apc/utf8.html b/info/examples/lwc/apc/utf8.html new file mode 100644 index 0000000000..51858d102a --- /dev/null +++ b/info/examples/lwc/apc/utf8.html @@ -0,0 +1,39 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html> +<head> +<title>UTF8 files</title> +<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> +</head> +<body> +<h1>Handling UTF-8 files</h1> + +<p>The word Russian (Русский) in Cyrillic: +<br> +Using ISO Cyrillic set: Русский +<br> + Using XML Unicode entities: Русский</p> + +<h2>Russian-English correspondence</h2> + +<p>◆ Ъ ъ Э э Е е Р р Т т Й й У у И и О о П п</p> + +<p>◆ А а С с Д д Ф ф Г г Х х J j К к Л л</p> + +<p>◆ З з Ы ы Ь ь В в Б б Н н М м</p> + +<p>◆ Я Ё Ю Э я ё ю э ч Ч ш Ш ц Ц щ Щ</p> + +<h2>Greek-English correspondence</h2> + +<p>● Q q Ω ω Ε ε Ρ ρ Τ τ Υ υ Ι ι Ο ο Π π</p> + +<p>● Α α Σ σ Δ δ Φ φ Γ γ Η η J j Κ κ Λ λ</p> + +<p>● Ζ ζ Ξ ξ Χ χ V v Β β Ν ν Μ μ</p> + +<h2>Math characters</h2> + +<p>And here is one of Maxwell's equations: ∇·B=0</p> +</body> +</html> + diff --git a/info/examples/lwc/apc/utf8.xml b/info/examples/lwc/apc/utf8.xml new file mode 100644 index 0000000000..fd2cf40c58 --- /dev/null +++ b/info/examples/lwc/apc/utf8.xml @@ -0,0 +1,33 @@ +<?xml version="1.0"?> +<!DOCTYPE mydoc [ +<!ELEMENT mydoc (#PCDATA)> +<!ENTITY % ISOcyr1 SYSTEM "ISOcyr1.pen"> +%ISOcyr1; +]> +<mydoc> +<par>The word Russian (Русский) in Cyrillic: <br/> +Using ISO Cyrillic set: +Русский <br/> +Using XML Unicode entities: +Русский +</par> +<head>Russian-English correspondence</head> +<eng>Q q W w E e R r T t Y y U u I i O o P p</eng> +<рус> Ъ ъ Э э Е е Р р Т т Й й У у И и О о П п</рус> +<eng>A a S s D d F f G g H h J j K k L l</eng> +<рус> А а С с Д д Ф ф Г г Х х J j К к Л л</рус> +<eng>Z z X x C c V v B b N n M m</eng> +<рус> З з Ы ы Ь ь В в Б б Н н М м</рус> +<eng>YA YO YU EE ya yo yu ee ch CH sh SH ts TS shch SHCH </eng> +<рус> Я Ё Ю Э я ё ю э ч Ч ш Ш ц Ц щ Щ </рус> +<head>Greek-English correspondence</head> +<eng>Q q W w E e R r T t Y y I i O o P p</eng> +<ελλ>Q q Ω ω Ε ε Ρ ρ Τ τ Υ υ Ι ι Ο ο Π π</ελλ> +<eng>A a S s D d F f G g H h J j K k L l</eng> +<ελλ>Α α Σ σ Δ δ Φ φ Γ γ Η η J j Κ κ Λ λ</ελλ> +<eng>Z z X x C c V v B b N n M m</eng> +<ελλ>Ζ ζ Ξ ξ Χ χ V v Β β Ν ν Μ μ</ελλ> +<head>Math characters</head> +<par>And here is one of Maxwell's equations: +∇·B=0</par> +</mydoc> diff --git a/info/examples/lwc/apc/utf8.xsl b/info/examples/lwc/apc/utf8.xsl new file mode 100644 index 0000000000..4ca722afb0 --- /dev/null +++ b/info/examples/lwc/apc/utf8.xsl @@ -0,0 +1,39 @@ +<?xml version='1.0'?> +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/XSL/Transform/1.0" + xmlns="http://www.w3.org/TR/REC-html40" + result-ns=""> +<xsl:template match="/"> + <html xmlns="http://www.w3.org/Profiles/xhtml1-transitional.dtd"> + <head> + <title>UTF8 files</title> + <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> + </head> + <body> + <h1>Handling UTF-8 files</h1> + <xsl:apply-templates/> + </body> + </html> +</xsl:template> +<xsl:template match="br"> + <br /> +</xsl:template> +<xsl:template match="par"> + <p><xsl:apply-templates/></p> +</xsl:template> +<xsl:template match="head"> + <h2><xsl:apply-templates/></h2> +</xsl:template> +<!-- eliminate English keyboard input --> +<xsl:template match="eng"> +</xsl:template> +<!-- transmit Russian keyboard input --> +<xsl:template match="рус"> +<p>◆ <xsl:apply-templates/></p> +</xsl:template> +<!-- transmit Greek keyboard input --> +<xsl:template match="ελλ"> +<p>● <xsl:apply-templates/></p> +</xsl:template> +</xsl:stylesheet> + diff --git a/info/examples/lwc/apc/utf8raw.html b/info/examples/lwc/apc/utf8raw.html new file mode 100644 index 0000000000..7fe4b5ea65 --- /dev/null +++ b/info/examples/lwc/apc/utf8raw.html @@ -0,0 +1,35 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html> +<head> +<title>UTF8 files</title> +<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> +</head> +<body> +<h1>Handling UTF-8 files</h1> +<p>The word Russian (Русский) in Cyrillic: <br> +Using ISO Cyrillic set: +Русский <br> +Using XML Unicode entities: +Русский +</p> +<h2>Russian-English correspondence</h2> + +<p>◆ Ъ ъ Э э Е е Р р Т т Й й У у И и О о П п</p> + +<p>◆ А а С с Д д Ф ф Г г Х х J j К к Л л</p> + +<p>◆ З з Ы ы Ь ь В в Б б Н н М м</p> + +<p>◆ Я Ё Ю Э я ё ю э ч Ч ш Ш ц Ц щ Щ </p> +<h2>Greek-English correspondence</h2> + +<p>● Q q Ω ω Ε ε Ρ ρ Τ τ Υ υ Ι ι Ο ο Π π</p> + +<p>● Α α Σ σ Δ δ Φ φ Γ γ Η η J j Κ κ Λ λ</p> + +<p>● Ζ ζ Ξ ξ Χ χ V v Β β Ν ν Μ μ</p> +<h2>Math characters</h2> +<p>And here is one of Maxwell's equations: +∇·B=0</p> +</body> +</html> |