Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

highlight code #2

Open
ratnanil opened this issue Oct 13, 2023 · 6 comments
Open

highlight code #2

ratnanil opened this issue Oct 13, 2023 · 6 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@ratnanil
Copy link
Contributor

ratnanil commented Oct 13, 2023

Wie machen wir das?

image

(p 28)

(p 52)

@ratnanil ratnanil self-assigned this Oct 24, 2023
@ratnanil
Copy link
Contributor Author

@ratnanil
Copy link
Contributor Author

This is how it can be done manually:

---
title: test
format: 
    pdf: default
    html: default
---

<style>
.red{
    background-color: red;
}

.gray{
    background-color: gray;
}
</style>



<pre><code>
     Paired t-test

data: blume$a and blume$b
<span class="gray">t = 3.4821, df = 9</span>, <span class="red">p-value = 0.006916</span>
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
  1.366339 6.433661
sample estimates:
mean of the differences
                    3.9
</pre></code>

\begin{lstlisting}
     Paired t-test

data: blume$a and blume$b
|\colorbox{gray}{t = 3.4821, df = 9}|, |\colorbox{red}{p-value = 0.006916}|
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
  1.366339 6.433661
sample estimates:
mean of the differences
                    3.9
\end{lstlisting}

@ratnanil
Copy link
Contributor Author

Aber wie in den beiden obigen Issue vermerkt, möchte ich lieber mit dem latex-environment lua filter arbeiten. Das ist aber noch nicht ganz gelöst

---
title: test
format: 
    pdf:
        keep-tex: true
        include-in-header:
            text: |
                \usepackage{listings}
                \lstset{basicstyle=\ttfamily,escapeinside={||}}
                \usepackage{xcolor}
filters:
   - latex-environment
environments: [lstlisting]
commands: colorbox
---

@ratnanil
Copy link
Contributor Author

ratnanil commented Oct 26, 2023

p 28 würde mit Code Annotation funktionieren, p 52. aber nicht. Grund ist, dass auf der gleichen Linie an zwei verschiedenen Stellen Annotationen gebraucht werden würden

So sieht Code Annotation aus:

image

```{.bash}

     Paired t-test                                                       # <1>
  
data:  blume$a and blume$b 
t = 3.4821, df = 9,                                                      # <4>
                    p-value = 0.006916                                   # <2>
alternative hypothesis: true difference in means is not equal to 0 
95 percent confidence interval: 
 1.366339 6.433661 
sample estimates: 
mean of the differences                                                  # <3>
                    3.9                                                  # <3>
```
1. Name des Tests (Methode) 
2. Signifikanz/p-Wert (Verlässlichkeit des Ergebnisses) 
3. Effektgrösse und -richtung (unser eigentliches Ergebnis!) 
4. ggf. Wert der Teststatistik und Freiheitsgrade („Zwischenergebnisse“)

ratnanil added a commit that referenced this issue Oct 26, 2023
@DLND8 DLND8 added enhancement New feature or request documentation Improvements or additions to documentation and removed enhancement New feature or request labels Nov 6, 2023
@ratnanil
Copy link
Contributor Author

::: {.content-visible when-format="html"}
1. <span class="orange">Name des Tests (Methode)</span>
2. <span class="red">Signifikanz/p-Wert (Verlässlichkeit des Ergebnisses)</span>
3. <span class="magenta">Effektgrösse und -richtung (unser eigentliches Ergebnis!)</span>
4. <span class="teal">ggf. Wert der Teststatistik und Freiheitsgrade ("Zwischenergebnisse")</span>
:::

::: {.content-visible when-format="pdf"}
1. \colorbox{orange}{Name des Tests (Methode)}
2. \colorbox{red}{Signifikanz/p-Wert (Verlässlichkeit des Ergebnisses)}
3. \colorbox{magenta}{Effektgrösse und -richtung (unser eigentliches Ergebnis!)}
4. \colorbox{teal}{ggf. Wert der Teststatistik und Freiheitsgrade ("Zwischenergebnisse")}
:::



Werfen wir noch einmal einen Blick auf den Output von R:

<pre><code>
     <span class="orange">Paired t-test</span>

data: blume$a and blume$b
<span class="teal">t = 3.4821, df = 9</span>, <span class="red">p-value = 0.006916</span>
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
  1.366339 6.433661
sample estimates:
<span class="magenta">mean of the differences
                    3.9</span>
</code></pre>

\begin{lstlisting}
     |\colorbox{orange}{Paired t-test}|

data: blume$a and blume$b
|\colorbox{teal}{t = 3.4821, df = 9}|, |\colorbox{red}{p-value = 0.006916}|
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
  1.366339 6.433661
sample estimates:
|\colorbox{magenta}{mean of the differences}|
                    |\colorbox{magenta}{3.9}|
\end{lstlisting}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants