Hi Fernando,

I use the same idea for my class notes - the students get one version
and the projector notes get a different version. This is what I ended
up doing it (there may be a better way!):

In your ReST code you something like:

.. only:: student

        - The answer for x =
        - The answer for y =
        
.. only:: instructor
                
        - The answer for x = :math:`238.8 - 3 \cdot
\dfrac{9.28}{(0.94)(\sqrt{5})} = 225.6`
        - The answer for y = :math:`238.8 + 3 \cdot
\dfrac{9.28}{(0.94)(\sqrt{5})} = 252.0`

A quick test on my end (not shown in the above code) shows that it
will handle the section idea that you require.

Then in my conf.py file I have these lines:

# The setting for student or instructor display. Uncomment the relevant line:
#tags.add('instructor')
tags.add('student')

Hope that helps,
Kevin

On Thu, Feb 4, 2010 at 19:01, Fernando Perez <fperez....@gmail.com> wrote:
> Hi all,
>
> I need to include some material (exercise solutions) for a doc build
> only in certain cases, but all my attempts so far are failing.  This:
>
>
> .. ifconfig:: include_solutions==True
>
>   Something trivial
>
>
> Works, and I see 'something trivial' in the pdf (I set ifconfig as per
> http://sphinx.pocoo.org/ext/ifconfig.html, using sphinx from hg here).
>
> But I actually need a section title, and calls to source code
> inclusion and math directives in there.  I tried things like:
>
> .. ifconfig:: include_solutions==True
>
>   Solution
>   ========
>
>   Solution
>
>   .. literalinclude:: examples/wordfreqs.py
>
>
>
> and a ton of variations, but so far nothing works.  Any hints on
> better use of ifconfig or perhaps an alternate solution to this
> problem  would be greatly appreciated.
>
> Cheers,
>
> f
>

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-dev" group.
To post to this group, send email to sphinx-...@googlegroups.com.
To unsubscribe from this group, send email to 
sphinx-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sphinx-dev?hl=en.

Reply via email to