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 Nov 14 11:52:05 2012  
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 Dec 10 08:19:01 2012, 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 Nov 25 19:02:47 2012, 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 Nov 23 13:47:20 2012, 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 Nov 23 05:28:14 2012, 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 Nov 22 22:02:13 2012, 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 Nov 14 11:52:05 2012, 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):

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 Nov 23 13:47:20 2012bettiniStatusWont Fix=>In Progress
    Thu Nov 22 22:02:13 2012bettiniStatusNone=>Wont Fix
    Mon Nov 19 10:04:58 2012bettiniAssigned toNone=>bettini
    Wed Nov 14 11:52:05 2012aaronpCarbon-Copy-=>Added aaronp

    Back to the top

    Powered by Savane 3.1-cleanup1