Marcin Borkowski <mb...@mbork.pl> writes:

> On 2015-06-18, at 18:02, Kaushal <kaushal.m...@gmail.com> wrote:
>
>> A quick google search comes up this these:
>>
>> http://tex.stackexchange.com/questions/83440/inputenc-error-unicode-char-u8-not-set-up-for-use-with-latex
>> http://tex.stackexchange.com/questions/4268/inputenc-error-unicode-char-u8-error-while-trying-to-write-a-degree-symbol
>>
>> Based on those solutions, may be you can add
>>
>> \DeclareUnicodeCharacter{200b}{}
>>
>> I haven't tried it, so cannot guarantee if that will work.
>
> Thanks, I'll check it in my Spare Time™.

I use something like this:

  (defcustom rasmus/org-latex-unicode-to-tex  '((" " "~")
                                              (" " "\\,")
                                              ("​" ""))
    "list of re rep pairs which are replaced during latex export")
  
  (defun rasmus/org-latex-unicode-to-tex (text backend info)
    "Replace unicode strings with their TeX equivalents.

Currently:  ' ' (no break space) to '~'
            ' ' (thin space) to '\,'
            '​'  (zero width space) to ''."
    (when (org-export-derived-backend-p backend 'latex)
      (cl-loop for (re rep) in rasmus/org-latex-unicode-to-tex do
               (setq text (replace-regexp-in-string re rep text t t)))
      text))
  
  (add-to-list 'org-export-filter-final-output-functions
               'rasmus/org-latex-unicode-to-tex)



-- 
Sådan en god dansk lagereddike kan man slet ikke bruge mere


Reply via email to