首页 > 其他分享 >latex代码插入word模版

latex代码插入word模版

时间:2023-02-14 20:25:33浏览次数:38  
标签:latex word alsolanguage color 模版 代码 行号 false true

编译器选择pdflatex

 

 

\documentclass{sistedes}
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{listings}
\lstset{%
alsolanguage=Java,
%language={[ISO]C++}, %language为,还有{[Visual]C++}
%alsolanguage=[ANSI]C, %可以添加很多个alsolanguage,如alsolanguage=matlab,alsolanguage=VHDL等
%alsolanguage= tcl,
alsolanguage= XML,
tabsize=4, %
frame=shadowbox, %把代码用带有阴影的框圈起来
commentstyle=\color{red!50!green!50!blue!50},%浅灰色的注释
rulesepcolor=\color{red!20!green!20!blue!20},%代码块边框为淡青色
keywordstyle=\color{blue!90}\bfseries, %代码关键字的颜色为蓝色,粗体
showstringspaces=false,%不显示代码字符串中间的空格标记
stringstyle=\ttfamily, % 代码字符串的特殊格式
keepspaces=true, %
breakindent=22pt, %
numbers=none,%左侧显示行号 往左靠,还可以为right,或none,即不加行号
stepnumber=1,%若设置为2,则显示行号为1,3,5,即stepnumber为公差,默认stepnumber=1
%numberstyle=\tiny, %行号字体用小号
numberstyle={\color[RGB]{0,192,192}\tiny} ,%设置行号的大小,大小有tiny,scriptsize,footnotesize,small,normalsize,large等
numbersep=8pt, %设置行号与代码的距离,默认是5pt
basicstyle=\footnotesize, % 这句设置代码的大小
showspaces=false, %
flexiblecolumns=true, %
breaklines=true, %对过长的代码自动换行
breakautoindent=true,%
breakindent=4em, %
escapebegin=\begin{CJK*}{GBK}{hei},escapeend=\end{CJK*},
aboveskip=1em, %代码块边框
tabsize=2,
showstringspaces=false, %不显示字符串中的空格
backgroundcolor=\color[RGB]{245,245,244}, %代码背景色
%backgroundcolor=\color[rgb]{0.91,0.91,0.91} %添加背景色
escapeinside=``, %在``里显示中文
%% added by http://bbs.ctex.org/viewthread.php?tid=53451
fontadjust,
captionpos=t,
framextopmargin=2pt,framexbottommargin=2pt,abovecaptionskip=-3pt,belowcaptionskip=3pt,
xleftmargin=4em,xrightmargin=4em, % 设定listing左右的空白
texcl=true,
% 设定中文冲突,断行,列模式,数学环境输入,listing数字的样式
extendedchars=false,columns=flexible,mathescape=true
% numbersep=-1em
}
\begin{document}
\lstinputlisting[language=Java]{exportImages.java}
\end{document}

标签:latex,word,alsolanguage,color,模版,代码,行号,false,true
From: https://www.cnblogs.com/legendcong/p/17120766.html

相关文章

  • 设计模式之模版方法模式的钩子方法
     publicabstractclassSoyaMilk{//模版方法可以做成finaL,不让子类去覆盖finalvoidmake(){select();if(customerWantCondiments()){......
  • 212. Word Search II[Hard]
    212.WordSearchIIGivenanmxnboardofcharactersandalistofstringswords,returnallwordsontheboard.Eachwordmustbeconstructedfromletterso......
  • 211. Design Add and Search Words Data Structure[Medium]
    211.DesignAddandSearchWordsDataStructureDesignadatastructurethatsupportsaddingnewwordsandfindingifastringmatchesanypreviouslyaddedstr......
  • 转载:Vue+springboot集成PageOffice实现在线编辑Word、excel文档
    说明:   PageOffice是一款在线的office编辑软件,帮助Web应用系统或Web网站实现用户在线编辑Word、Excel、PowerPoint文档。可以完美实现在线公文流转,领导批阅,盖章。......
  • 为什么称不坑盒子是wps和word使用者的救世主呢?
    不坑盒子很多朋友在工作过程中需要对Word文档进行编辑处理,如果想让Word排版更有效率可以试试小编带来的这款不坑盒子软件,这是一个非常好用的插件工具,专门应用在Word文档中......
  • WORD 易错题
    word文本框word提供横排和竖排两种类型的文本框。通过改变文本框的文字方向,可以实现横排和竖排的转换。在文本框中可以插入图片。在文本框中可以使用项目符号在文本框......
  • 富文本编辑器实现一键导入word
    ​ 项目需求可发布文章需求涉及到富文本编辑器经过查阅我选择了较为简便不需要后端支持可独立完成的tinymce框架官方文档也是相当完整虽然都是全英文但是有强大的......
  • 富文本编辑器实现一键从word中复制图片
    ​ 当前功能基于PHP,其它语言流程大抵相同。大概流程:1.将docx文件上传到服务器中2.使用PHPoffice/PHPword实现将word转换为HTML3.将HTML代码返回并赋值到编辑器中......
  • 富文本编辑器实现一键粘帖word图片
    ​ 在之前在工作中遇到在富文本编辑器中粘贴图片不能展示的问题,于是各种网上扒拉,终于找到解决方案,在这里感谢一下知乎中众大神以及TheViper。通过知乎提供的思路找到粘......
  • word出现正在更新office,无法启动
    文章目录​​解决方案:​​​​1、打开服务​​​​2、找到microsoftofficeClickToRunService​​​​3、重启电脑,问题解决​​解决方案:1、打开服务或者Win+R输入se......