引文

引文

如何使用 minted in引文

\documentclass{article}
\usepackage[a4paper,margin=2cm]{geometry}
\usepackage[indonesian]{babel}
\usepackage{lipsum,xcolor,warna} % http://latexcolor.com/
\usepackage{minted}
\usepackage{erewhon}
\usepackage{tikz}
\usepackage{pullquote}
\usetikzlibrary{angles}
\def\busur
{%
\begin{tikzpicture}[line join=round]
\coordinate(O) at (0,0) coordinate (A) at (0:6) coordinate (B) at (-22.5:6) ;
\pic[draw=orange,thick,angle radius=16mm,pic text=$22.5^\circ$,pic text options={rotate=-10}, font=\footnotesize,angle eccentricity=.75] {angle={B--O--A}};
\draw[very thick] (A) arc(0:-22.5:6)--(O)--cycle ;
  \end{tikzpicture}%
}

\begin{document}

\section*{Bermain dengan Busur}

\begin{pullquote}{object=\busur}
\lipsum[1-3]
\usemintedstyle{perldoc}
\begin{minted}[bgcolor=gray-asparagus!20,numbersep=2pt,
    frame=single, linenos=true, autogobble=true, %frame=lines,
    framerule=1pt,
    framesep=5pt,
    rulecolor=\color{wenge}
            ]{latex}
\documentclass[border=3pt]{standalone}
\usepackage{qrcode}
\begin{document}
\qrcode[height=5cm]{SMK 2 Sumbawa Besar}
\end{document}
\end{minted}
\end{pullquote}

\end{document}

我得到了

! \FV@BeginScanning 的参数有一个额外的 }。\par l.38 \end{pullquote}

答案1

pullquotes 的语法是错误的:据我所知,没有pullquote环境。

但我不确定你期望的输出是什么。

您可以将minted输出保存在一个盒子中,然后将该盒子提供给\pullquote

\documentclass{article}
\usepackage[a4paper,margin=2cm]{geometry}
\usepackage[indonesian]{babel}
\usepackage{lipsum,xcolor} % http://latexcolor.com/
\usepackage{minted}
\usepackage{erewhon}
\usepackage{tikz}
\usepackage{pullquote}
\usetikzlibrary{angles}

\colorlet{gray-asparagus}{gray}
\colorlet{wenge}{green!60}

\newcommand{\busur}{%
  \begin{tikzpicture}[line join=round]
    \coordinate(O) at (0,0) coordinate (A) at (0:6) coordinate (B) at (-22.5:6);
    \pic[
      draw=orange,
      thick,
      angle radius=16mm,
      pic text=$22.5^\circ$,
      pic text options={rotate=-10},
      font=\footnotesize,
      angle eccentricity=.75,
    ] {angle={B--O--A}};
    \draw[very thick] (A) arc(0:-22.5:6)--(O)--cycle;
  \end{tikzpicture}%
}

\newsavebox{\saveminted}

\begin{document}

\section*{Bermain dengan Busur}

\begin{lrbox}{\saveminted}
\begin{minipage}{0.3\textwidth}
\usemintedstyle{perldoc}
\begin{minted}[
  bgcolor=gray-asparagus!20,
  numbersep=2pt,
  frame=single,
  linenos=true,
  autogobble=true,
  %frame=lines,
  framerule=1pt,
  framesep=5pt,
  rulecolor=\color{wenge},
  breaklines,
  breakanywhere,
]{latex}
\documentclass[border=3pt]{standalone}
\usepackage{qrcode}
\begin{document}
\qrcode[height=5cm]{SMK 2 Sumbawa Besar}
\end{document}
\end{minted}
\end{minipage}
\end{lrbox}

\pullquote{%
  \lipsum[1-2]

  \vspace{10ex}

  \noindent\usebox{\saveminted}
}{\busur}

\end{document}

在此处输入图片描述

相关内容