Skip to content

Commit 2ccb19d

Browse files
Clement Foyerbgoglin
authored andcommitted
lstopo: Add output option for LaTeX tikzpicture
This output option generates a standalone picture to be compiled with pdflatex. The colors are defined using the xcolor package. If only the tikzpicture is of interest, one can extract the image code by copying the lines between "%%%%% If inserting in another document, this is the actual source code of the picture %%%%%" and "%%%%% End of actual source code of the picture to insert in another document %%%%%", however, some lines also have to be copied to the document preambule. Signed-off-by: Clement Foyer <[email protected]>
1 parent b2a7fcf commit 2ccb19d

14 files changed

+214
-3
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ Copyright © 2009 CNRS
22
Copyright © 2009-2020 Inria. All rights reserved.
33
Copyright © 2009-2013 Université Bordeaux
44
Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved.
5+
Copyright © 2020 Hewlett-Packard Enterprise. All rights reserved.
56

67
$COPYRIGHT$
78

@@ -29,6 +30,8 @@ Version 2.3.0
2930
+ Tools that have a --restrict option may now receive a nodeset or
3031
some custom flags for restricting the topology.
3132
+ Fix lstopo drawing when autoresizing on Windows 10
33+
+ Add a tikz lstopo graphical backend to generate picture easily included into
34+
LaTeX documents.
3235

3336

3437
Version 2.2.0

contrib/windows/lstopo-no-graphics.vcxproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
<ClCompile Include="..\..\utils\lstopo\lstopo.c" />
7373
<ClCompile Include="..\..\utils\lstopo\lstopo-ascii.c" />
7474
<ClCompile Include="..\..\utils\lstopo\lstopo-draw.c" />
75+
<ClCompile Include="..\..\utils\lstopo\lstopo-tikz.c" />
7576
<ClCompile Include="..\..\utils\lstopo\lstopo-fig.c" />
7677
<ClCompile Include="..\..\utils\lstopo\lstopo-svg.c" />
7778
<ClCompile Include="..\..\utils\lstopo\lstopo-text.c" />

contrib/windows/lstopo-no-graphics.vcxproj.filters

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
<ClCompile Include="..\..\utils\lstopo\lstopo-draw.c">
2525
<Filter>Source Files</Filter>
2626
</ClCompile>
27+
<ClCompile Include="..\..\utils\lstopo\lstopo-tikz.c">
28+
<Filter>Source Files</Filter>
29+
</ClCompile>
2730
<ClCompile Include="..\..\utils\lstopo\lstopo-fig.c">
2831
<Filter>Source Files</Filter>
2932
</ClCompile>

contrib/windows/lstopo-win.vcxproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
<ClCompile Include="..\..\utils\lstopo\lstopo.c" />
7474
<ClCompile Include="..\..\utils\lstopo\lstopo-ascii.c" />
7575
<ClCompile Include="..\..\utils\lstopo\lstopo-draw.c" />
76+
<ClCompile Include="..\..\utils\lstopo\lstopo-tikz.c" />
7677
<ClCompile Include="..\..\utils\lstopo\lstopo-fig.c" />
7778
<ClCompile Include="..\..\utils\lstopo\lstopo-svg.c" />
7879
<ClCompile Include="..\..\utils\lstopo\lstopo-text.c" />

contrib/windows/lstopo-win.vcxproj.filters

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
<ClCompile Include="..\..\utils\lstopo\lstopo-draw.c">
2525
<Filter>Source Files</Filter>
2626
</ClCompile>
27+
<ClCompile Include="..\..\utils\lstopo\lstopo-tikz.c">
28+
<Filter>Source Files</Filter>
29+
</ClCompile>
2730
<ClCompile Include="..\..\utils\lstopo\lstopo-fig.c">
2831
<Filter>Source Files</Filter>
2932
</ClCompile>

contrib/windows/lstopo.vcxproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
<ClCompile Include="..\..\utils\lstopo\lstopo.c" />
7373
<ClCompile Include="..\..\utils\lstopo\lstopo-ascii.c" />
7474
<ClCompile Include="..\..\utils\lstopo\lstopo-draw.c" />
75+
<ClCompile Include="..\..\utils\lstopo\lstopo-tikz.c" />
7576
<ClCompile Include="..\..\utils\lstopo\lstopo-fig.c" />
7677
<ClCompile Include="..\..\utils\lstopo\lstopo-svg.c" />
7778
<ClCompile Include="..\..\utils\lstopo\lstopo-text.c" />

contrib/windows/lstopo.vcxproj.filters

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
<ClCompile Include="..\..\utils\lstopo\lstopo-draw.c">
2525
<Filter>Source Files</Filter>
2626
</ClCompile>
27+
<ClCompile Include="..\..\utils\lstopo\lstopo-tikz.c">
28+
<Filter>Source Files</Filter>
29+
</ClCompile>
2730
<ClCompile Include="..\..\utils\lstopo\lstopo-fig.c">
2831
<Filter>Source Files</Filter>
2932
</ClCompile>

doc/hwloc.doxy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright © 2009-2020 Inria. All rights reserved.
44
* Copyright © 2009-2013 Université Bordeaux
55
* Copyright © 2009-2020 Cisco Systems, Inc. All rights reserved.
6+
* Copyright © 2020 Hewlett-Packard Enterprise. All rights reserved.
67
* See COPYING in top-level directory.
78
*/
89

@@ -84,7 +85,7 @@ work on "fake" topologies:
8485

8586
hwloc can display the topology in a human-readable format, either in
8687
graphical mode (X11), or by exporting in one of several different
87-
formats, including: plain text, PDF, PNG, and FIG (see \ref cli_examples
88+
formats, including: plain text, LaTeX tikzpicture, PDF, PNG, and FIG (see \ref cli_examples
8889
below). Note that some of the export formats require additional
8990
support libraries.
9091

utils/lstopo/Makefile.am

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Copyright © 2009-2019 Inria. All rights reserved.
22
# Copyright © 2009-2012, 2014 Université Bordeaux
33
# Copyright © 2009-2014 Cisco Systems, Inc. All rights reserved.
4+
# Copyright © 2020 Hewlett-Packard Enterprise. All rights reserved.
45
#
56
# See COPYING in top-level directory.
67

@@ -24,6 +25,7 @@ lstopo_no_graphics_SOURCES = \
2425
lstopo.h \
2526
lstopo.c \
2627
lstopo-draw.c \
28+
lstopo-tikz.c \
2729
lstopo-fig.c \
2830
lstopo-svg.c \
2931
lstopo-ascii.c \

utils/lstopo/lstopo-no-graphics.1in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
.\" Copyright © 2009-2020 Inria. All rights reserved.
33
.\" Copyright © 2009-2010 Université of Bordeaux
44
.\" Copyright © 2009-2010 Cisco Systems, Inc. All rights reserved.
5+
.\" Copyright © 2020 Hewlett-Packard Enterprise. All rights reserved.
56
.\" See COPYING in top-level directory.
67
.TH LSTOPO "1" "%HWLOC_DATE%" "%PACKAGE_VERSION%" "%PACKAGE_NAME%"
78
.SH NAME
@@ -447,6 +448,11 @@ If outputting to stdout and if colors are supported on the terminal,
447448
the output will be colorized.
448449
.
449450
.TP
451+
.B tikz or tex
452+
Output a LaTeX tikzpicture representation of the map that can be
453+
compiled with a LaTeX compiler.
454+
.
455+
.TP
450456
.B fig
451457
Output a representation of the map that can be loaded in Xfig.
452458
.

0 commit comments

Comments
 (0)