I only want to include the text with :ref:`installation` when building a 
latex (or latexpdf) document.  So, when "make html" is run, this code::

    .. only:: latex

       See the section called :ref:`installation`.

generates this warning::

    C:\Users\...\Introduction.rst:14: WARNING: undefined label: 
installation (if the link has no caption the label must precede a section 
header)

When using the "html" builder, this line should not produce any output or 
warnings or ... since it is inside the only directive that specifies a 
different builder.  In truth, the installation label is *not* present.  
That *would* be brought in to a the document under the same type of "only" 
directive elsewhere.

What have I misunderstood about the "only" directive?
http://www.sphinx-doc.org/en/stable/markup/misc.html#directive-only

Here is another user who has the same assumption, that content within the 
only directive will not be processed.
https://trello.com/c/84v7OWVz/1335-sphinx-improve-only-directive-2150

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sphinx-users+unsubscr...@googlegroups.com.
To post to this group, send email to sphinx-users@googlegroups.com.
Visit this group at https://groups.google.com/group/sphinx-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to