On Friday 22 February 2008 02:21, you wrote:
> Steve Litt wrote:
> > On Thursday 21 February 2008 18:27, James Mansion wrote:
> >> Is it possible to automate adminition blocks?
> >>
> >> James
> >
> > What is an admonition block or admonition paragraph? I couldn't find them
> > in wikipedia.
>
> Try here: http://www.methods.co.nz/asciidoc/userguide.html#X28
>
> The style of presentation can vary.
>
> Look at the 'info' block towards the bottom of:
> http://svnbook.red-bean.com/en/1.4/svn.tour.cycle.html#svn.tour.cycle.resol
>ve
>
> James

Now I understand :-)

If by automate you mean have a style for the admonition title (NOTE, TIP, 
WARNING, WHATEVERuWANT) and a style for the rest of the admonition, you can 
do it in your layout file.

The following is part of my layout file for "Learn Vim Tonight: Use the Worlds 
Most Productive Editor Tomorrow". Note that these snippits don't include 
Preamble/endpreamble.

Basically there's a LaTeX command that centers the title (callouttitleL), and 
one that prints in a shaded box with reduced margins (callouttextL). That's 
the LaTeX part. LyX style CalloutTitle is a command type LyX environment, and 
calls LaTeX command callouttitleL to print the title. LyX style CalloutText 
calls LaTeX environment callouttextL to print the text of the admonition.

You can make special LyX environment NOTE, WARNING and the like that strongarm 
the title, freeing you from having to type it in, but the generalistic method 
means you can put any title you want in one of these boxes.

If you implement this, I suggest you use more obvious names for commands and 
environments. It's less than a year since I wrote this layout file, and I 
already find my code confusing.

Have fun...

% ### Callout title latex
\newcommand{\callouttitleL}[1]{\def\callouttitleT{#1}}

\newenvironment{callouttextL}
  {%
  ~\\[-0.45in]%
  \setlength\fboxsep{4pt}%
  \definecolor{shadecolor}{rgb}{1.00,0.90,0.90}%
  \begin{shaded}%
  \addtolength{\hsize}{-0.20\columnwidth}%
  {\centering\Large\callouttitleT\\[0.2cm]}%
  \raggedright%
  \setlength\parindent{16pt}%
  }%
  {%
  \end{shaded}%
  \par
  }%

### CALLOUT LYX STYLES
Style CalloutTitle
Font
        Series  Bold
        Size Larger
EndFont
LatexName       callouttitleL
LatexType       Command
  Align                 Center
End

Style CalloutText
  LatexType             Environment
  LatexName             callouttextL
  LeftMargin            MMMMMM
  RightMargin           MMMMMM
  ParIndent             MMM
  TopSep                1.4
  ItemSep               0.7
  ParSep                0.7
  BottomSep             0.7
  Align                 Block
  AlignPossible         Block

  Font 
   Series               Medium
   Size                 Normal
   Shape                Italic
  EndFont
End

Reply via email to