문제

I'm generating some troff-style documentation. Is there a way to embed an image (jpg, etc) into a groff file?

도움이 되었습니까?

해결책

Depends on the output format. If you are creating a PostScript file, you can use PSPIC which uses a PS file itself with a single image. For example:

.PSPIC image.ps

Alignment, etc is a bit limited. By default it is aligned to the center but you can put it at the left or the right corner using -L or -R. There are some other options, check the groff_tmac manpage for these (search for pspic).

If you are creating a webpage you might need to use .IMG instead. The syntax is the same.

다른 팁

I use groff to prepare data analysis reports, and often need to tweak my graphs outside of R using Inkscape.

The following may not be to purists' liking but it works for me. Carefully name the images as you generate them, and provision the necessary vertical space for each image, adding appropriate labels.

Create the report's pdf (say tbl report.roff | eqn | groff -Tps -ms | ps2pdfwr - report.pdf) and use Inkscape (or any other pdf editor such as Pdf Studio) to copy-paste the images in the report's pdf.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top