# [XeTeX] XeTeX Digest, Vol 73, Issue 7

Brian Wilson bountonw at gmail.com
Thu Apr 8 15:59:09 CEST 2010

Thank you Fr. Michael.

I ran your suggestion and it worked beautifully.  Then I tried to adapt your
code to a file that I already had and it fell apart. One permutation of my
code had only the first number turning gray. I have changed some things and
after an hour of fiddling, can't get it to compile at all. (I am using the
xelatex command as I will be using this with a Lao document.)

Thank you,
Brian

\documentclass[a5paper,draft]{book}
\special{papersize=148mm, 210mm}

\usepackage{fontspec} % provides font selecting commands
\usepackage{xunicode} % provides unicode character macros
\usepackage{xltxtra} % provides some fixes/extras

\usepackage{polyglossia} % Not sure what this does
\usepackage[usenames,dvipsnames]{color} % I used color instead of xcolor
because I wanted to define the shade of gray.

\defaultfontfeatures{Mapping=tex-text} % have no idea what this does
\setmainfont{Palatino} % I would like to be able to set the font size of the
main font.
\newfontfamily\versenumbers{Myriad Pro} % I would like to be able to define
the size of the font relative to the main font.

\definecolor{light-gray}{gray}{0.6} %I want to be able to define the shade
of gray or the cmyk number
\newcommand\graytext[1]{\textcolor{light-gray}{#1}}
\newcommand\graynumbers[1]{\textsuperscript\graytext{#1}}

\newcommand\vnum[1]{{\versenumbers\graynumbers{#1}}\,}

\begin{document}

This is a test of the \vnum{234} command. % This is the line that is
failing.

End of test.

\end{document}

Brian Wilson wrote:
> Thank you to the XeTeX community for the help with my last issue.
>
> Over the last week I have learned how to change the paper size, make
running
> fellow newbies are reading this, the following site has been most helpful
to
> me. http://en.wikibooks.org/wiki/LaTeX
>
> Currently I am working on a small document of Bible portions in the Lao
> language. There are four things that I want to do with the verse numbers.
> 1 Superscript
> 2 grayscale
> 3 specify font
> 4 add a tiny space after the verse number and before the verse.
>
> Can I do all of this with a newly created \vnum command? I have googled
> about \newcommand until I am blue in the face. Succeeded in making a
command
> to do superscript and another command to do grayscale, but failed to make
a
> command containing both functions and so didn't proceed to the last two.
>

Hi Brian:

Try this:

%%%%%%%%%%%%%%%%%%%%%
\documentclass{minimal}

\usepackage{xltxtra}
\usepackage{polyglossia}
\setdefaultlanguage[variant=us]{english}
\usepackage{xcolor}

\defaultfontfeatures{Mapping=tex-text}
\setmainfont{Palatino}

\newcommand\grayssnumbers[1]{\textsuperscript{\color{gray}#1}}

\newcommand\vnum[1]{{\versenumbers\grayssnumbers{#1}}\,}

\begin{document}

This is a test of the \vnum{234} command.

End of test.

\end{document}
%%%%%%%%%%%%%%%%%%%%

You can substitute fonts as desired.

HTH.

--

fr. michael gilmary, mma

Most Holy Trinity Monastery