男单 618

生活象筒装的卫生纸,开始的时候怎么扯都不觉得在转,后来转的越来越快。

Archive for the ‘LaTeX相关’ Category

Beamer中使用verbatim环境

without comments

\begin{frame}[fragile]

Written by amao

七月 2nd, 2010 at 10:25 上午

Posted in LaTeX相关

Tagged with , ,

Batch Commander–自动设置TeX文件的样式

with one comment

Batch Commander是一个自动设置TeX文件样式的GUI程序,这里是作者的视频讲解:Styling TeX documents with Batch Commander | River Valley TV

但是我安装不上,找不到QtPoppler这个模块。Google说可能是要装pypoppler,但是始终装不上去。哪位知道如何解决?

补充:
Batch Commander中自带了QtPoppler.so,可惜是32位的,我64位的系统用不了……
后来在这里:http://forum.ubuntuusers.de/topic/python-qt-frontend-templatesystem-fuer-latex-/#post-1959666,找到pypoppler-qt4源码,里面的so文件也是32位的。又安装了一堆依赖才编译成功。

Written by amao

六月 1st, 2010 at 9:47 下午

Posted in LaTeX相关

Tagged with ,

rename-批量重命名命令

with 2 comments

原来还很麻烦的用for循环(Ubuntu下批量重命名),其实只用rename就够了。比如,要把所有的文件名改为小写:
rename ‘tr/A-Z/a-z/’ *
把所有文件的后缀由rm改为rmvb
rename ’s/.rm$/.rmvb/’ *
替换时,只匹配第一次找到的子串,如果要替换所有匹配到的子串,需要添加g,比如有以下文件:
1.txt,11.txt,111.txt
命令
rename ’s/1/a/’ *.txt
得到的结果是
a.txt, a1.txt, a11.txt
而,命令
rename ’s/1/a/g’ *.txt
得到的结果是
a.txt, aa.txt, aaa.txt

Written by amao

三月 9th, 2010 at 8:41 下午

Posted in LaTeX相关, 软件

Tagged with

TikZ一例

without comments

一下午就画这么个东西:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
\begin{tikzpicture}
    \def\L{8}
    \coordinate (m) at (0.5*\L,0);
    \draw (m) node[below] {$m$};
    \draw[->] (0,0) -- (1.2*\L,0);
    \node [circle,draw] (i) at (0,0) [minimum size=3cm] {};
    \draw (i) node[below left] {$i$
};
    \node [circle,draw] (j) at (\L,0) [minimum size=3cm] {};
    \draw (j) node[below right] {$j$
};
    \coordinate (a) at (tangent cs:node=i,point={(m)},solution=1);
    \coordinate (c) at (tangent cs:node=i,point={(m)},solution=2);
    \coordinate (b) at (tangent cs:node=j,point={(m)},solution=1);
    \coordinate (d) at (tangent cs:node=j,point={(m)},solution=2);
    \draw (a) node[above] {$A$} -- (i.center)-- (c) node[below] {$C$} --
      (d) node[above] {$D$} -- (j.center)-- (b) node[below] {$B$} -- cycle;

    \draw[dashed] (0,0) -- (0,0.5*\L);
    \draw[dashed] (\L,0) -- (\L,0.5*\L);
    \node (l) at (0.5*\L,0.45*\L) {$l_{ij}$};
    \draw[< -] (0,0.45*\L) -- (l);
    \draw[->] (l) -- (\L,0.45*\L);
   
    \draw (m) +(0:8mm) arc (0:22:8mm);
    \path (m) +(8:1.2cm) node{$\alpha_{ij}$};
   
    \draw[dashed] (m) +($(0,0)-(a)$) -- (0,0);

    \draw[->] (0,0) +(0:18mm) arc (0:-22:18mm);
    \path (0,0) +(-8:22mm) node{$\alpha_{ij}$};

    \draw[->] (0,0) -- (3,-2) node[below right] {$\overrightarrow{v}_{ij}$};
    \draw[->] (0,0) +(0:8mm) arc (0:-32:8mm);
    \path (0,0) +(-18:12mm) node{$\beta_{ij}$};

    \draw[dashed] (m) +($(0,0)-(c)$) -- (0,0);
\end{tikzpicture}

Written by amao

二月 17th, 2010 at 7:42 下午

