emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Emmanuel Charpentier <emanuel.charpentier@gmail.com>
To: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: (no subject)
Date: Wed, 19 Dec 2018 13:58:43 +0100	[thread overview]
Message-ID: <CAFG8T6XFuc0=oCyF5OSSjs3ASwxx8FRp5dpwGQMBTqefoFFHXg@mail.gmail.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 2223 bytes --]

[ Fourth attempt to send this to emacs-orgmode ; the first three attempts
were made from an account using an SMTP server seemingly blacklisted, but
no error message was sent back. Apologies if this turns out to be a
duplicate ]

I wish to be able to reference (i. e cross-references, lists) both some
tables or figures AND the code producing the objects.

To this effect, I added (distinct) #+caption:s to the source blocks AND
to the results, adorned with (distinct) org-ref's labels. An example is
included in the enclosed file Min-Ref.org.

The comparison of this source, the LaTeX code obtained by org-latex
export-to latex (Min-Ref.tex) and the resultant PDF (Min-Ref exported
by org-latex-export-to-pdf.pdf) show that the labels attributed to
source blocks are mislabeled as figures. Furthermore, while the org
source requests a list of figure, a list of table and a list of
listings (in that order), the list of figures appears *after* the list
of tables.

I am tempted to conclude that there is some confusion between figures
and listings. Further attempts tend to show that the problem may live n
the core org's code, rather than any specific exporter :

The ODT "native" exporter (org-odt-export-to-odt) is much less capable,
as shown in Min-Ref exported by org-odt-export-to-odt.odt.

Attempts to export via Pandoc to PDF (Min-Ref exported by org-pandoc-
export-to-latex-pdf.pdf), ODT (Min-Ref exported by org-pandoc-export-
to-odt.odt) and DOCX (Min-Ref.docx) show that these exporters may need
some specific configurations in order to be even vaguely usable.

Previous trials, using #+names: rather than org-ref's labels, gave
similar failures. If needed, I can reproduce these trials.

So I have a couple questions :

1) Is the confusion of source blocks and figures a bug, or do I miss a
subtle point ?

2) Is there some introductory material to the care and feeding of ox-
pandoc demonstrating the use of this exporter's options to enable the
addition of the needed features (figure inclusion, tables of tables /
figures / listings, etc...) ? The "manual" available as a README is way
too terse to be usable without diving in the source code and pandoc's
documentation.

Sincerely,

--
Emmanuel Charpentier

