Re: should a "wrapped" table result behave differently than one that is not?

2022-01-18 Thread Eric S Fraga
Hi Chuck,

On Tuesday, 18 Jan 2022 at 18:43, Berry, Charles wrote:
> This is annoying, but I think you can get the product you want by
> "pre-wrapping" the results.

Ah, I see: do the wrapping manually instead of using the :wrap header
argument.  Yes, this works.  A little annoying but it's a solution and
easy enough to do.  It's not as if I have that many results that need
this processing.  Thank you.

eric
-- 
: Eric S Fraga, with org release_9.5.2-306-g9623da in Emacs 29.0.50



Re: should a "wrapped" table result behave differently than one that is not?

2022-01-18 Thread Berry, Charles
Eric,

> On Jan 18, 2022, at 9:05 AM, Eric S Fraga  wrote:
> 
> been wrapped in a RESULTS special block be different than one that is
> not wrapped (beyond the wrapping, of course)?  Specifically, wrapping
> the results seems to cause org to ignore that ATTR_LATEX :center toggle
> [1].  A minimal example, both org and resulting LaTeX, attached.
> 
> I guess it makes sense in that the attr line will probably be applied to
> the results special block.  I am not sure how to get around this.
> Suggestions very welcome indeed!  I do need to wrap the results in a
> block of some type so I can control the formatting in the resulting PDF
> export but I do not want the table centred necessarily [2].
> 


This is annoying, but I think you can get the product you want by 
"pre-wrapping" the results.

Here is an example:

#+begin_src org
  Show default:

  ,#+begin_src emacs-lisp :exports both
  org-latex-tables-centered
  ,#+end_src

  ,#+name: awrappedtable
  ,#+header: :exports results
  ,#+header: :results value
  ,#+begin_src emacs-lisp
'((1 2) (3 4))
  ,#+end_src

  ,#+begin_results
  ,#+attr_latex: :center nil
  ,#+RESULTS: awrappedtable
  : initial filler
  ,#+end_results
#+end_src


On export I get

Show default:

\begin{verbatim}
org-latex-tables-centered
\end{verbatim}

\begin{verbatim}
t
\end{verbatim}


\begin{results}
\begin{tabular}{rr}
1 & 2\\
3 & 4\\
\end{tabular}
\end{results}


HTH,
Chuck






should a "wrapped" table result behave differently than one that is not?

2022-01-18 Thread Eric S Fraga
Dear all,

Should the export of a table that is the result of a code block and has
been wrapped in a RESULTS special block be different than one that is
not wrapped (beyond the wrapping, of course)?  Specifically, wrapping
the results seems to cause org to ignore that ATTR_LATEX :center toggle
[1].  A minimal example, both org and resulting LaTeX, attached.

I guess it makes sense in that the attr line will probably be applied to
the results special block.  I am not sure how to get around this.
Suggestions very welcome indeed!  I do need to wrap the results in a
block of some type so I can control the formatting in the resulting PDF
export but I do not want the table centred necessarily [2].

Thank you,
eric

Footnotes:
[1] describing this as a toggle (in the info manual) does not really
 make much sense to me as it implies a known initial state which is
 not specified in the manual.  I would prefer to have to say
 ":center no" (or nil) which then allows for ":center t"...?

[2] centring should happen by request, not by default, in my opinion, as
 it is trivial to enclose a table in a centring environment
 explicitly but difficult to remove otherwise.

-- 
: Eric S Fraga, with org release_9.5.2-306-g9623da in Emacs 29.0.50



t.org
Description: Lotus Organizer
% Created 2022-01-18 Tue 16:52
% Intended LaTeX compiler: pdflatex
\documentclass{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage{wrapfig}
\usepackage{rotating}
\usepackage[normalem]{ulem}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{capt-of}
\usepackage{hyperref}
\usepackage{xcolor}
\usepackage{tikz}
\usepackage{soul}
\usepackage{listings}
\usepackage[version=3]{mhchem}
\usepackage{doi}
\usepackage{amsmath}
\usepackage[british, english]{babel}
\author{Eric S Fraga}
\date{\today}
\title{}
\hypersetup{
 pdfauthor={Eric S Fraga},
 pdftitle={},
 pdfkeywords={},
 pdfsubject={},
 pdfcreator={Emacs 29.0.50 (Org mode 9.5.2)}, 
 pdflang={English}}
\begin{document}

\tableofcontents

A bare table gets exported properly:

\begin{tabular}{rr}
1 & 2\\
3 & 4\\
\end{tabular}

Now a table that is the result of some code:

\begin{tabular}{rr}
1 & 2\\
3 & 4\\
\end{tabular}

and finally a table from some code but wrapped:

\begin{results}
\begin{center}
\begin{tabular}{rr}
1 & 2\\
3 & 4\\
\end{tabular}
\end{center}
\end{results}

The last table is centred unfortunately.
\end{document}