[OS X TeX] Listing indentation

George Gratzer gratzer at me.com
Sun Nov 14 03:13:57 CET 2010


Perfect,

I added to the sty file:


\newtheoremstyle{myplain}%
{}% ⟨Space above⟩
{}% ⟨Space below⟩
{\itshape}% ⟨Body font and note font⟩
{}% ⟨Indent amount⟩
{\bfseries\thm at notefont{\bfseries}}% ⟨Theorem head font⟩
{.}% ⟨Punctuation after theorem head⟩
{5pt plus1pt minus1pt\relax}% ⟨Space after theorem head⟩
{}% ⟨Theorem head spec (can be left empty, meaning ‘normal’)⟩

\newtheoremstyle{mydefinition}%
{}% ⟨Space above⟩
{}% ⟨Space below⟩
{}% ⟨Body font and note font⟩
{}% ⟨Indent amount⟩
{\bfseries\thm at notefont{\bfseries}}% ⟨Definition head font⟩
{.}% ⟨Punctuation after theorem head⟩
{5pt plus1pt minus1pt\relax}% ⟨Space after definition head⟩
{}% ⟨Definition head spec (can be left empty, meaning ‘normal’)⟩

changed

\theoremstyle{plain}

to

\theoremstyle{myplain}

and changed

\theoremstyle{definition}

to

\theoremstyle{mydefinition}

Works like magic!

GG


On 2010-11-13, at 8:36 PM, Alan Munn wrote:

> 
> On Nov 13, 2010, at 8:15 PM, David Arnold wrote:
> 
>> All,
>> 
>> See attached:
>> 
>> In this frame, I'm trying to get the listings package to respect the indenting I want:
>> 
>> \begin{lstlisting}[escapeinside=!~]
>> \begin{tikzpicture}
>> \draw[help lines] (-5,-5) grid (5,5);
>> \draw[thick,<->] (-5,0) -- (5,0) node[right] {$x$};
>> \draw[thick,<->] (0,-5) -- (0,5) node[above] {$y$};
>> \begin{scope}
>> 	\clip (-5,-5) rectangle (5,5);
>> 	\draw [thick,blue] plot (\x,{\x*(\x+2)*(\x-2)});
>> \end{scope}
>> \end{tikzpicture}
>> \end{lstlisting}
>> 
>> However, everything comes out justified against the left margin. Anyone know how I can get those two lines to indent?
> 
> Use spaces instead of a tab.
> 
> Alan
> 
> -- 
> Alan Munn
> amunn at gmx.com
> 
> 
> 
> 
> ----------- Please Consult the Following Before Posting -----------
> TeX FAQ: http://www.tex.ac.uk/faq
> List Reminders and Etiquette: http://email.esm.psu.edu/mac-tex/
> List Archive: http://tug.org/pipermail/macostex-archives/
> TeX on Mac OS X Website: http://mactex-wiki.tug.org/
> List Info: http://email.esm.psu.edu/mailman/listinfo/macosx-tex
> 




More information about the macostex-archives mailing list