Re: Alphabetically sorting a table in Lyx

2012-09-12 Thread Andrew Parsloe

On 13/09/2012 10:13 a.m., Liviu Andronic wrote:

Andrew,
Excellent effort! Thanks!

Couple of observations:
- I think your work would be more useful to the community if you
included it on the Wiki. Perhaps something in the style of
http://wiki.lyx.org/Examples/SpreadsheetExternalInset , but a
copy/paste of this e-mail would work just fine.



- The '@@@' marker may not be very safe. Perhaps something similar to
'@@tablesort@@' would be a better and more intuitive choice, even if
it requires more typing.
- I'm wondering if instead of the stock Note inset you could come up
with a module with a customized Note 'custom inset' that would
automatically generate the marker in addition to the user-supplied
sorting arrangements. This would much clean up the approach and remove
the hacky feeling.
- I think that being python and with a little clean-up, there is scope
for a native LyX UI for the script.

Regards
Liviu

Thanks for the comments and suggestions Liviu -- the custom inset and 
automatic generation of the marker appeals.


I realise this method of sorting tables *is* hackish, but in theory it 
is only a stopgap until an inbuilt solution is forthcoming. What I 
wanted to show was that when one meets a "gap" in LyX's functionality, 
because LyX files are text files, and because modern computers are fast, 
it may be possible to write a script invoked by LyX's converter 
mechanism to achieve an effect that feels "nearly built-in".


