LaTeX图片环境 Picture environment
Picture environment
If you need to include simple diagrams or figures in your document, the picture environment may be helpful. This article describes circles, lines, and other graphic elements created with LATEX.
Contents |
Introduction
Images can be "programmed" directly in your LATEX file
\setlength{\unitlength}{1cm}
\thicklines
\begin{picture}(10,6)
\put(2,2.2){\line(1,0){6}}
\put(2,2.2){\circle{2}}
\put(6,2.2){\oval(4,2)[r]}
\end{picture}

The syntax of the picture is
\begin{picture}(width,height)(x-offset,y-offset)
the parameters are passed inside parentheses, width and height as you may expect, determine the width and the height of the picture; the units for this parameter are set by \setlength{\unitlength}{1cm}. The second parameter is optional and establishes the coordinates for the lower-left corner. Below a description of other commands:
\put(6,2.2){\oval(4,2)[r]}- will draw a oval centred in the point
4,2. The parameter[r]is optional, you can use r, l, t and b to show the right, left, top or bottom part of the oval. If absent the whole oval is drawn.
\put(2,2.2){\circle{2}}- draws a circle centred at the point (2,2.2) and whose diameter is 2.
In the next section the rest of the commands are described.
Open an example the picture environment in ShareLaTeX
Combining lines, circles and text
Different basic elements can be combined for more complex pictures
\setlength{\unitlength}{0.8cm}
\begin{picture}(12,4)
\thicklines
\put(8,3.3){{\footnotesize $3$-simplex}}
\put(9,3){\circle*{0.1}}
\put(8.3,2.9){$a_2$}
\put(8,1){\circle*{0.1}}
\put(7.7,0.5){$a_0$}
\put(10,1){\circle*{0.1}}
\put(9.7,0.5){$a_1$}
\put(11,1.66){\circle*{0.1}}
\put(11.1,1.5){$a_3$}
\put(9,3){\line(3,-2){2}}
\put(10,1){\line(3,2){1}}
\put(8,1){\line(1,0){2}}
\put(8,1){\line(1,2){1}}
\put(10,1){\line(-1,2){1}}
\end{picture}

In this example several lines and circles are combined to create a picture, then some text is added to label the points. Below each command is explained:
\thicklines- This changes the thickness of the lines, making them a bit thicker, you can also use
\thinlineswhich has the opposite effect.
\put(8,3.3){{\footnotesize $3$-simplex}}- The text "3-simplex" is inserted at the point (8,3.3), the font size is set to footnotesize. The same command is used to label each point.
\put(9,3){\circle*{0.1}}- This draws a filled circle centred at (9,3) and it's diameter is 0.1. Is so small that is used as a point.
\put(10,1){\line(3,2){1}}
- Draws a straight line, whose start point is at (10,1), it's length is 1 and it's direction is (3,2). As you see lines with arbitrary slopes are tricky to draw, some calculations must be performed for this.
Arrows can also be used inside a picture environment, let's see a second example
\setlength{\unitlength}{0.20mm}
\begin{picture}(400,250)
\put(75,10){\line(1,0){130}}
\put(75,50){\line(1,0){130}}
\put(75,200){\line(1,0){130}}
\put(120,200){\vector(0,-1){150}}
\put(190,200){\vector(0,-1){190}}
\put(97,120){$\alpha$}
\put(170,120){$\beta$}
\put(220,195){upper state}
\put(220,45){lower state 1}
\put(220,5){lower state 2}
\end{picture}

The syntax for vectors the same used for line
\put(120,200){\vector(0,-1){150}}- This renders a vector whose start point is (120,200), its length is 150 and the direction is (0,-1).
Open an example the picture environment in ShareLaTeX
Bézier curves
Bézier curves are special curves that are drawn using three parameters, one start point, one end point and a control point that determines "how curved" it is.
\setlength{\unitlength}{0.8cm}
\begin{picture}(10,5)
\thicklines
\qbezier(1,1)(5,5)(9,0.5)
\put(2,1){{Bézier curve}}
\end{picture}

