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

Prevent quarto filters #13

Closed
ratnanil opened this issue Oct 24, 2023 · 2 comments
Closed

Prevent quarto filters #13

ratnanil opened this issue Oct 24, 2023 · 2 comments

Comments

@ratnanil
Copy link

This is a superb extension which I use often. Thank you for your great work.

I'm trying to use the extension to highlight specific parts in code blocks. My starting point is just to create a code block using the latex listings package.

---
title: test
format: 
    pdf:
        keep-tex: true
        include-in-header:
            text: |
                \usepackage{listings}
filters:
   - latex-environment
environments: [lstlisting]
---

:::{.lstlisting}
    Paired t-test

data: blume$a and blume$b
:::

The desired latex output:

\begin{lstlisting}
    Paired t-test

data: blume$a and blume$b
\end{lstlisting}

The created output:

\begin{lstlisting}

\begin{verbatim}
Paired t-test
\end{verbatim}

data: blume\(a and blume\)b

\end{lstlisting}

I'm guessing quarto ran its own filter over the code, turning the indented Paired t-test to verbatim and turning blume$a to blume\(a. Is there a way to prevent quarto from doing this?

@Nenuial
Copy link
Contributor

Nenuial commented Oct 27, 2023

You can "protect" parts from the quarto filters by making then raw latex:

:::{.lstlisting}
```{=latex}
    Paired t-test

data: blume$a and blume$b
```
:::

This should generate the desired output.

@ratnanil
Copy link
Author

ratnanil commented Oct 31, 2023

perfect, it works!

@cderv cderv closed this as completed Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants