2
  1. In djvused bookmark format, to disable characters that have special meaning in djvused bookmark format:

    The format of djvused bookmark of a djvu file is for example:

    (bookmarks
     ("1 first chapter" "#10" 
     ("1.1 first section" "#11" 
     ("1.1.1 first subsection" "#12" ))
     ("1.2 second section" "#13" ))
     ("2 second chapter" "#14" 
     ("2.1 first section" "#16" )
     ("2.2 second section" "#13" ))
    )
    

    ...where the main points are the paring of left and right parenthesis for tree-like organization of sections and chapters, double quote for each bookmark item and each page number is preceded by a #.

    How can I escape characters like ", ( and ) to not be interpreted as control characters in the titles of chapters and sections?

    e.g. The following examples will not be accepted by djvused:

    ("2.2 "Hello!" " "#13" )
    ("2.2 f(g)" "#13" )
    

    The command I use to embed bookmarks into a djvu file is djvused in.djvu -e 'set-outline bmks' -s, where bmks is the text file for bookmarks.

  2. In djvused bookmark format, to enable characters that have special meaning in general text files:

    The character \n means new line. But if using it directly in djvu bookmark format, it will be shown as it is, not be interpreted as new line.

    For example:

    (bookmarks
     ("long title part 1 \n long title part 2" "#10" 
    )
    

    The long title will not be broken into two lines where \n is specified.

Tim
  • 101,790

1 Answers1

2

Quoting http://djvu.sourceforge.net/doc/man/djvused.html

Strings denote an arbitrary sequence of bytes, usually interpreted as a sequence of UTF-8 encoded characters. Strings in djvused files are similar to strings in the C language. They are surrounded by double quote characters. Certain sequences of characters starting with a backslash ("\") have a special meaning. A backslash followed by letter "a", "b", "t", "n", "v", "f", "r", "\", and stands for the ascii character BEL(007), BS(008), HT(009), LF(010), VT(011), FF(012), CR(013), BACKSLASH(134) and DOUBLEQUOTE(042) respectively. A backslash followed by one to three digits stands for the byte whose octal code is expressed by the digits. All other backslash sequences are illegal. All non printable ascii characters must be escaped.

sendmoreinfo
  • 2,573