Hi Any idea how to export checkboxes to odt? I mean not just simply having [ ] in the odt document but having them translated as actual boxes. Thanks and regards Uwe Brauer
[-- Attachment #1: Type: text/plain, Size: 260 bytes --] >>> "UB" == Uwe Brauer <oub@mat.ucm.es> writes: > Hi > Any idea how to export checkboxes to odt? > I mean not just simply having [ ] in the odt document but having them translated as actual boxes. Either using latex $\boxtimes$ or UTF8 ☒ [-- Attachment #2: smime.p7s --] [-- Type: application/pkcs7-signature, Size: 5673 bytes --]
Hi Uwe,
Uwe Brauer writes:
> Any idea how to export checkboxes to odt?
>
> I mean not just simply having [ ] in the odt document but having them translated as actual boxes.
You can try:
(defun my/org-odt--checkbox (item)
"Return check-box string associated to ITEM."
(let ((checkbox (org-element-property :checkbox item)))
(if (not checkbox) ""
(format "<text:span text:style-name=\"%s\">%s</text:span>"
"OrgCode" (cl-case checkbox
(on "\u2611 ") ; CHECK MARK
(off "\u2610 ")
(trans "[-] ")))))) ;; I don't know which character to choose here...
(advice-add 'org-odt--checkbox :override #'my/org-odt--checkbox)
Best regards,
Juan Manuel
[-- Attachment #1: Type: text/plain, Size: 288 bytes --] Hello, >> Any idea how to export checkboxes to odt? >> I mean not just simply having [ ] in the odt document but having them translated as actual boxes. > > Either using latex ⊠ > or UTF8 ☒ I’m wondering, would this be worth adding to ox-odt? All the best, Timothy
[-- Attachment #1.1: Type: text/plain, Size: 1383 bytes --] >>> "JMM" == Juan Manuel Macías <maciaschain@posteo.net> writes: Hi Juan, > Hi Uwe, > Uwe Brauer writes: >> Any idea how to export checkboxes to odt? >> >> I mean not just simply having [ ] in the odt document but having them translated as actual boxes. > You can try: > (defun my/org-odt--checkbox (item) > "Return check-box string associated to ITEM." > (let ((checkbox (org-element-property :checkbox item))) > (if (not checkbox) "" > (format "<text:span text:style-name=\"%s\">%s</text:span>" > "OrgCode" (cl-case checkbox > (on "\u2611 ") ; CHECK MARK > (off "\u2610 ") > (trans "[-] ")))))) ;; I don't know which character to choose here... > (advice-add 'org-odt--checkbox :override #'my/org-odt--checkbox) Thanks very much, I saw it too late to respond yesterday. A couple of remarks 1. (on "\u2611 ") ; CHECK MARK: I rather prefer 2612 but this is a question of taste 2. It seems not to work, I loaded the function and Executed the advice, but When I tried to export this minimal example * Check the conversion of checkboxes 1. Latex $\boxtimes$ 2. UTF8 ☒, ▢ □ 3. Org [ ] and [X] 4. Org [] [-] I obtained a odt file in which 3 and 4 were *not* converted to UTF8. I attach the file. What do I miss? Regards Uwe [-- Attachment #1.2: checkbox.odt --] [-- Type: application/vnd.oasis.opendocument.text, Size: 12057 bytes --] [-- Attachment #2: smime.p7s --] [-- Type: application/pkcs7-signature, Size: 5673 bytes --]
[-- Attachment #1: Type: text/plain, Size: 447 bytes --] >>> "T" == Timothy <tecosaur@gmail.com> writes: > Hello, >>> Any idea how to export checkboxes to odt? >>> I mean not just simply having [ ] in the odt document but having them translated as actual boxes. >> >> Either using latex ⊠ >> or UTF8 ☒ > I’m wondering, would this be worth adding to ox-odt? I think Juan's solution would be nice, however it does not work for me write now, so I have to see what is wrong with it. [-- Attachment #2: smime.p7s --] [-- Type: application/pkcs7-signature, Size: 5673 bytes --]
[-- Attachment #1: Type: text/plain, Size: 479 bytes --] > Hi Juan, > Thanks very much, I saw it too late to respond yesterday. A couple of remarks > 1. (on "\u2611 ") ; CHECK MARK: I rather prefer 2612 but this is a > question of taste > 2. It seems not to work, I loaded the function and Executed the > advice, but I just want to clarify, that your code works. I realized that I used the word checkbox not a the strict org mode sense. Sorry for the confusion! Thanks for your code [-- Attachment #2: smime.p7s --] [-- Type: application/pkcs7-signature, Size: 5673 bytes --]
On 29/09/2021 11:07, Timothy wrote:
>
>>> Any idea how to export checkboxes to odt?
>>> I mean not just simply having [ ] in the odt document but having them translated as actual boxes.
>>
>> Either using latex ⊠
>> or UTF8 ☒
>
> I’m wondering, would this be worth adding to ox-odt?
LibreOffice has some object called "checkbox" that could be inserted
using "Form Controls" toolbar. I have never used this feature, so unsure
whether it is a proper representation for Org checkboxes.
[-- Attachment #1: Type: text/plain, Size: 748 bytes --] >>> "MN" == Max Nikulin <manikulin@gmail.com> writes: > On 29/09/2021 11:07, Timothy wrote: >> >>> Any idea how to export checkboxes to odt? >>> I mean not just simply having [ ] in the odt document but having them translated as actual boxes. >>> >>> Either using latex ⊠ >>> or UTF8 ☒ >> I’m wondering, would this be worth adding to ox-odt? > LibreOffice has some object called "checkbox" that could be inserted > using "Form Controls" toolbar. I have never used this feature, so > unsure whether it is a proper representation for Org checkboxes. I should add, that I need to generate an odt document, in which checkboxes are placed in tables, a feature that is not supported by org mode as of today, unfortunately. [-- Attachment #2: smime.p7s --] [-- Type: application/pkcs7-signature, Size: 5673 bytes --]