[-- Attachment #1.2: Type: text/html, Size: 3340 bytes --]

[-- Attachment #2: Min-Ref.docx --]
[-- Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document, Size: 10789 bytes --]

[-- Attachment #3: Min-Ref.org --]
[-- Type: application/octet-stream, Size: 1645 bytes --]


#+options: toc:nil
#+property: header-args:python :session
#+language: fr

#+title: What's up with references ?
#+author:
#+date: December 2018

#+toc: headlines
#+toc: figures
#+toc: tables
#+toc: listings

* Some reference samples

This is created using =org-ref= 's =label= 's and =ref= 's.

** A reference...

... to cite:gelmanBayesianDataAnalysis2013 ,a /good/ textbook.

** A table

A Python block producing a (silly) table.

#+caption: A (silly) Python block. label:lst:Python1
#+BEGIN_SRC python :results table :exports both
[[u+str(v) for v in range(1,4)] for u in ["a", "b"]]
#+END_SRC

#+caption: A (silly) Python table. label:tab:Python1
#+RESULTS:
| a1 | a2 | a3 |
| b1 | b2 | b3 |

The table ref:tab:Python1 is produced by the code ref:lst:Python1.

** A figure

A Python block producing a figure.

#+caption: A Python block producing a figure. label:lst:Python2
#+BEGIN_SRC python :results file :exports both
import matplotlib.pyplot as plt, numpy as np
from sympy import *
x=symbols("x")
f=lambda x:sin(x)/x
t=np.arange(-6*np.pi,6*np.pi, 0.1)
ft=[f(u) for u in t]
fig=plt.figure(figsize=(3,2))
plt.plot(t, ft, "b-")
fig.tight_layout()
plt.savefig("tstfig.pdf")
"tstfig.pdf"
#+END_SRC

#+caption: A (not so silly) figure produced by Python. label:fig:Python2
#+RESULTS:
[[file:tstfig.pdf]]

The figure ref:fig:Python2 is produced by the code ref:lst:Python2.

[[bibliographystyle:vancouver]]
[[bibliography:Minimal.bib]]

# Local Variables:
# org-latex-packages-alist: (("AUTO" "babel" t ("pdflatex")) ("AUTO" "polyglossia" t ("xelatex" "lualatex")))
# org-latex-pdf-process: ("latexmk -shell-escape -bibtex -f -pdf %f")
# End:

[-- Attachment #4: Min-Ref.tex --]
[-- Type: text/x-tex, Size: 2236 bytes --]

% Created 2018-12-17 lun. 15:49
% 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}
\usepackage[frenchb]{babel}
\date{December 2018}
\title{What's up with references ?}
\hypersetup{
 pdfauthor={},
 pdftitle={What's up with references ?},
 pdfkeywords={},
 pdfsubject={},
 pdfcreator={Emacs 27.0.50 (Org mode 9.1.14)}, 
 pdflang={Frenchb}}
\begin{document}

\maketitle
\tableofcontents
\listoftables
\listoffigures

\section{Some reference samples}
\label{sec:orgfe4b8ad}

This is created using \texttt{org-ref} 's \texttt{label} 's and \texttt{ref} 's.

\subsection{A reference\ldots{}}
\label{sec:org22891f6}

\ldots{} to \cite{gelmanBayesianDataAnalysis2013} ,a \emph{good} textbook.

\subsection{A table}
\label{sec:org844d514}

A Python block producing a (silly) table.

\begin{verbatim}
[[u+str(v) for v in range(1,4)] for u in ["a", "b"]]
\end{verbatim}
\captionof{figure}{A (silly) Python block. \label{lst:Python1}}

\begin{table}[htbp]
\caption{A (silly) Python table. \label{tab:Python1}}
\centering
\begin{tabular}{lll}
a1 & a2 & a3\\
b1 & b2 & b3\\
\end{tabular}
\end{table}

The table \ref{tab:Python1} is produced by the code \ref{lst:Python1}.

\subsection{A figure}
\label{sec:orgf75a27d}

A Python block producing a figure.

\begin{verbatim}
import matplotlib.pyplot as plt, numpy as np
from sympy import *
x=symbols("x")
f=lambda x:sin(x)/x
t=np.arange(-6*np.pi,6*np.pi, 0.1)
ft=[f(u) for u in t]
fig=plt.figure(figsize=(3,2))
plt.plot(t, ft, "b-")
fig.tight_layout()
plt.savefig("tstfig.pdf")
"tstfig.pdf"
\end{verbatim}
\captionof{figure}{A Python block producing a figure. \label{lst:Python2}}

\begin{figure}[htbp]
\centering
\includegraphics[width=.9\linewidth]{tstfig.pdf}
\caption{A (not so silly) figure produced by Python. \label{fig:Python2}}
\end{figure}

The figure \ref{fig:Python2} is produced by the code \ref{lst:Python2}.

\bibliographystyle{vancouver}
\bibliography{Minimal}
\end{document}

[-- Attachment #5: Min-Ref exported by org-latex-export-to-pdf.pdf --]
[-- Type: application/pdf, Size: 143423 bytes --]

[-- Attachment #6: Min-Ref exported by org-odt-export-to-odt.odt --]
[-- Type: application/vnd.oasis.opendocument.text, Size: 18946 bytes --]

[-- Attachment #7: Min-Ref exported by org-pandoc-export-to-latex-pdf.pdf --]
[-- Type: application/pdf, Size: 202284 bytes --]

[-- Attachment #8: Min-Ref exported by org-pandoc-export-to-odt.odt --]
[-- Type: application/vnd.oasis.opendocument.text, Size: 17044 bytes --]

             reply	other threads:[~2018-12-19 12:59 UTC|newest]

Thread overview: 93+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-19 12:58 Emmanuel Charpentier [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-02-04  3:40 (no subject) Lawrence Bottorff
2018-10-20  9:02 stardiviner
2018-10-15  8:04 Nik Clayton
2018-10-17 13:20 ` Nicolas Goaziou
2019-09-15 21:06 ` Matt Price
2018-05-03 13:44 Arne Babenhauserheide
2018-05-03 14:29 ` Bastien
2018-05-03 21:02   ` Arne Babenhauserheide
2018-05-04  1:02     ` steen
2018-05-04  5:38   ` Michael Welle
2018-05-11 20:07 ` Nicolas Goaziou
2018-03-02 16:10 Joseph Vidal-Rosset
2016-11-01 16:10 John Kitchin
2016-09-19 16:38 John Brodie
2016-09-20 20:32 ` Nicolas Goaziou
2015-11-03 19:53 Fritz Kunze
2015-10-11 19:51 Shankar Rao
2015-09-04 14:51 Eduardo Mercovich
2015-09-04 15:25 ` thomas
2015-09-04 18:35   ` Eduardo Mercovich
2015-01-24 16:23 M.S.Khed Khed
2014-05-03  1:52 Ryan Moszynski
2014-05-03  3:01 ` William Henney
2014-05-03  3:22   ` William Henney
2014-01-30  0:03 Ken Okada
2014-01-30  0:15 ` Bastien
2014-01-30  0:22   ` John Hendy
2014-01-30  7:17     ` Ken Okada
2014-01-31  6:29       ` John Hendy
2014-01-31  7:11         ` Nick Dokos
2014-02-03 22:13           ` Marcin Borkowski
2013-11-06  6:13 Cecil Westerhof
2013-11-06  8:32 ` Bastien
2013-11-06  8:42 ` Bastien
     [not found]   ` <CAG-LmmDGaczy8pyeCTU6-YJ9oTBeEufqU6kC2PUb-U6ucexhZA@mail.gmail.com>
     [not found]     ` <87txfpaeli.fsf@bzg.ath.cx>
     [not found]       ` <CAG-LmmDFjqbuqfF1YJoeX6x_UdujK+0noeFcGSD15hs49Tbo=Q@mail.gmail.com>
2013-11-06 18:38         ` Cecil Westerhof
2013-10-11  7:14 "Recent items" Agenda view? Martin Beck
2013-10-11 20:35 ` Samuel Wales
2013-10-14  8:46   ` (no subject) Martin Beck
2013-03-07 20:37 [RFC] Org syntax (draft) Nicolas Goaziou
2013-03-08 10:39 ` was: " Andreas Röhler
2013-03-08 10:46   ` (no subject) Bastien
2013-03-08 10:59     ` Andreas Röhler
2013-03-08 11:05       ` Bastien
2013-03-08 11:18         ` Andreas Röhler
2013-03-08 11:23           ` Bastien
2013-03-08 13:00             ` Andreas Röhler
2013-03-08 13:12               ` Bastien
2013-03-08 15:22                 ` Andreas Röhler
2013-03-08 15:40                   ` Bastien
2013-03-08 20:39                     ` T.F. Torrey
2013-03-08 21:19                       ` Nicolas Goaziou
2013-03-08 21:57                         ` Suvayu Ali
2013-03-09 14:09                       ` Bastien
2013-03-10 22:40                         ` T.F. Torrey
2013-03-03  0:55 Vikas Rawal
2013-01-29  9:43 Martin Beck
2013-01-30 12:12 ` Bernt Hansen
2013-01-24 12:11 Herbert Sitz
2013-01-15 19:26 Rick Frankel
2012-11-11 15:36 Fabrice Popineau
2012-11-11 23:09 ` Nicolas Goaziou
2012-11-12  7:40   ` Fabrice Popineau
2012-11-07 18:50 Kevin Buchs
2012-09-29  7:30 Neuwirth Erich
2012-09-29  7:39 ` Bastien
2012-09-29  8:09   ` Achim Gratz
2012-09-29  9:12     ` Bastien
2012-09-29  9:52 ` Achim Gratz
2012-08-24 16:21 Feiming Chen
2012-05-22  3:32 "Smart" quotes Mark E. Shoulson
2012-05-23 22:17 ` Nicolas Goaziou
2012-05-24  3:05   ` Mark E. Shoulson
2012-05-25 17:14     ` Nicolas Goaziou
2012-05-25 22:51       ` Mark E. Shoulson
2012-05-26  6:48         ` Nicolas Goaziou
2012-05-29  1:30           ` Mark E. Shoulson
2012-05-29 17:57             ` Nicolas Goaziou
2012-05-30  0:51               ` Mark E. Shoulson
2012-05-31  1:50                 ` (no subject) Mark Shoulson
2012-05-31 13:38                   ` Nicolas Goaziou
2012-05-11 20:56 Rick Frankel
2012-05-11 20:38 ` Eric Schulte
2012-05-11 22:43   ` Bernt Hansen
2012-05-17  6:23   ` Bastien
2012-01-23 12:00 Tom Regner
2012-01-23 16:34 ` Tom Regner
2012-01-23 20:31 ` Eric Schulte
2012-01-24  1:55   ` Tom Regner
2012-01-05 17:36 Ab Cd
2011-08-06  1:19 Vikas Rawal
2011-02-21 22:13 Vincent-Xavier JUMEL
2011-02-23 19:52 ` Bernt Hansen
2011-02-23 19:54 ` Bernt Hansen
2011-04-09  9:41   ` Vincent-Xavier JUMEL
2010-06-29 17:50 amscopub-mail
2009-09-18 12:35 Robin Green
2009-02-17 18:57 Matthew Lundin
2009-02-17 20:26 ` Carsten Dominik
2008-01-28 11:20 Dimitris Kapetanakis
2008-01-29  9:39 ` Bastien Guerry
2007-11-13 20:35 François Puitg
2007-10-20 10:33 Kevin Brubeck Unhammer
2007-10-21 22:20 ` Bastien
2006-05-25 10:43 Thomas Baumann
2006-05-25 12:49 ` Carsten Dominik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFG8T6XFuc0=oCyF5OSSjs3ASwxx8FRp5dpwGQMBTqefoFFHXg@mail.gmail.com' \
    --to=emanuel.charpentier@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).