emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Rescaling #+INCLUDES / Not centering #+INCLUDE?
@ 2021-10-05 14:18 Guillaume MULLER
  2021-10-05 15:06 ` Eric S Fraga
  0 siblings, 1 reply; 6+ messages in thread
From: Guillaume MULLER @ 2021-10-05 14:18 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1.1: Type: text/plain, Size: 1893 bytes --]

Hi,

I have Emacs 26.3 + Org mode 9.4.6.

I tried to recompile an org-beamer file I created a few moths ago (see equivalent MCE attached), but it did not succeed.

The thing is I was #+INCLUDing a .dot file (also attached for completeness, but it could be any .dot file). I was putting the result inside a scalebox:

@@latex: \center \scalebox{.85}{@@
#+INCLUDE: test.dot src dot :file test.png
@@latex:}@@

I don't know how it was translated in previous versions of org-mode but it compiled perfectly.

Now I get error "! LaTeX Error: Something's wrong--perhaps a missing \item." during LaTeX compilation.

It seems the problem comes from the fact that the included file is automatically \begin{center}ed, which conflicts with my scalebox, as seen in output .tex file:

\begin{frame}[label={sec:org0a44c10}]{Test Slide}
 \center \scalebox{.85}{
\begin{center}
\includegraphics[width=.9\linewidth]{./images/DesignPatterns/23_DesignPatterns.png}
\end{center}

}
\end{frame}

When I remove the \begin/end{center}, the .tex file compiles fine.

I've tried to add ":center false" in the #+INCLUDE instruction and in a #+ATTR_LATEX preceding the #+INCLUDE. With no success.

I cannot find anything about centering (or not) a #+INCLUDE results in the docs nor in the mailing list.

Maybe there is a way to rescale the output without the \scalebox too, but I couldn't find how. Whatever I put in the #+ATTR_LATEX before the #+INCLUDE or in the #+INCLUDE (:cmdline -Gsize for dot) does not seem to be taken into account.

So any help would be appreciated.

BTW, thanks for the magnificent tools. I use them everyday and I love them!

Regards,

-- 
Guillaume MULLER
Data Scientist, PhD
Télécom Saint-Étienne (office i119)
25 rue du Dr Remy Annino
-
Laboratoire Hubert Curien (office e002)
18 rue du Pr Benoît Lauras
-
42000 Saint-Étienne
FRANCE

[-- Attachment #1.1.2: test.dot --]
[-- Type: application/msword-template, Size: 2283 bytes --]

[-- Attachment #1.1.3: test.org --]
[-- Type: text/plain, Size: 217 bytes --]

#+STARTUP: showall indent beamer

#+LATEX_CLASS: beamer

* Test Slide

#+ATTR_LATEX: :width .1\textwidth
#+ATTR_DOT: size="9,15"
#+INCLUDE: test.dot src dot results :cmdline -Tpng -Gsize=9,15 -Gdpi=100 :file test.png

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

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

* Re: Rescaling #+INCLUDES / Not centering #+INCLUDE?
  2021-10-05 14:18 Rescaling #+INCLUDES / Not centering #+INCLUDE? Guillaume MULLER
@ 2021-10-05 15:06 ` Eric S Fraga
  2021-10-06 15:30   ` Guillaume MULLER
  0 siblings, 1 reply; 6+ messages in thread
From: Eric S Fraga @ 2021-10-05 15:06 UTC (permalink / raw)
  To: Guillaume MULLER; +Cc: emacs-orgmode

A data point: your example works just fine in org 9.5.
-- 
: Eric S Fraga via Emacs 28.0.60, Org release_9.5-62-gcc2490
: Latest paper written in org: https://arxiv.org/abs/2106.05096


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

* Re: Rescaling #+INCLUDES / Not centering #+INCLUDE?
  2021-10-05 15:06 ` Eric S Fraga
@ 2021-10-06 15:30   ` Guillaume MULLER
  2021-10-07  7:24     ` Eric S Fraga
  2022-09-10  8:54     ` Ihor Radchenko
  0 siblings, 2 replies; 6+ messages in thread
From: Guillaume MULLER @ 2021-10-06 15:30 UTC (permalink / raw)
  To: Org Mode List


[-- Attachment #1.1.1: Type: text/plain, Size: 1191 bytes --]



On 10/5/21 5:06 PM, Eric S Fraga wrote:
> A data point: your example works just fine in org 9.5.

Arg... Yes sorry, I mixed up my MCE with my tests to get rid of the scalebox.

You'll find attached the actual non working .org file with the \scalebox that conflicts with the  \begin{center} that is automatically inserted by #+INCLUDE


My (unsuccessful) approaches so far to find a solution:
1. remove the automatic \begin{center} inserted by #+INCLUDE
   => using :center nil in #+INCLUDE or in additional #+ATTR_LATEX added above #+INCLUDE does not work
2. remove the use of \scalebox by using a more "org-mode"'s way of doing things
   => using :width in #+INCLUDE or in additional #+ATTR_LATEX or even passing options to dot have no effect (see previously attached file) 

Thanks for any help

PS: Sorry for my other mistake: I thought MELPA had latest org-mode, but I've now switched to actual lastest org-mode using git clone. Same problem occurs.
-- 
Guillaume MULLER
Data Scientist, PhD
Télécom Saint-Étienne (office i119)
25 rue du Dr Remy Annino
-
Laboratoire Hubert Curien (office e002)
18 rue du Pr Benoît Lauras
-
42000 Saint-Étienne
FRANCE

[-- Attachment #1.1.2: test_MCE.org --]
[-- Type: text/plain, Size: 172 bytes --]

#+STARTUP: showall indent beamer

#+LATEX_CLASS: beamer

* Test Slide

#+LATEX: \scalebox{.85\textwidth}{
#+INCLUDE: test.dot src dot :center nil :file test.png
#+LATEX: }

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

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

* Re: Rescaling #+INCLUDES / Not centering #+INCLUDE?
  2021-10-06 15:30   ` Guillaume MULLER
@ 2021-10-07  7:24     ` Eric S Fraga
  2022-09-10  8:54     ` Ihor Radchenko
  1 sibling, 0 replies; 6+ messages in thread
From: Eric S Fraga @ 2021-10-07  7:24 UTC (permalink / raw)
  To: Guillaume MULLER; +Cc: Org Mode List

Confirmed: this version does not work for me either.

-- 
: Eric S Fraga via Emacs 28.0.60, Org release_9.5-63-g67b613
: Latest paper written in org: https://arxiv.org/abs/2106.05096


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

* Re: Rescaling #+INCLUDES / Not centering #+INCLUDE?
  2021-10-06 15:30   ` Guillaume MULLER
  2021-10-07  7:24     ` Eric S Fraga
@ 2022-09-10  8:54     ` Ihor Radchenko
  2022-09-10 11:22       ` Max Nikulin
  1 sibling, 1 reply; 6+ messages in thread
From: Ihor Radchenko @ 2022-09-10  8:54 UTC (permalink / raw)
  To: Guillaume MULLER; +Cc: Org Mode List

Guillaume MULLER <guillaume.muller@univ-st-etienne.fr> writes:

> My (unsuccessful) approaches so far to find a solution:
> 1. remove the automatic \begin{center} inserted by #+INCLUDE
>    => using :center nil in #+INCLUDE or in additional #+ATTR_LATEX added above #+INCLUDE does not work
> 2. remove the use of \scalebox by using a more "org-mode"'s way of doing things
>    => using :width in #+INCLUDE or in additional #+ATTR_LATEX or even passing options to dot have no effect (see previously attached file) 

It is kind of late, but I think that the problem is not with Org. Rather
with LaTeX. Org uses \begin{center}..\end{center} around the image,
which cannot be used inside \scalebox. See
https://tex.stackexchange.com/questions/67843/problem-resizing-an-itemize-environment-with-a-scalebox-somethings-wrong 


-- 
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92


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

* Re: Rescaling #+INCLUDES / Not centering #+INCLUDE?
  2022-09-10  8:54     ` Ihor Radchenko
@ 2022-09-10 11:22       ` Max Nikulin
  0 siblings, 0 replies; 6+ messages in thread
From: Max Nikulin @ 2022-09-10 11:22 UTC (permalink / raw)
  To: emacs-orgmode

On 10/09/2022 15:54, Ihor Radchenko wrote:
> Guillaume MULLER writes:
> 
>> My (unsuccessful) approaches so far to find a solution:
>> 1. remove the automatic \begin{center} inserted by #+INCLUDE
>>     => using :center nil in #+INCLUDE or in additional #+ATTR_LATEX added above #+INCLUDE does not work
>> 2. remove the use of \scalebox by using a more "org-mode"'s way of doing things
>>     => using :width in #+INCLUDE or in additional #+ATTR_LATEX or even passing options to dot have no effect (see previously attached file)
> 
> It is kind of late, but I think that the problem is not with Org. Rather
> with LaTeX. Org uses \begin{center}..\end{center} around the image,
> which cannot be used inside \scalebox. See
> https://tex.stackexchange.com/questions/67843/problem-resizing-an-itemize-environment-with-a-scalebox-somethings-wrong

I have not tried to reproduce the issue, but provided latex snippet is 
quite strange. Accordingly to ORG-NEWS, \scalebox was added in 9.3 for 
tikz and pdf, while \includegraphics appeared in the example. In this 
case scale should be applied through \includegraphics option.

Anyway I expect \begin{center} around \scalebox, not inside it.

Finally it should be possible to pass :center nil through ob-dot to the 
generated image.



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

end of thread, other threads:[~2022-09-10 11:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-05 14:18 Rescaling #+INCLUDES / Not centering #+INCLUDE? Guillaume MULLER
2021-10-05 15:06 ` Eric S Fraga
2021-10-06 15:30   ` Guillaume MULLER
2021-10-07  7:24     ` Eric S Fraga
2022-09-10  8:54     ` Ihor Radchenko
2022-09-10 11:22       ` Max Nikulin

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).