From: Tim L. <ti...@ti...> - 2018-06-02 21:30:10
|
Hi, I'm investigating a build failure in Fedora for Pymacs (https://github.com/pinard/Pymacs) that occurs with (Fedora 28's) Docutils 0.14, but not with (Fedora 27's) Docutils 0.13.1 (https://bugzilla.redhat.com/show_bug.cgi?id=1555730). The .rst file in question is https://github.com/pinard/Pymacs/blob/master/pymacs.rst.in with two instances of "@VERSION@" replaced by "0.25". It gets processed with "rst2latex --use-latex-toc --input-encoding=UTF-8 $rst $tex". It starts with defining custom roles as "aliases": | .. role:: code(strong) | .. role:: file(literal) | .. role:: var(emphasis) | ================================================================ | Pymacs version @VERSION@ | ================================================================ | […] Docutils 0.13.1 is fine with this, Docutils 0.14 causes a TeX error (https://bugzilla.redhat.com/attachment.cgi?id=1443162): | […] | ! Undefined control sequence. | <write> ...re your \protect \texttt {\DUrolefile | {.emacs}} file}{\thepage }... | l.580 F | rom Pymacs 0.23 and upwards, Python 2.2 or better is likely needed, | ? | ! Emergency stop. | […] The .tex files differ (inter alia) by: | --- /tmp/f27.tex 2018-06-02 10:10:17.035844460 +0000 | +++ /tmp/f28.tex 2018-06-02 10:10:02.937009242 +0000 | @@ -1,6 +1,5 @@ | \documentclass[a4paper]{article} | % generated by Docutils <http://docutils.sourceforge.net/> | -\usepackage{fixltx2e} % LaTeX patches, \textsubscript | \usepackage{cmap} % fix search and cut-and-paste in Acrobat | \usepackage{ifthen} | \usepackage[T1]{fontenc} | @@ -37,14 +36,11 @@ | % inline markup (custom roles) | % \DUrole{#1}{#2} tries \DUrole#1{#2} | \providecommand*{\DUrole}[2]{% | - \ifcsname DUrole#1\endcsname% | + % backwards compatibility: try \docutilsrole#1{#2} | + \ifcsname docutilsrole#1\endcsname% | + \csname docutilsrole#1\endcsname{#2}% | + \else | \csname DUrole#1\endcsname{#2}% | - \else% backwards compatibility: try \docutilsrole#1{#2} | - \ifcsname docutilsrole#1\endcsname% | - \csname docutilsrole#1\endcsname{#2}% | - \else% | - #2% | - \fi% | \fi% | } | […] My TeX is rusty, and I do not completely understand http://docutils.sourceforge.net/docs/user/latex.html#custom-interpreted-text-roles. Is this a bug in Docutils, or does Pymacs need to add dummy "\newcommand{\DUrolefile}{}"s as raw LaTex? TIA, Tim |