Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SVG files for in Chapter2/figs/vector/* is not recognised #167

Open
mxochicale opened this issue Jun 25, 2018 · 3 comments
Open

SVG files for in Chapter2/figs/vector/* is not recognised #167

mxochicale opened this issue Jun 25, 2018 · 3 comments

Comments

@mxochicale
Copy link

For some reason when using fig.svg file in Chapter2.tex

\begin{figure}[htbp!]
\centering
\includegraphics[width=1.0\textwidth]{fig}
\caption[Minion]{This is just a figure caption}
\label{fig:minion}
\end{figure}

with images in the right path

/phd-thesis/chapter2/figs$ tree
.
├── raster
│   └── WallE.png
└── vector
    ├── fig.svg
    ├── WallE.eps
    └── WallE-eps-converted-to.pdf

I got this error after using make:

Makefile:2824: thesis.d: No such file or directory
= thesis.tex --> thesis.d thesis.pdf.1st.make (0-1) =
make: *** No rule to make target 'fig', needed by 'thesis.d'. Stop.

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?

@kks32
Copy link
Owner

kks32 commented Jun 25, 2018

@mxochicale
Copy link
Author

mxochicale commented Jul 24, 2018

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 holgern/TUB_PhDThesisTemplate#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!

@clbarnes
Copy link
Contributor

clbarnes commented Nov 20, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants