File size: 4,082 Bytes
45721da
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
Error rendering code in callout (code listing in a callout)
Error:

- The error appears to be caused by placing attributed code inside a callout 
- Issue could be that we're incorrectly turning this into a code listing
- Issue could be that we don't properly support code listings in callouts


```
LaTeX Error: Not in outer par mode.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...

l.221
```


repro:

````markdown

---
title: Hello
format: pdf
keep-tex: true
---

::: {.callout-note}
If the `www-frame-origin` option is set to `same` or `any` instead of a URI, you must add the following setting with the actual URI:

```{.ini filename="/etc/rstudio/rsession.conf"}
tutorial-api-client-origin=http://localhost:8080
```
:::

````


relevant tex diff:

**Good**
```latex
\begin{tcolorbox}[enhanced jigsaw, left=2mm, rightrule=.15mm, arc=.35mm, toprule=.15mm, coltitle=black, bottomtitle=1mm, titlerule=0mm, opacityback=0, breakable, opacitybacktitle=0.6, toptitle=1mm, colbacktitle=quarto-callout-note-color!10!white, colback=white, title=\textcolor{quarto-callout-note-color}{\faInfo}\hspace{0.5em}{Note}, bottomrule=.15mm, leftrule=.75mm]

If the \texttt{www-frame-origin} option is set to \texttt{same} or
\texttt{any} instead of a URI, you must add the following setting with
the actual URI:

\textbf{/etc/rstudio/rsession.conf}

\begin{Shaded}
\begin{Highlighting}[]
\DataTypeTok{tutorial{-}api{-}client{-}origin}\OtherTok{=}\StringTok{http://localhost:8080}
\end{Highlighting}
\end{Shaded}

\end{tcolorbox}
```

**Bad**
```latex
\begin{tcolorbox}[enhanced jigsaw, leftrule=.75mm, arc=.35mm, toptitle=1mm, left=2mm, colback=white, breakable, colbacktitle=quarto-callout-note-color!10!white, bottomtitle=1mm, title=\textcolor{quarto-callout-note-color}{\faInfo}\hspace{0.5em}{Note}, bottomrule=.15mm, titlerule=0mm, opacityback=0, colframe=quarto-callout-note-color-frame, toprule=.15mm, rightrule=.15mm, opacitybacktitle=0.6, coltitle=black]

If the \texttt{www-frame-origin} option is set to \texttt{same} or
\texttt{any} instead of a URI, you must add the following setting with
the actual URI:

\begin{codelisting}

\caption{\texttt{/etc/rstudio/rsession.conf}}

\begin{Shaded}
\begin{Highlighting}[]
\DataTypeTok{tutorial{-}api{-}client{-}origin}\OtherTok{=}\StringTok{http://localhost:8080}
\end{Highlighting}
\end{Shaded}

\end{codelisting}

\end{tcolorbox}
```

## Relevant pre-fix discussion

### Issue #5011

#### Comment at 2023-03-29T03:39:27Z

Let's talk about this live tomorrow.

The issue is the presence of `filename="/etc/rstudio/rsession.conf"`. That causes us to attempt to render the code block as a listing, so that we can do the caption treatment on it.

In 1.2, we'd render the code block by itself like this:

![image](assets/quarto-dev__quarto-cli-5018/001.png)

In 1.3, we render the code block by itself like this:

![image](assets/quarto-dev__quarto-cli-5018/002.png)

I did this by design, but only because I didn't consider that people would want to put a listing inside a callout.

I think the new appearance is better, but I agree that we should have a way to disable this treatment since LaTeX callouts are necessarily relatively limited in functionality.

#### Comment at 2023-03-29T03:41:56Z

Without the filename attribute, we render successfully in 1.3:

![image](assets/quarto-dev__quarto-cli-5018/003.png)

This suggests a workaround: move `/etc/rstudio/rsession.conf` to outside the listing (and filename declaration), and into plain markdown content before the code block, `**/etc/rstudio/rsession.conf**`:

````
---
title: Hello
format: pdf
---

::: {.callout-note}
If the `www-frame-origin` option is set to `same` or `any` instead of a URI, you must add the following setting with the actual URI:

**/etc/rstudio/rsession.conf**

```{.ini}
tutorial-api-client-origin=http://localhost:8080
```
:::
````




![image](assets/quarto-dev__quarto-cli-5018/004.png)