[OS X TeX] Colored words

Aaron Jackson jackson at msrce.howard.edu
Sun Feb 20 18:45:31 EST 2005

On Feb 20, 2005, at 9:07 AM, Alain Schremmer wrote:

> Aaron Jackson wrote:
>> You most likely only need to change the C references to tex, or  
>> something similar, in order to use it as is.  Then just tweek until  
>> you get what you want...
> Awsome! Indeed, all I did was to change C to tex and Hello world to  
> file.tex and there it was.
> Unfortunately, this does not help me. Here is my situation:
> In the process of a step by step instruction, I am refering within my  
> own text to pieces of the TeXShop source code that a person already  
> has. Using the TeXShop look and feel for these pieces of source code  
> would avoid the use of quotes. Here is an example of what I am  
> writing:
>            Say you want to Boldface the word "text". Select "text", Go  
> Window > LaTeX panel > Typeface > Bold. Observe that, in the source,  
> "text" is now the argument of "\textbf{ }". Typeset.
> Most of this is in Body Text but I would like "text" to be in  
> Helvetica, "\textbf" to be in blue Helvetica with the curly braces "{  
> }" in green Helvetica, rather than in Body Text between quotes.

OK.  I looked at this again and the following is the best I could do...  
  Maybe comp.text.tex can give better info.


NOTE:  If you replace texcsstyle={\color{blue}} with  
texcsstyle=*{\color{blue}} the leading \ of each command is also  
considered part of the command, however this is a buggy feature.

%% For computer code listings
\settowidth{\xleftmargin}{\textbf{99999}}% width of 5 digits in the  
current font.
\settowidth{\numbersep}{\textbf{99}}% width of 2 digits in the current  
\lstset{language={[latex]TeX}, keywordstyle=\color{blue},  
identifierstyle=\textsf, texcsstyle={\color{blue}},  
commentstyle=\color{red}, showstringspaces=false, showspaces=false,  
showtabs=false, columns=fullflexible, numbers=left, stepnumber=1,  
numberstyle=\normalsize, numbersep=\numbersep,  
xleftmargin=\xleftmargin, tabsize=4,  fontadjust, basewidth=1ex,  
breaklines, moretexcs={numbersep,xleftmargin,  

\mysyntaxp{textbf}{test} \\

\mysyntax{itshape} \\



--------------------- 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