[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Possible bug somewhere



Hello.

I attach a file which tests the use of \texttt given a number of packages.
It results in a weird error when run with "lualatex tt1.tex".

I should welcome some advice on what to do to correct the error.

Please find attached:
   (1) The small test file tt1.tex
   (2) My style file pkaff.sty

This should enable you to pinpoint the error.

 Have a good holiday!

Regards
--
Sian Mountbatten
Specialist of Algol 68


\documentclass[11pt,a5paper,oneside]{book}
%\usepackage{verbatim}
%\usepackage[utf8]{inputenc}
\usepackage{fontspec}
\usepackage{makeidx}
\usepackage{pkaff}
\defaultfontfeatures{Ligatures=TeX}
\setmainfont{Droid Serif}
\setsansfont[Scale=MatchLowerCase]{Droid Sans}
\setmonofont[Scale=MatchLowerCase]{Droid Sans Mono}
\begin{document}
\pagestyle{headings}
\texttt{http://www.poenikatu.co.uk/algol68/}
\end{document}

% Style file for ``Programado kun Algol 68 Farita Facila''
%
%  Created by Sian -- 2012/12/22 05:20:17
%
%  $Log: pkaff.sty,v $
%
\makeatletter
% Hyphenation patterns
\hyphenation{par-am-etro par-am-etroj par-am-etron par-am-etrojn}
\hyphenation{oper-ando oper-andoj oper-andon oper-andojn}
% New length
\newlength{\ruleht}\setlength{\ruleht}{0.6pt}
% Commands for answers
\newcommand{\makeanswers}{%
   \newwrite\@answerfile
   \immediate\openout\@answerfile=\jobname.solv
   \immediate\write\@answerfile{\string\Chapter{Solvoj}{app-solv}}
   \typeout{Skribante solvdosieron \jobname.solv}}

\newcommand{\printanswers}{%
   \immediate\closeout\@answerfile
   \input{\jobname.solv}}
% Counters
\newcounter{chapnum}       % Used by the answer environment
\newcounter{exno}[chapter] % Exercise number - starts from 1 for each chapter
\newcounter{subexno}[exno] % Sub-exercise number (letter)
\newcounter{hyper}[section]% Used to form hyperref labels
% Esperanto terms for fixed heading texts
\renewcommand{\contentsname}{Enhavo}
\renewcommand{\bibname}{Bibliografio}
\renewcommand{\indexname}{Indekso}
\renewcommand{\chaptername}{Ä?apitro}
\renewcommand{\appendixname}{Aldono}
\renewcommand{\seename}{vidu}
% Table of contents macros
\renewcommand{\l@chapter}[2]{%
  \ifnum \c@tocdepth >\m@ne
    \addpenalty{-\@highpenalty}%
    \vskip 1.0em \@plus\p@
    \setlength\@tempdima{2.0em}%
    \begingroup
      \parindent \z@ \rightskip \@pnumwidth
      \parfillskip -\@pnumwidth
      \leavevmode \bfseries
      \advance\leftskip\@tempdima
      \hskip -\leftskip
      #1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par
      \penalty\@highpenalty
    \endgroup
  \fi}
\renewcommand{\l@section}{\@dottedtocline{1}{2.0em}{2.8em}}
\renewcommand{\l@subsection}{\@dottedtocline{2}{4.8em}{3.7em}}
\renewcommand{\l@subsubsection}{\@dottedtocline{3}{8.5em}{4.6em}}
\renewcommand{\l@paragraph}{\@dottedtocline{4}{13.1em}{5.5em}}
\renewcommand{\l@subparagraph}{\@dottedtocline{5}{18.6em}{6.5em}}
% Sectioning commands
\newcommand\Chapter[2]{% #1: chapter title #2: label
   \chapter{#1}\label{#2}}
\newcommand\Section[2]{% #1: section title #2: label
  \section{#1}\label{#2}}
\newcommand\Subsection[2]{% #1: subsection title #2: label
  \subsection{#1}\label{#2}}
\newcommand\Subsubsection[2]{% #1: subsubsection title #2: label
  \subsubsection{#1}\label{#2}}
% Heading command
\renewcommand{\ps@headings}{%
  \def\@oddfoot{\ref{toc}{Enhavo}\hfil\ref{indekso}{Indekso}}%
  \def\@oddhead{{\itshape\rightmark}\hfil\thepage}%
  \let\@mkboth\markboth
  \def\chaptermark##1{%
    \markright {%
      \ifnum \c@secnumdepth > -1
        \if@mainmatter
          \@chapapp\ \thechapter. \ %
        \fi
      \fi
    ##1}}}
% Indexing environment
\renewenvironment{theindex}
   {\if@twocolumn
    \@restonecolfalse
    \else
      \@restonecoltrue
   \fi
   \columnseprule \z@
   \columnsep 35\p@
   \twocolumn[\@makeschapterhead{\indexname}]%
   \label{indekso}%
   \@mkboth{\MakeUppercase\indexname}{\MakeUppercase\indexname}%
   \thispagestyle{plain}\parindent\z@
   \parskip\z@ \@plus .3\p@\relax
   \let\item\@idxitem}
  {\if@restonecol\onecolumn\else\clearpage\fi}
%
% Hypertext macros
%
% \hy@anchor: #1=URL #2=Text
%\newcommand\hy@anchor[2]{\special{html:<a name="#1">}#2\special{html:</a>}}
% \hy@ref:    #1=URL #2=Text
%\newcommand\hy@ref[2]{\special{html:<a href="#1">}#2\special{html:</a>}}

%\newcommand\hy@cnt{\addtocounter{hyper}{1}}
%\newcommand\hy@lab{%
%   ind-\roman{chapter}-\ifx\value{section}{0}%
%                       \else\roman{section}
%                       \fi
%                      -\roman{hyper}}

\newcommand\hylabel[1]{\label{#1}}
\newcommand\hyref[1]{\ref{#1}}
\newcommand\hx[2]{% #1=text entry, #2=index entry
%  \hy@cnt
%  \hy@anchor{\hy@lab}{#1}%
  #1\index{#2}}
\newcommand\hxrt[2]{% #1=text entry(r), #2=index entry(t)
%  \hy@cnt
%  \hy@anchor{\hy@lab}{#1}%
  #1\index{#2@\texttt{#2}}}
\newcommand\hxtt[2]{% #1=text entry(t), #2=index entry(t)
%  \hy@cnt
%  \hy@anchor{\hy@lab}{\texttt{#1}}%
  \texttt{#1}\index{#2@\texttt{#2}}}
\newcommand\hxtii[3]{% #1=text, #2=index, #3=level-2 index
%  \hy@cnt
%  \hy@anchor{\hy@lab}{\texttt{#1}}%
  \texttt{#1}\index{#2@\texttt{#2}!#3@\texttt{#3}}}
\newcommand\hxrtii[3]{% #1=text, #2=index, #3=lev 2
%   \hy@cnt
%   \hy@anchor{\hy@lab}{#1}%
   #1\index{#2@\texttt{#2}!#3@\texttt{#3}}}
\newcommand\ix[1]{\hx{#1}{#1}}
\newcommand\ixtt[1]{\hxtt{#1}{#1}}
\newcommand\bfix[1]{\hx{\textbf{#1}}{#1}}
%
% Exercise and answer macros
%
\newenvironment{answer}[1]%
 {\vskip0pt plus .2\vsize\penalty-250
  \vskip0pt plus-.2\vsize\goodbreak
  \ifnum#1=\value{chapnum}%
  \else
    \setcounter{chapnum}{#1}%
    \Section{Ä?apitro \arabic{chapnum}}{app-\roman{chapnum}}%
  \fi
  \begin{description}}
 {\end{description}}

\newenvironment{exercise}% begdef follows
  {\immediate\write\@answerfile{}% blank line
   \immediate\write\@answerfile{\string\begin{answer}{\arabic{chapter}}}%
   \vskip0pt plus .2\vsize\penalty-250
   \vskip0pt plus-.2\vsize\goodbreak
   \bigskip\bigskip\hrule height \ruleht
   \subsection*{Ekzercoj}
   \def\@ref{\roman{chapter}-\roman{exno}}%
   \def\@lab{\arabic{chapter}.\arabic{exno}}%
   \begin{list}{% Commands for the default label for exercise
     \addtocounter{exno}{1}%
%     \hy@anchor{ex-\@ref}{\@lab}%
    \@lab\label{ex-\@ref}\ref{ans-\@ref}
    \immediate\write\@answerfile{% answer label commands
       \string\item[%
         \expandafter\string\ref{ex-\@ref}Ex}%
     \immediate\write\@answerfile{%
       \expandafter\string\label{ans-\@ref}\@lab]}}%
     {}}% begdef
  {\end{list}% enddef
   \immediate\write\@answerfile{\string\end{answer}}
   \smallskip
   \hrule height \ruleht
   \vskip0pt plus .2\vsize\penalty-250
   \vskip0pt plus-.2\vsize\goodbreak}

\newenvironment{subex}%
  {\def\@lab{\arabic{chapter}.\arabic{exno}}
   \def\@ref{\roman{chapter}-\roman{exno}}
   Ans\ref{ans-\@ref}
   \immediate\write\@answerfile{\ \string\par}
   \immediate\write\@answerfile{\string\begin{description}}%
   \begin{list}{(\alph{subexno})}%
     {\usecounter{subexno}%
      \setlength{\itemsep}{0pt}%
      \setlength{\parsep}{1pt plus 1pt minus 0.5pt}
      \setlength{\leftmargin}{\labelwidth}%
      \addtolength{\leftmargin}{\labelsep}}}% end of begdef
  {\end{list}
   \immediate\write\@answerfile{\string\end{description}}}% enddef

\outer\def\ans{\nobreak
  \def\@ref{\roman{chapter}-\roman{exno}}%
  \def\@lab{\arabic{chapter}.\arabic{exno}}%
  Ans\ref{ans-\@ref}%
  \copytoendans}

\outer\def\subans{%
  \par
  \immediate\write\@answerfile{\string\item[(\alph{subexno})]}%
  \copytoendans}%

\def\@line{}%
\def\copytoendans{\begingroup\setupcopy\copyans}%
\def\setupcopy{\def\do##1{\catcode`##1=12}\dospecials
   \do\| \obeylines}%
{\obeylines \gdef\copyans#1
   {\ifx '#1%
       \let\next=\endgroup %
    \else \immediate\write\@answerfile{#1}%
       \let\next\copyans %
    \fi %
    \next}}%
%
% Miscellaneous macros
%
\newcommand{\bang}{\char33} % Exclamation mark in the text
\newcommand{\up}[1]{\leavevmode\raise.3ex\hbox{#1}}
\newcommand{\pd}{{\upr\$}}
\newcommand{\ith}[2]{$#1^{\hbox{\scriptsize #2}}$}
\newcommand{\cancel}[2]{\c@ncel{#1}{#2}}
\newcommand{\displaybreak}{\vskip 11pt plus 1pt minus .5pt}
% PiCTeX definition
\def\pmarrow from #1 #2 to #3 #4{\arrow <3.6mm> [0.2, 0.67] from #1 #2 to #3 #4}
\makeatother


Reply to: