“Ubuntu 16.04下Lyx的安装和使用简介”的版本间的差异
来自软件实验室
(→long story) |
(→基本技巧) |
||
第111行: | 第111行: | ||
* ctrl+r可以预览pdf,或者点击工具栏中的眼睛图标。 | * ctrl+r可以预览pdf,或者点击工具栏中的眼睛图标。 | ||
+ | * 插入图片尽量采用矢量图,svg或者eps格式。 | ||
+ | * http://dz.sdut.edu.cn/blog/subaochen/category/lyxlatex/ 也会不定期的发一些lyx/latex的小技巧。 |
2016年11月12日 (六) 09:01的版本
安装
sudo apt-get install texlive-full sudo apt-get remove lyx sudo apt-get autoremove sudo add-apt-repository ppa:lyx-devel/release sudo apt-get update sudo apt-get install lyx mkdir $HOME/.lyx/layouts git clone https://github.com/subaochen/lyx-modules.git cd lyx-modules ./deploy.sh
以上步骤完成后,打开lyx,选择工具:重配置,然后关闭Lyx重新打开即可。
使用入门
short story
打开任何已经写好的文档,直接编辑或者删除原内容重新开始即可。
long story
如果可能,完整阅读 http://softlab.sdut.edu.cn/wiki/index.php?title=%E6%96%87%E4%BB%B6:Lyx_Chinese_guide.pdf
- 选择合适的文档类,一般中文文章选择CTex Article,书籍选择CTex Book。
- 导入合适的preamble(将下面代码粘贴到文档:首选项:LaTex导言区),下面我是个人的preamble供参考:
%%%%%%%%%%%%%%%%%% %中文断行 \XeTeXlinebreaklocale "zh" \XeTeXlinebreakskip = 0pt plus 1pt % 标题左对齐 %\usepackage[raggedright]{titlesec} % 页边距设置 \usepackage[top=1.2in,bottom=1.2in,left=1.2in,right=1in]{geometry} % 页眉页脚设置 \usepackage{fancyhdr} \pagestyle{fancy} \fancyhf{} % 清空页眉页脚 \fancyhead[LE,RO]{\thepage} % 偶数页左,奇数页右 \fancyhead[RE]{\leftmark} % 偶数页右 \fancyhead[LO]{\rightmark} % 奇数页左 \fancypagestyle{plain}{ \fancyhf{} % 重定义plain页面样式 \renewcommand{\headrulewidth}{0pt} } \usepackage{listings} \usepackage{color} \definecolor{hellgelb}{rgb}{1,1,0.85} \definecolor{colKeys}{rgb}{0,0,1} \definecolor{colIdentifier}{rgb}{0,0,0} \definecolor{colComments}{rgb}{1,0,0} \definecolor{colString}{rgb}{0,0.5,0} \AtBeginDocument{\renewcommand\lstlistingname{代码清单}} \AtBeginDocument{\renewcommand\tablename{表}} %\AtBeginDocument{\newcommand\examplename{例}} \AtBeginDocument{\renewcommand\figurename{图}} \AtBeginDocument{\renewcommand\listfigurename{图~目~录}} \AtBeginDocument{\renewcommand\listtablename{表~目~录}} \AtBeginDocument{\newcommand\sectionname{节}} \lstset{% language=Java,% float=hbp,% basicstyle=\footnotesize\ttfamily,% identifierstyle=\color{colIdentifier},% keywordstyle=\color{colKeys},% stringstyle=\color{colString},% commentstyle=\itshape\color{colComments},% columns=fixed, tabsize=4,% frame=tb,% 顶部和底部加横线 %frame=shadowbox, framerule=1pt, framexleftmargin=2em, % 行号包含在代码区域内 showspaces=false,% showstringspaces=false,%不显示代码字符串中间的空格标记 numbers=left,%左侧显示行号 numberstyle=\tiny\ttfamily,% numbersep=1em,% breaklines=true,% 对过长的代码自动换行 breakindent=10pt,% backgroundcolor=\color{hellgelb},% breakautoindent=true,% %escapebegin=\begin{CJK*}{GBK}{hei},escapeend=\end{CJK*}, aboveskip=1em, %代码块边框 captionpos=t,% %% added by http://bbs.ctex.org/viewthread.php?tid=53451 %fontadjust, xleftmargin=1em, xrightmargin=\fboxsep,%设定listing左右的空白 %texcl=true, % 设定中文冲突,断行,列模式,数学环境输入,listing数字的样式 extendedchars=false,columns=flexible,mathescape=true, escapechar=| }
- 开始写吧!几个注意事项:
- 短文的图片、表格等一般直接插入,长文的图片、表格等一般插入“浮动项”。
- 注意段落的层次关系,善用章、节、小节。
- 善用“交叉引用”。
基本技巧
- ctrl+r可以预览pdf,或者点击工具栏中的眼睛图标。
- 插入图片尽量采用矢量图,svg或者eps格式。
- http://dz.sdut.edu.cn/blog/subaochen/category/lyxlatex/ 也会不定期的发一些lyx/latex的小技巧。