auctex
[Top][All Lists]

## Re: [AUCTeX] Not including the full path in \includegraphics

 From: Kourosh Kalayeh Subject: Re: [AUCTeX] Not including the full path in \includegraphics Date: Wed, 25 Jul 2018 16:47:06 -0400

```On 25 Jul 2018, at 16:05, Mosè Giordano wrote:

```
```Hi Kourosh,

2018-07-22 17:50 GMT+02:00 Kourosh Kalayeh <address@hidden>:
```
```Dear all,

```
Sorry if my question is repeated. I was not able to find an answer on the
```Web and AUCTeX mailing list.

```
I was wondering if there is anyway that I can tell AUCTeX to not to include
```a full path when using \includegraphics path.

More specifically, below is my workflow;
```
I usually use insert macro command (C-c Return) to add \includegraphics. AUCTeX then asks me for options and the path of the image that I want to include in my file. And it adds it with the full path with respect to the directory that my LaTeX file is in. I want AUCTeX to just use the image name
```in the inserted command. How can I achieve this?
```
I have explicitly set the path to my figures by adding \graphicspath command
```in my preamble.
```
```

--8<---------------cut here---------------start------------->8---
(file-name-base
"Image file: " nil nil nil nil
(lambda (fname)
(or (file-directory-p fname)
(string-match (LaTeX-includegraphics-extensions) fname))))))

--8<---------------cut here---------------end--------------->8---

returns the basename of file, without path and extension (which is
fine for LaTeX).

Bye,
Mosè
```
```
Mosè,

It works perfect. Thanks a lot.

Kind Regards,
Kourosh

```