這是留言板-既然來了,就留個言再走吧!
由 養花種魚數月亮賞星星 於 2029年7月22日星期日
下午2:43 發表
Exporting graphics to TikZ format with Mathematica, Version 2
由 戴忠淵 於 2020年2月3日星期一
下午12:05 發表
mytwoaxistikz[data__,{xmin_,xmax_,ymin_,ymax_},
mycolor__,{xlabel_,ylabel_},{rticks__,decimalr_,lticks__,decimall_},
linelabel__,linepos__,plotaspectratio_:1]:=Block[{temp=data,axis1,axis2,textpos,line},
axis1="
\\begin{axis}[
yticklabel style={
/pgf/number format/.cd,
fixed,
fixed zerofill,
precision="<>ToString[decimall]<>",
},
scale only axis,
axis y line*=left,
xtick pos=left,
xscale="<>ToString[N@plotaspectratio]<>",
xmin="<>ToString[xmin]<>",xmax="<>ToString[xmax]<>",ymin="<>ToString[ymin]<>
",ymax="<>ToString[ymax]<>",
xlabel="<>xlabel<>",ylabel="<>ylabel<>",
ytick="<>ToString[lticks]<>"]\n";
textpos=StringJoin[Table["
\\node[] at (axis cs:"<>ToString[linepos[[z,1]]]<>","<>ToString[linepos[[z,2]]]<>
") {"<>linelabel[[z]]<>"};",{z,Length@temp}]];
line=StringJoin[Table["
\\addplot[color="<>If[ListQ[mycolor[[z]]],
ToString[mycolor[[z,1]]]<>","<>ToString[mycolor[[z,2]]],
ToString[mycolor[[z]]]]<>",mark=none,line width=0.5mm] coordinates{\n"
<>StringJoin["("<>ToString[#[[1]]]<>","<>ToString[#[[2]]]<>")\n"&/@temp[[z]]]<>
"};\n\\addlegendentry{$G_{0}= "<>ToString[G0[[z]]]<>"$}",{z,Length@temp}]]
<>"\n\\end{axis}\n";
axis2="\n\\begin{axis}[
yticklabel style={
/pgf/number format/.cd,
fixed,
fixed zerofill,
precision="<>ToString[decimalr]<>",
},
scale only axis,
axis y line*=right,
xtick pos=left,
xscale="<>ToString[N@plotaspectratio]<>",
xmin="<>ToString[xmin]<>",xmax="<>ToString[xmax]<>",ymin="<>ToString[ymin]<>
",ymax="<>ToString[ymax]<>",
ytick="<>ToString[rticks]<>"]\n";
"\\begin{tikzpicture}"<>axis1<>textpos<>line<>axis2<>"\n\\end{axis}\n\\end{tikzpicture}"
]
Exporting graphics to TikZ format with Mathematica
由 戴忠淵 於 2018年2月9日星期五
下午6:04 發表
mytwoaxistikz[data__,{xmin_,xmax_,ymin_,ymax_},mycolor__,{xlabel_,ylabel_},{rticks__,lticks__},
linelabel__,linepos__,plotaspectratio_:1]:=Block[{temp=data,axis1,axis2,textpos,line},
axis1="
\\begin{axis}[
scale only axis,
axis y line*=left,
xtick pos=left,
xscale="<>ToString[N@plotaspectratio]<>",
xmin="<>ToString[xmin]<>",xmax="<>ToString[xmax]<>",
ymin="<>ToString[ymin]<>",ymax="<>ToString[ymax]<>",
xlabel="<>xlabel<>",ylabel="<>ylabel<>",
ytick="<>ToString[lticks]<>"]\n";
textpos=StringJoin[Table["
\\node[] at (axis cs:"<>ToString[linepos[[z,1]]]<>","<>
ToString[linepos[[z,2]]]<>") {"<>linelabel[[z]]<>"};",
{z,Length@temp}]];
line=StringJoin[Table["
\\addplot[color="<>If[ListQ[mycolor[[z]]],
ToString[mycolor[[z,1]]]<>","<>ToString[mycolor[[z,2]]],
ToString[mycolor[[z]]]]<>",mark=none,line width=0.5mm] coordinates{\n"
<>StringJoin["("<>ToString[#[[1]]]<>","<>ToString[#[[2]]]<>")\n"&/@temp[[z]]]<>"};",
{z,Length@temp}]]
<>"\n\\end{axis}\n";
axis2="\n\\begin{axis}[
scale only axis,
axis y line*=right,
xtick pos=left,
xscale="<>ToString[N@plotaspectratio]<>",
xmin="<>ToString[xmin]<>",xmax="<>ToString[xmax]<>",
ymin="<>ToString[ymin]<>",ymax="<>ToString[ymax]<>",
ytick="<>ToString[rticks]<>"]\n";
"\\begin{tikzpicture}"<>axis1<>textpos<>line<>axis2<>"\n\\end{axis}\n\\end{tikzpicture}"
]
Mathematica 教學:Generate relevant reports with LaTeX
由 戴忠淵 於 2016年2月7日星期日
上午10:57 發表
SetDirectory[NotebookDirectory[]]
(* Variable names *)
vars = Import["1042.tsv", CharacterEncoding -> "UTF8"][[1]];
(* data file *)
data = Import["1042.tsv", CharacterEncoding -> "UTF8"][[2 ;; -1]];
(* Split data file by department *)
mydata = GatherBy[data, #[[29]] &];
mydep[depnum_] :=
mydep[depnum_]:=Block[{mystr,mytex},mystr=#[[1]]<> " & " <>#[[2]]<>"\\\\ \\hline"&/@
(Partition["\\raisebox{-\\totalheight}{\\includegraphics[width=0.14\\textwidth]{"<> #[[3]] <>"}} &
"<>"姓名 "<>#[[4]]<>"\\par 原讀學校系所\\par "<>#[[25]]<>"\\par "<>#[[26]]<>"\\par 籍貫 "<>#[[15]]<>
"\\par 生日 "<> #[[8]]<>"\\par 電話 "<>ToString@ #[[12]]&/@mydata[[depnum]],2]);
mytex=StringJoin[
(*LaTeX preamble and Longtable code *)
"\ \documentclass[11pt, a4paper]{article}
\\usepackage{CJKutf8}
\\usepackage{geometry}
\\geometry{verbose,a4paper,tmargin=1.5in,bmargin=1.5in,lmargin=1in,rmargin=1in,footskip=1cm}
\\usepackage[pdftex]{graphicx}
\\usepackage{longtable}
\\begin{document}
\\begin{CJK}{UTF8}{cwmc}
\\tabcolsep=3pt
\\begin{center}
\\begin{longtable}{|p{0.15\\textwidth}|p{0.3\\textwidth}|p{0.15\\textwidth}|p{0.3\\textwidth}|}\\hline",
(* LaTeX Report *)
mystr,
(* LaTeX code *)
" \\end{longtable}
\\end{center}
\\end{CJK}
\\end{document}"];
mytex=StringReplace[mytex,"\\raisebox{-\\totalheight}{\\includegraphics[width=0.14\\textwidth]{取消來台}}"->"取消來台"];
(* Generate TeX file*)
RenameFile[Export[mydata[[depnum,1,-4]]<>".txt",mytex],ToString@depnum<>".tex"];
(* Generate PDF file *)
Run["cd "<>NotebookDirectory[]<>"; /Library/TeX/texbin/pdflatex "<>ToString[depnum]];
RenameFile[ToString@depnum<>".pdf", mydata[[depnum,1,-4]]<>".pdf"];
(* Remove Relevant files *)
DeleteFile[ToString@depnum<>".aux"];
DeleteFile[ToString@depnum<>".tex"];
DeleteFile[ToString@depnum<>".log"];
]
Mathematica 教學 輸出講義所需的TeX語法
由 戴忠淵 於 2013年6月21日星期五
上午12:21 發表
懶惰是一種美德
handoutform[command_String] := Block[{text},
(*判斷語法是否多行*)
text = StringSplit[command, "\n"];
(*輸出Mathematica計算結果*)
Print@ToExpression[command];
(*若程式僅一行,TeX直接跳到下一列;若程式兩行,第一行換行第二行跳列;若三行中間行僅換行*)
StringReplace["\\begin{mathenv}\n\\memo{}\n" <>
Which[
Length[text] == 1,
"\\mathin\n\\verb|" <> StringReplace[text[[1]], " " -> ""] <>
"|\\\\\n" ,
Length[text] == 2,
"\\mathin \n\\verb|" <> StringReplace[text[[1]], " " -> ""] <>
"|\\newline \n\\verb|" <> StringReplace[text[[2]], " " -> ""] <>
"|\\\\\n" ,
Length[text] >= 3,
"\\mathin \n\\verb|" <> StringReplace[text[[1]], " " -> ""] <>
"|\\newline\n\\verb|" <>
StringJoin[
StringReplace[#, " " -> ""] <> "|\\newline\n\\verb|" & /@
text[[2 ;; -2]]] <> StringReplace[text[[-1]], " " -> ""] <>
"|\\\\\n"]
<> "\\mathout $" <> ToString[TeXForm[ToExpression[command]]] <>
"$\n\\end{mathenv}", {"e^" -> "\\ex^"}]
];
(*設定圖形目錄*)
SetDirectory[];
handoutplotform[command_String, figurename_String] := Block[{text},
text = StringSplit[command, "\n"];
Print@ToExpression[command];
(*輸出圖形至指定目錄*)
Export[figurename <> ".eps", ToExpression[command]];
"\\begin{mathenv}\n\\memo{}\n" <>
Which[
Length[text] == 1,
"\\mathin \n\\verb|" <> StringReplace[text[[1]], " " -> ""] <>
"|\\\\\n" ,
Length[text] == 2,
"\\mathin \n\\verb|" <> StringReplace[text[[1]], " " -> ""] <>
"|\\newline\n\\verb|" <> StringReplace[text[[2]], " " -> ""] <>
"|\\\\\n" ,
Length[text] >= 3,
"\\mathin \n\\verb|" <> StringReplace[text[[1]], " " -> ""] <>
"|\\newline\n\\verb|" <>
StringJoin[
StringReplace[#, " " -> ""] <> "|\\newline\n\\verb|" & /@
text[[2 ;; -2]]] <> StringReplace[text[[-1]], " " -> ""] <>
"|\\\\\n"]
<> "\\mathplot{" <> figurename <> "}\n\\end{mathenv}"
]
(*Example*)
handoutplotform["Plot[Sin[x],{x,0,2Pi}]", "test"]
handoutform["Integrate[24*x*y,{x,0,0.5},{y,1-x,1}]+
Integrate[24*x*y,{x,0.5,1},{y,1-x,1.5-x}]"]
handoutform["PDF[NormalDistribution[],x]"]
Version 2.
Options[handoutform]={"Method"->"unList"};
handoutform[command_String,OptionsPattern[]]:=
Block[{myout,text,outputtex,arraytext,a,b,x,newlinepos,
newlinesign,listtex,method},
(*選項*)
Options[handoutform]={"Method"->"unList"};
method=OptionValue["Method"];
(*判斷語法是否多行*)
myout=ToExpression[command];
text=StringSplit[command,"\n"];
(*輸出Mathematica計算結果*)
outputtex=ToString@TeXForm[StandardForm@ToExpression[command]];
arraytext=
"{l"<>StringReplace[
StringCases[outputtex,"\\begin{array}{c"~~x__~~"c}"->x],
"c"->"l"]<>"l}";
listtex=If[method=="List",
newlinepos=StringPosition[outputtex,"\\}"];
newlinepos=
1+Accumulate[
Length/@
NestWhileList[
Cases[newlinepos,{a_,b_}/;#[[-1,2]]<
b<#[[-1,2]]+95]&,{{0,0}},#[[-1,2]]!=
newlinepos[[All,2]][[-1]]&][[2;;-2]]];
Print@myout;
TeXForm[Insert[myout,newlinesign,Partition[newlinepos,1]]],
Print@myout];
listtex=
StringReplace[ToString@listtex,
",\\text{newlinesign},"->"$,\\newline\n$"];
(*若程式僅一行,TeX直接跳到下一列;若程式兩行,第一行換行第二行跳列;若三行中間行僅換行*)
StringReplace[
"\\begin{mathenv}\n\\memo{}\n"<>
Which[Length[text]==1,
"\\mathin\n\\verb|"<>StringReplace[text[[1]],""->""]<>
"|\\\\\n",Length[text]==2,
"\\mathin\n\\verb|"<>StringReplace[text[[1]],""->""]<>
"|\\newline\n\\verb|"<>StringReplace[text[[2]],""->""]<>
"|\\\\\n",Length[text]>=3,
"\\mathin\n\\verb|"<>StringReplace[text[[1]],""->""]<>
"|\\newline\n\\verb|"<>
StringJoin[
StringReplace[#,""->""]<>"|\\newline\n\\verb|"&/@
text[[2;;-2]]]<>StringReplace[text[[-1]],""->""]<>
"|\\\\\n"]<>"\\mathout\n$"<>
If[method=="List",listtex,outputtex]<>"$\n\\end{mathenv}",
(*取代字串*)
{"e^"->"\\ex^",
"dx$"->"\\dx$",
"dy$"->"\\dy$",
"dz$"->"\\dz$",
"du$"->"\\du$",
"dv$"->"\\dv$",
"\\text{"~~ShortestMatch[a___]~~"}"->a,
"{c"~~ShortestMatch[b___]~~"c}"->arraytext,
"$\\begin{array}"->"\\matharray{\n\\begin{array}",
"\\end{array}$"->"\\end{array}\n}"}]];
(* Example *)
handoutform["N@Table[{x,Sin[x]},{x,0,2Pi,Pi/10}]"]
handoutform["N@Table[{x,Sin[x]},{x,0,2Pi,Pi/10}]","Method"->"List"]
TeXShop中文無法辨識
由 戴忠淵 於 2012年12月19日星期三
下午1:25 發表
Mathematica 教學:Including LaTeX to EPS
由 戴忠淵 於 2012年7月22日星期日
下午4:08 發表

I write this function to include the equations and other scientific text of LaTeX into EPS file via Mathematica.
mypsfrag[fig_Graphics,filename_String,pstext_List]:=
Block[{myticks,mytex,mytex1,mytex2,mytex3,aa,aaa,bbb,epilogtext,
axestext},
(*先計算Mathematica的圖形大小,並將圖形輸出*)
Export["fig.eps",fig];
aaa=ToString[1.2#]<>"pt"&/@ImageDimensions[fig];
(*利用geometry產生適當著eps圖形大小,並產生TeX檔*)
mytex1=
"\\documentclass[12pt]{article}
\\usepackage{amssymb,amsmath,amsthm,bm}
\\usepackage[dvips]{psfrag,graphicx}
\\usepackage[papersize={"<>aaa[[1]]<>","<>aaa[[2]]<>"},margin={0.1in}]{geometry}
\\newcommand{\\text}{\\mbox}
\\begin{document}
\\pagestyle{empty}
\\begin{center}
\\begin{psfrags}";
mytex2=
StringJoin[
"\\psfrag{"<>#[[1]]<>"}[bc][bc]{"<>#[[2]]<>"}%\n"&/@pstext];
mytex3=
"\\includegraphics[width=0.95\\textwidth]{fig.eps}\n\
\\end{psfrags}\n\\end{center}\n\\end{document}";
(*組合TeX*)
mytex=mytex1<>mytex2<>mytex3;
(*LaTeX檔案處理*)
If[FileExistsQ["test.tex"],DeleteFile["test.tex"]];
If[FileExistsQ["test.eps"],DeleteFile["test.eps"]];
If[FileExistsQ[filename<>".eps"],
DeleteFile[filename<>".eps"]];
RenameFile[Export["test.txt",mytex],"test.tex"];
Run["/usr/texbin/latex --interaction=nonstopmode test"];
Run["/usr/texbin/dvips test"];
RenameFile["test.ps",filename<>".eps"];
(*若想輸出原始檔,可移除註解 *)
(*
DeleteFile["fig.eps"];
DeleteFile["test.tex"];
*)
DeleteFile["test.aux"];
DeleteFile["test.log"];
DeleteFile["test.dvi"];
]
(*
Usage: mypsfrag[figure, "filename", psfrag_stynax]
*)
fig2=Plot[Sin[x],{x,0,2Pi},
AxesLabel->{xx,y},
Epilog->{Text[x1,{3,0.5}],Text[x2,{5,0.5}]}]
mypsfrag[fig2,"test",
{{"x1","$\\Pi$"},{"x2","$\\pi$"},{"xx","$\\boldsymbol{x}$"},{"y","$\\boldsymbol{y}$"}}
]


LaTeX titlesec 模版
由 戴忠淵 於 2011年12月10日星期六
下午4:31 發表


無聊修改一下講義使用的章節標題格式,使用titlesec這個Package。感覺這樣比較像一本書~~
\definecolor{titlecolor}{rgb}{0.503906,0.503906,0.734375}
\newcommand{\hwyk}{\CJKfamily{cwhbb}}
\newcommand{\mytitle}[1]{
\begin{tabular}{p{0.01\textwidth}p{0.99\textwidth}}
\cellcolor{black} &\cellcolor{titlecolor} \textcolor{white}
{\newline\hwyk \LARGE 第\ \thechapter \ 章 \ \ #1}
\end{tabular}
\arrayrulewidth=0.4pt
}
\newcommand{\mysection}[1]{
\setlength\arrayrulewidth{1pt}\arrayrulecolor{titlecolor}
\begin{tabular}{p{0.01\textwidth}p{0.99\textwidth}}
\hline
\cellcolor{titlecolor} & \textcolor{black}{\hwyk \LARGE \thesection ~ #1}
\end{tabular}
\arrayrulewidth=0.4pt
}
\definecolor{titlecolor}{rgb}{0.503906,0.503906,0.734375}
\newcommand{\hwyk}{\CJKfamily{cwhbb}}
\titleformat{\chapter}[hang]{\hwyk \LARGE \sf}
{}{0mm}{\hspace{-0.4cm}\mytitle}
\titleformat{\section}[hang]{\hwyk \LARGE \sf}
{}{0mm}{\hspace{-0.5cm}\mysection}
Lyx方程式輸入
由 戴忠淵 於 2011年4月9日星期六
下午5:51 發表
Mac TeXShop上的引用pdf圖形
由 戴忠淵 於 2010年8月15日星期日
下午11:52 發表
Q: 目前手邊的工作是用R語言畫出圖後儲存(pdf檔)在引用pdf圖檔,所以我用了
\usepackage[dvipdfm]{graphicx}
... ...
... ...
\begin{figure}
\centering
\includegraphics[width=0.9\textwidth]{R圖檔名.pdf}
\end{figure}
但是就是沒辦法跑出圖來 囧
Ans: 這邊只能用pdflatex,所以在TeXShop上將編譯器改成pdftex
Step 1.
Step 2.
OK!收工~~
\documentclass[a4paper,11pt]{article}
\usepackage{graphicx}
\usepackage{CJKutf8}
\begin{document}
\begin{CJK}{UTF8}{cwmc}
爬了文跟翻了手邊的教學書還是搞不定
目前手邊的工作是用R語言畫出圖後儲存(pdf檔)
在引用pdf圖檔
\begin{figure}
\centering
\includegraphics[width=0.2\textwidth]{kennydye.pdf}
\end{figure}
\newpage
爬了文跟翻了手邊的教學書還是搞不定
目前手邊的工作是用R語言畫出圖後儲存(pdf檔)
在引用pdf圖檔
\begin{figure}
\centering
\includegraphics[width=0.5\textwidth]{kennydye.pdf}
\end{figure}
\newpage
爬了文跟翻了手邊的教學書還是搞不定
目前手邊的工作是用R語言畫出圖後儲存(pdf檔)
在引用pdf圖檔
\begin{figure}
\centering
\includegraphics[width=0.7\textwidth]{kennydye.pdf}
\end{figure}
\end{CJK}
\end{document}
LaTeX: Sidewaystable in Endfloat
由 戴忠淵 於 2010年1月29日星期五
下午4:58 發表

在LaTeX中同時使用Rotating及Endfloat時,Sidewaystable會造成表格編號錯誤!解決的方法如下:
1. google "efxmpl.cfg",下載並複製到目錄
2. 將"efxmpl.cfg"改名為"endfloat.cfg"
3. 重新compile
收工OK
使用TeX做出Mathematica操作畫面
由 戴忠淵 於 2009年10月6日星期二
下午9:53 發表

為了把Mathematica的講義做到擬真的地步,還真的得花一些時間。下面是Mathematica鐘查詢函數用法的畫面

以下是tex編譯出來的畫面
\begin{mathenv}
\memo{查詢函數N的用法}
\mathin ?N \\ \arrayrulecolor[rgb]{1,0.9,0.7} \cmidrule[7pt]{2-2}
\mathoutquery \\[-25pt]
\mathoutquery \cellcolor[rgb]{1,1,0.9}
N[expr] gives the numerical value of expr. \newline
N[expr,n] attempts to give a result with n-digit precision. \textcolor{blue}{>>} \\
\end{mathenv}

mathematica;教學;pdf mathematica 6教學 mathematica基本教學 mathematica mathematica下載 spss教學網站 spss教學講義下載 spss教學pdf spss教學網 spss教學講義下載 spss教學網站 spss教學下載 spss教學講義 spss教學pdf roc curve spss教學 manova spss教學 spss教學手冊 spss 16教學 automator mac 教學 automator 浮水 box cox spss cwtex linux cwtex ptt cwtex texlive cwtex-linux excel matrix excel 分配圖 excel 畫常態分配圖 excel常態分配 excel常態分配圖 excel畫常態分佈圖 excel畫常態分配圖 google latex 註解 graphicspath latex 路徑 import mathematica integral exp x 2 latex latex 文字和圖片重疊 latex 浮水印 透明度 watermark latex 圖例 latex 圖片文字重疊 latex教學 mac automator mac latex 新增 package mac pdf 浮水印 mac 水印 mac合併pdf mathematica mathematica 8 圖 字 mathematica abs mathematica pso mathematica 字型 mathematica 教學 pdf mathematica 講義 mathematica教學 mathematica講義 norminv vba p-value excel scientific workplace lyx spss string substr spss 幾何平均數 spss 遺漏值 spss教學講義下載 丁吉峰 可愛手寫字體 可愛字體 可愛的字體 如何畫常態分配圖 利用mac automator幫pdf加入浮水印 怎麼合併pdf for mac automator 怎麼畫星星 浮水印 cwtex 留言板 常態分配圖 常態分配圖如何畫 敏感性分析 公式 統計學講義 最小生成樹 華康可愛字體 戴忠淵
Incompatibility between "cline" and the "colortbl" package
由 養花種魚數月亮賞星星 於 2009年9月29日星期二
下午10:27 發表
在LaTeX中使用colortbl和cline套件時,通常會發現框線被顏色擋住,如上圖。這時候要如何解決框線的問題,答案很簡單,就是在各列中再加上一個個空白列。指令如下請參閱。\begin{center}
\begin{tabular}
{|p{2.5cm}|p{3cm}|p{2cm}|p{3cm}|p{4cm}|} \hline
\cellcolor[gray]{.9} 姓名 & 戴忠淵 & \cellcolor[gray]{.9}性別 & 男 & \raisebox{-6.00ex}[0cm][0cm]{} \\[8pt] \cline{1-4}
&&&&\\[-19pt] \cline{1-1}
\cellcolor[gray]{.9} 身份證字號 & T000000000 & \cellcolor[gray]{.9}出生日期 & 民國63年1月10日 & \\[8pt] \cline{1-4}
& \multicolumn{3}{p{9cm}|}{ } &\\[-19pt] \cline{1-1}
\cellcolor[gray]{.9}通訊地址 & \multicolumn{3}{p{9cm}|}{高雄市高雄市高雄市高雄市} &\\[8pt] \cline{1-4}
&&&&\\[-19pt] \cline{1-1}
\cellcolor[gray]{.9}聯絡電話 & (07)0000000 & \cellcolor[gray]{.9}手機 & 0000000000 & \\[8pt] \cline{1-4}
& \multicolumn{3}{p{9cm}|}{ } &\\[-19pt] \cline{1-1}
\cellcolor[gray]{.9} Email & \multicolumn{3}{p{9cm}|}{chungyuandye@gmail.com} &
\\[8pt]
\hline
\end{tabular}
\end{center}
LaTeX在合併列中插入圖片
由 戴忠淵 於 2009年9月19日星期六
上午9:43 發表

用LaTeX做履歷表時,有時候必須在合併列中插入圖片。如果單單用\includegraphics可能導致表格上下列高不一。這時候建議改用picture環境來插入圖片。如此可以不影響原始表格設定,也更美觀。
\begin{picture}(a,b)(c,d)的意思為將此圖形列印在寬度a,高度b的矩型中,圖形座標為(c,d) 。
範例:
\begin{picture}(40,50)(-341,170)
\includegraphics[width=0.25\textwidth]{cydye.eps}
\end{picture}
\begin{center}
\begin{tabular}
{|p{2.5cm}|p{3cm}|p{2cm}|p{3cm}|p{4cm}|} \hline
\par 姓名 & \par 戴忠淵 & \par 性別 & \par 男 & \raisebox{-6.00ex}[0cm][0cm]{} \\[8pt] \cline{1-4}
\par 身份證字號 & \par X987654321 & \par 出生日期 & \par 民國63年1月10日 & \\[8pt] \cline{1-4}
\par 通訊地址 & \multicolumn{3}{p{9cm}|}{高雄市鼓山區太空站8樓} & \\[8pt] \cline{1-4}
\par 聯絡電話 & \par (07)9876543 & \par 手機 & \par 987654321 & \\[8pt] \cline{1-4}
\par e-mail & \multicolumn{3}{p{9cm}|}{chungyuandye@gmail.com} & \\[8pt] \hline
\end{tabular}
\end{center}
\section{學歷}
\begin{center}
\begin{tabular}
{|p{4cm}|p{4cm}|p{2cm}|p{5cm}|} \hline
\rowcolor[gray]{.9}\par 學校名稱 & \par 主修學門系所 & \par 學位 & \par 起訖年月 \\[8pt] \hline
\par 淡江大學 & \par 管理科學研究所 & \par 博士 & \par 民國86年9月$\sim$90年1月 \\[8pt] \hline
\par 淡江大學 & \par 管理科學研究所 & \par 碩士 & \par 民國84年9月$\sim$86年6月 \\[8pt] \hline
\par 國立台灣海洋大學 & \par 航運管理系 & \par 學士 & \par 民國80年10月$\sim$84年6月 \\[8pt] \hline
\end{tabular}
\end{center}
結果:

使用Mathematica做批次轉檔
由 養花種魚數月亮賞星星 於 2009年9月15日星期二
下午7:51 發表

由於在做講義的過程中,需要很多螢幕抓圖,所以我一直很積極的在找可以將螢幕抓的圖直接存成EPS格式的檔案。在Mac中想要把螢幕抓圖的檔案存成pdf檔很容易,但是要轉成EPS檔就有麻煩。當然如果你不排斥要$$的軟體,那倒是很多~
到目前為止,我認為最方便的是Inkscape,但是要一張一張轉,真的讓人很無力。由於我已經利用國科會買了Mathematica,所以就讓Mathematica來效勞。
首先先設定圖檔儲存的目錄,假設目錄的絕對路徑是 ~/test
SetDirectory["~/test"];
輸出test目錄下所有圖形檔的檔名
data = FileNames["*.JPG" | "*.jpg"]
將圖形檔轉成EPS格式
Export[StringReplace[#,"jpg"|"JPG"->"eps"],Import[#]]&/@data
轉檔真的就是那麼容易~~當然其他格式間的轉換也是沒問題!
MacTeX 2008 讓CJK產生的PDF bookmarks不會有亂碼
由 戴忠淵 於 2009年9月8日星期二
上午12:10 發表
如果是MacTeX 2008的話,請在LaTeX的前文設定如下:% PDF文件属性設定
\usepackage[T1]{fontenc}
\usepackage[dvipdfm, unicode=true, bookmarksnumbered=true]{hyperref}
\hypersetup{pdfauthor={},
pdftitle={Mathematica},
pdfsubject={Mathematica},
pdfkeywords={CJK,LaTeX, Mathematica},
pdfstartview=FitH,
pdfpagemode=UseOutlines,
bookmarks=true,
colorlinks=true,
linkcolor=black,
citecolor=black
}
如果是使用MacTeX 2007,那請參照這一篇文章的設定
讓CJK產生的PDF bookmarks不會有亂碼
LaTeX連續引用
由 戴忠淵 於 2009年8月27日星期四
下午5:37 發表
在文中想連續引用多篇文章,可以使用natbib這個Package
首先在前文的地方加入
\usepackage[numbers,sort&compress]{natbib}
之後在引用參考文獻時將文獻一起加入,latex 會自己判斷需不需要加連接線,例如: \citep{San1,San2,San3,San4}。

繼續閱讀全文 LaTeX連續引用
首先在前文的地方加入
\usepackage[numbers,sort&compress]{natbib}
之後在引用參考文獻時將文獻一起加入,latex 會自己判斷需不需要加連接線,例如: \citep{San1,San2,San3,San4}。

LaTeX 快速多行註解
由 養花種魚數月亮賞星星 於 2009年7月9日星期四
下午2:40 發表

LaTeX 快速多行註解
在排版LaTeX時,某些內容可能食之無味,棄之可惜。多行註解要一行一行手動 % 實在不方便,
這時候有個comment的package可以使用,在前文加上\usepackage{comment}
要註解的文字前後分別加上 \begin{comment} \end{comment} 即可。
如果你是Mac的實用者,那在TeXShop中只要使用快速鍵就可以完成註解的動作:
註解:cmd+shift+[
不要註解:cmd+shift+]
統計分析講義-第三版
由 養花種魚數月亮賞星星 於 2008年9月13日星期六
下午11:48 發表
這是我為樹德科技大學經營管理研究所多變量分析以及EMBA統計分析所編寫的統計分析講義。這次的修改只是小幅度的修改,我增加了一些不會太難的數學證明還有SPSS沒有提供分析的一些程式。我想這應該是這本講義最後一次的改版,所以我將這本講義的原始檔提供給大家,希望有興趣的人也能一起來編寫這本講義,讓講義的內容更豐富!講義的source檔我放在下面的網址:
http://www.pws.stu.edu.tw/cydye/Stat.zip
如果你有為這本講義新增一些內容,希望也能夠讓大家分享!如果你只是想要看看這本講義的內容,那將source檔抓回去,解壓縮後裡面的pdf檔就是講義的原稿。
繼續閱讀全文 統計分析講義-第三版
http://www.pws.stu.edu.tw/cydye/Stat.zip
如果你有為這本講義新增一些內容,希望也能夠讓大家分享!如果你只是想要看看這本講義的內容,那將source檔抓回去,解壓縮後裡面的pdf檔就是講義的原稿。
Lyx with CJK-LaTeX on Leopard
由 養花種魚數月亮賞星星 於 2008年7月15日星期二
上午12:10 發表
lyx 教學 mac使用LyX來編排LaTeX文件,快速又方便!
首先字型的安裝部分,可參考政大應數蔡老師的網站教學方式安裝cwtex字型。安裝完後有五種字型可以交替使用:
- 明體: cwmc, cwmb
- 楷書: cwkc, cwkb
- 仿宋體: cwfsc, cwfsb
- 粗黑體: cwhbc, cwhbb
- 圓體: cwyc, cwyb

設定紙張大小:一般以『A4』為主,將頁面模式選擇『美化』
語言配置:將語言調整成『繁體中文』,並選擇以『UTF8』編碼方式
LaTeX前文:將一般所需的套件及文稿設定輸入,以我為例,我的設定方式為\usepackage{amssymb,amsmath,amsthm}
\usepackage[dvipdfm]{graphicx}
% PDF文件属性設定
\usepackage[T1]{fontenc}
\usepackage[dvipdfm, CJKbookmarks, bookmarksnumbered=true]{hyperref}
\hypersetup{pdfauthor={戴忠淵},
pdftitle={統計分析},
pdfsubject={統計分析},
pdfkeywords={CJK,LaTeX,統計分析},
pdfstartview=FitH,
pdfpagemode=UseOutlines,
bookmarks=true,
colorlinks=true,
linkcolor=black,
citecolor=black }
%讓中文書籤不會亂碼
\AtBeginDvi{\special{pdf:tounicode UTF8-UCS2}}
%以明體為預設字型
\CJKencfamily{UTF8}{cwmc}
其中cwmc為所使用的預設字型。為了使以後能方便使用,可將這些設定設為預設範本。
大功告成,可以開始來編排文件了。文件輸出的方式有很多,可以輸出成tex檔,也可輸出成pdf檔。若要檢視輸出之pdf檔,則只要在工具列上『檢視』的地方選擇PDF(dvipdfm)即可。
文件輸出畫面如下:

此外,LyX也可以作為Mathematica、Maxima或Maple的前端程式。設定的方式僅需將程式的路徑加入PATH中,再執行Reconfigure即可。


Reconfigure後,切記需重新執行程式。要做符號運算,執行『編輯』→『數學』→『使用電腦代數系統』→『你所安裝的程式』即可。

輸出畫面如下:

如果你有使用過Scientific WorkPlace,那你應該會覺得很類似才對。














