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

how to make an zebra effect on linenumbers and contents #211

Closed
xiaoleeza opened this issue Aug 14, 2018 · 3 comments
Closed

how to make an zebra effect on linenumbers and contents #211

xiaoleeza opened this issue Aug 14, 2018 · 3 comments

Comments

@xiaoleeza
Copy link

xiaoleeza commented Aug 14, 2018

problem at tex.stackexchange.com

I am using highlightlines={1,3,5,7,...}, but this is not convenient when there is too many lines.

@gpoore
Copy link
Owner

gpoore commented Aug 14, 2018

Take a look at gpoore/fvextra#8. minted uses fvextra internally. You could use the linked demo implementation for now, but would need to use \fvset rather than \setminted to specify options since the demo doesn't implement a wrapper for minted. fvextra will add official support for this at some point (then I'll add minted support), but I don't know when that will be.

@xiaoleeza
Copy link
Author

Thanks you very much for your response. Waiting for your good news.

@muzimuzhi
Copy link

By the way, if you want use new fvextra options introduced in the demo gpoore/fvextra#8 through normal minted ways, defining those options in minted could help. Take a look at the following example:

\documentclass{article}
\usepackage{minted}

% names of new added options might change
\makeatletter
\minted@def@optfv{highlightlinenumbercolor}
\minted@def@optfv{linenumberwidth}
\makeatother

\setminted{
  linenos,
  highlightcolor={cyan!10, cyan!15},
  highlightlinenumbercolor={yellow!30, yellow!40},
  numbersep=3pt
}

\begin{document}
\begin{minted}{c}
int main() {
  printf("hello, world");
return 0;
\end{minted}
\end{document}

Output:
image

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