Notice that the command \qbezier (quadratic Bezier curve) is not inside a \put command. The parameters that must be passed are:
- A start point,
- A control point and
- An endpoint.
Picture is the standard tool to create figures in LATEX, as you see this is tool is sometimes too restrictive and cumbersome to work with, but it's supported by most of the compilers and no extra packages are needed. If you need to create complex figures, for more suitable and powerful tools see the TikZ package andPgfplots package articles.
Open an example the picture environment in ShareLaTeX
from: https://www.sharelatex.com/learn/Picture_environment
LaTeX图片环境 Picture environment的更多相关文章
- latex 常用环境(environment)
align \begin{align} \overline{A \cup B} &= \overline{A} \cap \overline{B}, \\ \overline{A \cap B ...
- LaTex Verbatim 环境下使用数学符号
参考: Write math and make a box with alltt environment LaTex Verbatim 环境下使用数学符号 在 Verbatim 环境下使用数学符号,需 ...
- LaTeX技巧96:LaTeX 图片控制命令,位置控制
LaTeX技巧96:LaTeX 图片控制命令,位置控制 2012-04-05 17:25:44 zd0303 阅读数 28512更多 分类专栏: Latex LaTeX 控制图片的位置,就是加感叹 ...
- Ubuntu下LaTex中文环境安装与配置
转载自:http://www.linuxidc.com/Linux/2012-06/62456.htm LaTeX是一个强大的排版软件,但是其最初只是为英文排版而设计的.为了使其能够胜任中文排版的重任 ...
- Mac LaTex中文环境搭建
为了在博客上写公式,折腾了一晚上Mac上的LaTex的环境搭建,本文对步骤进行记录. 系统:Mac OSX 10.10.5 软件准备 1) MacTex 2015 Distribution (Tex的 ...
- LATEX图片位置
常用选项[htbp]是浮动格式: -『h』当前位置.将图形放置在正文文本中给出该图形环境的地方.如果本页所剩的页面不够,这一参数将不起作用. -『t』顶部.将图形放置在页面的顶部. -『b』底部.将图 ...
- Latex图片显示问题(1)
用latex编译后,若用dvipdf生成pdf文件,则其中有个eps图的左侧会显示不完全:若是用dvips--pspdf生成pdf文件,图像显示没问题. 这种情况的问题出在,加载 graphicx 宏 ...
- ubuntu14.04配置中文latex完美环境(texlive+texmaker+lyx)
Ubuntu下的文档编辑虽然有libreoffice,但对中文和公式的排版始终不如ms office,因此要想写出高质量的文档,只能靠latex了,现在随着xeCjk的开发,中文文档在ubuntu下的 ...
- Atom+latex+中文环境
最近在写论文,的路上.很多idea都受限于官方给的模板不能够添加自己即时的中文idea,所以添加中文到文献中很有必要,这里记录自己添加中文的几个小步骤 1. 受限将atom中的latex packag ...
随机推荐
- JS函数学习
=============数学函数========== 1.Math.random()为取随机数0~1之间的:0可以取到,1取不到 alert(Math.random()); 2.Math.PI为3. ...
- ubuntu安装Shutter截图工具以及设置系统快捷键
一.安装截图工具 Shutter 1. 添加安装包软件源 sudo add-apt-repository ppa:shutter/ppa 2. 更新源并安装 shutter sudo apt-get ...
- linux 大法
实验楼 练习 小笔记 可以输出图形字符的命令banner 你可以先使用如下命令安装: $ sudo apt-get update $ sudo apt-get install sysvbanner 然 ...
- 【LOJ】#2007. 「SCOI2015」国旗计划
题解 考虑朴素的做法,断环为链,复制2M个,找到一个位置i,f(i)是这个位置之前开始的线段,结束位置最远的位置在哪 然后对于每一个人,从自己线段的起点往下跳,跳到起点+M或以后的步数就是答案 我们发 ...
- 【笔试题】Java 继承知识点检测
笔试题 Java 继承知识点检测 Question 1 Output of following Java Program? class Base { public void show() { Syst ...
- SASS详解之混合(mixins)
SASS详解之混合(mixins)可以出现在SASS的任何地方.有很多类名具有相同或者相似的样式,就可以用SASS中的混合(mixins)来进行编写,然后针对不同类名的不同样式逐一编写. 定义一个混合 ...
- fastadmin iframe 表单提交之后跳转
controller 对应的那个js文件中添加: define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function($, und ...
- Django+Nginx+uwsgi搭建自己的博客(一)
最近对写爬虫有些厌倦了,于是将方向转移到了Web开发上.其实在之前自己也看过一部分Flask的资料,但总觉得Flask的资料有些零散,而且需要的各种扩展也非常多.因此,我将研究方向转移到了另一个主流的 ...
- mac linux 命令笔记 - 权限管理
壹 权限 在使用命令行工具时,可能需要临时切换到管理员/root权限,如何切换呢? 正文 进入 root 权限: sudo -i 提示输入密码,这个密码就是锁屏的解锁密码. 在操作完成之后,使用 ex ...
- Bzoj[Usaco2018 Feb]5194 Snow Boots(线段树)
Description 到冬天了,这意味着下雪了!从农舍到牛棚的路上有N块地砖,方便起见编号为1…N,第i块地砖上积了fi英尺的雪 .在Farmer John的农舍的地窖中,总共有B双靴子,编号为1… ...