PreTeXtBook / pretext

PreTeXt: an authoring and publishing system for scholarly documents
https://pretextbook.org
Other
254 stars 202 forks source link

characters in a @label #2120

Open Alex-Jordan opened 3 months ago

Alex-Jordan commented 3 months ago

For example, this label on an image is no good at present: label="graph-of-y=1/2x". The slash is a problem when the label is used in a filename for obvious reasons. The equals sign is apparently potentially problematic in a file name in Windows.

Two solutions occur to me:

  1. We sanitize labels when making things like file names. You end up with files like graph-of-y__equals__1__slash__2x.png.
  2. We restrict the characters that are used in an authored label in the first place. In assembly, where label duplication is checked, that would be a natural place to check that only approved characters are used.