URL:
  <https://savannah.gnu.org/bugs/?67883>

                 Summary: [refer] groff -R renders refer preprocessor commands
within .R1 and .R2
                   Group: GNU roff
               Submitter: afh
               Submitted: Sat 03 Jan 2026 03:17:00 PM UTC
                Category: Preprocessor refer
                Severity: 3 - Normal
              Item Group: Incorrect behaviour
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Unlocked
         Planned Release: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Sat 03 Jan 2026 03:17:00 PM UTC By: Alexis <afh>
groff built from the latest Git (e91667c1e37a93d6b44e7b1c1e4b94b01df45e41)
demonstrates the unexpected (and incorrect?) behaviour for ms and mm, where
the refer preprocessor instructions within .R1 and .R2 are rendered to the
document and any references in the text appear as the keyword specified within
.[ and .] when refer is invoked via groff's -R option. Note that running refer
separately and piping its output to groff works as expected.

Please find attached minimal working examples (mwe) for ms and mm including a
bibliography file for refer. What follows are examples using demonstrating the
issue based on the mwe.


echo;nroff -R -ms -mrefer-ms mwe-refer.ms  | sed -E -e '/^$/d' -e
's/\x1B\[[0-9?;]*[mK]//g'

accumulate database mwe-refer.bib
     Minimal  Working  Example  Demonstrating  use of Refer
                             with ms
This sentences makes a reference to the paper on  grohtml.   mul-
ley-lemberg



echo;nroff -R -mm -mrefer-mm mwe-refer.mm  | sed -E -e '/^$/d' -e
's/\x1B\[[0-9?;]*[mK]//g'

                                   ‐ 1 ‐
       accumulate database mwe‐refer.bib
        Minimal Working Example Demonstrating Use of Refer with mm
       This  sentences  makes  a reference to the paper on grohtml.
       mulley‐lemberg


Either using groff 1.23.0 or running refer separately and piping its output to
groff demonstrates the expected correct behaviour for ms and mm:


echo; nroff -R -ms -mrefer-ms mwe-refer.ms  | sed -E -e '/^$/d' -e
's/\x1B\[[0-9?;]*[mK]//g'

     Minimal  Working  Example  Demonstrating  use of Refer
                             with ms
This sentences makes a reference to the paper on grohtml.[1]
References
1.   Gaius Mulley and Werner Lemberg,  "Extending  GNU  Troff  to
     Produce  HTML  Through  the  Technique of Next Event Simula-
     tion," International Journal of Simulation  Vol.  6  No  7-8
     (2005-06).



echo; nroff -R -mm -mrefer-mm mwe-refer.mm  | sed -E -e '/^$/d' -e
's/\x1B\[[0-9?;]*[mK]//g'

        Minimal Working Example Demonstrating Use of Refer with mm
       This sentences makes a reference to the paper on grohtml.[1]
                                REFERENCES
         1. Gaius  Mulley  and Werner Lemberg, "Extending GNU Troff
            to Produce HTML Through the  Technique  of  Next  Event
            Simulation," International Journal of Simulation Vol. 6
            No 7-8 (2005-06).



echo; refer mwe-refer.ms | nroff -ms -mrefer-ms  | sed -E -e '/^$/d' -e
's/\x1B\[[0-9?;]*[mK]//g'

     Minimal  Working  Example  Demonstrating  use of Refer
                             with ms
This sentences makes a reference to the paper on grohtml.[1]
References
1.   Gaius Mulley and Werner Lemberg,  “Extending  GNU  Troff  to
     Produce  HTML  Through  the  Technique of Next Event Simula‐
     tion,” International Journal of Simulation  Vol.  6  No  7‐8
     (2005‐06).



echo; refer mwe-refer.mm | nroff -mm -mrefer-mm  | sed -E -e '/^$/d' -e
's/\x1B\[[0-9?;]*[mK]//g'

        Minimal Working Example Demonstrating Use of Refer with mm
       This sentences makes a reference to the paper on grohtml.[1]
                                REFERENCES
         1. Gaius  Mulley  and Werner Lemberg, “Extending GNU Troff
            to Produce HTML Through the  Technique  of  Next  Event
            Simulation,” International Journal of Simulation Vol. 6
            No 7‐8 (2005‐06).








    _______________________________________________________
File Attachments:

Name: mwe-refer.bib                  Size: 220B
    <https://file.savannah.gnu.org/file/mwe-refer.bib?file_id=58064>

Name: mwe-refer.mm                   Size: 211B
    <https://file.savannah.gnu.org/file/mwe-refer.mm?file_id=58065>

Name: mwe-refer.ms                   Size: 198B
    <https://file.savannah.gnu.org/file/mwe-refer.ms?file_id=58066>



    AGPL NOTICE

These attachments are served by Savane. You can download the corresponding
source code of Savane at
https://savannah.gnu.org/source/savane-5829dcd8b4efd8e205da836113e4d40e523b205e.tar.gz

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?67883>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/


Reply via email to