From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adonay Felipe Nogueira Subject: Re: General advice beyond Org Date: Tue, 5 Jun 2018 16:52:06 -0300 Message-ID: <6e1d6252-f534-743b-61ac-d743b9629d05@hyperbola.info> References: <7dc580d0ea76c21328dc586ffadb5499@openmail.cc> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="NKWXUgxXpaOiMBPlNBPbDGRzwTEvSvW8j" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51930) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fQI0I-0006Si-BM for emacs-orgmode@gnu.org; Tue, 05 Jun 2018 15:52:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fQI0F-0003lq-8i for emacs-orgmode@gnu.org; Tue, 05 Jun 2018 15:52:26 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:33587) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fQI0E-0003ki-SK for emacs-orgmode@gnu.org; Tue, 05 Jun 2018 15:52:23 -0400 Received: from [192.168.1.100] (unknown [179.220.58.104]) (Authenticated sender: adfeno@hyperbola.info) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 554EE240002 for ; Tue, 5 Jun 2018 21:52:22 +0200 (CEST) In-Reply-To: <7dc580d0ea76c21328dc586ffadb5499@openmail.cc> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --NKWXUgxXpaOiMBPlNBPbDGRzwTEvSvW8j Content-Type: multipart/mixed; boundary="oGHLUDUqUsP9ouChOVGfZzF9ADjzMLcxJ"; protected-headers="v1" From: Adonay Felipe Nogueira To: emacs-orgmode@gnu.org Message-ID: <6e1d6252-f534-743b-61ac-d743b9629d05@hyperbola.info> Subject: Re: [O] General advice beyond Org References: <7dc580d0ea76c21328dc586ffadb5499@openmail.cc> In-Reply-To: <7dc580d0ea76c21328dc586ffadb5499@openmail.cc> --oGHLUDUqUsP9ouChOVGfZzF9ADjzMLcxJ Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Just an update to let you know that I decided to migrate from Org-mode+LaTeX to ODF-and-related, particularly because of LPPL+GPL incompatibility, caused by LaTeX and related projects and because ODF-and-related are easier for the other people to participate and see the changes (no need to compile a .pdf nor to download 4 GiB of software)= =2E ODF 1.2 (which is used by default at least in LibreOffice 5) is good and offers many features similar to Org-mode, including adding files to each other, interacting with spreadsheets (look for "relative DDE link"), and also offers bibliography/reference manageemnt, along many other things. Although I do want to point out that you might want to go to View -> Disable "Show figures", so that LibreOffice Writer .odt documents are more editable and less slow. Also, note that you must recommend people to use LibreOffice to open the files. Microsoft says to have support, but it's not excellent. You may also want to import other .odt/.rtf/.doc/.docx files inside the main one. The tricks are that if you do so using "Insert" -> "Section" and tick "Link", the inserted section will use the main document's styles, not their own. Besides, for these files, since they *do* have notion of what is a "page break", then they will inevitably start in the next page. Also, inserting them this way may replace or add document metadata/properties (look in "File" -> "Properties"). at the same time, some files that you want to add are actually drawings made in LibreOffice Draw. In all the cases you might want to keep their own styling. To do this export them to .pdf. I use this: ------------------------------------------------------------------------ # Please close any running LibreOffice, or `soffice' silently fails. # No need to specify target file name. while read each_file do soffice --headless \ -convert-to pdf \ "${each_file}" done < "Figure"/"image", tick the box that has "Link" and select the image that you want to insert. Do this for each .png image. The "link" options are important so that the main document picks any change made to the .png image, otherwise LibreOffice will insert the entire image in the .odt, which will also make it more heavier to attach in e-mails (but requires the other person to also have the linked file in the same place). A caveat of the manual .png insertion is that if a .pdf happens to have more or less pages than the last conversion to .png, then you will need to add or delete the related links and their corresponding figures in the main .odt file. If someone has better solution please share. Additionally, one can't do "Insert" -> "OLE Object" to insert .odg or =2Eods files because these *cannot* break across pages, and don't look good when printing. This OLE feature wasn't made for printing purpose, but to facilitate editing without leaving the same program. If I recall correctly, it's a Microsoft kludge. As for tabular/table results produced by R, use and abuse of `write.csv'. Besides, make R output graphics to a .png image (use the `png' command/device). For all of this, write an .R/.r file and use Rscript to run it. The R-produced .png files can be inserted in the main .odt document I described earlier, no need to repeat the explanation. What you need to tweak in the `png' R command/device is the `pointsize' and `res' arguments. Something like this would do: ------------------------------------------------------------------------ ## The variables are here just for explanation. ## The standard DPI/`res' of the `png' command/device. R_img_dpi <- 72 ## The standard pointsize of the `png' command/device. R_pointsize <- 12 ## The new DPI/`res' of our image, to make things sharp. ## Just changing `width' or `height' isn't enough. sharp_img_dpi <- 90 png(file=3D"Plot.png", height =3D 768, pointsize =3D R_pointsize * sharp_img_dpi / R_img_dpi, res =3D sharp_img_dpi, width =3D 1024) plot(something) ## ... or output some graphic. ## Close/save the .png image. dev.off() ------------------------------------------------------------------------ Now you ask, how to insert the .csv files in the main .odt document as tables in a dynamic way (such that if the .csv contents are changed by a external application, LibreOffice picks the modifocation)? To partially answer that question, I suggest you to make a new .ods spreadsheet set/document, and for each .csv, use "Spreadsheet" -> "Insert spreadsheet from file", select the .csv, enable/tick "Link", save the .ods. With that done, go to the spreadsheet/tab in LibreOffice Calc that you want to insert in your main .odt, click on the square between the column name A and which is above row name 1 (this will select the entire spreadsheet), copy (Ctrl + C), and Ctrl + Shift + V in the .odt, select "DDE link". To style the table, do it in the .odt document, not in the .ods spreadsheet. Particularly, if you want to make tables with consistent formating, make the first example table according to your needs then use the "Table" -> "Style and formating" -> "Add" option to make that formatting into a new table style. Note however that applying this to other tables doesn't establish a "style" relationship as is done in the case of other elements in LibreOffice, so I cannot expect every "Black 1"-styled table to change if I ever update/remake the "Black 1" table style, so my advice is that these styles deal with display of tables/cells/rows/columns themselves, not their contents/text. For these you are better off changing the "Table content" and "Table title/heading" paragraph styles. Another caveat of this method is that the DDE column/row references are absolute ("take from 1 to 3") and as far as I know there is no way to say "take the entire spreadsheet even if new columns/rows are added". Again, if someone has a better method that addresses both caveats, please share. Finally, there is a known bug[1] in LibreOffice Writer in which DDE links from Calc .ods files are inserted referring to the absolute path of the file. So after doing the "Ctrl + Shift + V, select 'DDE link'", go to "Edit" -> "Links", double-click in the corresponding "soffice" link to the .ods file, and in "File" field, and change that to relative path, inserting "file:./" at the start, like so: Old path: /home/adfeno/Docs/Work/Spreadsheets in the same directory.ods New path: file:./Spreadsheets in the same directory.ods Or if the spreadsheets are in some parent directory, use "file:../", like so: Old path: /home/adfeno/Docs/Spreadsheets in parent directory.ods New path: file:../Spreadsheets in parent directory.ods And so on for traversing to outer directories: Old path: /home/adfeno/Docs/Contract/Spreadsheets in contract.ods New path: file:../Contract/Spreadsheets in contract.ods Similarly: Old path: /home/adfeno/Spreadsheets at home.ods New path: file:../../Spreadsheets at home.ods All in all, the command-line steps are great because you can append these in the main .odt itself (to be printed verbatim) using "Insert" -> "Section", and since they are plain text files, it won't make the text start in new page (so you can write a section title before them). Happy hacking! :D [1] https://bugs.documentfoundation.org/show_bug.cgi?id=3D47223 --oGHLUDUqUsP9ouChOVGfZzF9ADjzMLcxJ-- --NKWXUgxXpaOiMBPlNBPbDGRzwTEvSvW8j Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iF4EAREIAAYFAlsW6eYACgkQyNbhUgHunaH5TQEAiAEQWtTKCwXJJA/oP6IYrayA pIgUaHiBJj8FP+RPgDAA/Ag9ejf7Ovnsu/2/lhLajo9A+lZU46gokuxtH4xLVk9E =dr6F -----END PGP SIGNATURE----- --NKWXUgxXpaOiMBPlNBPbDGRzwTEvSvW8j--