0

[in this chapter of org-mode manual][1], there is a tutorial on how to export a latex file with some features of verse package, such as line-counting and centralization. The example given is a poem by Shakespeare:

#+ATTR_LATEX: :center t :latexcode \color{red} :lines 5
#+ATTR_LATEX: :versewidth Feed’st thy light’s flame with self-substantial fuel,
#+BEGIN_VERSE
From fairest creatures we desire increase,
That thereby beauty’s rose might never die,
But as the riper should by time decease
His tender heir might bear his memory
But thou, contracted to thine own bright eyes,
Feed’st thy light’s flame with self-substantial fuel,
Making a famine where abundance lies,
Thyself thy foe, to thy sweet self too cruel.
Thou that art now the world’s fresh ornament,
And only herald to the gaudy spring,
Within thine own bud buriest thy content,
And, tender churl, mak’st waste in niggardly.
Pity the world, or else this glutton be,
To eat the world’s due, by the grave and thee.
#+END_VERSE

This, however, doesn't work when I try it. I of course added #+LATEX_HEADER: \usepackage{verse} before it, but still... doesn't work. I also tried #+LATEX_HEADER: \usepackage{verse.sty} instead, but then it displays: file [...] wasn't produced "See "Org PDF LaTEx Output" for details".


Debugging comments:

Check the .tex file and make sure there is a \usepackage{verse} line in the preamble. Check the rest of the file too and see if it makes sense: in particular, does it include \begin{verse}...\end{verse} and the \poemlines{5} \color{red} macro calls? – NickD

So, \usepackage{verse} is there, as well as \begin{verse}...\end{verse}. But \poemlines{5} \color{red} is absent. I'm uninstalling MikTex and installing Texlive to see if this is the problem. - OP

It's Org mode that produces the TeX file, so if something is missing in the TeX file, then Org mode is the culprit. The TeX processor takes the TeX file produces by Org mode as input, so it can not be held responsible. – NickD

Is line 34 \newcommand{\getmodulo@vs}{\bgroup - OP

In any case I edited \newcommand{\getmodulo@vs}{\bgroup and still Emacs displays "PDF file produced with errors" and no line numbers etc. are seen. I asked a friend of mine to try the code and the same happens: error and no line numbers / etc. – OP

No, it was \newcommand*{\theHpoemline}{\arabic{verse@envctr}.\arabic{poemline}}. In my version, the \getmodulo@vs definition is line 56. – NickD

So, it is not compiling with errors anymore; but still, no numbers or centering etc. I checked the tex file produced and there's no \poemlines or anything. Only \begin{verse} - OP

You need to debug the Org mode LaTeX exporter then: what version of Org mode are you using? Also check that there is no empty line between the #+ATTR lines and the #+BEGIN_VERSE – NickD [1]: https://orgmode.org/manual/Verse-blocks-in-LaTeX-export.html

1
  • I thank you for the help, but I think I have no need to go further on this. I can easily set lines and centring with latex code ipsis litteris. Changing that line of verse.sty corrected the bug of "pdf file produced with errors". So I am okay for now. Thank you. Commented Feb 16, 2022 at 19:35

1 Answer 1

0
#+LaTeX_HEADER: \usepackage{verse} #+LATEX_HEADER: \settowidth{\versewidth}{And the dish ran away with the spoon.} #+OPTIONS: todo:nil date:nil toc:nil * A Verse #+ATTR_LATEX: :center t :latexcode \itshape #+BEGIN_VERSE Hey Diddle Diddle The cat and the fiddle, The cow jumped over the moon. The little dog laughed, To see such sport, And the dish ran away with the spoon. #+END_VERSE 
2
  • Hi Jeffrey. What does this post demonstrate? Commented Nov 3 at 9:54
  • Above is a simple example showing minimum needed to get centered verse with org-mode. Commented Nov 6 at 15:14

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.