Oleg Katsitadze | 1 Mar 2009 21:42
Picon

Re: verbatim text in a footnote

On Sat, Feb 28, 2009 at 12:25:47PM +0100, Helmut Jarausch wrote:
> Is there a method in Eplain or something similar to
> ftp://cam.ctan.org/tex-archive/macros/latex/contrib/misc/verbdef.sty

No, there isn't.  The easiest would be to save the program texts in
separate files and then typeset them using \listing:

    \input eplain.tex

    A\footnote*{%
    \listing{test.txt}
    }

    \bye

Best,
Oleg

John Culleton | 6 Mar 2009 21:09
Gravatar

\idxname and "Jr."

According to Chicago names like mine are indexed as
Culleton, John R. , Jr., 101 etc. 

Is there a way to go from John R. Culleton Jr. to  the above 
inverted form without hand massaging of the result?
--

-- 
John Culleton
Able Indexers and Typesetters
http://wexfordpress.com

Oleg Katsitadze | 8 Mar 2009 18:35
Picon

Re: \idxname and "Jr."

On Fri, Mar 06, 2009 at 03:09:53PM -0500, John Culleton wrote:
> According to Chicago names like mine are indexed as
> Culleton, John R. , Jr., 101 etc.
>
> Is there a way to go from John R. Culleton Jr. to  the above
> inverted form without hand massaging of the result?

Looks like there isn't.  Of course, you can always define a macro to
do this using \sidx.

Oleg

Adam Fenn | 23 Mar 2009 13:10
Picon
Favicon

Re: optional arguments

> I don't understand -- how can the order be wrong if the names are all
> the same? :) But if you mean, relative to other ("non-architect")
> entries, then the problem is again with non-expanding \name, because
> makeindex sorts the string "\name" instead of what this macro stands
> for.

> \makeatletter
>
> \newtoks\arch <at> name
> \newtoks\arch <at> loc
>
> \def\architect#1{%
> \arch <at> name={#1}%
> \ <at> getoptionalarg\finisharchitect
> }
>
> \def\finisharchitect{%
> \arch <at> loc=\expandafter{\ <at> optionalarg}%
> \ifx\ <at> optionalarg\empty
> % No optional argument present.
> \expandafter\sidx\expandafter{\the\arch <at> name}
> \else
> % One was present.
> \edef\temp{architects!\the\arch <at> name, {\noexpand\it \the\arch <at> loc}}%
> \expandafter\sidx\expandafter{\temp}%
> \edef\temp{\the\arch <at> name, {\noexpand\it architect, \the\arch <at> loc}}%
> \expandafter\sidx\expandafter{\temp}%
> \fi
> }
>
> \resetatcatcode

I've just noticed that there is something not quite right here.

If you run TeX on

\architect{Smith, John}

\architect{Smith}

the index is correctly typeset as

Smith, 1
Smith, John, 1

However, if you include the optional argument

\architect{Smith, John}[London]

\architect{Smith}[London]

then the index is incorrectly typeset

Smith, John, architect, of London, 1
Smith, architect, of London

Any ideas how I can sort this out?

TIA
Adam.

Share your photos with Windows Live Photos – Free. Try it Now!
John Culleton | 23 Mar 2009 17:38
Gravatar

Re: optional arguments

On Monday 23 March 2009 08:10:27 am Adam Fenn wrote:
> > I don't understand -- how can the order be wrong if the
> > names are all the same? :)  But if you mean, relative
> > to other ("non-architect") entries, then the problem is
> > again with non-expanding \name, because makeindex sorts
> > the string "\name" instead of what this macro stands
> > for.
> >
> > \makeatletter
> >
> > \newtoks\arch <at> name
> > \newtoks\arch <at> loc
> >
> > \def\architect#1{%
> >   \arch <at> name={#1}%
> >   \ <at> getoptionalarg\finisharchitect
> > }
> >
> > \def\finisharchitect{%
> >   \arch <at> loc=\expandafter{\ <at> optionalarg}%
> >   \ifx\ <at> optionalarg\empty
> >     % No optional argument present.
> >     \expandafter\sidx\expandafter{\the\arch <at> name}
> >   \else
> >     % One was present.
> >     \edef\temp{architects!\the\arch <at> name, {\noexpand\it
> > \the\arch <at> loc}}% \expandafter\sidx\expandafter{\temp}%
> >     \edef\temp{\the\arch <at> name, {\noexpand\it architect,
> > \the\arch <at> loc}}% \expandafter\sidx\expandafter{\temp}%
> >   \fi
> > }
> >
> > \resetatcatcode
>
> I've just noticed that there is something not quite right
> here.
>
> If you run TeX on
>
> \architect{Smith, John}
>
> \architect{Smith}
>
> the index is correctly typeset as
>
> Smith, 1
> Smith, John, 1
>
> However, if you include the optional argument
>
> \architect{Smith, John}[London]
>
> \architect{Smith}[London]
>
> then the index is incorrectly typeset
>
> Smith, John, architect, of London, 1
> Smith, architect, of London
>
> Any ideas how I can sort this out?
>
> TIA
> Adam.
I also note that these two entries will end up as separate 
items in the index:
\idx{Smith, John}
\idxname{John}{Smith}

So I use one form or the other in the entire document. 

--

-- 
John Culleton
Able Indexers and Typesetters
http://wexfordpress.com

Dan Luecking | 23 Mar 2009 17:18
Picon
Favicon

Re: optional arguments

At 07:10 AM 3/23/2009, Adam Fenn wrote:

