latex

latex笔记(0)

空扰寡人 提交于 2020-01-26 03:48:07
文章目录 资源整理 概念辨析 测试安装成功 编译中文 文章编译讲解 字体设置 自定义新命令 特殊字符 篇章结构 图表 环境 \begin{} 文献引用 琐碎 资源整理 VS Code配置LaTeX编译环境 LaTex入门: 一份其实很短的LaTeX入门文档 使用texdoc + 宏包名字 可以查到相关文档。e.g.命令行输入 texdoc lshort-zh 或者 texdoc ctex 这个TOC做的很清晰 这个看到21 感觉不错 还有beamer的制作 文献添加及生成过程详解 概念辨析 TeX是一个软件,也是一个排版引擎,LaTeX是在其上的一个系统(因为TeX原生版本实在是太简陋了)(有点像tensorflow和keras的关系,后者是前者的一个接口) XeTeX也是TeX的一个扩展,可以支持中文、韩文等多种语言,但是需要使用utf-8编码,XeLaTeX和XeTeX的关系就像是TeX和LaTeX的关系 Tex Live 和Ctex就是各种引擎(软件)的集合,Tex Studio则是一编辑器 测试安装成功 latex -v xelatex -v tlmgr update --all % 连接到相应网站并进行更新 编译中文 使用编译器XeLaTex 保证文件编码是UTF-8 \usepackage{ctex} 文章编译讲解 在主文件里面编译 不要在辅助文件里面编译 (

Matplotlib, dynamically changing width of plot

自闭症网瘾萝莉.ら 提交于 2020-01-25 17:26:22
问题 So i have a matplotlib plot that is completely black with all axes disabled, the only thing present on the plot is white text, containing a mathematical expression, entered by the user, which is passed into the render function as the parameter 'expr'. def render(expr, path, width, x, y): fig = plt.figure(figsize=(width, 16 if 'begin' in expr else 12)) plt.text(x, y, expr, fontsize=320, fontweight='bold', color='white') fig.set_facecolor('#000000') plt.axis('off') plt.savefig(path, facecolor

Latex verbatim:how to show the file directoy created by tree command?

岁酱吖の 提交于 2020-01-25 09:03:38
问题 I want to insert a file directory diagram created by tree command using verbatim enviroment. But in the output document, only file names are kept, and the connection lines are disapeared. \documentclass{article} \usepackage{fancyvrb} \begin{document} \begin{Verbatim} . ├── app ├── bakery ├── build ├── CHANGELOG.md ├── composer.json ├── composer.lock ├── docker ├── sponsors ├── STYLE-GUIDE.md └── webserver-configs \end{Verbatim} \end{document} I have tried using fancyvrb package by setting

Too much white space between caption and figure produced by tikzDevice and ggplot2 in LaTeX

时光毁灭记忆、已成空白 提交于 2020-01-24 10:14:33
问题 I'm currently using R's ggplot2 and tikzDevice packages to produce graphics and introduce them in LaTeX documents, but I'm struggling with the resulting big white spaces between the figures and the captions, as you can see if you compare the images (I've manually highlighted the spaces to make it clearer): Here's my MWE: The R code: library(ggplot2) library(tikzDevice) set.seed(1) x <- rnorm(200) tikz(file = "Rplots.tex", width = 4, height = 4) qplot(x, geom = "histogram") dev.off() and the

problems with usetex in OSX 10.8

橙三吉。 提交于 2020-01-24 10:09:44
问题 I recently upgraded to OSX 10.8 (Mountain Lion) and my python install is now misbehaving if I try to use latex mark-up in my plot labels. The following code runs perfectly: plt.figure() plt.plot( rand(51), rand(51) ) plt.show() However, this does not: plt.rc( 'text', usetex=True ) plt.figure() plt.plot( rand(51), rand(51) ) plt.show() The errors I get back are: Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/7.2/lib/python2.7/site-packages/wx/_misc.py",

problems with usetex in OSX 10.8

*爱你&永不变心* 提交于 2020-01-24 10:09:18
问题 I recently upgraded to OSX 10.8 (Mountain Lion) and my python install is now misbehaving if I try to use latex mark-up in my plot labels. The following code runs perfectly: plt.figure() plt.plot( rand(51), rand(51) ) plt.show() However, this does not: plt.rc( 'text', usetex=True ) plt.figure() plt.plot( rand(51), rand(51) ) plt.show() The errors I get back are: Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/7.2/lib/python2.7/site-packages/wx/_misc.py",

knitr chunk options to control line spacing, font size in output

不想你离开。 提交于 2020-01-24 06:47:13
问题 I'd like to have more control over the font size and line spacing used for code chunks and R output via LaTeX. Using the default render_latex(), I see I can set both globally using (in my premable) \renewenvironment{knitrout}{\small\renewcommand{\baselinestretch}{.85}}{} ... \begin{document} But, say there are chunks I'd like to print in \footnotesize, or customize in some other way. I know I can do this with a LaTeX group, but not with the knitrout environment: {\small \renewcommand{

Latex基本使用方法(二)

烈酒焚心 提交于 2020-01-24 01:22:15
1.sty文件 sty文件时latex的模板文件包,一般包括这个文档的字体,样式等一系列模板。 一般使用\usepackage{}添加 对于一个Latex文件缺少sty包时,一般直接google包名,就能下载保存(这个文件一般官网会给,好好找一下官网模板)。 2.插入横跨两联的大表格,大图的方法 在开始定义处插入星号 \begin{figure*}[htb] **** \end{figure*} 3.表格处理 在线表格转Latex代码,真滴方便 https://www.tablesgenerator.com/ 4.公式转化 pdf转latex,应该也可以手写公式然后转latex https://mathpix.com/ 5.文献引用 一般使用BiBTex style引用文献,方便快捷 \bibliographystyle{IEEEbib} %引用文献的风格样式文件,一般是会议机构给定的bst文件,IEEEbib是文件名 \bibliography{bibfile} %存放引用文献的bib文件,bibfile是文件名 bib文件生成方法: 首先通过google学术找到需要引用的论文,点击双引号,找到bibtex @InProceedings{He_2017_ICCV, author = {He, Kaiming and Gkioxari, Georgia and Dollar,

How to define two ispell dictionaries in Emacs for LaTeX mode?

橙三吉。 提交于 2020-01-23 08:58:15
问题 I have a document with many quotations in a second language. How can I define this second language to Ispell? I have this in file top: %% Local IspellDict: brasileiro I tried this, but it didn't work: %% Local IspellDict: brasileiro, english 回答1: I have a way to toggle between two languages: ;; You should have aspell-ru and aspell-en packages installed (let ((langs '("english" "russian"))) (setq lang-ring (make-ring (length langs))) (dolist (elem langs) (ring-insert lang-ring elem))) (defun