From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Agelastos Subject: Formatting issues exporting to a man page Date: Wed, 18 Oct 2017 14:38:01 -0600 Message-ID: <92299554-1C3B-4116-828A-A12F9C1D5ECA@gmail.com> References: <4E7387A7-FEF7-4848-A13A-AFE9C96BCDFD@sandia.gov> Mime-Version: 1.0 (1.0) Content-Type: multipart/alternative; boundary=Apple-Mail-BD2FC35D-FC5D-4336-A7E2-F7E087F63F7D Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45157) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4v6O-0004jb-MG for emacs-orgmode@gnu.org; Wed, 18 Oct 2017 16:38:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e4v6M-0005wG-3C for emacs-orgmode@gnu.org; Wed, 18 Oct 2017 16:38:08 -0400 Received: from mail-it0-x22d.google.com ([2607:f8b0:4001:c0b::22d]:46326) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e4v6L-0005vF-OL for emacs-orgmode@gnu.org; Wed, 18 Oct 2017 16:38:06 -0400 Received: by mail-it0-x22d.google.com with SMTP id f187so7865866itb.1 for ; Wed, 18 Oct 2017 13:38:05 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org --Apple-Mail-BD2FC35D-FC5D-4336-A7E2-F7E087F63F7D Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Greetings: =20 I am trying to use org to export to a man page and I noticed that some items= with formatting do not show up appropriately. I will provide an example of t= he issue below in addition to system information and the troubleshooting I=E2= =80=99ve done so far. I would appreciate any guidance you can provide with f= ixing this issue. Thank you for your help with this. =20 I have a simple org file that has the following within it. {{{ 1 #+TITLE: Test of org-mode 2 #+AUTHOR: Anthony M. Agelastos 3 #+EMAIL: iqgrande@gmail.com 4 #+DATE: 2017-10-17 5 #+LANGUAGE: en 6 #+OPTIONS: ^:nil 7 #+DESCRIPTION: This document is a test of org mode. 8 #+KEYWORDS: org-mode 9 #+KEYWORDS: test 10 #+LATEX_COMPILER: lualatex 11 #+LATEX_CLASS: article 12 #+LATEX_CLASS_OPTIONS: [letterpaper,11pt] 13 #+LATEX_HEADER: \input{preamble} 14 #+STARTUP: overview 15 16 * Introduction 17 ** foo 18 Does this work? 19 ** bar 20 Does this =3Dwork=3D? 21 ** baz 22 Does this ~work~? 23 24 * Results 25 ** foo 26 Does this *work*? 27 ** bar 28 Does this /work/? }}} =20 This generates the following man page where much of the formatting save for =E2= =80=9C=3D=3D=E2=80=9D and =E2=80=9C~~=E2=80=9D work. Those 2, however, ultim= ately fail with different behavior. I should also note that this exports cor= rectly to Info, PDF, ASCII, HTML, and Markdown. {{{ Test of org-mode(1) General Commands Manual = Test of org-mode(1) =20 Introduction foo Does this work? =20 bar Does this .nf nil =20 baz Does this (code (:value work :begin 453 :end 459 :post-blank 0 :par= ent (paragraph (:begin 443 :end 461 :contents-begin 443 :contents-end 461 :post-blank 0 :post-aff= iliated 443 :parent (section (:begin 443 :end 462 :contents-begin 443 :contents-end 461 :post-bla= nk 1 :post-affiliated 443 :par=E2=80=90 ent (headline (:raw-value baz :begin 436 :end 461 :pre-blank 0 :conte= nts-begin 443 :contents-end 461 :level 2 :priority nil :tags nil :todo-keyword nil :todo-type nil :p= ost-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 436 :title (baz) := parent (headline (:raw-value Introduction :begin 373 :end 462 :pre-blank 0 :contents-begin 388 :co= ntents-end 461 :level 1 :prior=E2=80=90 ity nil :tags nil :todo-keyword nil :todo-type nil :post-blank 1 :foo= tnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 373 :title (Introduction) = :parent (org-data nil (section (:begin 1 :end 373 :contents-begin 1 :contents-end 372 :post-blank 1 := post-affiliated 1 :parent #10) (keyword (:key TITLE :value Test of org-mode :begin 1 :end 27 :post-b= lank 0 :post-affiliated 1 :par=E2=80=90 ent #11)) (keyword (:key AUTHOR :value Anthony M. Agelastos :begin 27= :end 58 :post-blank 0 :post- affiliated 27 :parent #11)) (keyword (:key EMAIL :value iqgrande@gma= il.com :begin 58 :end 86 :post- blank 0 :post-affiliated 58 :parent #11)) (keyword (:key DATE :value 2= 017-10-17 :begin 86 :end 105 :post-blank 0 :post-affiliated 86 :parent #11)) (keyword (:key LAN= GUAGE :value en :begin 105 :end 120 :post-blank 0 :post-affiliated 105 :parent #11)) (keyword (:key O= PTIONS :value ^:nil :begin 120 :end 137 :post-blank 0 :post-affiliated 120 :parent #11)) (keywor= d (:key DESCRIPTION :value This document is a test of org mode. :begin 137 :end 189 :post-blank 0 :po= st-affiliated 137 :parent #11)) (keyword (:key KEYWORDS :value org-mode :begin 189 :end 210 :post-bla= nk 0 :post-affiliated 189 :par=E2=80=90 ent #11)) (keyword (:key KEYWORDS :value test :begin 210 :end 227 :po= st-blank 0 :post-affiliated 210 :parent #11)) (keyword (:key LATEX_COMPILER :value lualatex :begin 22= 7 :end 254 :post-blank 0 :post- affiliated 227 :parent #11)) (keyword (:key LATEX_CLASS :value articl= e :begin 254 :end 277 :post- blank 0 :post-affiliated 254 :parent #11)) (keyword (:key LATEX_= CLASS_OPTIONS :value [letterpa=E2=80=90 per,11pt] :begin 277 :end 319 :post-blank 0 :post-affiliated 277 := parent #11)) (keyword (:key LATEX_HEADER :value input{preamble} :begin 319 :end 352 :post-blank= 0 :post-affiliated 319 :parent #11)) (keyword (:key STARTUP :value overview :begin 352 :end 372 :pos= t-blank 0 :post-affiliated 352 :parent #11))) #8 (headline (:raw-value Results :begin 462 :end 522 := pre-blank 0 :contents-begin 472 :contents-end 522 :level 1 :priority nil :tags nil :todo-keyword nil := todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliat= ed 462 :title (Results) :parent #10) (headline (:raw-value foo :begin 472 :end 497 :pre-blank 0 :con= tents-begin 479 :contents-end 497 :level 2 :priority nil :tags nil :todo-keyword nil :todo-type n= il :post-blank 0 :footnote-sec=E2=80=90 tion-p nil :archivedp nil :commentedp nil :post-affiliated 472 :title= (foo) :parent #11) (section (:begin 479 :end 497 :contents-begin 479 :contents-end 497 :post-bla= nk 0 :post-affiliated 479 :par=E2=80=90 ent #12) (paragraph (:begin 479 :end 497 :contents-begin 479 :content= s-end 497 :post-blank 0 :post- affiliated 479 :parent #13) Does this (bold (:begin 489 :end 495 :c= ontents-begin 490 :contents-end 494 :post-blank 0 :parent #14) work) ? ))) (headline (:raw-value bar= :begin 497 :end 522 :pre-blank 0 :contents-begin 504 :contents-end 522 :level 2 :priority nil :ta= gs nil :todo-keyword nil :todo- type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commen= tedp nil :post-affiliated 497 :title (bar) :parent #11) (section (:begin 504 :end 522 :contents-beg= in 504 :contents-end 522 :post- blank 0 :post-affiliated 504 :parent #12) (paragraph (:begin 504 :end= 522 :contents-begin 504 :con=E2=80=90 tents-end 522 :post-blank 0 :post-affiliated 504 :parent #13) Does= this (italic (:begin 514 :end 520 :contents-begin 515 :contents-end 519 :post-blank 0 :parent #14= ) work) ? )))))) (headline (:raw-value foo :begin 388 :end 411 :pre-blank 0 :contents-begin= 395 :contents-end 411 :level 2 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-bla= nk 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 388 :title (foo) := parent #8) (section (:begin 395 :end 411 :contents-begin 395 :contents-end 411 :post-blank 0 :post-af= filiated 395 :parent #9) (para=E2=80=90 graph (:begin 395 :end 411 :contents-begin 395 :contents-end 411 :po= st-blank 0 :post-affiliated 395 :parent #10) Does this work? ))) (headline (:raw-value bar :begin 41= 1 :end 436 :pre-blank 0 :con=E2=80=90 tents-begin 418 :contents-end 436 :level 2 :priority nil :tags nil := todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil= :post-affiliated 411 :title (bar) :parent #8) (section (:begin 418 :end 436 :contents-begin 418 := contents-end 436 :post-blank 0 :post-affiliated 418 :parent #9) (paragraph (:begin 418 :end 436 :con= tents-begin 418 :contents-end 436 :post-blank 0 :post-affiliated 418 :parent #10) Does this (v= erbatim (:value work :begin 428 :end 434 :post-blank 0 :parent #11)) ? ))) #6)) #4)) #2)) Does this = #0 ? )))? =20 Results foo Does this work? =20 bar Does this work? }}} =20 I generate the man page with the following command. {{{ emacs -Q -l load.el -l init.el Test.org --batch -f org-man-export-to-man --k= ill }}} =20 The =E2=80=9Cload.el=E2=80=9D script contains the following. {{{ (add-to-list 'load-path "/path/to/my/org-mode/lisp") }}} =20 The =E2=80=9Cinit.el=E2=80=9D script contains the following. {{{ ;;; EMACS USUALLY HAS A SPLASH SCREEN ON STARTUP. LET'S GET RID OF THAT AND S= TART WITH A BLANK BUFFER. (setq inhibit-startup-message t) =20 ;;; FIX PARAGRAPH FILLING WIDTH ;; To do this easily, just do M-q (setq-default fill-column 72) =20 ;;; MAKE ORG MODE SPIT OUT SMART QUOTES (setq org-export-with-smart-quotes t) =20 ;;; HANDLE TODO BETTER (setq org-log-done 'time) (setq org-log-done 'note) =20 ;;; ENABLE EXPORTING (require 'ox-texinfo) (require 'ox-man) }}} =20 My org-mode installation was created with the following steps. {{{ cd /path/to/my git clone git://orgmode.org/org-mode.git cd org-mode make make doc make test Ran 755 tests, 754 results as expected, 1 unexpected (2017-10-17 17:33:46-06= 00) 11 expected failures =20 1 unexpected results: FAILED test-org-publish/resolve-external-link =20 mk/targets.mk:104: recipe for target 'test' failed make: *** [test] Error 1 }}} =20 I performed the following mitigating steps. =20 Just to be safe, I also rebuilt Emacs 25.3.1 from scratch with nothing fancy= (i.e., `./configure --prefix=3Dfoo && make && make install`) and used it wi= thin my environment while org was built. I completely removed my =E2=80=9C~/.emacs.d=E2=80=9D folder so there were no= user settings that were contaminating the environment. I investigated this on macOS 10.12.6, macOS 10.13, and RHEL 7.3 and had the s= ame ultimate behavior along with results from the org `make test`. =20 Kind regards, =20 Anthony M. Agelastos --Apple-Mail-BD2FC35D-FC5D-4336-A7E2-F7E087F63F7D Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable Greetings:

 

I am trying to use o= rg to export to a man page and I noticed that some items with formatting do n= ot show up appropriately. I will provide an example of the issue below in ad= dition to system information and the troubleshooting I=E2=80=99ve done so far. I would appreciate any guidan= ce you can provide with fixing this issue. Thank you for your help with this= .

 

I have a simple org f= ile that has the following within it.

{{{

  1 #+TITLE: Test of org-mode

  2 #+AUTHOR: Anthony M. Agelastos<= /p>

  3 #+EMAIL: iq= grande@gmail.com

  4 #+DATE: 2017-10-17

  5 #+LANGUAGE: en

  6 #+OPTIONS: ^:nil

  7 #+DESCRIPTION: This document is a test of org mod= e.

  8 #+KEYWORDS: org-mode

  9 #+KEYWORDS: test

10 #+LATEX_COMPILER: lualatex

11 #+LATEX_CLASS: article

12 #+LATEX_CLASS_OPTIONS: [letterpaper,11pt]

13 #+LATEX_HEADER: \input{preamble}

14 #+STARTUP: overview

15

16 * Introduction

17 ** foo

18 Does this work?

19 ** bar

20 Does this =3Dwork=3D?

21 ** baz

22 Does this ~work~?

23

24 * Results

25 ** foo

26 Does this *work*?

27 ** bar

28 Does this /work/?

}}}

 

This generates the f= ollowing man page where much of the formatting save for =E2=80=9C=3D=3D=E2=80= =9D and =E2=80=9C~~=E2=80=9D work. Those 2, however, ultimately fail with di= fferent behavior. I should also note that this exports correctly to Info, PDF, ASCII, HTML, and Markdown.

{{{

Test of org-mode(1)       &n= bsp;            =    General Commands Manual      = ;            &nb= sp;    Test of org-mode(1)

 

Introduction

   foo

       Does this work?

 

   bar

       Does this .nf nil

 

   baz

       Does  this = (code (:value work :begin 453 :end 459 :post-blank 0 :parent (paragraph (:b= egin 443 :end

       461 :contents-begin 4= 43 :contents-end  461  :post-blank  0  :post-affiliated&= nbsp; 443  :parent  (section

       (:begin  443 :en= d 462 :contents-begin 443 :contents-end 461 :post-blank 1 :post-affiliated 4= 43 :par=E2=80=90

       ent (headline (:raw-v= alue baz :begin 436 :end 461 :pre-blank 0 :contents-begin 443 :contents-end 4= 61

       :level  2 :prior= ity nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-s= ection-p

       nil :archivedp nil :c= ommentedp nil :post-affiliated 436 :title (baz) :parent  (headline = ; (:raw-value

       Introduction :begin 3= 73 :end 462 :pre-blank 0 :contents-begin 388 :contents-end 461 :level 1 :pri= or=E2=80=90

       ity nil :tags nil :to= do-keyword nil :todo-type nil :post-blank 1 :footnote-section-p nil  :a= rchivedp

       nil  :commentedp=   nil  :post-affiliated  373  :title  (Introduction= )  :parent (org-data nil (section

       (:begin 1 :end 373 :c= ontents-begin 1 :contents-end 372 :post-blank 1 :post-affiliated 1 :parent #= 10)

       (keyword (:key TITLE := value Test of org-mode :begin 1 :end 27 :post-blank 0 :post-affiliated 1 :pa= r=E2=80=90

       ent #11)) (keyword (:= key AUTHOR :value Anthony M. Agelastos :begin 27 :end 58 :post-blank  0=   :post-

       affiliated  27 := parent #11)) (keyword (:key EMAIL :value iqgrande@gmail.com :begin 58 :end 86 :post-

       blank 0 :post-affilia= ted 58 :parent #11)) (keyword (:key DATE :value 2017-10-17 :begin 86  := end  105

       :post-blank  0&n= bsp; :post-affiliated  86 :parent #11)) (keyword (:key LANGUAGE :value e= n :begin 105 :end

       120 :post-blank 0 :po= st-affiliated 105 :parent #11)) (keyword (:key OPTIONS :value ^:nil :begin&n= bsp; 120

       :end  137  := post-blank  0  :post-affiliated 120 :parent #11)) (keyword (:key D= ESCRIPTION :value This

       document is a test of= org mode. :begin 137 :end 189 :post-blank 0 :post-affiliated 137 :parent #1= 1))

       (keyword (:key KEYWOR= DS :value org-mode :begin 189 :end 210 :post-blank 0 :post-affiliated 189 :p= ar=E2=80=90

       ent #11)) (keyword (:= key KEYWORDS :value test :begin 210 :end 227 :post-blank 0 :post-affiliated 2= 10

       :parent #11)) (keywor= d (:key LATEX_COMPILER :value lualatex :begin 227 :end 254 :post-blank 0 :po= st-

       affiliated 227 :paren= t #11)) (keyword (:key LATEX_CLASS :value article :begin 254  :end = ; 277  :post-

       blank  0  := post-affiliated  254  :parent  #11)) (keyword (:key LATEX_CLA= SS_OPTIONS :value [letterpa=E2=80=90

       per,11pt] :begin 277 := end 319 :post-blank  0  :post-affiliated  277  :parent&n= bsp; #11))  (keyword  (:key

       LATEX_HEADER  :v= alue  input{preamble} :begin 319 :end 352 :post-blank 0 :post-affiliate= d 319 :parent

       #11)) (keyword (:key S= TARTUP :value overview :begin 352 :end 372 :post-blank 0 :post-affiliated&nb= sp; 352

       :parent #11))) #8 (he= adline (:raw-value Results :begin 462 :end 522 :pre-blank 0 :contents-begin 4= 72

       :contents-end 522 :le= vel 1 :priority nil :tags nil :todo-keyword nil :todo-type  nil  := post-blank  0

       :footnote-section-p n= il :archivedp nil :commentedp nil :post-affiliated 462 :title (Results) :par= ent

       #10) (headline (:raw-= value foo :begin 472 :end 497 :pre-blank 0  :contents-begin  479&n= bsp; :contents-end

       497  :level = ; 2 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 := footnote-sec=E2=80=90

       tion-p nil :archivedp= nil :commentedp nil :post-affiliated 472 :title (foo)  :parent  #= 11)  (section

       (:begin  479 :en= d 497 :contents-begin 479 :contents-end 497 :post-blank 0 :post-affiliated 4= 79 :par=E2=80=90

       ent #12) (paragraph (= :begin 479 :end 497 :contents-begin 479 :contents-end 497 :post-blank 0 = ; :post-

       affiliated  479 := parent #13) Does this  (bold (:begin 489 :end 495 :contents-begin 490 := contents-end

       494 :post-blank 0 :pa= rent #14) work) ?  ))) (headline (:raw-value bar :begin 497 :end 522 :p= re-blank

       0  :contents-beg= in  504  :contents-end 522 :level 2 :priority nil :tags nil :todo-= keyword nil :todo-

       type nil :post-blank 0= :footnote-section-p nil :archivedp nil :commentedp nil  :post-affiliat= ed  497

       :title (bar) :parent #= 11) (section (:begin 504 :end 522 :contents-begin 504 :contents-end 522 :pos= t-

       blank 0 :post-affilia= ted 504 :parent #12) (paragraph (:begin 504 :end 522 :contents-begin 504&nbs= p; :con=E2=80=90

       tents-end  522&n= bsp; :post-blank  0 :post-affiliated 504 :parent #13) Does this  (= italic (:begin 514 :end

       520 :contents-begin 5= 15 :contents-end 519 :post-blank 0  :parent  #14)  work) = ; ?   ))))))  (headline

       (:raw-value  foo=   :begin  388  :end  411 :pre-blank 0 :contents-begin 39= 5 :contents-end 411 :level 2

       :priority nil :tags n= il :todo-keyword nil  :todo-type  nil  :post-blank  0&nb= sp; :footnote-section-p  nil

       :archivedp  nil&= nbsp; :commentedp  nil :post-affiliated 388 :title (foo) :parent #8) (s= ection (:begin 395

       :end 411 :contents-be= gin 395 :contents-end 411 :post-blank 0 :post-affiliated 395 :parent #9) (pa= ra=E2=80=90

       graph  (:begin 3= 95 :end 411 :contents-begin 395 :contents-end 411 :post-blank 0 :post-affili= ated 395

       :parent #10) Does thi= s work?  ))) (headline (:raw-value bar :begin 411 :end 436 :pre-blank&n= bsp; 0  :con=E2=80=90

       tents-begin  418= :contents-end 436 :level 2 :priority nil :tags nil :todo-keyword nil :todo-= type nil

       :post-blank 0 :footno= te-section-p nil :archivedp nil :commentedp  nil  :post-affiliated=   411  :title

       (bar)  :parent #= 8) (section (:begin 418 :end 436 :contents-begin 418 :contents-end 436 :post= -blank 0

       :post-affiliated 418 := parent #9) (paragraph (:begin 418 :end 436 :contents-begin  418  := contents-end

       436  :post-blank=   0  :post-affiliated  418 :parent #10) Does this  (verb= atim (:value work :begin 428

       :end 434 :post-blank 0= :parent #11)) ?  ))) #6)) #4)) #2)) Does this  #0 ?  )))?

 

Results

   foo

       Does this work?

 

   bar

       Does this work?

}}}

 

I generate the man p= age with the following command.

{{{

emacs -Q -l load.el -l init.el Test.org --batch -f org-man-export-to-man --kill

}}}

 

The =E2=80=9Cload.el= =E2=80=9D script contains the following.

{{{

(add-to-list 'load-path "/path/to/my/org-mode/lisp")

}}}

 

The =E2=80=9Cinit.el= =E2=80=9D script contains the following.

{{{

;;; EMACS USUALLY HAS A SPLASH SCREEN ON STARTUP. LET'S GE= T RID OF THAT AND START WITH A BLANK BUFFER.

(setq inhibit-startup-message t)

 

;;; FIX PARAGRAPH FILLING WIDTH

;; To do this easily, just do M-q

(setq-default fill-column 72)

 

;;; MAKE ORG MODE SPIT OUT SMART QUOTES<= /p>

(setq org-export-with-smart-quotes t)

 

;;; HANDLE TODO BETTER

(setq org-log-done 'time)

(setq org-log-done 'note)

 

;;; ENABLE EXPORTING

(require 'ox-texinfo)

(require 'ox-man)

}}}

 

My org-m= ode installation was created with the following steps.

=

{{{

cd /path/to/my

git clone git://orgmode.org/org-mode.git

cd org-mode

make

make doc

make test

<snip>

Ran 755 tests, 754 results as expected, 1 unex= pected (2017-10-17 17:33:46-0600)

11 expected failures

 

1 unexpected results:

   FAILED  test-org-publish/res= olve-external-link

 

mk/targets.mk:104: recipe for target 'test' fa= iled

make: *** [test] Error 1

=

}}}

 

I perfor= med the following mitigating steps.

 

  • Just to be safe, I also rebuilt Emacs 25.3.= 1 from scratch with nothing fancy (i.e., `./configure --prefix=3Dfoo &&a= mp; make && make install`) and used it within my environment while o= rg was built.
  • I completely removed my =E2=80=9C~/.emacs.d= =E2=80=9D folder so there were no user settings that were contaminating the e= nvironment.
  • I investigated this on macOS 10.12.6, macOS= 10.13, and RHEL 7.3 and had the same ultimate behavior along with results f= rom the org `make test`.

 

Kind reg= ards,

 

Antho= ny M. Agelastos

=
= --Apple-Mail-BD2FC35D-FC5D-4336-A7E2-F7E087F63F7D--