> > \makeatletter
> >
> > \newtoks\arch <at> name
> > \newtoks\arch <at> loc
> >
> > \def\architect#1{%
> > \arch <at> name={#1}%
> > \ <at> getoptionalarg\finisharchitect
> > }
> >
> > \def\finisharchitect{%
> > \arch <at> loc=\expandafter{\ <at> optionalarg}%
> > \ifx\ <at> optionalarg\empty
> > % No optional argument present.
> > \expandafter\sidx\expandafter{\the\arch <at> name}
> > \else
> > % One was present.
> > \edef\temp{architects!\the\arch <at> name, {\noexpand\it \the\arch <at> loc}}%
> > \expandafter\sidx\expandafter{\temp}%
> > \edef\temp{\the\arch <at> name, {\noexpand\it architect, \the\arch <at> loc}}%
> > \expandafter\sidx\expandafter{\temp}%
> > \fi
> > }
> >
> > \resetatcatcode
>
>I've just noticed that there is something not quite right here.
>
>If you run TeX on
>
>\architect{Smith, John}
>
>\architect{Smith}
>
>the index is correctly typeset as
>
>Smith, 1
>Smith, John, 1
>
>However, if you include the optional argument
>
>\architect{Smith, John}[London]
>
>\architect{Smith}[London]
>
>then the index is incorrectly typeset
>
>Smith, John, architect, of London, 1
>Smith, architect, of London
>
>Any ideas how I can sort this out?

What do the \indexentry commands look like in your idx file?
It seems to work for me.

Dan

Daniel H. Luecking
Department of Mathematical Sciences
University of Arkansas
"Dubito ergo cogito, cogito ergo sum" --Descartes

John Culleton | 23 Mar 2009 19:31
Gravatar

Re: optional arguments


I am addressing a different problem than the \architect 
macro but rather the discrepancy between:
\idxname{John}{Smith}
and
\idx{Smith, John}

These two items end up on separate lines in  the final 
index.  The villian here seems to be the \indexseparator 
item inserted by the \indexname routines. Makeindex does 
not combine the two references on a single line.

When I use eplain and makeindex the idx file looks like 
this:
----------------------------------------------------------------
\indexentry{Smith\idxnameseparator John}{1}
\indexentry{Smith, John}{2}
------------------------------------------------------------
and the book.ind file looks like this:
----------------------------------------------------
\item Smith, John, 2
\item Smith\idxnameseparator John, 1
------------------------------------------------------

The solution would be to modify eplain such that instead of 
inserting  \indexnameseparator the \indexname macro would 
simply insert a comma. This is the default choice anyhow 
and the one that conforms to standard indexing practice. 

The eplain code is formidable enough that I hesitate to 
offer a patch myself.  

--

-- 
John Culleton
Able Indexers and Typesetters
http://wexfordpress.com

Oleg Katsitadze | 24 Mar 2009 04:52
Picon

Re: optional arguments

On Mon, Mar 23, 2009 at 11:18:31AM -0500, Dan Luecking wrote:
> It seems to work for me.

I've just tried and it works for me, too.  The macros Adam sent just
cannot produce the "of" in front of "London".  This might be a stale
.ind or .idx file which you are seeing.  Try removing those files and
rebuilding your document.

Oleg

Oleg Katsitadze | 24 Mar 2009 05:42
Picon

Expanding \indexnameseparator (was: optional arguments)

On Mon, Mar 23, 2009 at 02:31:46PM -0400, John Culleton wrote:
> The solution would be to modify eplain such that instead of 
> inserting  \indexnameseparator the \indexname macro would 
> simply insert a comma. This is the default choice anyhow 
> and the one that conforms to standard indexing practice. 

Well, the whole point of \indexnameseparator is to provide
flexibility, in case someone wants something different from the
standard indexing practice.  But I agree it would be nice to have ", "
instead of "\indexnameseparator" inside the .idx file.  So I suggest
the patch below.  It seems backwards-compatible, except in situations
described by John, but such documents are already broken anyway.

If there are no objections, I'll install the patch.

Thanks,
Oleg

Index: xeplain.tex
===================================================================
RCS file: /cvsroot/eplain/eplain/xeplain.tex,v
retrieving revision 1.47
diff -u -r1.47 xeplain.tex
--- xeplain.tex 20 Nov 2007 21:51:02 -0000  1.47
+++ xeplain.tex 24 Mar 2009 04:28:03 -0000
 <at>  <at>  -2842,7 +2842,7  <at>  <at> 
   \ifx\temp\empty
     \toks <at>  = {}%
   \else
-    \toks <at>  = {\idxnameseparator #1}%
+    \toks <at>  = \expandafter{\idxnameseparator #1}%
   \fi
   \toks2 = {#2}%
   %

Adam Fenn | 24 Mar 2009 07:30
Picon
Favicon

Re: optional arguments

> On Mon, Mar 23, 2009 at 11:18:31AM -0500, Dan Luecking wrote:
> > It seems to work for me.
>
> I've just tried and it works for me, too. The macros Adam sent just
> cannot produce the "of" in front of "London". This might be a stale
> .ind or .idx file which you are seeing. Try removing those files and
> rebuilding your document.
>
> Oleg

Sorry, I didn't explain myself very well. The problem is not the missing
'of' - I missed that out of my example. The problem is that when you use
Oleg's \architect macro without the optional argument the index is typeset
correctly, but when you use the optional argument the index is typeset
incorrectly and the order is reversed.

(No optional argument)
Smith, 1
Smith, John, 1

(With optional argument)

Smith, John, (architect, of London,) 1
Smith, (architect, of London,) 1Adam.

Beyond Hotmail — see what else you can do with Windows Live. Find out more!

Gmane