Re: [O] Make * bold?

2014-10-13 Thread Rainer M Krug
Andreas Leha  writes:

> Hi Rainer,
>
> Rainer M Krug  writes:
>
>> Andrea Rossetti  writes:
>>
>>> Rainer M Krug  krugs.de> writes:
 I would like to make three stars bold - is this possible? I have the
 following table and at the moment, I get what is in the latex
 column. But I would like to have what is in the last column.
 
 | org | latex| what I would like |
 | *3.96e-21 *** * | \textbf{3.96e-21 **} *   | \textbf{3.96e-21 ***} |
 ...
 
 Any suggestions?
>>>
>>> Hi! using the "pretty entity" \ast{} works for me in HTML and PDF:
>>>
>>> | *3.96e-21 \ast{}\ast{}\ast{}*  |
>>>
>>> Does it work for you too? Regards, Andrea
>>
>> Thanks - it does, indeed. Strange that it works for both export
>> backends.
>>
>>
>> But there are a few formating issues with this:
>>
>> 1) in tex, the spacing between two is different to the spacing between
>> three
>> 2) in html, the asterix are at the bottom and
>> 3) it is not very readable in org.
>
> To help with 3) have a look at http://orgmode.org/manual/Special-symbols.html 
> (esp. C-c C-x \)

Thanks - good point.

Rainer

>
> Best,
> Andreas
>
>
>

-- 
Rainer M. Krug
email: Rainerkrugsde
PGP: 0x0F52F982


pgpWetaUzhTHC.pgp
Description: PGP signature


Re: [O] Make * bold?

2014-10-13 Thread Andreas Leha
Hi Rainer,

Rainer M Krug  writes:

> Andrea Rossetti  writes:
>
>> Rainer M Krug  krugs.de> writes:
>>> I would like to make three stars bold - is this possible? I have the
>>> following table and at the moment, I get what is in the latex
>>> column. But I would like to have what is in the last column.
>>> 
>>> | org | latex| what I would like |
>>> | *3.96e-21 *** * | \textbf{3.96e-21 **} *   | \textbf{3.96e-21 ***} |
>>> ...
>>> 
>>> Any suggestions?
>>
>> Hi! using the "pretty entity" \ast{} works for me in HTML and PDF:
>>
>> | *3.96e-21 \ast{}\ast{}\ast{}*  |
>>
>> Does it work for you too? Regards, Andrea
>
> Thanks - it does, indeed. Strange that it works for both export
> backends.
>
>
> But there are a few formating issues with this:
>
> 1) in tex, the spacing between two is different to the spacing between
> three
> 2) in html, the asterix are at the bottom and
> 3) it is not very readable in org.

To help with 3) have a look at http://orgmode.org/manual/Special-symbols.html 
(esp. C-c C-x \)

Best,
Andreas




Re: [O] Make * bold?

2014-10-13 Thread Rainer M Krug
Andrea Rossetti  writes:

> Rainer M Krug  krugs.de> writes:
>> I would like to make three stars bold - is this possible? I have the
>> following table and at the moment, I get what is in the latex
>> column. But I would like to have what is in the last column.
>> 
>> | org | latex| what I would like |
>> | *3.96e-21 *** * | \textbf{3.96e-21 **} *   | \textbf{3.96e-21 ***} |
>> ...
>> 
>> Any suggestions?
>
> Hi! using the "pretty entity" \ast{} works for me in HTML and PDF:
>
> | *3.96e-21 \ast{}\ast{}\ast{}*  |
>
> Does it work for you too? Regards, Andrea

Thanks - it does, indeed. Strange that it works for both export
backends.


But there are a few formating issues with this:

1) in tex, the spacing between two is different to the spacing between
three
2) in html, the asterix are at the bottom and
3) it is not very readable in org.

Thanks,

Rainer

>
>
>

-- 
Rainer M. Krug
email: Rainerkrugsde
PGP: 0x0F52F982


pgpCmXKOTmQdG.pgp
Description: PGP signature


Re: [O] Make * bold?

2014-10-13 Thread Andrea Rossetti
Rainer M Krug  krugs.de> writes:
> I would like to make three stars bold - is this possible? I have the
> following table and at the moment, I get what is in the latex
> column. But I would like to have what is in the last column.
> 
> | org | latex| what I would like |
> | *3.96e-21 *** * | \textbf{3.96e-21 **} *   | \textbf{3.96e-21 ***} |
> ...
> 
> Any suggestions?

Hi! using the "pretty entity" \ast{} works for me in HTML and PDF:

| *3.96e-21 \ast{}\ast{}\ast{}*  |

Does it work for you too? Regards, Andrea




[O] Make * bold?