The original enquirer on this topic was having difficulty sorting table 
cells containing ERT. I had forgotten the ERT bit. However, version 1.1 
of the script, attached, will sort a table even when cells contain ERT, 
and also it allows any number of columns, up to the number in the table, 
to be used in the sort specification -- it's not limited to three. And 
it tidies some of my python code (I'm still a "learner-driver" at this).


Andrew


# Sort the rows of a table according to values in specified
# columns. Columns are numbered 1, 2, 3, ... from the left.
# Sort type is indicated by a alphabetical(ignore case), A 
# alphabetical(distinguish case), or n (numerical) following
# a digit indicating the column. Thus a specification might be
# @@@ 3a,4n,1A (or @@@3a4n1A or @@@3a 4n 1A) for a primary
# alphabetical sort, ignoring case, by the entries in the first
# column, a secondary numerical sort by the entries in the fourth
# column, and a tertiary alphabetical sort, distinguishing case,
# by the entries in the first column. The @@@ marker and at least
# one column number and trailing letter (a, A or n) are essential.
# Any number of columns up to the number in the table can be speci-
# fied. The specification should be placed in a yellow note before
# the first row to be sorted.
#
# Andrew Parsloe, 13 September 2012, apars...@clear.net.nz 
#
# tablesort.py infile.lyx outfile.lyx
#
#
import sys, re, argparse
from operator import itemgetter

parser = argparse.ArgumentParser(description='Sort the rows of a table', \
 version='1.1')

parser.add_argument('infile', type=argparse.FileType('r'), \
help='Input file with table to sort.')

parser.add_argument('outfile', type=argparse.FileType('w'), \
help='Output file with sorted table.')

fin =parser.parse_args().infile
fout=parser.parse_args().outfile

re_marker = re.compile(r'@@@')
re_row = re.compile(r'^')
re_row_end = re.compile(r'^')
re_table_end = re.compile(r'^')
re_lyxcmds = re.compile(r'(\\\w+.*)|(status (open|collapsed))')
re_ert_inset = re.compile(r'\\begin_inset ERT')
re_begin_inset = re.compile(r'\\begin_inset')
re_end_inset = re.compile(r'\\end_inset')

# 0 = no table; 1 = next row; 2 = this row; 3 = this cell; 4 = ERT inset
table_status = 0
insets = 0
current_row = ''
rows = [] # list of (sort1st, sort2nd, ..., row)
sortby = []
cols = []
sort_type = []
qeys = []

for line in fin:
if table_status == 0:   #no table
fout.write(line)
#@@@ marker found; get columns to sort by & sort types
if re_marker.match(line):
table_status = 1
columns = re.findall(r'\d+',line)
colsorts = re.findall(r'(A|a|n)',line)
numsorts =  len(columns)
qeys = [0 for i in range(numsorts)]
for i in range(0,numsorts):
cols.append(int(columns[numsorts-i-1]))
sort_type.append(colsorts[numsorts-i-1])


elif table_status == 1: #next row
if re_row.match(line):
table_status = 2
current_row = line
colnum = 0
elif re_table_end.match(line):
for i in range(numsorts):
rows = sorted(rows,key=itemgetter(i))
for item in rows:
fout.write(item[numsorts])
fout.write(line)
table_status = 0
else:
fout.write(line)

elif table_status == 2: #this row
current_row += line
if re_cell.match(l

Re: Alphabetically sorting a table in Lyx

2012-09-12 Thread Liviu Andronic
Andrew,
Excellent effort! Thanks!

Couple of observations:
- I think your work would be more useful to the community if you
included it on the Wiki. Perhaps something in the style of
http://wiki.lyx.org/Examples/SpreadsheetExternalInset , but a
copy/paste of this e-mail would work just fine.
- The '@@@' marker may not be very safe. Perhaps something similar to
'@@tablesort@@' would be a better and more intuitive choice, even if
it requires more typing.
- I'm wondering if instead of the stock Note inset you could come up
with a module with a customized Note 'custom inset' that would
automatically generate the marker in addition to the user-supplied
sorting arrangements. This would much clean up the approach and remove
the hacky feeling.
- I think that being python and with a little clean-up, there is scope
for a native LyX UI for the script.

Regards
Liviu


On Wed, Sep 12, 2012 at 3:18 AM, Andrew Parsloe  wrote:
> On 12/09/2012 6:05 a.m., Liviu Andronic wrote:
>>
>> On Sun, Sep 2, 2012 at 9:52 PM, Richard Heck  wrote:

 Is it possible to sort a table alphabetically in Lyx? This seems to be a
 problem according to the internet.
 I can't copy the table to MS Excel to sort it there, since it contains
 ERT.

>>> There's no automated way to do this, so far as I know.
>>>
>> I think this is worth a feature request.
>>
>> Liviu
>>
> +1
> Although there's no built-in means of sorting a table, it's possible to use
> LyX's converter mechanism to create a "built-out" mechanism that can give,
> with the speed of modern computers, an illusion of being built-in. The
> attached Python script will sort the *rows* of a table, alphabetically or
> numerically, according to the values in specified columns. It allows up to
> three columns to be specified, for primary secondary and tertiary sorts.
>
> The script expects to find a sort specification like @@@ 2a,3A,4n in a
> yellow note. This precedes the table if all rows of the table are to be
> sorted; if the table has header rows, it is placed in the final header row.
> The program assumes the *next* row it meets is the first to be sorted. The
> program searches for the @@@ marker. (If by some freak this occurs elsewhere
> in your document, you will need to choose a different marker and change the
> Python script.) It then reads the specification. The example is read as:
> primary sort by the entries in the 2nd column, alphabetical, ignore case
> (lower-case a); secondary sort by the entries in the 3rd column,
> alphabetical, distinguish case (upper-case A); tertiary sort by the entries
> in the 4th column, numerical (lower-case n). The commas in the specification
> are not essential, nor do you need to specify three columns, but you do need
> to specify at least one and its sort type, e.g. a specification like @@@ 1n
> means a numerical sort of the rows, by the entries in the 1st column only.
>
> Place the script in the script folder in your personal LyX2.0 directory. On
> my Windows Vista machine this is
>
> C:/Users/Andrew/AppData/Roaming/LyX2.0/scripts
>
> Now in LyX go to Tools>Preferences>File Formats, click the New button and
> enter, say, LyX (table) in the Format: box, tick the Document format and
> Show in export menu check boxes, enter lyxtabsort (for instance) in the
> Short Name: box, enter lyx in the Extension: box, under Editor: choose
> Custom and enter LyX in the box on the right. Do the same under Viewer:. Now
> click the Apply button, then select Converters from the list on the left.
>
> In the From format: box, scroll down to LyX; in the To format: box scroll
> down to LyX (table) which should now be there. In the Converter: box enter,
> suitably modified for your computer,
>
> python C:/Users/Andrew/AppData/Roaming/LyX2.0/scripts/tablesort.py $$i $$o
>
> If you now create a table in LyX, put a sort specification in the last
> header row of the table (just before the first row to be sorted), and click
> the View Other Formats button, you should find View LyX (table) there. Click
> it. In due course a second instance of LyX will be started and the sorted
> table presented for view. (Possibly the second instance will exactly overlie
> the first. Move it to the side.) The formatting rules delineating the rows
> of the table will (probably) have been disturbed by the sort. That's easily
> fixed but do your decorating of the table *after* sorting. You can now copy
> the sorted table back to your original document. (The Update other
> formats>Update LyX (table) button also is available if the table needs
> re-sorting, but the viewer LyX doesn't automatically show the update. You
> need to enter a buffer-reload command in the viewer's command buffer, to see
> the update. Better still, assign a shortcut key to buffer-reload.)
>
> Or you can live more dangerously. Assign a shortcut key
> (Tools>Preferences>Editing>Shortcuts) to the command sequence
>
> command-sequence buffer-export lyxtabsort; buffer-reload;
>
> Make some change to the sort

Re: Lyx misplacing brackets when converting to latex, cannot produce pdf

2012-09-12 Thread Richard Heck

On 09/12/2012 01:48 PM, Christian Obst wrote:

Hi,

I have this strange problem. A document which was previously working
cannot be compiled anymore because latex complains about "unbalanced
brackets or parentheses in a foot- or endnote". If I manually convert
to .tex and look at the resulting file, I find passages like this:

texttexttext.%
\footnote{Texinfootnote.%
}

First, I dont understand why lyx is putting the percentage signs there,
they are regular footnotes, not comments. Also, I thought they
are supposed to xcomment out the rest of the line, not what is enclosed
between two of them. However, they leave one bracket out, so I think
this is what produces my error.
That is perfectly OK code. The %s do exactly what you say, so there's 
nothing unbalanced there (and nothing in that part of the LyX code has 
changed recently). The problem is surely elsewhere. I'd suggest you try 
bisecting: removing chunks until you get something that works, then 
adding stuff back, etc.


Richard



Re: Problem with citation

2012-09-12 Thread Richard Heck

On 09/12/2012 10:56 AM, Harold Mouras wrote:

Dear Lyx Users,
I have a Lyx file with citations and .bib bibliography. I just made 
citations in the main text and used natbib as usual. However, when 
compiling the file, the following error message is coming back for 
several references:



...emph{affectives \citep{Panksepp:2003uq}}

, s'intressant aux

The control sequence marked  should

not appear between \csname and \endcsname.



Is the problem that it is emphasized?

Richard



Re: Produce PDF/A in Lyx

2012-09-12 Thread mendy
Ernesto Posse  cs.queensu.ca> writes:

> 
> Several years ago I had to go through the same thing and it was
> painful. In the end, after asking around and insisting a bit, they
> accepted a normal PDF if the thesis was generated with latex (they
> somehow strangely assumed that everyone used MSWord). You might want
> to ask in your university about this.
> 
> However there are tools out there to do this. The script in the
> following link might work
> 
> http://www.cs.mcgill.ca/~kwysoc/hacks/#ps2pdfa
> 
> ...but I haven't tried it.
> 
> What will work is to use Acrobat Pro/Distiller (not the free version).
> Unfortunately those are *not* free tools.
> 
> Good luck.
> 
Thanks. I do have access to Distiller (and in fact the free software PDFCreator
works as well), but those will produce PDF/A files which do not retain any of 
the
hyperref features!

I'll see if i can get the mcgill hack to work. The university is adamant about
only accepting pdf/a.





Re: Produce PDF/A in Lyx

2012-09-12 Thread Ernesto Posse
Several years ago I had to go through the same thing and it was
painful. In the end, after asking around and insisting a bit, they
accepted a normal PDF if the thesis was generated with latex (they
somehow strangely assumed that everyone used MSWord). You might want
to ask in your university about this.

However there are tools out there to do this. The script in the
following link might work

http://www.cs.mcgill.ca/~kwysoc/hacks/#ps2pdfa

...but I haven't tried it.

What will work is to use Acrobat Pro/Distiller (not the free version).
Unfortunately those are *not* free tools.

Good luck.


On Wed, Sep 12, 2012 at 2:35 PM, mendy wenger  wrote:
> Hi,
> My university requires PDF/A format for thesis submissions. I have to submit
> by tomorrow but unfortunately, it is turning out to be very difficult for me
> to produce a PDF/A file in Lyx.
> Does anyone know how to do so?
>
> I am able to convert my PDF file to PDF/A by using Adobe, but then I lose
> the hyperref features such as bookmarks and linked citations.
>
> Within Lyx, I tried using xmpincl package but get an error such as:
> ! Undefined control sequence.
>
> \xmpinclReadln ->\xmpProducer
>
> 
>
> l.55 \includexmp{pdfa-1b}
>
>
> I've also tried using the pdfx package, but then I get an error about:
> ! pdfTeX error (ext5): cannot open file for embedding.
>
> l.137 ...eam attr{/N 4} file{sRGBIEC1966-2.1.icm}
>
>
> even though I have placed that file in the folder.
>
>
> Thanks,
>
> Mendy
>
>



-- 
Ernesto Posse

Modelling and Analysis in Software Engineering
School of Computing
Queen's University - Kingston, Ontario, Canada


Lyx misplacing brackets when converting to latex, cannot produce pdf

2012-09-12 Thread Christian Obst
Hi,

I have this strange problem. A document which was previously working
cannot be compiled anymore because latex complains about "unbalanced
brackets or parentheses in a foot- or endnote". If I manually convert
to .tex and look at the resulting file, I find passages like this:

texttexttext.%
\footnote{Texinfootnote.%
}

First, I dont understand why lyx is putting the percentage signs there,
they are regular footnotes, not comments. Also, I thought they
are supposed to xcomment out the rest of the line, not what is enclosed
between two of them. However, they leave one bracket out, so I think
this is what produces my error.

My texlive packages are all uptodate (however recently updated), and I
also ran Tools->Reconfigure.

This problem exists for me in the stable version and the one from git.

Any help?

Best regards,
Christian



Re: Put figures in figure float in center - the best way?

2012-09-12 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 12/09/12 17:15, Stephen Buonopane wrote:
> 
> On Sep 12, 2012, at 10:55 AM, Rainer M Krug wrote:
> 
 I have not used it recently, but I get the same error you do. I copied it 
 from Herbert
 Voss' tips and tricks page many years ago. It worked then, but I am not 
 sure what has
 changed.
>>> 
 Actually…it looks like the /singlespacing command is causing the problem. 
 Delete that and
 the centering still works.
>> 
>> Great - thanks
> 
> \singlespacing requires the setspace package not really sure what it was 
> intended to do in this
> context.
> 

Thanks.

Just to add two links: I asked the question at stackexchange, and got some 
answers:

http://tex.stackexchange.com/questions/71280/best-way-to-centre-figure-in-float

and
http://tex.stackexchange.com/questions/2651/should-i-use-center-or-centering-for-figures-and-tables

Effeectively: use \centering as the preferred option. If you want to have this 
for all floats,
there are e.g. the "floatrow" package (http://www.ctan.org/pkg/floatrow) as 
well as the
"adjustbox" (http://www.ctan.org/pkg/adjustbox) oryou can use

\makeatletter
\g@addto@macro\@floatboxreset\centering
\makeatother

I must admit I have not the slightest clue what the second line is doing.

Cheers,

Rainer


- -- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys.
(Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :   +33 - (0)9 53 10 27 44
Cell:   +33 - (0)6 85 62 59 98
Fax :   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

Skype:  RMkrug
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlBQqfoACgkQoYgNqgF2egpCMACfcjEbyWsOp8Ekrz8kQ6i8Oj/2
5MsAnRy7xqnlw/IdWCSLp6b94Pvhgp6q
=nN5+
-END PGP SIGNATURE-


Re: Put figures in figure float in center - the best way?

2012-09-12 Thread Stephen Buonopane

On Sep 12, 2012, at 10:55 AM, Rainer M Krug wrote:

>>> I have not used it recently, but I get the same error you do. I copied it 
>>> from Herbert Voss'
>>> tips and tricks page many years ago. It worked then, but I am not sure what 
>>> has changed.
>> 
>>> Actually…it looks like the /singlespacing command is causing the problem. 
>>> Delete that and the
>>> centering still works.
> 
> Great - thanks

\singlespacing requires the setspace package
not really sure what it was intended to do in this context.

Re: Put figures in figure float in center - the best way?

2012-09-12 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 12/09/12 15:36, Stephen Buonopane wrote:
> 
> On Sep 12, 2012, at 9:21 AM, Rainer M Krug wrote:
> 
> On 12/09/12 15:15, Rainer M Krug wrote:
 On 12/09/12 14:19, Stephen Buonopane wrote:
> You can add something like this to your preamble (does not affect how 
> they appear in
> LyX preview of course)…
 
> \renewenvironment{figure}[1][]{ \@float{figure} \centering 
> \singlespacing} {\end@float}
>  \renewenvironment{table}[1][]{ \@float{table} \centering \singlespacing} 
> {\end@float}
 
 Now this is a neat idea - haven't thought about that. Saves me quite some 
 work.
> 
> But I was to fast. I get an error:
> 
> ! Undefined control sequence. \\figure ...at {figure} \centering 
> \singlespacing
> 
> l.177 \begin{figure}[H]
> 
> The control sequence at the end of the top line of your error message was 
> never \def'ed. If you
> have misspelled it (e.g., `\hobx'), type `I' and the correct spelling (e.g., 
> `I\hbox').
> Otherwise just continue, and I'll forget about whatever was undefined.
> 
> Any suggestions?
> 
> Rainer
> 
> 
>> I have not used it recently, but I get the same error you do. I copied it 
>> from Herbert Voss'
>> tips and tricks page many years ago. It worked then, but I am not sure what 
>> has changed.
> 
>> Actually…it looks like the /singlespacing command is causing the problem. 
>> Delete that and the
>> centering still works.

Great - thanks

Rainer

> 
>> Steve
> 
 
 Thanks,
 
 Rainer
 
 
> On Sep 12, 2012, at 7:23 AM, Liviu Andronic wrote:
 
>> On Wed, Sep 12, 2012 at 12:58 PM, Rainer M Krug  
>> wrote:
>>> There are (at least) two ways of centering a single figure / graphic 
>>> horizontally
>>> in a figure float:
>>> 
>>> 1) using paragrahh properties - alignment - center
>>> 
>> I'm no expert, but this is what I usually do. And to me this seems the 
>> less hacky 
>> approach.
>> 
>> Liviu
>> 
>> 
>>> 2) using a \hfill left and right of the figure
>>> 
>>> What is the better / more robust / more LaTeX way of doing this?
>>> 
>>> Thanks,
>>> 
>>> Rainer
>>> 
>>> - -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation 
>>> Biology,
>>> UCT), Dipl. Phys. (Germany)
>>> 
>>> Centre of Excellence for Invasion Biology Stellenbosch University South 
>>> Africa
>>> 
>>> Tel :   +33 - (0)9 53 10 27 44 Cell:   +33 - (0)6 85 62 59 98 
>>> Fax :
>>> +33 - (0)9 58 10 27 44
>>> 
>>> Fax (D):+49 - (0)3 21 21 25 22 44
>>> 
>>> email:  rai...@krugs.de
>>> 
>>> Skype:  RMkrug
> 
 
> 
> 
> 

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEUEARECAAYFAlBQonQACgkQoYgNqgF2egpd9ACXWx7OqeyV2Dqs54VCGD8qm0ZE
yACeLd67c4x+ZvHCc4ORtGjv8C9CBp4=
=IhFk
-END PGP SIGNATURE-


Re: Put figures in figure float in center - the best way?

2012-09-12 Thread Stephen Buonopane

On Sep 12, 2012, at 9:21 AM, Rainer M Krug wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> On 12/09/12 15:15, Rainer M Krug wrote:
>> On 12/09/12 14:19, Stephen Buonopane wrote:
>>> You can add something like this to your preamble (does not affect how they 
>>> appear in LyX 
>>> preview of course)…
>> 
>>> \renewenvironment{figure}[1][]{ \@float{figure} \centering \singlespacing} 
>>> {\end@float} 
>>> \renewenvironment{table}[1][]{ \@float{table} \centering \singlespacing} 
>>> {\end@float}
>> 
>> Now this is a neat idea - haven't thought about that. Saves me quite some 
>> work.
> 
> But I was to fast. I get an error:
> 
> ! Undefined control sequence.
> \\figure ...at {figure} \centering \singlespacing
> 
> l.177 \begin{figure}[H]
> 
> The control sequence at the end of the top line
> of your error message was never \def'ed. If you have
> misspelled it (e.g., `\hobx'), type `I' and the correct
> spelling (e.g., `I\hbox'). Otherwise just continue,
> and I'll forget about whatever was undefined.
> 
> Any suggestions?
> 
> Rainer
> 

I have not used it recently, but I get the same error you do.
I copied it from Herbert Voss' tips and tricks page many years ago. 
It worked then, but I am not sure what has changed.

Actually…it looks like the /singlespacing command is causing the problem.
Delete that and the centering still works.

Steve

>> 
>> Thanks,
>> 
>> Rainer
>> 
>> 
>>> On Sep 12, 2012, at 7:23 AM, Liviu Andronic wrote:
>> 
 On Wed, Sep 12, 2012 at 12:58 PM, Rainer M Krug  wrote:
> There are (at least) two ways of centering a single figure / graphic 
> horizontally in a 
> figure float:
> 
> 1) using paragrahh properties - alignment - center
> 
 I'm no expert, but this is what I usually do. And to me this seems the 
 less hacky
 approach.
 
 Liviu
 
 
> 2) using a \hfill left and right of the figure
> 
> What is the better / more robust / more LaTeX way of doing this?
> 
> Thanks,
> 
> Rainer
> 
> - -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation 
> Biology, UCT), 
> Dipl. Phys. (Germany)
> 
> Centre of Excellence for Invasion Biology Stellenbosch University South 
> Africa
> 
> Tel :   +33 - (0)9 53 10 27 44 Cell:   +33 - (0)6 85 62 59 98 Fax 
> :   +33 - 
> (0)9 58 10 27 44
> 
> Fax (D):+49 - (0)3 21 21 25 22 44
> 
> email:  rai...@krugs.de
> 
> Skype:  RMkrug
> 
>> 
> 
> - -- 
> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
> UCT), Dipl. Phys.
> (Germany)
> 
> Centre of Excellence for Invasion Biology
> Stellenbosch University
> South Africa
> 
> Tel :   +33 - (0)9 53 10 27 44
> Cell:   +33 - (0)6 85 62 59 98
> Fax :   +33 - (0)9 58 10 27 44
> 
> Fax (D):+49 - (0)3 21 21 25 22 44
> 
> email:  rai...@krugs.de
> 
> Skype:  RMkrug
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.11 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://www.enigmail.net/
> 
> iEYEARECAAYFAlBQjD8ACgkQoYgNqgF2egrUSACfapSbOg4k++TnoErSLBpLA3Hq
> Yf8AmwUh5HpGyGw+nRPkTRyqYToGwqYl
> =caSn
> -END PGP SIGNATURE-



Re: Put figures in figure float in center - the best way?

2012-09-12 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 12/09/12 15:15, Rainer M Krug wrote:
> On 12/09/12 14:19, Stephen Buonopane wrote:
>> You can add something like this to your preamble (does not affect how they 
>> appear in LyX 
>> preview of course)…
> 
>> \renewenvironment{figure}[1][]{ \@float{figure} \centering \singlespacing} 
>> {\end@float} 
>> \renewenvironment{table}[1][]{ \@float{table} \centering \singlespacing} 
>> {\end@float}
> 
> Now this is a neat idea - haven't thought about that. Saves me quite some 
> work.

But I was to fast. I get an error:

! Undefined control sequence.
\\figure ...at {figure} \centering \singlespacing

l.177 \begin{figure}[H]

The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

Any suggestions?

Rainer

> 
> Thanks,
> 
> Rainer
> 
> 
>> On Sep 12, 2012, at 7:23 AM, Liviu Andronic wrote:
> 
>>> On Wed, Sep 12, 2012 at 12:58 PM, Rainer M Krug  wrote:
 There are (at least) two ways of centering a single figure / graphic 
 horizontally in a 
 figure float:
 
 1) using paragrahh properties - alignment - center
 
>>> I'm no expert, but this is what I usually do. And to me this seems the less 
>>> hacky
>>> approach.
>>> 
>>> Liviu
>>> 
>>> 
 2) using a \hfill left and right of the figure
 
 What is the better / more robust / more LaTeX way of doing this?
 
 Thanks,
 
 Rainer
 
 - -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation 
 Biology, UCT), 
 Dipl. Phys. (Germany)
 
 Centre of Excellence for Invasion Biology Stellenbosch University South 
 Africa
 
 Tel :   +33 - (0)9 53 10 27 44 Cell:   +33 - (0)6 85 62 59 98 Fax 
 :   +33 - 
 (0)9 58 10 27 44
 
 Fax (D):+49 - (0)3 21 21 25 22 44
 
 email:  rai...@krugs.de
 
 Skype:  RMkrug

> 

- -- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys.
(Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :   +33 - (0)9 53 10 27 44
Cell:   +33 - (0)6 85 62 59 98
Fax :   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

Skype:  RMkrug
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlBQjD8ACgkQoYgNqgF2egrUSACfapSbOg4k++TnoErSLBpLA3Hq
Yf8AmwUh5HpGyGw+nRPkTRyqYToGwqYl
=caSn
-END PGP SIGNATURE-


Re: Put figures in figure float in center - the best way?

2012-09-12 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 12/09/12 14:19, Stephen Buonopane wrote:
> You can add something like this to your preamble (does not affect how they 
> appear in LyX
> preview of course)…
> 
> \renewenvironment{figure}[1][]{ \@float{figure} \centering \singlespacing} 
> {\end@float}  
> \renewenvironment{table}[1][]{ \@float{table} \centering \singlespacing} 
> {\end@float}

Now this is a neat idea - haven't thought about that. Saves me quite some work.

Thanks,

Rainer

> 
> On Sep 12, 2012, at 7:23 AM, Liviu Andronic wrote:
> 
>> On Wed, Sep 12, 2012 at 12:58 PM, Rainer M Krug  wrote:
>>> There are (at least) two ways of centering a single figure / graphic 
>>> horizontally in a
>>> figure float:
>>> 
>>> 1) using paragrahh properties - alignment - center
>>> 
>> I'm no expert, but this is what I usually do. And to me this seems the less 
>> hacky approach.
>> 
>> Liviu
>> 
>> 
>>> 2) using a \hfill left and right of the figure
>>> 
>>> What is the better / more robust / more LaTeX way of doing this?
>>> 
>>> Thanks,
>>> 
>>> Rainer
>>> 
>>> - -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation 
>>> Biology, UCT),
>>> Dipl. Phys. (Germany)
>>> 
>>> Centre of Excellence for Invasion Biology Stellenbosch University South 
>>> Africa
>>> 
>>> Tel :   +33 - (0)9 53 10 27 44 Cell:   +33 - (0)6 85 62 59 98 Fax : 
>>>   +33 -
>>> (0)9 58 10 27 44
>>> 
>>> Fax (D):+49 - (0)3 21 21 25 22 44
>>> 
>>> email:  rai...@krugs.de
>>> 
>>> Skype:  RMkrug -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 
>>> (GNU/Linux) 
>>> Comment: Using GnuPG with Mozilla - http://www.enigmail.net/
>>> 
>>> iEYEARECAAYFAlBQau0ACgkQoYgNqgF2egp7FgCeIHyhYT/x+bJzqoANM9Muapeo 
>>> vi4An28oDskmG/XKqdTgVLKPvJlhfRiZ =88Df -END PGP SIGNATURE-
>> 
>> 
>> 
>> -- Do you know how to read? http://www.alienetworks.com/srtest.cfm 
>> http://goodies.xfce.org/projects/applications/xfce4-dict#speed-reader Do you 
>> know how to
>> write? http://garbl.home.comcast.net/~garbl/stylemanual/e.htm#e-mail
> 
> 

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlBQiwAACgkQoYgNqgF2egqn4wCfeaVsxaeXKeZg05j+FldYgxVy
keIAn0p3xiStaP6F5uR8HLwEszM5w8zv
=aBmS
-END PGP SIGNATURE-



Re: Put figures in figure float in center - the best way?

2012-09-12 Thread Stephen Buonopane
You can add something like this to your preamble
(does not affect how they appear in LyX preview of course)…

\renewenvironment{figure}[1][]{
 \@float{figure}
 \centering
 \singlespacing}
 {\end@float}
 
 \renewenvironment{table}[1][]{
 \@float{table}
 \centering
 \singlespacing}
 {\end@float}

On Sep 12, 2012, at 7:23 AM, Liviu Andronic wrote:

> On Wed, Sep 12, 2012 at 12:58 PM, Rainer M Krug  wrote:
>> There are (at least) two ways of centering a single figure / graphic 
>> horizontally in a figure float:
>> 
>> 1) using paragrahh properties - alignment - center
>> 
> I'm no expert, but this is what I usually do. And to me this seems the
> less hacky approach.
> 
> Liviu
> 
> 
>> 2) using a \hfill left and right of the figure
>> 
>> What is the better / more robust / more LaTeX way of doing this?
>> 
>> Thanks,
>> 
>> Rainer
>> 
>> - --
>> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
>> UCT), Dipl. Phys.
>> (Germany)
>> 
>> Centre of Excellence for Invasion Biology
>> Stellenbosch University
>> South Africa
>> 
>> Tel :   +33 - (0)9 53 10 27 44
>> Cell:   +33 - (0)6 85 62 59 98
>> Fax :   +33 - (0)9 58 10 27 44
>> 
>> Fax (D):+49 - (0)3 21 21 25 22 44
>> 
>> email:  rai...@krugs.de
>> 
>> Skype:  RMkrug
>> -BEGIN PGP SIGNATURE-
>> Version: GnuPG v1.4.11 (GNU/Linux)
>> Comment: Using GnuPG with Mozilla - http://www.enigmail.net/
>> 
>> iEYEARECAAYFAlBQau0ACgkQoYgNqgF2egp7FgCeIHyhYT/x+bJzqoANM9Muapeo
>> vi4An28oDskmG/XKqdTgVLKPvJlhfRiZ
>> =88Df
>> -END PGP SIGNATURE-
> 
> 
> 
> -- 
> Do you know how to read?
> http://www.alienetworks.com/srtest.cfm
> http://goodies.xfce.org/projects/applications/xfce4-dict#speed-reader
> Do you know how to write?
> http://garbl.home.comcast.net/~garbl/stylemanual/e.htm#e-mail



Re: Put figures in figure float in center - the best way?

2012-09-12 Thread Liviu Andronic
On Wed, Sep 12, 2012 at 12:58 PM, Rainer M Krug  wrote:
> There are (at least) two ways of centering a single figure / graphic 
> horizontally in a figure float:
>
> 1) using paragrahh properties - alignment - center
>
I'm no expert, but this is what I usually do. And to me this seems the
less hacky approach.

Liviu


> 2) using a \hfill left and right of the figure
>
> What is the better / more robust / more LaTeX way of doing this?
>
> Thanks,
>
> Rainer
>
> - --
> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
> UCT), Dipl. Phys.
> (Germany)
>
> Centre of Excellence for Invasion Biology
> Stellenbosch University
> South Africa
>
> Tel :   +33 - (0)9 53 10 27 44
> Cell:   +33 - (0)6 85 62 59 98
> Fax :   +33 - (0)9 58 10 27 44
>
> Fax (D):+49 - (0)3 21 21 25 22 44
>
> email:  rai...@krugs.de
>
> Skype:  RMkrug
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.11 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://www.enigmail.net/
>
> iEYEARECAAYFAlBQau0ACgkQoYgNqgF2egp7FgCeIHyhYT/x+bJzqoANM9Muapeo
> vi4An28oDskmG/XKqdTgVLKPvJlhfRiZ
> =88Df
> -END PGP SIGNATURE-



-- 
Do you know how to read?
http://www.alienetworks.com/srtest.cfm
http://goodies.xfce.org/projects/applications/xfce4-dict#speed-reader
Do you know how to write?
http://garbl.home.comcast.net/~garbl/stylemanual/e.htm#e-mail


Put figures in figure float in center - the best way?

2012-09-12 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi

There are (at least) two ways of centering a single figure / graphic 
horizontally in a figure float:

1) using paragrahh properties - alignment - center
2) using a \hfill left and right of the figure

What is the better / more robust / more LaTeX way of doing this?

Thanks,

Rainer

- -- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys.
(Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :   +33 - (0)9 53 10 27 44
Cell:   +33 - (0)6 85 62 59 98
Fax :   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

Skype:  RMkrug
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlBQau0ACgkQoYgNqgF2egp7FgCeIHyhYT/x+bJzqoANM9Muapeo
vi4An28oDskmG/XKqdTgVLKPvJlhfRiZ
=88Df
-END PGP SIGNATURE-