LibreOfficeについてのメモ。
グラフのデフォルトカラーパレットは、お世辞にも配色が良いとは言いづらいの変更しておくと見やすいグラフが書けます。
配色に自信のない人は Adobe Kulerなどを参考にするとよいかも。
系列1 | 赤2 |
---|---|
系列2 | 青8 |
系列3 | グラフ3 |
系列4 | 緑4 |
グラフはベタ塗りでもいいのですが、円グラフなどは若干グラデーションをかけると見やすくなります。
グラデーションの「終わりの値」は30%ぐらいが自然な感じで見やすくなります。
=MOD(ROW(),2)=0
」を指定します。「適用スタイル」に「新しいスタイル…」を選択し、ハイライトする背景の書式を作成し、書式を指定する。
行ではなく列を変更したい場合は「=MOD(COLUMN(),2)=1
」と指定すると良い。
odsファイルを検索したり、2つのファイルの差分を取りたいことがあります。 そんなときは、オープンソースの表計算ソフトGnumeric付属のssdiff, ssgrepを使うとよいです。
グラフのカラーパレットは標準固定ですが、図形に使うカラーパレットは変更できます。
標準のカラーパレットは ~/.config/libreoffice/3/user/config/standard.soc
です。
これを置き換えると標準のカラーパレットが変更できます。
Writer2LaTeXのベータ版を使うと XeLaTexを使ってエクスポートできるので、それを使う。
Flat ODF形式で保存をすると一つの大きなXML文書として保存されるので、grepすることができます。
odtはzipファイルなのでこんなふうにすればgrepできます。
$ unzip -p hoge.odt | grep fuga
ただ、これには欠点があります。 odtは文書に装飾が入るとXMLタグでタグ付けされ連続した文字列が分割されます。それにより思った通りの文字列で検索できません。 そのため、本文をきちんと検索するには odt2txtを使うほうがよいでしょう。
$ odt2txt hoge.odt | grep fuga
実を言うとdocxをgrepで検索する方法を探してたので、docxもメモしておきます。 docxの場合はodt2txtの代わりにdocx2txtを利用すれば、odt2txtと同じように検索できます。
そんな場合は「オプション」を開き、「配色の調整」にある「全般」の「フォントの色」を自動から白に固定しましょう。
これで、ダーク系GTK2テーマ使用時、背景色を黒系にしたにもかかわらず黒系の色を選択して困る!>< なバグにひっかかっても大丈夫です。 (修正されたので、これからは大丈夫だと思いますが)
メモリに余裕があるなら、メモリの割り当てを変更することで動作を高速化できる。
Arch Wikiでは、オプションの「Java」にある「Javaランタイム環境を使用」のチェックを外す、と書いてあるけれど外すと影響が大きい(特にBaseは使い物にならなくなる)ので手を付けないほうがよいでしょう。
Impress/Drawでオブジェクトをドラッグすると移動が耐えられないぐらいの遅さでスライド作成にストレスがたまりますが、これはオブジェクトにアンチエイリアスがかかっていることが原因です。
とりあえずの回避方法としては、オプションの[LibreOffice]→[表示]にある、「アンチエイリアシングを使用する」のチェックを外します。
LibreOfficeで文書を作成して正常に終了させたにも関わらず、次回、開く際に文書の復元を求められる場合は、そのファイルがあるディレクトリに
.~lock.(ファイル名)#
というファイルがあるか見てください。
あればこいつの仕業なので削除します。
OpenOffice.orgの拡張機能は、拡張機能マネージャーを使わなくても、unopkgコマンドでコマンドラインからインストールすることもできます。
$ unopkg --help using: unopkg add <options> extension-path... unopkg remove <options> extension-identifier... unopkg list <options> extension-identifier... unopkg reinstall <options> unopkg gui unopkg -V unopkg -h sub-commands: add add extension remove remove extensions by identifier reinstall expert feature: reinstall all deployed extensions list list information about deployed extensions gui raise Extension Manager Graphical User Interface (GUI) options: -h, --help this help -V, --version version information -v, --verbose verbose output to stdout -f, --force force overwriting existing extensions --log-file <file> custom log file; default: <cache-dir>/log.txt --shared expert feature: operate on shared installation deployment context; run only when no concurrent Office process(es) are running! --deployment-context expert feature: explicit deployment context <context> To learn more about the Extension Manager and extensions, see: http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/Extensions/Extensions
管理者権限かつ–sharedオプションをつけてインストールすると、すべての人が使えるようになります。
$ sudo unopkg add --shared fugahoge.oxt
GIMPのカラーパレット(.gpl)をLibreOfficeで使うためのシェルスクリプト。
使い方はGIMPパレットファイルを指定して実行します。
$ ./gpl2soc.sh カラーパレット.gpl
カラーパレット.soc ファイルが生成されるので、これを ~/.config/libreoffice/4/user/config/ に移動して、読み込ませるとLibreOfficeのカラーパレットとして使えます。
#!/bin/bash # # Convert GIMP Palette to LibreOffice Color Palette. # Usage: hue3602soc.sh [ GIMP_palette.gpl ] # # Copyright: Jun NOGATA <nogajun@gmail.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. GPL_FILE="$1" usage(){ echo "Usage: gpl2soc.sh [ GIMP_palette.gpl ]" echo "Convert GIMP Palette(.gpl) to LibreOffice Color Palette(.soc)." echo } # file Check if [ "$#" = "0" ]; then usage exit 1 fi if [ ! -e "$1" ]; then echo "Can't file reading: No such file or directory" exit 1 fi # GIMP Palette Check if [ ! "$(head -1 $1 | grep GIMP)" ]; then echo "This is NOT Gimp Color Palette file." exit 1 fi FILENAME="${GPL_FILE%.gpl}.soc" # ------------------------------------------------------------------------ put_header(){ # put header cat << EOL > ${FILENAME} <?xml version="1.0" encoding="UTF-8"?> <ooo:color-table xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ooo="http://openoffice.org/2004/office"> <!-- White to Black --> <draw:color draw:name="White" draw:color="#FFFFFF"/> <draw:color draw:name="Gray1" draw:color="#E3E3E3"/> <draw:color draw:name="Gray2" draw:color="#C6C6C6"/> <draw:color draw:name="Gray3" draw:color="#AAAAAA"/> <draw:color draw:name="Gray4" draw:color="#8E8E8E"/> <draw:color draw:name="Gray5" draw:color="#717171"/> <draw:color draw:name="Gray6" draw:color="#555555"/> <draw:color draw:name="Gray7" draw:color="#393939"/> <draw:color draw:name="Gray8" draw:color="#1C1C1C"/> <draw:color draw:name="Black" draw:color="#000000"/> <!-- Convert Palette --> EOL } put_footer(){ # put footer echo "</ooo:color-table>" >> ${FILENAME} } put_header tail -n +5 $GPL_FILE | while read; do C=(${REPLY}) if [ "$(echo ${C[0]} | grep [0-9])" ]; then COLORNAME=$(echo ${REPLY} | cut -f4- -d" ") COLORCODE=$(printf "#%02x%02x%02x" ${C[0]} ${C[1]} ${C[2]}) echo " <draw:color draw:name=\"${COLORNAME}\" draw:color=\"${COLORCODE}\"/>" >> ${FILENAME} fi done put_footer
HUE/360で作ったカラーパレットをLibreOfficeで使うためのシェルスクリプト。
使い方は「Print User Color」を押して表示されたカラーパレットをコピペして、テキストファイルとして保存した後、
$ ./hue3602soc カラーパレット.txt
と実行すると カラーパレット.soc ファイルが生成されます。
これを ~/.config/libreoffice/4/user/config/ に移動して、読み込ませるとLibreOfficeのカラーパレットとして使えます。
#!/bin/bash # # Convert HUE/360 Palette to LibreOffice Color Palette. # Usage: hue3602soc.sh [ HUE360_palette.txt ] # # input file structure # color name: #(color code) # # input file example: # white: #ffffff # black: #000000 # # Copyright: Jun NOGATA <nogajun@gmail.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. HUE_FILE="$1" usage(){ echo "Usage: hue3602soc.sh [ HUE360_palette.txt ]" echo "Convert HUE/360 Palette(.txt) to LibreOffice Color Palette(.soc)." echo } # file Check if [ "$#" = "0" ]; then usage exit 1 fi if [ ! -e "$1" ]; then echo "Can't file reading: No such file or directory" exit 1 fi FILENAME="${HUE_FILE%.txt}.soc" put_header(){ # put header cat << EOL > ${FILENAME} <?xml version="1.0" encoding="UTF-8"?> <ooo:color-table xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ooo="http://openoffice.org/2004/office"> <!-- White to Black --> <draw:color draw:name="White" draw:color="#FFFFFF"/> <draw:color draw:name="Gray1" draw:color="#E3E3E3"/> <draw:color draw:name="Gray2" draw:color="#C6C6C6"/> <draw:color draw:name="Gray3" draw:color="#AAAAAA"/> <draw:color draw:name="Gray4" draw:color="#8E8E8E"/> <draw:color draw:name="Gray5" draw:color="#717171"/> <draw:color draw:name="Gray6" draw:color="#555555"/> <draw:color draw:name="Gray7" draw:color="#393939"/> <draw:color draw:name="Gray8" draw:color="#1C1C1C"/> <draw:color draw:name="Black" draw:color="#000000"/> <!-- Convert Palette --> EOL } put_footer(){ # put footer echo "</ooo:color-table>" >> ${FILENAME} } put_header COUNT=1 cat ${HUE_FILE} | while read; do if [ "${REPLY}" != "" ] || [ ! "$(echo ${REPLY}|grep ^#)" ] ; then C=(${REPLY}) COLORNAME="${C[0]%:}" COLORCODE="${C[1]}" if [ "${COLORNAME}" = "subColor" ]; then COLORNAME="${COLORNAME}${COUNT}" COUNT=$((${COUNT}+1)) fi echo " <draw:color draw:name=\"${COLORNAME}\" draw:color=\"${COLORCODE}\"/>" >> ${FILENAME} fi done put_footer