frankluebeck / GAPDoc

A package to generate documentation for GAP (https://www.gap-system.org) code
http://www.math.rwth-aachen.de/~Frank.Luebeck/GAPDoc/
5 stars 10 forks source link

Is it possible to include pictures in GAPDoc manual sections? #69

Open james-d-mitchell opened 7 months ago

james-d-mitchell commented 7 months ago

This isn't so much an issue as the question in the title, maybe this is already answered in the manual, but I didn't find it. Thanks in advance @frankluebeck

frankluebeck commented 6 months ago

Yes, this question comes up from time to time.

There is nothing like an <Image> tag in GAPDoc. The main reason is that there is no way to display images in the text version of the documentation (used in the terminal that runs GAP). Therefore, usually pictures should be avoided.

What you can use (and in some manuals this is done) is the tag and specifiy separately what should appear in the HTML, PDF and text version of the manual.

james-d-mitchell commented 6 months ago

Thanks for your reply @frankluebeck. Could you possibly post an example of what you mean by:

What you can use (and in some manuals this is done) is the tag

I'm not sure what tag you are referring to here. Thanks again!

james-d-mitchell commented 6 months ago

Ah, I think I should use something like this:

<![CDATA[<img width="350" src="cytoscape-example.png"/>]]></Alt>
fingolfin commented 6 months ago

@james-d-mitchell yes exactly. Here is a more complex example from ctbllib:

<Alt Only='HTML'><![CDATA[
<center>
<img src="ambigfus1.png" alt="setup: some subgroups of G"/>
</center>
]]></Alt>

<Alt Only='Text'>
<Verb>
                                G
                               ╱ ╲
                              ╱   ╲
                             M     S
                              ╲   ╱
                               ╲ ╱
                                .
                                │
                                U
                                │
                                │
                                1
</Verb>
</Alt>

<Alt Only='LaTeX'>
<!-- BP ambigfus1 -->
<![CDATA[
\setlength{\unitlength}{3pt}
\begin{center}
\begin{picture}(40,30)(-10,0)
\put(10, 5){\circle*{1}}
\put(10,10){\circle{1}} \put(13,10){\makebox(0,0){$U$}}
\put(10,15){\circle{1}}
\put( 5,20){\circle{1}} \put(2,20){\makebox(0,0){$M$}}
\put(15,20){\circle{1}} \put(17,20){\makebox(0,0){$S$}}
\put(10,25){\circle*{1}} \put(10,28){\makebox(0,0){$G$}}
\put(10, 5){\line(0,1){10}}
\put(10,15){\line(-1,1){5}}
\put(10,15){\line(1,1){5}}
\put( 5,20){\line(1,1){5}}
\put(15,20){\line(-1,1){5}}
\end{picture}
\end{center}
]]>
<!-- EP -->
</Alt>
james-d-mitchell commented 6 months ago

Thanks @frankluebeck and @fingolfin