emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-latex-image-default-width ignored
@ 2018-03-24 15:20 Julien Cubizolles
  2018-03-24 17:57 ` Eric S Fraga
  0 siblings, 1 reply; 5+ messages in thread
From: Julien Cubizolles @ 2018-03-24 15:20 UTC (permalink / raw)
  To: emacs-orgmode

I'd like all inline images resized during beamer and latex export. I
tried setting org-latex-image-default-width to ".3\\linewidth" but after
export the latex file still uses the default .9\linewidth default. See
the following examples.

Julien.

orgmode file:
--8<---------------cut here---------------start------------->8---
#+begin_src emacs-lisp :exports none
  (setq org-latex-image-default-width ".3\\linewidth")
#+end_src

#+RESULTS:
: .3\linewidth

* hello
[[file:file:/home/wilk/enseignement/schemas/plickers/mvmt-circ-F-faux.png]]
--8<---------------cut here---------------end--------------->8---

gets exported to:
--8<---------------cut here---------------start------------->8---
% Created 2018-03-24 sam. 16:06
% Intended LaTeX compiler: pdflatex
\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{grffile}
\usepackage{longtable}
\usepackage{wrapfig}
\usepackage{rotating}
\usepackage[normalem]{ulem}
\usepackage{amsmath}
\usepackage{textcomp}
\usepackage{amssymb}
\usepackage{capt-of}
\usepackage{hyperref}
\author{Julien Cubizolles}
\date{\today}
\title{}
\hypersetup{
 pdfauthor={Julien Cubizolles},
 pdftitle={},
 pdfkeywords={},
 pdfsubject={},
 pdfcreator={Emacs 27.0.50 (Org mode 9.1.7)}, 
 pdflang={English}}
\begin{document}

\tableofcontents

\section{hello}
\label{sec:org777755b}
\begin{center}
\includegraphics[width=.9\linewidth]{file:/home/wilk/enseignement/schemas/plickers/mvmt-circ-F-faux.png}
\end{center}
\end{document}--8<---------------cut here---------------end--------------->8---

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: org-latex-image-default-width ignored
  2018-03-24 15:20 org-latex-image-default-width ignored Julien Cubizolles
@ 2018-03-24 17:57 ` Eric S Fraga
  2018-03-25  7:52   ` Julien Cubizolles
  0 siblings, 1 reply; 5+ messages in thread
From: Eric S Fraga @ 2018-03-24 17:57 UTC (permalink / raw)
  To: Julien Cubizolles; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 469 bytes --]

On Saturday, 24 Mar 2018 at 16:20, Julien Cubizolles wrote:
> I'd like all inline images resized during beamer and latex export. I
> tried setting org-latex-image-default-width to ".3\\linewidth" but after
> export the latex file still uses the default .9\linewidth default. See
> the following examples.

Your example works for me with up to date org from git.  What version
are you using?

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.1.6-341-g3a4fd3

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 194 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: org-latex-image-default-width ignored
  2018-03-24 17:57 ` Eric S Fraga
@ 2018-03-25  7:52   ` Julien Cubizolles
  2018-03-25 11:56     ` Eric S Fraga
  0 siblings, 1 reply; 5+ messages in thread
From: Julien Cubizolles @ 2018-03-25  7:52 UTC (permalink / raw)
  To: emacs-orgmode

Eric S Fraga <esflists@gmail.com> writes:

> On Saturday, 24 Mar 2018 at 16:20, Julien Cubizolles wrote:
>> I'd like all inline images resized during beamer and latex export. I
>> tried setting org-latex-image-default-width to ".3\\linewidth" but after
>> export the latex file still uses the default .9\linewidth default. See
>> the following examples.
>
> Your example works for me with up to date org from git.  What version
> are you using?

Found the cause of the problem, my default configuration exports in
async mode, so this variable should be set in
org-export-async-init.el.

Is there a way to have a variable set during export to avoid setting it
for all exports?

Julien.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: org-latex-image-default-width ignored
  2018-03-25  7:52   ` Julien Cubizolles
@ 2018-03-25 11:56     ` Eric S Fraga
  2018-03-26  8:39       ` Julien Cubizolles
  0 siblings, 1 reply; 5+ messages in thread
From: Eric S Fraga @ 2018-03-25 11:56 UTC (permalink / raw)
  To: Julien Cubizolles; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 473 bytes --]

On Sunday, 25 Mar 2018 at 09:52, Julien Cubizolles wrote:
> Found the cause of the problem, my default configuration exports in
> async mode, so this variable should be set in
> org-export-async-init.el.
>
> Is there a way to have a variable set during export to avoid setting it
> for all exports?

I've never used the async export so I am not sure but maybe check out
the #+bind: directive?

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.1.6-347-gd73a5e

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 194 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: org-latex-image-default-width ignored
  2018-03-25 11:56     ` Eric S Fraga
@ 2018-03-26  8:39       ` Julien Cubizolles
  0 siblings, 0 replies; 5+ messages in thread
From: Julien Cubizolles @ 2018-03-26  8:39 UTC (permalink / raw)
  To: emacs-orgmode

Eric S Fraga <esflists@gmail.com> writes:

> On Sunday, 25 Mar 2018 at 09:52, Julien Cubizolles wrote:
>> Found the cause of the problem, my default configuration exports in
>> async mode, so this variable should be set in
>> org-export-async-init.el.
>>
>> Is there a way to have a variable set during export to avoid setting it
>> for all exports?
>
> I've never used the async export so I am not sure but maybe check out
> the #+bind: directive?

I tried

--8<---------------cut here---------------start------------->8---
#+BIND: org-latex-image-default-width ".3\\linewidth"
--8<---------------cut here---------------end--------------->8---

with no success in async mode, but it works in synchronous mode. I guess
I'll avoid async mode for now on, or use a set of different
org-export-async-init.el files for different files.

Nevertheless I think it would make sense to have a way to set some
variables during async export. According to the Org Manual:

--8<---------------cut here---------------start------------->8---
Emacs variables can become buffer-local during export by using the BIND
keyword.  Its syntax is ‘#+BIND: variable value’.  This is particularly
useful for in-buffer settings that cannot be changed using keywords.
--8<---------------cut here---------------end--------------->8---

But the options set using #+ keywords are used during async export while
those set using #+BIND are ignored. A "+BIND-ASYNC would come in handy.

Julien.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-03-26  8:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-24 15:20 org-latex-image-default-width ignored Julien Cubizolles
2018-03-24 17:57 ` Eric S Fraga
2018-03-25  7:52   ` Julien Cubizolles
2018-03-25 11:56     ` Eric S Fraga
2018-03-26  8:39       ` Julien Cubizolles

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).