beamer中插入c代码,python代码的经验

下面是插入的scala代码,它与python在某些语法上类似,所在在https://github.com/olivierverdier/python-latex-highlighting下载了一个python代码,然后放到当前的tex目录,并加入\usepackage{pythonhighlight}即可,这里需要注意两点:(1)一定要在frame后面加上[fragile],否则编译通不过;(2)在\begin{python}前面不能再加“\uncover<1->{”,否则编译不过。切记!!

\begin{frame}[fragile]

\begin{python}

object test {
def main(args:Array[String]) {
val capitals=Map("France"->"Paris",
"Japan"->"Tokyo")
println("capitals.get(\"France\"):"
+capitals.get("France"))
}
}
\end{python}

转载于:https://www.cnblogs.com/ml-cv/p/5310769.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
好的,下面是一份美观的Beamer代码,其包含左侧导航栏: ```latex \documentclass[UTF8,11pt]{beamer} \usepackage{ctex} \usepackage{graphicx} \usetheme{Madrid} \useoutertheme{sidebar} \useinnertheme{circles} \usecolortheme{default} \setbeamertemplate{sidebar canvas left}[vertical shading][top=white,bottom=blue!10] \setbeamertemplate{sidebar left}{% \begin{minipage}[c][\paperheight][c]{.2\textwidth} \begin{flushleft} \insertlogo\par \vfill \insertverticalnavigation{.8\textwidth}\par \vfill \hbox{\usebeamerfont{author in sidebar}% \usebeamercolor[fg]{author in sidebar}% \insertshortauthor[width=.75\textwidth,center,respectlinebreaks]\par% \usebeamerfont{institute in sidebar}% \usebeamercolor[fg]{institute in sidebar}% \insertshortinstitute[width=.75\textwidth,center,respectlinebreaks]\par% \vfill} \end{flushleft} \end{minipage} } \title{这里是标题} \author{这里是作者} \institute{这里是机构} \date{\today} \begin{document} \begin{frame} \titlepage \end{frame} \section{第一节} \begin{frame} \frametitle{这里是帧标题} 这里是帧内容。 \begin{itemize} \item 第一项 \item 第二项 \end{itemize} \begin{figure}[htbp] \centering \includegraphics[width=0.5\textwidth]{example-image} \caption{这里是图片标题} \end{figure} \end{frame} \section{第二节} \begin{frame} \frametitle{这里是帧标题} 这里是帧内容。 \begin{enumerate} \item 第一项 \item 第二项 \end{enumerate} \begin{figure}[htbp] \centering \includegraphics[width=0.5\textwidth]{example-image} \caption{这里是图片标题} \end{figure} \end{frame} \end{document} ``` 你可以根据自己的需要调整左侧导航栏的颜色和字体。此外,你可以在左侧导航栏添加自己的Logo。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值