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


bug #37732: LaTeX output fails with underscores in filename

Submitter:  Aaron <aaronp>
Submitted:  Wed 14 Nov 2012 11:52:05 AM UTC
Category:  None Severity:  3 - Normal
Item Group:  None Status:  In Progress
Privacy:  Public Assigned to:  bettini
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup

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>
Group administrator
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>
Group administrator
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>
Group administrator
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 Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.


    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-11-23 bettini StatusWont Fix In Progress
    2012-11-22 bettini StatusNone Wont Fix
    2012-11-19 bettini Assigned toNone bettini
    2012-11-14 aaronp Carbon-Copy- Added aaronp

    Back to the top

    Powered by Savane 3.13-ee12.
    Corresponding source code