[OS X TeX] Two issues -- need help
M. Tamer =?ISO-8859-1?B?1g==?=zsu
tozsu at sympatico.ca
Sat Aug 6 13:49:37 EDT 2005
---
I wonder if someone can help me with two issues:
1. I am writing a book for which the publisher has supplied some macros.
Among them there is a pair of macros for examples. Their definition are
\newcommand{\bex}[1]{\vspace{11pt}\par\noindent{\bf Example
#1}\vspace{11pt}\par\noindent\begin{inpar}\parskip=2pt plus 0.5pt}
\newcommand{\eex}{\end{inpar}\vspace{11pt}\par\noindent}
and their use are
\bex{4.1}
...
\eex
that generates
Example 4.1
...
The problem is that if you add/delete any example then you need to do the
renumbering again. I am trying to add a counter to this so it can do the
renumbering automatically. The following works:
\newcounter{exmp}[chapter]
\newcommand{\bex}{\regstepcounter{exmp}\vspace{11pt}\par\noindent{\bf
Example
\arabic{chapter}.\arabic{exmp}}\vspace{11pt}\par\noindent\begin{inpar}\par
skip=2pt plus 0.5pt}
(I know I can renewcommand \theexmp to be \arabic{chapter}.\arabic{exmp},
but that is not important right now). This works in assigning the right
numbers to the examples, but referencing the examples don't work right.
\ref{...} only produces \theexmp without the chapter prefix. I tried to
Fix this using
\newcounter{exmp}[chapter]
\newcommand{\bex}{\renewcommand{\theexmp}{\stepcounter{exmp}\thechapter.\a
rabic{exmp}}\vspace{11pt}\par\noindent{\bf Example
\theexmp}\vspace{11pt}\par\noindent\begin{inpar}\parskip=2pt plus 0.5pt}
but this did not work either. The numbering is OK, but \ref{...} simply
generates the number of the section within which the example occurs.
I would appreciate any help in changing the \bex definition so that it
generates the numbers prefixed with chapter numbers and also handles the
references right.
2. On one of my machines, files with .tex extension have defaulted to open
with the Script Editor. When I try to reset this to TexShop or iTexMac from
Get Info window, it asks me if I really wanted to change, but then it
reverts back to Script Editor. What might be going wrong? I did fix the
permissions, etc, but I can't think of what else to try.
(This is a more general problem with all file types, but I had to make it
tex relevant for this list -) )
Thanks for any suggestions.
--
M. Tamer Ozsu
University of Waterloo
--------------------- Info ---------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
& FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Post: <mailto:MacOSX-TeX at email.esm.psu.edu>
More information about the MacOSX-TeX
mailing list