2014-10-13 Thread Rainer M Krug
Hi

I would like to make three stars bold - is this possible? I have the
following table and at the moment, I get what is in the latex
column. But I would like to have what is in the last column.

| org | latex| what I would like |
| *3.96e-21 *** * | \textbf{3.96e-21 **} *   | \textbf{3.96e-21 ***} |
| *4.11e-01   | \textbf{4.11e-01 \textbf{*}} | \textbf{4.11e-01 ***} |
| *2.07e-03 ***   | \textbf{2.07e-03 **} | \textbf{2.07e-03 **}  |
| *3.43e-02 **| \textbf{3.43e-02 *}  | \textbf{3.43e-02 *}   |

Line 1 and two are just tries to see if there iss a difference with or
without space *there is, but none works).

Line 3 and four, i.e. two and one stars, works as expected.

Any suggestions on how I can get the three stars in bold? I could
obviously use \textbf{} in the table, but I also export the document
to html - so this would not be an option.

Any suggestions?

Thanks,

Rainer
-- 
Rainer M. Krug
email: Rainerkrugsde
PGP: 0x0F52F982


pgp4wIsWraE2x.pgp
Description: PGP signature


Re: [O] Make * bold or use colour for export to html and LaTeX

2014-10-10 Thread Aaron Ecay
Hi Rainer,

2014ko urriak 10an, Rainer M Krug-ek idatzi zuen:
> 
> Hi
> 
> I want to highlight the cells in the table below with "***" by using
> color red for the font, "**' by using green for the font, ... or, if not 
> possible, bold. Is any of this possible?
> 
> The table is generated in R, so the ascii package might help (just
> thinking about it while typing)?

If you’re exporting only to Latex, an option might be the pgfplotstable
package.  Here’s some examples from tex.stackexchange:

https://tex.stackexchange.com/questions/100458/pgfplotstable-conditional-post-processing-of-cell-content-on-a-per-column-basis
https://tex.stackexchange.com/questions/126959/conditional-format-for-correlation-table
https://tex.stackexchange.com/questions/156168/conditional-formatting-rounding-and-postprocessing-of-a-column-in-pgfplotstable

-- 
Aaron Ecay



Re: [O] Make * bold or use colour for export to html and LaTeX

2014-10-10 Thread Rainer M Krug
Andreas Leha  writes:

> Hi Rainer,
>
> Rainer M Krug  writes:
>> Hi
>>
>> I want to highlight the cells in the table below with "***" by using
>> color red for the font, "**' by using green for the font, ... or, if not 
>> possible, bold. Is any of this possible?
>>
>> The table is generated in R, so the ascii package might help (just
>> thinking about it while typing)?
>>
>> Thanks,
>>
>> Rainer 
>>
>> ||  slope | intercept | p |  
>>  pm |pb |
>> |++---+---+--+---|
>> | quercus_robur.single   | -1.358 |  4.76 |   |  
>> |   |
>> | quercus_robur.95   | -1.957 |  5.71 | 3.96e-21 ***   | 
>> 7.47e-07 *** |  7.60e-09 *** |
>> | quercus_robur.90   | -1.752 |  5.42 | 3.43e-02 *|   
>> 7.18e-02 . |4.79e-02 * |
>> | quercus_robur.85   | -1.773 |  5.41 | 4.11e-01  | 
>> 8.33e-01 |  9.38e-
>
>
> I am not sure to understand your question correctly, but if the table is
> R generated anyway, why not use R to provide the formatting for org?

You do - bold or in colour. 

>
>
> Like -- as a start -- this function, that does the simplest of those and
> replaces "***" with bold:

This looks very promising, but I would also like to keep the stars, so I
would like to have "3.96e-21 ***" in bold (or even in color`). But I am
going to start with your example.

Thanks,

Rainer
 

>
> boldpattern <- " \\*\\*\\*$"
> tbl <- apply(tbl, 2,
>  function(x) ifelse(grepl(boldpattern, x),
> paste0("*", gsub(boldpattern, "", x), "*"),
> x))
>
>
> Here as full example in action:
>
> ## -- ##
> ## create a table ##
> ## -- ##
>
> ## from ?lm
> ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14)
> trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69)
> group <- gl(2, 10, 20, labels = c("Ctl","Trt"))
> weight <- c(ctl, trt)
> lm.D9 <- lm(weight ~ group)
> lm.D90 <- lm(weight ~ group - 1) # omitting intercept
> ## extract the coefficients
> tbl <- summary(lm.D90)$coefficients
> ## add the signif codes
> tbl[,4] <- paste(tbl[,4],
>  symnum(tbl[,4], corr = FALSE, na = FALSE, 
> cutpoints = c(0, 0.001, 0.01, 0.05, 0.1, 1), 
> symbols = c("***", "**", "*", ".", " ")))
> tbl
>
>
> ## -- ##
> ## make them 'org-bold'   ##
> ## -- ##
> boldpattern <- " \\*\\*\\*$"
> tbl <- apply(tbl, 2,
>  function(x) ifelse(grepl(boldpattern, x),
> paste0("*", gsub(boldpattern, "", x), "*"),
> x))
> tbl
>
>
> HTH,
> Andreas
>
> PS: The usual "don't use the signif.codes" applies.
>
>
>

-- 
Rainer M. Krug
email: Rainerkrugsde
PGP: 0x0F52F982


pgpudQua4IYue.pgp
Description: PGP signature


Re: [O] Make * bold or use colour for export to html and LaTeX

2014-10-10 Thread Andreas Leha
Hi Rainer,

Rainer M Krug  writes:
> Hi
>
> I want to highlight the cells in the table below with "***" by using
> color red for the font, "**' by using green for the font, ... or, if not 
> possible, bold. Is any of this possible?
>
> The table is generated in R, so the ascii package might help (just
> thinking about it while typing)?
>
> Thanks,
>
> Rainer 
>
> ||  slope | intercept | p |   
> pm |pb |
> |++---+---+--+---|
> | quercus_robur.single   | -1.358 |  4.76 |   |   
>|   |
> | quercus_robur.95   | -1.957 |  5.71 | 3.96e-21 ***   | 7.47e-07 
> *** |  7.60e-09 *** |
> | quercus_robur.90   | -1.752 |  5.42 | 3.43e-02 *|   
> 7.18e-02 . |4.79e-02 * |
> | quercus_robur.85   | -1.773 |  5.41 | 4.11e-01  | 
> 8.33e-01 |  9.38e-


I am not sure to understand your question correctly, but if the table is
R generated anyway, why not use R to provide the formatting for org?


Like -- as a start -- this function, that does the simplest of those and
replaces "***" with bold:

--8<---cut here---start->8---
boldpattern <- " \\*\\*\\*$"
tbl <- apply(tbl, 2,
 function(x) ifelse(grepl(boldpattern, x),
paste0("*", gsub(boldpattern, "", x), "*"),
x))
--8<---cut here---end--->8---


Here as full example in action:

--8<---cut here---start->8---
## -- ##
## create a table ##
## -- ##

## from ?lm
ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14)
trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69)
group <- gl(2, 10, 20, labels = c("Ctl","Trt"))
weight <- c(ctl, trt)
lm.D9 <- lm(weight ~ group)
lm.D90 <- lm(weight ~ group - 1) # omitting intercept
## extract the coefficients
tbl <- summary(lm.D90)$coefficients
## add the signif codes
tbl[,4] <- paste(tbl[,4],
 symnum(tbl[,4], corr = FALSE, na = FALSE, 
cutpoints = c(0, 0.001, 0.01, 0.05, 0.1, 1), 
symbols = c("***", "**", "*", ".", " ")))
tbl


## -- ##
## make them 'org-bold'   ##
## -- ##
boldpattern <- " \\*\\*\\*$"
tbl <- apply(tbl, 2,
 function(x) ifelse(grepl(boldpattern, x),
paste0("*", gsub(boldpattern, "", x), "*"),
x))
tbl
--8<---cut here---end--->8---


HTH,
Andreas

PS: The usual "don't use the signif.codes" applies.




[O] Make * bold or use colour for export to html and LaTeX

2014-10-10 Thread Rainer M Krug
Hi

I want to highlight the cells in the table below with "***" by using
color red for the font, "**' by using green for the font, ... or, if not 
possible, bold. Is any of this possible?

The table is generated in R, so the ascii package might help (just
thinking about it while typing)?

Thanks,

Rainer 

--8<---cut here---start->8---
||  slope | intercept | p |   
pm |pb |
|++---+---+--+---|
| quercus_robur.single   | -1.358 |  4.76 |   | 
 |   |
| quercus_robur.95   | -1.957 |  5.71 | 3.96e-21 ***   | 7.47e-07 
*** |  7.60e-09 *** |
| quercus_robur.90   | -1.752 |  5.42 | 3.43e-02 *|   7.18e-02 
. |4.79e-02 * |
| quercus_robur.85   | -1.773 |  5.41 | 4.11e-01  | 
8.33e-01 |  9.38e-
--8<---cut here---end--->8---

-- 
Rainer M. Krug
email: Rainerkrugsde
PGP: 0x0F52F982


pgpT5ZXn0f3Z0.pgp
Description: PGP signature