
다음 tex 파일이 있습니다.
\documentclass[12pt,a4paper,twoside]{report}
\usepackage{mathtools}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{listings}
\usepackage{color}
\definecolor{dkgreen}{rgb}{0,0.6,0}
\definecolor{gray}{rgb}{0.5,0.5,0.5}
\definecolor{mauve}{rgb}{0.58,0,0.82}
\lstset{
language=Java,
aboveskip=3mm,
belowskip=3mm,
showstringspaces=false,
columns=flexible,
={\small\ttfamily},
numbers=none,
numberstyle=\tiny\color{gray},
=\color{blue},
commentstyle=\color{dkgreen},
stringstyle=\color{mauve},
breaklines=true,
breakatwhitespace=true,
tabsize=3
}
\begin{document}
\begin{lstlisting}[caption={Third median in terms of $\theta$ and $\phi$},label={lst:f4}]
p, t= var('p t')
a=(-2*p*t^2-p^2*t)+(2*t*p-p^2)+t+1
b=(p*t^2+2*p^2*t)+(2*t*p-t^2)-p+1
c=(p*t^2-p^2*t)+(t^2+2*t*p+p^2)+t-p #3 sides (a,b,c) in terms of theta and phi
expand(2*a^2+2*b^2-c^2) #third median equation, m=1/2*sqrt(2*a^2+2*b^2-c^2)
9*p^4*t^2 + 18*p^3*t^3 + 9*p^2*t^4 + 6*p^4*t + 18*p^3*t^2 - 18*p^2*t^3 -
6*p*t^4 + p^4 - 22*p^3*t + 6*p^2*t^2 - 22*p*t^3 + t^4 + 2*p^3 - 6*p^2*t
+ 6*p*t^2 - 2*t^3 - 3*p^2 + 18*p*t - 3*t^2 - 4*p + 4*t + 4
\end{lstlisting}
\end{document}
목록의 글꼴을 더 작게 변경하고 싶습니다 \tiny
. 아마도 . 누구든지 나에게 방법을 안내해 줄 수 있습니까?
답변1
열쇠 basicstyle
는 아마도 당신이 추구하는 것입니다.
\lstset{
basicstyle=\small\ttfamily,
...
}
\ttfamily
타자기 글꼴을 사용한다고 가정합니다. 보다 작은 글꼴의 경우 원하는 내용에 따라 , 또는 로 \small
바꾸십시오 .\small
\footnotesize
\scriptsize
\tiny
key=value
의 쌍 에서 일부 키가 누락된 것 같습니다 (원하는 위치일 수 있음 ) lstset
. 물론 나중에 는 의도한 바가 아니지만.={\small\ttfamily}
basicstyle
=\color{blue}