ResearchMethods-ZHAW / Statistik

https://researchmethods-zhaw.github.io/Statistik/
5 stars 10 forks source link

Code inputs / outputs #6

Closed ratnanil closed 10 months ago

ratnanil commented 10 months ago

Jürgen hatte code inputs rot und outputs blau. Der export docx → quarto sieht nicht wirklich gut aus. ich habe es jeweils so angepasst:

```{.r}
binom.test(82,200)
     Exact binomial test

data: 84 and 200
number of successes = 84, number of trials = 200, p-value = 0.02813
alternative hypothesis: true probability of success is not equal to 0.5
95 percent confidence interval:
 0.3507439 0.4916638
sample estimates:
probability of success
                  0.42


Inputs also in `{.r}` und outpus in `{.default}`. Zudem habe ich bei den Inputs viele unnötige Leerzeilen und teilweise escape characters `\` entfernen müssen. Die Outputs habe ich jeweils nochmals aus dem docx kopiert.
DLND8 commented 10 months ago

https://github.com/ResearchMethods-ZHAW/Statistik/commit/9af1f34dea43ce98e60dc75cb844ee77f877647e

Ich habe eine Border hinzugefügt

DLND8 commented 10 months ago

image

Wenn der Code Chunk verschoben werden kann, passt sich die Border nicht an.

ratnanil commented 10 months ago

Das Problem war, dass du <pre> selektiert hattest, du bräuchtest aber das darüber liegende <div>. Dieses <div> kennt aber die Klassen .r und .default nicht. Zurzeit gibt es keinen Plattform übergreifend funktionierenden CSS parent selector, deshalb habe ich das Problem mit JS gelöst (siehe https://github.com/ResearchMethods-ZHAW/Statistik/commit/5ee6b35b420b07fbc4a12024b5bbd300f2cd475e)

ratnanil commented 10 months ago

in tex/pdf wird das ganze vermutlich nicht möglich, siehe den tex output aus dem obigen Beispiel:

\begin{Shaded}
\begin{Highlighting}[]
\FunctionTok{binom.test}\NormalTok{(}\DecValTok{82}\NormalTok{,}\DecValTok{200}\NormalTok{)}
\end{Highlighting}
\end{Shaded}

\begin{Shaded}
\begin{Highlighting}[]
\NormalTok{     Exact binomial test}

\NormalTok{data: 84 and 200}
\NormalTok{number of successes = 84, number of trials = 200, p{-}value = 0.02813}
\NormalTok{alternative hypothesis: true probability of success is not equal to 0.5}
\NormalTok{95 percent confidence interval:}
\NormalTok{ 0.3507439 0.4916638}
\NormalTok{sample estimates:}
\NormalTok{probability of success}
\NormalTok{                  0.42}
\end{Highlighting}
\end{Shaded}
ratnanil commented 10 months ago

aktuell finde ich keine Lösung, um das gleiche in PDF umzusetzen. Ich schliesse das issue mal