Advertisement
Guest User

Untitled

a guest
Jul 2nd, 2021
333
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. \documentclass[a4paper,french]{article}
  2. \usepackage[T1]{fontenc}
  3. \usepackage{babel}
  4. \usepackage[margin=1cm]{geometry}
  5. \usepackage{xcolor}
  6. \usepackage{enumitem}
  7. \input{insbox}
  8. \usepackage{listings}
  9.  
  10. \lstdefinestyle{mypython}{
  11. language=Python,
  12. tabsize=4,
  13. numberstyle=\tiny,
  14. columns=flexible,
  15. backgroundcolor=\color{black!05},
  16. showstringspaces=true,
  17. literate=
  18. {à}{{\`a}}1
  19. {â}{{\^a}}1
  20. {é}{{\'e}}1
  21. {è}{{\`e}}1
  22. {ê}{{\^e}}1
  23. {ë}{{\"e}}1
  24. {î}{{\^i}}1
  25. {ô}{{\^o}}1
  26. {ù}{{\`u}}1
  27. {«}{{\og}}1
  28. {»}{{\fg{}}}1
  29. }
  30.  
  31. \usepackage[most]{tcolorbox}
  32. \begin{document}
  33.  
  34. \begin{tcblisting}{
  35. colback=white,
  36. colframe=white,
  37. comment and listing,
  38. sidebyside,
  39. listing style=mypython,
  40. comment={
  41. \begin{enumerate}
  42. \item question 1...
  43. \item question 2...
  44. \item question 3...
  45. \end{enumerate}
  46. }
  47. }
  48. def f(x):
  49. y=x**2-x+3
  50. return(y)
  51. \end{tcblisting}
  52.  
  53. \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement