Add in text cross references to figures, sections, and tables using the Report Genorator toolbox.
4 次查看(过去 30 天)
显示 更早的评论
I am using Report Generator to translate a spreadsheet into a complete word document with sections, text, tables, figures, etc. I want cross reference figures, tables, and section numbers in the body of the text. Something like "see Figure 1.1 for more detail". I want to reference the figure (or table or section) number as it falls in the report.
1 个评论
Joris
2023-9-3
I figured something out, though I would have liked the normal Xref documentation as Rahul Singhal pointed out to have covered this.
So to be clear, the normal Xref documentation works to get a cross reference, but with the title instead of the (in my experience common) type and number reference, e.g. Figure 5.6 / Table 4.
The solution I found still uses Xref, but the inspiration came from 'Number Section Headings, Table Titles, and Figure Captions Programmatically' documentation. Number Section Headings, Table Titles, and Figure Captions.
I modified the getFigureCaption and getTableTitle functions shown in the above documentation. So instead of using the Dom functions to caption figures (linkTarget on fig.Snapshot.Caption) and tables (linkTarget on BaseTable('Title', ...) I build my own paragraph with my own counters and set linkTarget to the Figure M.N portion / Table M.N of my captions. A bit of work but it does work out.
回答(1 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!