Using amsmath package, the equation numbering is by default set to right, i.e., reqno. It is possible to change to leqno by \documentclass[leqno,...]{article}, for example. However, if one desires to temporarily switch between the two a good solution can be found at
http://www.golatex.de/wechsel-zwischen-leqno-und-reqno-fleqn-uvm-t2488.html
For convenience, I paste Herbert's code here:
\makeatletter
\def\Links{\tagsleft@true}\def\Rechts{\tagsleft@false}
\makeatother
Examples of use:
\begin{align}
y=f(x)
\end{align}
\Links
\begin{align}
y=f(x)
\end{align}
\Rechts
\begin{align}
y=f(x)
\end{align}
2013年5月6日 星期一
2013年3月22日 星期五
Printing "usable" postscript figure in windows 8
This note is to illustrate how to capture an image from a PDF and export as a postscript file in windows 8. The file has to be compatible with latex.
Previously in windows 7, this can be done by printing the selected image in Acrobat with the virtual printer "WMF2EPS Color PS L2". In Win8, there is also a virtual printer called "Microsoft PS Class Driver" that can print files or images as ps files. When viewing the output ps figures with ghostscript, they look pretty fine. The only problem is, there is no bounding box. Without bounding box, we cannot use them directly in doing latex.
The solution I found is that Matlab can help. There is an exchange file on the "File Exchange - MATLAB Central" called "export_fig" by Oliver Woodford. The file can be freely downloaded here. This mini-program outputs figure files in good qualities and may sometimes be needed, in addition to Matlab's built-in command "print". This export_fig can also do pdf2eps, but before having this function work, one has to download necessary files related with xpdf.
Anyway, when this function (pdf2eps) is activated, the following is then the simple procedure of how a captured image in a PDF file can be transformed to an EPS file that is compatible with LaTeX:
Anyway, when this function (pdf2eps) is activated, the following is then the simple procedure of how a captured image in a PDF file can be transformed to an EPS file that is compatible with LaTeX:
1. open the pdf file and select the desired image
2. right-click to print the selected image
3. choose the adobe acrobat virtual printer to output the image in the pdf format (ex.: image.pdf)
4. open matlab and use the pdf2eps command to transform the pdf file into an eps file; then it's done
An example is shown below to summarize the procedure:
Note:
1. In the last view, the dashed box of the eps file shown in ghostview is the bounding box, which is very important when doing latex.
2. Sometimes the boundary of the captured image in the pdf format is not satisfactory. This can be improved by cropping the file in the Adobe Acrobat.
2012年9月5日 星期三
newtheorem
要自訂新的 theorem 環境
可以用 amsthm 這個 package
非常方便
例如
\newtheorem{mynote}{Note}[chapter]
{mynote} 是新環境的名字,於是往後可以用 \begin{mynote}...\end{mynote}
{Note} 是這個新環境的標題
[chapter] 是跟編號有關
這個例子用在書的話,例如
\begin{mynote}
This is important.
\end{mynote}
大概會產生(假如是在第二章裡第一次使用)
Note 2.1. This is important.
此外,這裡的 {mynote} 會出現在 swp 的下拉選單裡
而 {Note} 則是在 swp 的環境標題
細節的部分
說明檔已經很清楚
但是 \newtheoremstyle 的最後一個參數沒有說得很清楚
而且其實很簡單
按照說明檔:
\newtheoremstyle{note}% <name>
{3pt}% <Space above>
{3pt}% <Space below>
{}% <Body font>
{}% <Indent amount>
{\itshape}% <Theorem head font>
{:}% <Punctuation after theorem head>
{.5em}% <Space after theorem head>
{}% <Theorem head spec (can be left empty, meaning `normal')>
每個參數都算清楚
就只有最後一個參數沒說清楚
而這裡: http://users.stat.umn.edu/~geyer/amslatex.html
對最後這個 theorem head spec 有清楚的說明
(假如這個連結還在的話)
設定好這個新的 theoremstyle 之後
如果
\theoremstyle{note}
\newtheorem{mynote}{Note}[chapter]
則會把這個名叫 note 的新的 theoremstyle 套用到 mynote 這個新的 theorem 環境上
而按照上面這個 style
排出來的結果也差不多是 Note 2.1: This is important.
就只是"Note"是斜體,還有2.1後面變冒號而已
舉個實際的例子:
\newtheoremstyle{ref}
{3pt}
{3pt}
{}
{}
{}
{}
{.5em}
{\Pointinghand\enspace [\thmnumber{#2}]}
\theoremstyle{ref}
\newtheorem{reading}{Further Reading}[chapter]
這個例子是用來當 further reading 的環境
安排在每一章之後
使得可以得到類似
-> [2.1] M. Johnson, Some Journal 99, 1234 (1995).
-> [2.2] S. Body, Some Journal 88, 4321 (1992).
的結果
新環境格式的最後一個參數我們用了{\Pointinghand\enspace [\thmnumber{#2}]}
\Pointinghand 其實是一隻手,這裡用 -> 代表,這個要\usepackage{marvosym}才行
\enspace 是插入一個小空格
\thmnumber{#2} 是編號 而我們外面用 [ ] 包起來
排出來也就照列
如果我們把這個最後一個參數留白{}
其效果等於是
{\thmname{#1}\thmnumber{ #2}}
注意到\thmnumber{ #2}裡面#2前面有個空格
而\thmname{#1}在這個例子就是Further Reading
這個實例裡
雖然我用了\newtheorem{reading}{Further Reading}[chapter]
而在設定 newtheoremstyle 時其實沒有用到\thmname{#1}
所以跟\newtheorem{reading}{}[chapter]效果其實一樣
然而差別是,前面已經提過
這個環境標題會在 swp 顯示
所以雖然不影響排版
但是在 swp 編輯的時候
看起來會比較舒服
可以用 amsthm 這個 package
非常方便
例如
\newtheorem{mynote}{Note}[chapter]
{mynote} 是新環境的名字,於是往後可以用 \begin{mynote}...\end{mynote}
{Note} 是這個新環境的標題
[chapter] 是跟編號有關
這個例子用在書的話,例如
\begin{mynote}
This is important.
\end{mynote}
大概會產生(假如是在第二章裡第一次使用)
Note 2.1. This is important.
此外,這裡的 {mynote} 會出現在 swp 的下拉選單裡
而 {Note} 則是在 swp 的環境標題
細節的部分
說明檔已經很清楚
但是 \newtheoremstyle 的最後一個參數沒有說得很清楚
而且其實很簡單
按照說明檔:
\newtheoremstyle{note}% <name>
{3pt}% <Space above>
{3pt}% <Space below>
{}% <Body font>
{}% <Indent amount>
{\itshape}% <Theorem head font>
{:}% <Punctuation after theorem head>
{.5em}% <Space after theorem head>
{}% <Theorem head spec (can be left empty, meaning `normal')>
每個參數都算清楚
就只有最後一個參數沒說清楚
而這裡: http://users.stat.umn.edu/~geyer/amslatex.html
對最後這個 theorem head spec 有清楚的說明
(假如這個連結還在的話)
設定好這個新的 theoremstyle 之後
如果
\theoremstyle{note}
\newtheorem{mynote}{Note}[chapter]
則會把這個名叫 note 的新的 theoremstyle 套用到 mynote 這個新的 theorem 環境上
而按照上面這個 style
排出來的結果也差不多是 Note 2.1: This is important.
就只是"Note"是斜體,還有2.1後面變冒號而已
舉個實際的例子:
\newtheoremstyle{ref}
{3pt}
{3pt}
{}
{}
{}
{}
{.5em}
{\Pointinghand\enspace [\thmnumber{#2}]}
\theoremstyle{ref}
\newtheorem{reading}{Further Reading}[chapter]
這個例子是用來當 further reading 的環境
安排在每一章之後
使得可以得到類似
-> [2.1] M. Johnson, Some Journal 99, 1234 (1995).
-> [2.2] S. Body, Some Journal 88, 4321 (1992).
的結果
新環境格式的最後一個參數我們用了{\Pointinghand\enspace [\thmnumber{#2}]}
\Pointinghand 其實是一隻手,這裡用 -> 代表,這個要\usepackage{marvosym}才行
\enspace 是插入一個小空格
\thmnumber{#2} 是編號 而我們外面用 [ ] 包起來
排出來也就照列
如果我們把這個最後一個參數留白{}
其效果等於是
{\thmname{#1}\thmnumber{ #2}}
注意到\thmnumber{ #2}裡面#2前面有個空格
而\thmname{#1}在這個例子就是Further Reading
這個實例裡
雖然我用了\newtheorem{reading}{Further Reading}[chapter]
而在設定 newtheoremstyle 時其實沒有用到\thmname{#1}
所以跟\newtheorem{reading}{}[chapter]效果其實一樣
然而差別是,前面已經提過
這個環境標題會在 swp 顯示
所以雖然不影響排版
但是在 swp 編輯的時候
看起來會比較舒服
2012年5月23日 星期三
用 latex 繪製中華民國國旗
中華民國國旗 |
規格按照中華民國國徽國旗法
成品預覽如右圖
以下是簡短簡易的 latex code
任何版友皆可享用
這裡有 eps 圖檔的成品
\documentclass{article}
\usepackage{pst-node}
\pagestyle{empty}
\begin{document}
\fcolorbox{white}{white}{%
\pspicture(-6,-4)(6,4)%
\psset{linewidth=1pt,unit=0.1cm}%
%%%%% 滿地紅
\psline*[linecolor=red](-60,-40)(60,-40)(60,40)(-60,40)%
\rput(-30,20){
%%%%% 青天
\psline*[linecolor=blue](-30,-20)(30,-20)(30,20)(-30,20)
%%%%% 白日
\psline*[linecolor=white]%
(15;0)(15;150)(15;300)(15;450)(15;600)(15;750)%
(15;900)(15;1050)(15;1200)(15;1350)(15;1500)(15;1650)(15;1800)%
%%%%% 藍圈
\pscircle*[linecolor=blue](0,0){8.5}
\pscircle*[linecolor=white](0,0){7.5}
}
\endpspicture
}
\end{document}
2012年1月7日 星期六
Unique rand in MATLAB
The rand function in MATLAB is generated by a long vector containing "random" numbers. The sequence is therefore important. Without setting the sequence, the random numbers always appear in series like
0.8147 0.9058 0.1270 0.9134 0.6324 ...,
whenever MATLAB is restarted. To make sure the random numbers do not appear in the same sequence, one can first
s = RandStream('mt19937ar','seed',sum(100*clock));
0.8147 0.9058 0.1270 0.9134 0.6324 ...,
whenever MATLAB is restarted. To make sure the random numbers do not appear in the same sequence, one can first
s = RandStream('mt19937ar','seed',sum(100*clock));
and then execute rand(s,n,m). This makes sure that the sequence would hardly repeat when starting MATLAB at different time.
2011年10月3日 星期一
footnote reference in beamer
作者: hantis (呢呢是豬) 看板: Hantis
標題: [隨寫] Note: footnote referenece in beamer
時間: Mon Oct 3 21:12:45 2011
如何在 Beamer 的投影片下面以footnote的形式放reference:
1. \usepackage{bibentry}
2. 在開始引用之前 \begin{document}之後的任何位置
放:
\bibliographystyle{phjcp}
\nobibliography{mhl2}%
phjcp這個style還挺適合的 不會把標題也給列出來 比較短
有些style不相容 會出錯 例如apsrev4-1之類的
mhl2是 .bib 的資料庫
3. 別忘了在preamble裡要把\newblock給取消掉
也就是放 \newcommand{\newblock}{}
否則compile的時候會有個不致命的錯誤出現
4. 在要引用的地方放 \footnote{\bibentry{...}}
... 即 例如 Yamakage2009, Liu2010, ...
5. 建議放 2 的部分在某一頁內 也就是 \begin{frame} \end{frame}之間
否則如果放在頁與頁之間會跑出多餘的空白頁
標題: [隨寫] Note: footnote referenece in beamer
時間: Mon Oct 3 21:12:45 2011
如何在 Beamer 的投影片下面以footnote的形式放reference:
1. \usepackage{bibentry}
2. 在開始引用之前 \begin{document}之後的任何位置
放:
\bibliographystyle{phjcp}
\nobibliography{mhl2}%
phjcp這個style還挺適合的 不會把標題也給列出來 比較短
有些style不相容 會出錯 例如apsrev4-1之類的
mhl2是 .bib 的資料庫
3. 別忘了在preamble裡要把\newblock給取消掉
也就是放 \newcommand{\newblock}{}
否則compile的時候會有個不致命的錯誤出現
4. 在要引用的地方放 \footnote{\bibentry{...}}
... 即 例如 Yamakage2009, Liu2010, ...
5. 建議放 2 的部分在某一頁內 也就是 \begin{frame} \end{frame}之間
否則如果放在頁與頁之間會跑出多餘的空白頁
2011年9月25日 星期日
color definition and usage in latex
作者: hantis (呢呢是豬) 看板: Hantis
標題: [隨寫] Note: color
時間: Sun Sep 25 22:40:12 2011
\usepackage{color}
This allows easy text coloring, like: {\red This is red.}
To define other colors, simply
\definecolor{violet}{rgb}{1,0, 1}
and then
{\color{violet} This text is in violet.}
標題: [隨寫] Note: color
時間: Sun Sep 25 22:40:12 2011
\usepackage{color}
This allows easy text coloring, like: {\red This is red.}
To define other colors, simply
\definecolor{violet}{rgb}{1,0,
and then
{\color{violet} This text is in violet.}
2011年9月12日 星期一
top-aligning imported graphics
作者: hantis (呢呢是豬) 看板: Hantis
標題: [隨寫] Note: top-aligning imported graphics
時間: Mon Sep 12 21:58:26 2011
要把圖靠上對齊可以用
\vtop{%
\vskip0pt
\hbox{%
\includegraphics{figure}%
}%
}
不需要用 parbox 或 minipage 什麼的
直接用即可
for more details, see:
http://www.tex.ac.uk/cgi-bin/ texfaq2html?label=topgraph
標題: [隨寫] Note: top-aligning imported graphics
時間: Mon Sep 12 21:58:26 2011
要把圖靠上對齊可以用
\vtop{%
\vskip0pt
\hbox{%
\includegraphics{figure}%
}%
}
不需要用 parbox 或 minipage 什麼的
直接用即可
for more details, see:
http://www.tex.ac.uk/cgi-bin/
2010年5月27日 星期四
verbatim in beamer
作者: hantis (呢呢是豬) 看板: Hantis
標題: [隨寫] Note: verbatim in beamer
時間: Thu May 27 10:47:12 2010
In beamer, if one tries to use verbatim in some slide, simply
\begin{frame} --> \begin{frame}[ containsverbatim]
Otherwise error when compiling.
標題: [隨寫] Note: verbatim in beamer
時間: Thu May 27 10:47:12 2010
In beamer, if one tries to use verbatim in some slide, simply
\begin{frame} --> \begin{frame}[
Otherwise error when compiling.
2010年5月26日 星期三
\href to open a local target
作者: hantis (呢呢是豬) 看板: Hantis
標題: [隨寫] Note: \href
時間: Wed May 26 13:58:29 2010
\href{URL}{showing text}
URL can be http something
and a local target as well, like D:/temp.pdf.
The file name can be a problem.
If the target is in the same folder, simply
\href{temp.pdf}{Open the file.}
somehow 點超連結之後 原來的檔會被關掉
可以按 alt + shift + <- 以檢視前一文件
(如此 acrobat 保持只開著一個文件)
標題: [隨寫] Note: \href
時間: Wed May 26 13:58:29 2010
\href{URL}{showing text}
URL can be http something
and a local target as well, like D:/temp.pdf.
The file name can be a problem.
If the target is in the same folder, simply
\href{temp.pdf}{Open the file.}
somehow 點超連結之後 原來的檔會被關掉
可以按 alt + shift + <- 以檢視前一文件
(如此 acrobat 保持只開著一個文件)
2010年4月16日 星期五
MATLAB colormap
作者: hantis (呢呢是豬) 看板: Hantis
標題: [隨寫] Note: MATLAB colormap
時間: Fri Apr 16 09:15:47 2010
contourf 之類的 color shading 圖
有兩個東西會混淆: colormap, caxis
colormap 是給定一個顏色矩陣
讓作圖的時候依據data的值是多少來填色
所以 hot, gray, hsv, winter, autumn, ...
這些其實是產生顏色矩陣的函數
例如有個顏色矩陣產生函數叫做 cmatrix
其色調是從黑色到白色
那麼
colormap cmatrix
作用等同於
colormapt(cmatrix(128))
cmatrix(128)所產生的東西是 [R,G,B]
其中 R,G,B 三個 element 都是從 0 到 1 的 column matrix
也就是 linspace(0,1,128)'
所以想使用任意色調來著色
只需自行產生色調矩陣
然後放進 colormap 即可
例如最高值是藍色 [0 0 1]
最低值是白色 [1 1 1] 的色調
可以用
cmatrix = [linspace(1,0,Nc);linspace(1, 0,Nc);ones(1,Nc)]';
colormap(cmatrix)
這樣就行了
其中 Nc 是想要分割出來的色段數
MATLAB內定值是 128
至於 caxis
是定義了 colormap 之後
自行調整 data 中哪個數字視為 colormap 的最高值或最低值
MATLAB內定是把 data 中的最高值
以 colormap 的最下面一個顏色來填
而 data 中的最低值則以第一個顏色來填
例如上面的 cmatrix
第一個顏色是白色 [1 1 1]
最後一個顏色是藍色 [0 0 1]
假如 contourf 的 Z data 是
[1 2 3 4;
5 6 7 8;
9 8 7 6;
5 4 3 2]
那麼在 9 對應到的位置就會填上藍色
在 1 的地方會填上白色
假如希望3以下的都用白色來填
7以上的都用藍色來填
則可以
caxis([3 7])
也就是說
沒下這道命令的話內定值是 caxis([1 9])
或者說是 caxis([min(min(Z)),max(max(Z)) ])
標題: [隨寫] Note: MATLAB colormap
時間: Fri Apr 16 09:15:47 2010
contourf 之類的 color shading 圖
有兩個東西會混淆: colormap, caxis
colormap 是給定一個顏色矩陣
讓作圖的時候依據data的值是多少來填色
所以 hot, gray, hsv, winter, autumn, ...
這些其實是產生顏色矩陣的函數
例如有個顏色矩陣產生函數叫做 cmatrix
其色調是從黑色到白色
那麼
colormap cmatrix
作用等同於
colormapt(cmatrix(128))
cmatrix(128)所產生的東西是 [R,G,B]
其中 R,G,B 三個 element 都是從 0 到 1 的 column matrix
也就是 linspace(0,1,128)'
所以想使用任意色調來著色
只需自行產生色調矩陣
然後放進 colormap 即可
例如最高值是藍色 [0 0 1]
最低值是白色 [1 1 1] 的色調
可以用
cmatrix = [linspace(1,0,Nc);linspace(1,
colormap(cmatrix)
這樣就行了
其中 Nc 是想要分割出來的色段數
MATLAB內定值是 128
至於 caxis
是定義了 colormap 之後
自行調整 data 中哪個數字視為 colormap 的最高值或最低值
MATLAB內定是把 data 中的最高值
以 colormap 的最下面一個顏色來填
而 data 中的最低值則以第一個顏色來填
例如上面的 cmatrix
第一個顏色是白色 [1 1 1]
最後一個顏色是藍色 [0 0 1]
假如 contourf 的 Z data 是
[1 2 3 4;
5 6 7 8;
9 8 7 6;
5 4 3 2]
那麼在 9 對應到的位置就會填上藍色
在 1 的地方會填上白色
假如希望3以下的都用白色來填
7以上的都用藍色來填
則可以
caxis([3 7])
也就是說
沒下這道命令的話內定值是 caxis([1 9])
或者說是 caxis([min(min(Z)),max(max(Z))
2010年4月8日 星期四
amscd
作者: hantis (呢呢是豬) 看板: Hantis
標題: [隨寫] Note: amscd
時間: Thu Apr 8 11:54:55 2010
This is an extremely useful package for communative diagrams,
such as
after 10 years
A ----------------> B
The above example can be obtained by
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
...
\usepackage{amscd}
...
\[
\begin{CD}
A @>\text{after 10 years}>> B
\end{CD}
\]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Note that the CD environment must be inside the math mode.
So \begin{align*}\begin{CD} XXX \end{CD}\end{align*} is ok,
and so is $\begin{CD} XXX \end{CD}$.
標題: [隨寫] Note: amscd
時間: Thu Apr 8 11:54:55 2010
This is an extremely useful package for communative diagrams,
such as
after 10 years
A ----------------> B
The above example can be obtained by
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
...
\usepackage{amscd}
...
\[
\begin{CD}
A @>\text{after 10 years}>> B
\end{CD}
\]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Note that the CD environment must be inside the math mode.
So \begin{align*}\begin{CD} XXX \end{CD}\end{align*} is ok,
and so is $\begin{CD} XXX \end{CD}$.
2010年4月1日 星期四
jpg for latex
作者: hantis (呢呢是豬) 看板: Hantis
標題: [隨寫] Note: jpg for latex
時間: Thu Apr 1 09:50:22 2010
This note was written long time ago but I didn't post on my board.
Here it goes:
============================== ============================== ======
bmeps是將點陣圖如jpg png等
轉成eps或ps圖的driver
直接在黑黑的DOS視窗執行就可以
例如:
bmeps XXX.jpg XXX.ps
就可以把XXX.jpg轉出一張XXX.ps圖
接著就可以用熟悉的方法來插入圖
然後latex -> dvips -> ps2pdf
不會有問題
不過這個轉圖法會是黑白的
要轉出彩色的則多下個 -c
即
bmeps -c XXX.jpg XXX.ps
這樣的ps圖就是彩色的
只是這樣的ps圖好像會很大
爛爛的解析度就會到1MB以上
另外一個方法更好
在吳聰穎、吳聰慧的書有提
不過不是很完全
這個方法
可以用\includegraphics{XXX.jpg} 直接來
直接執行latex的話會掛掉
因為它需要bounding box
所以要用這個方法的話
得先bmeps -b XXX.jpg XXX.bb
這樣就會generate出XXX. bb這個宣告bounding box的檔
(其實這個bounding box也可以直接下
例如\includegraphics[bb=0 0 300 400,width=5cm,...]{XXX.jpg}
可是這個方法好像不太好)
有了bb檔之後
還要在PREAMBLE下
\DeclareGraphicsRule{.jpg}{ eps}{.bb}{}
這樣
latex就OK
這樣子compile出來的dvi是OK的
但是直接dvips會把彩色圖弄成黑白的
這時候要再多下-I c
dvips這個driver有很多option
其指令格式是dvips [option] filename
其中[option]可以有很多
有一個網站有summarize
總之
dvips -I c filename
即可把filename. dvi成功轉成彩色的filename.ps
當然啦
如果本來就沒有jpg圖檔
直接dvips filename是沒有問題的
小結:
欲放入jpg之點陣圖檔最好的方法
1) PREAMBLE放入這行指令
\DeclareGraphicsRule{.jpg}{ eps}{.bb}{}
2) 插入圖:
\includegraphics[...]{XXX.jpg}
3) 在Command Prompt製造XXX.bb的bounding box檔:
bmeps -b XXX.jpg XXX.bb
4) 開始compile以及轉檔:
latex main
dvips -I c main
ps2pdf main.ps
要在beamer的title page放圖的指令:
\titlegraphic{...}
例如
\titlegraphic{\ includegraphics[width=2cm]{ XXX.jpg}}
放在maketitle之前都可以
這個指令會自動把圖放在正下方
如果要放左下角 可以在\includegraphics之前加個\ flushleft
當然 \flushright就到右下角
如果要放兩個 一左一右
可以\flushleft \includegraphics[...]{...} \hfill \flushright
\includegraphics...
無法解決的問題:
通常把這行\titlegraphic指令插在\date之前
但是swp55總是會自動把它移到\maketitle之後
以致於圖會不見
所以目前只能在投影片確定好之好
要真正generate講稿的時候
用WinEdt 或是記事本
強制把那行指令移過去對的地方
然後再latex
標題: [隨寫] Note: jpg for latex
時間: Thu Apr 1 09:50:22 2010
This note was written long time ago but I didn't post on my board.
Here it goes:
==============================
bmeps是將點陣圖如jpg png等
轉成eps或ps圖的driver
直接在黑黑的DOS視窗執行就可以
例如:
bmeps XXX.jpg XXX.ps
就可以把XXX.jpg轉出一張XXX.ps圖
接著就可以用熟悉的方法來插入圖
然後latex -> dvips -> ps2pdf
不會有問題
不過這個轉圖法會是黑白的
要轉出彩色的則多下個 -c
即
bmeps -c XXX.jpg XXX.ps
這樣的ps圖就是彩色的
只是這樣的ps圖好像會很大
爛爛的解析度就會到1MB以上
另外一個方法更好
在吳聰穎、吳聰慧的書有提
不過不是很完全
這個方法
可以用\includegraphics{XXX.jpg}
直接執行latex的話會掛掉
因為它需要bounding box
所以要用這個方法的話
得先bmeps -b XXX.jpg XXX.bb
這樣就會generate出XXX.
(其實這個bounding box也可以直接下
例如\includegraphics[bb=0 0 300 400,width=5cm,...]{XXX.jpg}
可是這個方法好像不太好)
有了bb檔之後
還要在PREAMBLE下
\DeclareGraphicsRule{.jpg}{
這樣
latex就OK
這樣子compile出來的dvi是OK的
但是直接dvips會把彩色圖弄成黑白的
這時候要再多下-I c
dvips這個driver有很多option
其指令格式是dvips [option] filename
其中[option]可以有很多
有一個網站有summarize
總之
dvips -I c filename
即可把filename.
當然啦
如果本來就沒有jpg圖檔
直接dvips filename是沒有問題的
小結:
欲放入jpg之點陣圖檔最好的方法
1) PREAMBLE放入這行指令
\DeclareGraphicsRule{.jpg}{
2) 插入圖:
\includegraphics[...]{XXX.jpg}
3) 在Command Prompt製造XXX.bb的bounding box檔:
bmeps -b XXX.jpg XXX.bb
4) 開始compile以及轉檔:
latex main
dvips -I c main
ps2pdf main.ps
要在beamer的title page放圖的指令:
\titlegraphic{...}
例如
\titlegraphic{\
放在maketitle之前都可以
這個指令會自動把圖放在正下方
如果要放左下角 可以在\includegraphics之前加個\
當然 \flushright就到右下角
如果要放兩個 一左一右
可以\flushleft \includegraphics[...]{...} \hfill \flushright
\includegraphics...
無法解決的問題:
通常把這行\titlegraphic指令插在\date之前
但是swp55總是會自動把它移到\maketitle之後
以致於圖會不見
所以目前只能在投影片確定好之好
要真正generate講稿的時候
用WinEdt 或是記事本
強制把那行指令移過去對的地方
然後再latex
2010年3月23日 星期二
boxing equations
作者: hantis (呢呢是豬) 看板: Hantis
標題: [隨寫] Note: boxing equations
時間: Tue Mar 23 12:11:12 2010
With amsmath package, there is one simple command to box a
displayed equation: \boxed. Here is an example:
\begin{equation} % equation, align, ... all work
\boxed{f = ma}
\end{equation}
The above will give a boxed equation like
__________
| |
| f = ma | (1)
|__________|
However, whenever multiple lines are involved, this does not work.
The empheq package is helpful here. This package is compatible with
many commonly used packages such as amsmath and fancybox.
Simplest usage is like
\begin{empheq}[box=\fbox]{ align}
f & = ma \\
p & = mv
\end{empheq}
These will give something like
_______
| |
| f = ma | (1)
| p = mv | (2)
|_______|
There are other types of boxes that can be called within the help
of fancybox package. They are doublebox, ovalbox, and shadowbox.
The last one may cause problem and needs some advanced modification.
For the other two, one can just, for example,
\begin{empheq}[box=\doublebox] {align}
....
\end{empheq}
ovalbox actually sucks. So ignore it.
標題: [隨寫] Note: boxing equations
時間: Tue Mar 23 12:11:12 2010
With amsmath package, there is one simple command to box a
displayed equation: \boxed. Here is an example:
\begin{equation} % equation, align, ... all work
\boxed{f = ma}
\end{equation}
The above will give a boxed equation like
__________
| |
| f = ma | (1)
|__________|
However, whenever multiple lines are involved, this does not work.
The empheq package is helpful here. This package is compatible with
many commonly used packages such as amsmath and fancybox.
Simplest usage is like
\begin{empheq}[box=\fbox]{
f & = ma \\
p & = mv
\end{empheq}
These will give something like
_______
| |
| f = ma | (1)
| p = mv | (2)
|_______|
There are other types of boxes that can be called within the help
of fancybox package. They are doublebox, ovalbox, and shadowbox.
The last one may cause problem and needs some advanced modification.
For the other two, one can just, for example,
\begin{empheq}[box=\doublebox]
....
\end{empheq}
ovalbox actually sucks. So ignore it.
2010年3月18日 星期四
\itemize in pspicture
作者: hantis (呢呢是豬) 看板: Hantis
標題: [隨寫] Note: \itemize in pspicture
時間: Thu Mar 18 11:44:17 2010
Within pspicture environment, \itemize has to be wrapped within \parbox
(or some others). For example,
...
\pspicture(0,0)(8,8){
...
\rput[l](1,2){\parbox{5cm}{\ begin{itemize}%
\item This is a test%
\end{itemize}}%
...
\endpspicture
...
標題: [隨寫] Note: \itemize in pspicture
時間: Thu Mar 18 11:44:17 2010
Within pspicture environment, \itemize has to be wrapped within \parbox
(or some others). For example,
...
\pspicture(0,0)(8,8){
...
\rput[l](1,2){\parbox{5cm}{\
\item This is a test%
\end{itemize}}%
...
\endpspicture
...
訂閱:
文章 (Atom)