0

I have a long, skinny table that's likely going to end up spanning multiple pages that I'm using the longtable environment for. I want to have this placed on the left-hand side of my document, and to have the main text of my document on the same page to the right of my document. In other words, I want my final PDF to end up looking something like this

-------------   Pellentesque dapibus suscipit ligula.  
| Cell 1    |   Donec posuere augue in quam.  Etiam 
| multiline |   vel tortor sodales tellus ultricies 
| cell      |   commodo.  Suspendisse potenti.  
-------------   Aenean in sem ac leo mollis blandit.  

***************** PAGE BREAK **************************

-------------   Nullam eu ante vel est convallis 
| Cell 2    |   Donec neque quam, dignissim in, mollis 
| Different |   nec, sagittis eu, wisi.  Phasellus 
| number of |   lacus.  Etiam laoreet quam sed arcu.  
| lines     |   Phasellus at dui in ligula mollis 
-------------   ultricies.  Integer placerat tristique 
| Cell 3    |   nisl.  Praesent augue.  Fusce commodo.  
-------------   Vestibulum convallis, lorem a tempus 
semper, dui dui euismod elit, vitae placerat urna 
tortor vitae lacus.  Nullam libero mauris, consequat 
quis, varius et, dictum id, arcu.  Mauris mollis 
tincidunt felis.  Aliquam feugiat tellus ut neque.  
Nulla facilisis, risus a rhoncus fermentum, tellus 
tellus lacinia purus, et dictum nunc justo sit amet
 elit.

How can I go about accomplishing this using org-mode to export to Latex?

Edit: Upon request from a commenter, here is something around what I want in pure Latex:

\documentclass{article}
\usepackage{lipsum}
\usepackage{wrapfig}
\usepackage{multirow}

\begin{document}

\begin{wrapfigure}{l}{0.25\textwidth}
  \begin{center}
    \begin{tabular}{|p{0.2\textwidth}|}
      \hline
      Content 1 \\
      Content 2 \\
      Content 3 \\
      \hline \\
      Content 4 \\
      Content 5 \\
      Content 6 \\
      Content 7 \\
      \hline \\
      Content 8 \\
      \hline 
    \end{tabular}
  \end{center}
\end{wrapfigure}

\lipsum[1-3]

\end{document}
4
  • Do you know how to do it in LaTeX? If not, I would suggest that you start there and (after deleting references to Org mode) move this question to TeX SE. If you do know how to do it in LaTeX, then post a short example LaTeX file and maybe (no guarantees!) we can figure out how to have Org mode produce it. In general, Org mode helps with common, run-of-the-mill LaTeX but it is more often an obstacle when you are trying to do something out of the ordinary (like this case).
    – NickD
    Apr 21 at 2:47
  • My LaTex knowledge is pretty rudimentary, however I was able to use ChatGPT to come up with close to what I need. Going to edit the main post to include that Latex. Apr 21 at 3:04
  • Maybe you can add longtable to the specification and see what it comes up with. The tabular above limits it to tables that fit on one page. And I'm not at all sure that wrapfigure will be able to deal with the long table. But who knows? It might surprise us (I must admit I'm impressed).
    – NickD
    Apr 21 at 4:21
  • I tried it: it suggested using a wraptable environment around longtable but AFAICT that does not work: the table is not split AFAICS. My suggestion to ask the question (sans Org mode stuff) on TeX SE still stands.
    – NickD
    Apr 21 at 14:01

1 Answer 1

0

What you want to achieve is feasible with LaTeX. But AFAIK it is not feasible in Org (regardless of the export format).

So when you want to export an Org document where parts are not writable in Org, I would recommend writing the non-writable parts as export blocks. The content of the export blocks would then be written in the language of the exported format, in your case LaTeX.

So it would look like this:

Part writable in Org
#+begin_export latex
% Part not writable in Org, for example,
% LaTeX code for text around tables
\begin{wrapfigure}{l}{0.25\textwidth}
...
#+end_export
Part writable in Org

In order to write the proper code inside the export block you can ask TeX SE for help as NickD suggested.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.