Open mxochicale opened 6 years ago
Have you looked at this: https://tex.stackexchange.com/questions/2099/how-to-include-svg-diagrams-in-latex?
Thanks for the reference but I am not using LaTex compiler to create SVG files. Makefile has the following rule:
# Converts svg files into .eps files
#
# $(call convert-svg,<svg file>,<eps/pdf file>,[gray])
convert-svg = $(INKSCAPE) --without-gui $(if $(filter %.pdf,$2),--export-pdf,--export-eps)='$2' '$1'
for the purpose of the conversion from svg to PDF. However, make output is the following:
$ make
make: *** No rule to make target 'drawing', needed by 'thesis.d'. Stop
and some output in "thesis.d" said the following
90 .SECONDEXPANSION:
91 # MISSING stem "drawing" - allowed extensions are ".png,.jpg,.pdf,.eps" - leave comment here - it affects the build
92 -include drawing.gpi.d
From Makefile, I found that Holger Nahrstaedt is the last maintainer of Makefile and so I create an issue https://github.com/holgern/TUB_PhDThesisTemplate/issues/2 asking the same question.
For the time being, what it is working for me when using SVG files is following command typed in the terminal:
inkscape --export-pdf PDF/thesis-structure.pdf vector/drawing.svg
I appreciate any help that you can provide!
A bit old, but for anyone who comes across this in the future:
I understand that inkscape sometimes rasterises stuff you don't want it to, and as such I personally use rsvg-convert
to convert SVGs into PDFs as per this answer. In my repo I have a scripts
directory, which includes this script:
#!/bin/bash
set -e
ROOT_PATH=$1
for SVG_PATH in $(find ${ROOT_PATH} -iname "*.svg" | grep -vP "CollegeShields/")
do
PDF_PATH="${SVG_PATH%.svg}.pdf"
if [ ! -f "${PDF_PATH}" ] || [ "${SVG_PATH}" -nt "${PDF_PATH}" ]; then
echo "converting ${SVG_PATH} to PDF"
rsvg-convert -f pdf -o ${PDF_PATH} ${SVG_PATH}
else
echo "don't need to convert ${SVG_PATH}"
fi
done
It looks for any file ending with .svg
which isn't below the CollegeShields
directory, then if that SVG doesn't have a PDF of the same name in the same directory, or it does but the SVG file is newer than the PDF, the conversion is done.
Then in my makefile:
.PHONY: svg-convert
svg-convert:
./scripts/svg-convert.sh .
then I add svg-convert
as a dependency of the all
and all-pdf
recipes.
For some reason when using fig.svg file in Chapter2.tex
with images in the right path
I got this error after using make:
I checked the Makefile (version := 2.2.1-alpha10) and it seems fine and tried with eps files and the making works well.
Any suggestions?