bugGNU source-highlight - Bugs: bug #37732, LaTeX output fails with...

 
 

bug #37732: LaTeX output fails with underscores in filename

Submitted by:  Aaron <aaronp>
Submitted on:  Wed 14 Nov 2012 11:52:05 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: In Progress
Privacy: PublicAssigned to: Lorenzo Bettini <bettini>
Open/Closed: Open

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 10 Dec 2012 08:19:01 AM UTC, comment #5:

source-highlight is agnostic with respect to the output format: it is specified in .outlang files, thus also an outlang not well written could produce an invalid output ;)

thus, the only thing I can do is add the command line to tell source-highlight to preprocess also the title...

Lorenzo Bettini <bettini>
Project AdministratorIn charge of this item.
Sun 25 Nov 2012 07:02:47 PM UTC, comment #4:

Hmm, it's your call. It's still not ideal that the program could produce invalid output, but I suppose it's fine if it's documented in the man page.

Aaron <aaronp>
Fri 23 Nov 2012 01:47:20 PM UTC, comment #3:

One possible (non invasive) solution that comes into my mind is to add a command line option --preprocess-title which performs char translation also on the title string.

It is still reponsibility of the user to explicitly specify that...

does it sound reasonable?

Lorenzo Bettini <bettini>
Project AdministratorIn charge of this item.
Fri 23 Nov 2012 05:28:14 AM UTC, comment #2:

Sure. It's an edge case that most likely comes up only very rarely. Still, perhaps it is possible to fail more gracefully, for example throwing an error message instead of producing invalid output? IMO, the biggest problem was that the program failed in a way that wasn't immediately obvious.

If it's not reasonable to be done in a specific way, perhaps it can be done in a general way. For example, if underscores are known to break with more than one outlang when --doc is used, perhaps it should just not be allowed?

Aaron <aaronp>
Thu 22 Nov 2012 10:02:13 PM UTC, comment #1:

I tried to deal with this issue, but performing character translation in title cannot be done consistently in all output formats:

- in HTML it is not required
- in ODT you even get a title which is not displayed correctly

indeed in different output formats translation may not be required or even must not be done in the title tag...

thus I think I cannot fix this; if one gets errors due to the title in an output format he should provide a valid title in that specific format (with --title option, for instance for Latex --title="my\_title").

I don't see other solutions without breaking existing code, or without requiring much more specifications in the .outlang which I'd avoid since this issue shows up only if --doc is specified without a --title...

if --title is specified then it is the user responsibility to provide a valid one...

does it sound reasonable?

Lorenzo Bettini <bettini>
Project AdministratorIn charge of this item.
Wed 14 Nov 2012 11:52:05 AM UTC, original submission:

Underscores are special characters in LaTeX. If possible, source-highlight should try to escape underscores in titles using -f latex and latexcolor.

Aaron <aaronp>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bettini (Updated the item)
  • -unavailable- added by aaronp (Submitted the item)
  • -unavailable- added by aaronp
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 23 Nov 2012 01:47:20 PM UTCbettiniStatusWont Fix=>In Progress
    Thu 22 Nov 2012 10:02:13 PM UTCbettiniStatusNone=>Wont Fix
    Mon 19 Nov 2012 10:04:58 AM UTCbettiniAssigned toNone=>bettini
    Wed 14 Nov 2012 11:52:05 AM UTCaaronpCarbon-Copy-=>Added aaronp

    Back to the top


    Powered by Savane 3.1-cleanup