Posted in LaTeX相关

Tagged with

Beamer中自定义定理环境的风格继承问题

without comments

为了修改定理环境的标题,我们需要使用
\newtheorem{liti}{例}[section]
这样的命令重新定义一个新的环境。但是这样定义的liti块的风格是与theorem块相同,而不是我们想要的exampleblock的风格。

要想继承原有的block风格,先用
\theoremstyle{example}
命令切换成exampleblock的风格,再定义新的环境liti
\newtheorem{liti}{例}[section]
这样出来的块就和exampleblock的风格完全一致。

其他细节参见beamerbasetheorems.sty这个文件。

Written by amao

一月 27th, 2010 at 2:14 上午

Posted in LaTeX相关

Tagged with

给Beamer中的图表加编号

without comments

默认的Beamer设置中,图表都是没有编号的,因为作者认为没人会关注这些编号。如果你很希望加上这个编号,可以使用:
\setbeamertemplate{caption}[numbered]

Written by amao

一月 26th, 2010 at 10:32 下午

Posted in LaTeX相关

Tagged with

一种基于Latex语言的中文期刊双栏排版模板

with one comment

LaTeX模板也能申请专利?居然还是发明专利。

一种基于Latex语言的中文期刊双栏排版模板:http://zhuanli.baidu.com/pages/sipo/20061001/17/8689afa3f9b3ab08f79f203dddeae334_0.html

虽然编写好的LaTeX模板是一件十分困难的事情,但是没想到还能申请发明专利。

Written by amao

十一月 5th, 2009 at 10:27 下午

Posted in LaTeX相关

Tagged with ,

解决apt依赖问题

without comments

在Ubuntu下一直是用国内朋友修改后的texlive,原来是2005,现在是2008。这样如果再要装kile这样的软件的话,就会有包依赖的问题,一直不知道怎么解决。今天在查另外一个问题的时候,无意中看到解决方案。总的来就,就是造一个假包装上。在这里,42楼:http://forum.ubuntu.org.cn/viewtopic.php?f=35&t=168940。下面还是转一下原文。

引用:

另外我想重复再问一下,谁有解决 apt 包依赖问题的办法?

手工安装 TeX Live 后,如果还要从源里安装依赖 texlive 的软件(一个明显的例子就是 LaTeX 的编辑器 kile),就又会要求你再装源里面的那个已经被分解得比较零碎的 texlive2007。似乎是需要做一个关于 texlive 的空的假包?哪里有相关的文档,似乎不好找。

装 dummy 包的办法很简单了,过程如下:

代码:
sudo apt-get install equivs

它要装不少东西,好在不是很大,另外有我本来就需要的 MySQL。

在桌面上新建一 .ctl 个文件,比如:texlive-dummy.ctl 。

然后添加如下内容:

代码:
Section: tex
Package: texlive-dummy
Provides: texlive, texlive-base-bin, texlive-base-bin-doc,texlive-bibtex-extra, texlive-common, texlive-doc-base, texlive-doc-bg,texlive-doc-cs+sk, texlive-doc-de, texlive-doc-el, texlive-doc-en,texlive-doc-es, texlive-doc-fi, texlive-doc-fr, texlive-doc-it,texlive-doc-ko, texlive-doc-mn, texlive-doc-nl, texlive-doc-pl,texlive-doc-pt, texlive-doc-ru, texlive-doc-th, texlive-doc-tr,texlive-doc-uk, texlive-doc-vi, texlive-doc-zh, texlive-extra-utils,texlive-font-utils, texlive-fonts-extra, texlive-fonts-extra-doc,texlive-fonts-recommended, texlive-fonts-recommended-doc,texlive-formats-extra, texlive-full, texlive-games,texlive-generic-extra, texlive-generic-recommended, texlive-humanities,texlive-humanities-doc, texlive-lang-african, texlive-lang-all,texlive-lang-arab, texlive-lang-armenian, texlive-lang-cyrillic,texlive-lang-czechslovak, texlive-lang-danish, texlive-lang-dutch,texlive-lang-finnish, texlive-lang-french, texlive-lang-german,texlive-lang-greek, texlive-lang-hebrew, texlive-lang-hungarian,texlive-lang-indic, texlive-lang-italian, texlive-lang-latin,texlive-lang-manju, texlive-lang-mongolian, texlive-lang-norwegian,texlive-lang-polish, texlive-lang-portuguese, texlive-lang-spanish,texlive-lang-swedish, texlive-lang-tibetan, texlive-lang-ukenglish,texlive-lang-vietnamese, texlive-latex-base, texlive-latex-base-doc,texlive-latex-extra, texlive-latex-extra-doc, texlive-latex-recommended,texlive-latex-recommended-doc, texlive-latex3, texlive-math-extra,texlive-metapost, texlive-metapost-doc, texlive-music, texlive-omega,texlive-pictures, texlive-pictures-doc, texlive-plain-extra,texlive-pstricks, texlive-pstricks-doc, texlive-publishers,texlive-publishers-doc, texlive-science, texlive-science-doc,texlive-xetex, texlive-lang-other, texlive-lang-croatian, texlive-base,texlive-doc-ja, cm-super, lmodern, latex-xcolor, latex-beamer, pgf,preview-latex-style
Description: TeXlive dummy package
This package provides dpkg with the information that
there is a local TeXlive version installed.

保存后开始打包:

代码:
sudo equivs-build texlive-dummy.ctl

然后可以看见一个 deb 文件,名为:texlive-dummy_1.0_all.deb

现在就可以安装它了:

代码:
sudo dpkg -i texlive-dummy_1.0_all.deb

行了,下面就不用多说了,打开新立德,找到 kile 安装就是了,效果如下:

附件:
Screenshot.png

Screenshot.png [ 1002.93 KiB | 被浏览 738 次 ]

顺便把这两个文件也一并打包附赠:

附件:

texlive-dummy.tar.gz [4.25 KiB]

被下载 90 次

Written by amao

十月 19th, 2009 at 8:02 下午

Posted in LaTeX相关, linux

Tagged with , ,

CaR,GCLC,TikZ

without comments

C.a.R.和GCLC都可以算做类似几何画板的所谓动态几何软件,这里是维基百科上关于这类软件的一个比较。那张表并不完整,至少缺了是否跨平台这一栏。而这两个软件都具备以下特点:

  1. 免费
  2. 跨平台
  3. 支持LaTeX

另外,C.a.R.可以将动态结果输出至网页形式,只要装了Java的机器,可以直接在浏览器中操作。GCLC则有机器证明的功能,并可以将做图脚本输出为TikZ格式。

而TikZ是LaTeX上的一个宏包,可与Beamer很好的配合。

缺点是这三个软件都非常小众,无论国内还是国外,用户似乎都不多。

8月15日补充:

关于TikZ/PGF的好站(强力推荐):http://www.texample.net

Written by amao

八月 15th, 2009 at 10:33 上午

几则Beamer技巧

without comments

1、列目录时,隐藏所有的小节
\tableofcontents[hideallsubsections]

2、自动压缩,以显示全部内容
\begin{frame}[shrink]

3、在每一节(或小节)前增加目录
命令\AtBeginSection[]{}和\AtBeginSubsection[]{}。比如下面两个命令可以实现在每一节前显示文档目录,隐藏所有小节标题,并高亮当前节标题,而在每一小节前显示的目录中,只会显示本节的小节标题,并高亮当前小节标题,其他节的小节标题不显示,只显示节标题。
\AtBeginSection[]
{
    \begin{frame}
        \tableofcontents[currentsection,hideallsubsections]
    \end{frame}
}
\AtBeginSubsection[]
{
    \begin{frame}
[shrink]
        \tableofcontents[sectionstyle=show/shaded,subsectionstyle=show/shaded/hide]
    \end{frame}
}

4、frametitle的两种写法
\begin{frame}
  \frametitle{标题}
\end{frame}

\begin{frame}{标题}
\end{frame}

btw: 其实这些技巧在手册中都有,只是手册太长,一直没有完整的读过。结果每次都有新发现。喜欢Beamer,不单因为Beamer确实比较方便、漂亮,更重要的是Beamer的作者对于幻灯片的制作和使用有自己独到的见解。内容的组织,颜色的搭配,时间的控制,都有所涉及。让人感觉非常专业,自然产生一种信任。

Written by amao

八月 15th, 2009 at 1:15 上午

Posted in LaTeX相关

Tagged with ,