顯示具有 Tex 標籤的文章。 顯示所有文章
顯示具有 Tex 標籤的文章。 顯示所有文章

2011年10月6日 星期四

2011年9月22日 星期四

[Tex] package (Tikz)


package (Tikz)



\begin{tikzpicture}[every node/.style=draw]

\tikzstyle{every node}=[draw,shape=rectangle];



\node(Template) {Template};

\node[inner sep=5pt,right=0.5cm of Template ] (www) {www};

\node[inner sep=5pt,above=0.5cm of www] (project) {project};

\node[inner sep=5pt,right=0.5cm of www] (resource) {resource};

\node[inner sep=5pt,right=0.5cm of resource] (handler) {handler};

\draw [->] (Template.east) -- (www.west)   node [midway,above,draw=none] { (1) };

\draw [->] (project.south) -- (www.north)  node [midway,right,draw=none] { (2) } ;

\draw [->] (www.east) -- (resource.west) node [midway,above,draw=none] { (3) };

\draw [->] (resource.east) -- (handler.west) node [midway,above,draw=none] { (4) };

\end{tikzpicture}



 



pgfmanual - book

2011年9月18日 星期日

[Latex] tikz draw picture


\usepackage{tikz}



\begin{tikzpicture}[scale=2.5]

\tikzstyle{every node}=[draw,shape=rectangle];

\path (0:0cm) node (Template) {a.Template};

\path (0:1cm) node (www) {b.www};

\path (0:2cm) node (resource) {c.resource};

\draw [->] (Template) to (www);

\draw [->] (www) to (resource);

\end{tikzpicture}

2011年9月16日 星期五

[TEX] How to use \lstset


\lstset{

       keywordstyle=\color{RedViolet},

       basicstyle=\tiny\sffamily,

       columns=fullflexible,

       commentstyle=\color{blue}\textit,

       comment=[l]{//},

       morecomment=[s]{/*}{*/},

       %morecomment=[l]{//},

       morecomment=[l]{//},

       morecomment=[s]{/*}{*/},

       morecomment=[l][\color{darkgray}]{+},

       morecomment=[l][\color{red}]{-},

       numberstyle=\tiny,

       %extendedchars=true,

       breaklines=true,

       frame=b,

       numbers=left,

       numberstyle=\tiny,

       stepnumber=1,

       numbersep=5pt,

       %xleftmargin=3pt,

       %xrightmargin=3pt,

       framextopmargin=10pt,

       %framexleftmargin=17pt,

       %framexrightmargin=5pt,

       %framexbottommargin=4pt,

       stringstyle=\color{red}\textit,

       morestring=[s]{<****}{****>},

        morestring=[b],

        %morestring=[b]",

       belowskip=10pt,

       belowskip=10pt

       }




       % l command must like

       % morecomment=[l][\color{green}]{<green}

       % s command must like

       % morecomment=[s][\color{green}]{<green}{>}

2011年9月13日 星期二

[TEX] lstset


%\lstset{ %

%basicstyle=\tiny,       % the size of the fonts that are used for the code

%breaklines=true,

%}

%

%\lstset{

% basicstyle=\tiny,

% numbers=left,

% numberstyle=\tiny,

% stepnumber=1,

% numbersep=5pt,

% backgroundcolor=\color{white},

% showspaces=false,

% showstringspaces=false,

% showtabs=false,

% tabsize=2,

% captionpos=b,

% breaklines=true,

% breakatwhitespace=true,

% breakautoindent=true,

% escapeinside={\%}{)},

% linewidth=\huge

% }





\lstset{

       % keywordstyle=\color{RedViolet},

       basicstyle=\small\sffamily,

       columns=fullflexible,

       commentstyle=\color{Gray}\textit,

       numberstyle=\tiny,

       %extendedchars=true,

       breaklines=true,

       frame=b,

       numbers=left,

       numberstyle=\tiny,

       stepnumber=1,

       numbersep=5pt,

       %xleftmargin=3pt,

       %xrightmargin=3pt,

       framextopmargin=10pt,

       %framexleftmargin=17pt,

       %framexrightmargin=5pt,

       %framexbottommargin=4pt,

       morecomment=[l]{//},

       stringstyle=\color{DarkGray}\textit,

       belowskip=10pt,

       belowskip=10pt

}



 



Reference :




  1. Cool code listings in LaTex

2011年9月10日 星期六

2011年9月3日 星期六

2011年8月26日 星期五

[tex][code] Article have code inside


\usepackage{color}
\usepackage{listings}
\lstset{ %
language=C++, % choose the language of the code
basicstyle=\footnotesize, % the size of the fonts that are used for the code
numbers=left, % where to put the line-numbers
numberstyle=\footnotesize, % the size of the fonts that are used for the line-numbers
stepnumber=1, % the step between two line-numbers. If it is 1 each line will be numbered
numbersep=5pt, % how far the line-numbers are from the code
backgroundcolor=\color{white}, % choose the background color. You must add \usepackage{color}
showspaces=false, % show spaces adding particular underscores
showstringspaces=false, % underline spaces within strings
showtabs=false, % show tabs within strings adding particular underscores
frame=single, % adds a frame around the code
tabsize=2, % sets default tabsize to 2 spaces
captionpos=b, % sets the caption-position to bottom
breaklines=true, % sets automatic line breaking
breakatwhitespace=false, % sets if automatic breaks should only happen at whitespace
escapeinside={\%}{)} % if you want to add a comment within your code
}




\begin{lstlisting}

place your source code here

\end{lstlisting}



The other possibility is to directly include the source file:



\lstinputlisting{filename.java}



Reference :



[tex][pic][template] pic template 201108270809


\documentclass[12pt]{article}



\usepackage{graphicx}



\usepackage{subfigure}



\begin{document}



\begin{figure}[ht]



\begin{center}



\mbox{



\subfigure[]{\includegraphics[height= 4.4cm]{1}}



\subfigure[]{\includegraphics[height= 4.4cm]{1}} }



\caption{}



\end{center}



\end{figure}



\setcounter{subfigure}{0}



\begin{figure}[ht]



\begin{center}



\subfigure[]{\includegraphics[width= 5.4cm]{1}}



\subfigure[]{\includegraphics[width= 5.4cm]{1}}



\subfigure[]{\includegraphics[width= 3.4cm]{1}}



\end{center}



\end{figure}



\end{document}


[tex][pic][template] pic template


\documentclass[12pt, a4paper]{article}

\oddsidemargin=-1cm %%更改版面

\topmargin =-2cm

\footskip = 5cm

\usepackage{graphicx}%----要加入這個才有圖型的效果----%

\newcommand{\pic}{d:/cwtex/note/201108/20110825/20110825PIC/add_device_using_PIN_method/} %圖片檔放置的目錄



\begin{document}



Must Support 4-digit PIN (ok) \\

\includegraphics[width=1.2\textwidth]{\pic{1}}



\end{document}


2011年8月23日 星期二

2011年7月27日 星期三

[tex] equation number is one , how to reference it


\documentclass[12pt,a4paper]{article}

\renewcommand{\figurename}{圖}

\usepackage[dvips]{graphicx}



\begin{document}



\begin{equation}\label{weight_value}

w(i,j)= \left\{

\begin{array}{lll}

0 & \mbox{(i=j)}\\[2pt]

\frac{1}{H(i,j)} &\mbox{(i $\neq$ j, AP(i) and AP(j) are adjacent)}\\[2pt]

\infty & \mbox{(AP(i) and AP(j) are not adjacent)}

\end{array}\right.

\end{equation}

%\left\{ 這個要和 \right. 配合 這裡要有一個點 \end{equation}








呈現依w(i,j).eq (\Z\ref{weight_value}) 秀出權重值在ap(i)和ap(j)之間.



%如果第一次compile,有出現??.那麼請在compile第二次,3q.

\end{document}

[tex] 行距


\documentclass[12pt,a4paper]{article}

\begin{document}

%欲更改全文之行距,有幾個方法。譬如,若行距要放大為內定值之1.15倍,可使用以下的指令%

%\renewcommand{\baselinestretch}{1.15}%



%\linespread{1.15}%

%以上之指令將把全文之行距通通放大為原來的1.15倍%



%以上指令把行距放大為某一倍數。

%以上都是把指令放在\begin{document}之前





%以下都是把指令放在\begin{document}之後

%如果全文之行距要改為某一數值,可使用%

%下列指令:%

%\setlength{\baselineskip}{15pt}%





%\setlength{\baselineskip}{15pt}

%如果希望它即時產生效果,我

%們可以在指令之後加上\small\normalsize, 其功能是把字體縮小一級之後, 又

%立刻回復原來大小。因為字級已變更,行距指令即可發揮作用。%



%本例之\documentclass指令選擇以12pt之字體排版,此一選項同時也選定

%了行距大小。LATEX 之設計是以英文為對象, 內定之行距較小, 對中文並不適用。

%因此,排版中文稿時,我們須重新設定行距。第7行指令:

%\fontsize{12}{20pt}\selectfont

%選定字體為12pt,行距為20pt。1pt等於1/72.27吋,故20pt約為0.7公分。





%排版時, 條列項目將自成一個區域, 上下多留出一點空白, 各項目之間距也

%比正常行距稍大;

%\begin{enumerate}\itemsep=-2pt, 即

%設定使項目之間距比內定值小2pt。





%{\Large \ctxfbb 排版的原則}\\[5mm]

%緊接著的[5mm] 則設定行距加大0.5公分。





%\fontsize 指令。此一指令同時變更字體點數與行距。假設要選用14.4點字體,而行距要變成20點,指令為:

%\fontsize{14.4}{20pt plus.4pt minus.3pt}\selectfont

%第一個大括號內之14.4選用14.4點字體;第二個大括號內之數字選定行距為20點,其後為行距調整之伸縮彈性正0.4點與負0.3點。

%如果選擇版面高度為310點(pt), 而行距為20點, 則版面上可排入15行, 但第16行擠不進去。因此, 行距指令中若加入伸縮彈性, 則實

%際之行距可以因應版面高度而略作改變, 這有助於latex 程式調整出最佳行距。

%不過, 行距之伸縮彈性也不宜太大, 否則每一頁版面之行距可能大小不一, 版面

%看起來的感覺並不好



{\setlength{\textwidth}{100cm}

如果希望它即時產生效果,我

們可以在指令之後加上 其功能是把字體縮小一級之後, 又

立刻回復原來大小。因為字級已變更,行距指令即可發揮作用。

如果希望它即時產生效果,我

們可以在指令之後加上 其功能是把字體縮小一級之後, 又

立刻回復原來大小。因為字級已變更,行距指令即可發揮作用。

立刻回復原來大小。因為字級已變更,行距指令即可發揮作用。

如果希望它即時產生效果,我

們可以在指令之後加上

}

\small\normalsize

其功能是把字體縮小一級之後, 又

立刻回復原來大小。因為字級已變更,行距指令即可發揮作用。

立刻回復原來大小。因為字級已變更,行距指令即可發揮作用。

如果希望它即時產生效果,我

們可以在指令之後加上 其功能是把字體縮小一級之後, 又

立刻回復原來大小。因為字級已變更,行距指令即可發揮作用。

立刻回復原來大小。因為字級已變更,行距指令即可發揮作用。

如果希望它即時產生效果,我

們可以在指令之後加上 其功能是把字體縮小一級之後, 又

立刻回復原來大小。因為字級已變更,行距指令即可發揮作用。





\end{document}

[tex] make a menu


% example4.tex

\documentclass{report}

\title{Aesop Fables}

\author{Aesop\thanks{Thanks to the reader.}

\and Nobody\thanks{Thanks to nobody}}

\date{\today}

\begin{document}

\maketitle

\tableofcontents %多加入這一行

\chapter{Aesop Fables}

\section{The Ant and the Dove}



\end{document}







這裡千萬要注意的是,\tableofcontents 要加在 \maketitle 的後面,否則目錄會印在 title page 之前。而且要編譯兩次。第一次產生 example4.toc,然後第二次編譯再跟據這個 toc 檔,真正編入目錄。





在 LaTeX 文稿內,\tablofcontents 可以排版一般的章節目錄。\listoffigures 指令可以排版圖目錄,\listoftables 指令則可排版表目錄。





11.1.3 額外的目錄

這是指沒有編入目錄,但想自行加進去的情形,例如:章節指令使用了星號就不會編號,圖表目錄沒有使用 \caption 指令,也不編入目錄了,這時我們可以使用 \addcontentsline 指令來把他們手動加進去。我們來看看文圖表的三種不同情況:





\addcontentsline{toc}{章節名}{標題}

\addcontentsline{lof}{figure}{標題}

\addcontentsline{lot}{table}{標題}



這樣就會把這些納入目錄,但是,這還是沒有編號的。目錄中所顯示的頁數,就是這些指令(圖表)所在的頁數。




[tex] 縮排


4.1.2 關於縮排

第一行縮排了!這是因為我們完全沒有分章節,所以,LaTeX 就把這些內容當做是引言的部份,依 LaTeX 的安排,引言開頭是會縮排的。要解決這個問題,可有兩種方法:





在第一行之前加入 \noindent 來指示 LaTeX 不要去縮排。但是這只作用在下指令的地方,其他該縮排的地方還是會縮排。

在 preamble 區加入 \parindent=0pt,這表示讓全文的縮排為 0pt,當然,這就表示全文都不要縮排了。

[tex] font size


\documentclass[12pt,a4paper]{article}

\begin{document}

%欲更改全文之行距,有幾個方法。譬如,若行距要放大為內定值之1.15倍,可使用以下的指令%

%\renewcommand{\baselinestretch}{1.15}%



%\linespread{1.15}%

%以上之指令將把全文之行距通通放大為原來的1.15倍%



%以上指令把行距放大為某一倍數。

%以上都是把指令放在\begin{document}之前





%以下都是把指令放在\begin{document}之後

%如果全文之行距要改為某一數值,可使用%

%下列指令:%

%\setlength{\baselineskip}{15pt}%





%\setlength{\baselineskip}{15pt}

%如果希望它即時產生效果,我

%們可以在指令之後加上\small\normalsize, 其功能是把字體縮小一級之後, 又

%立刻回復原來大小。因為字級已變更,行距指令即可發揮作用。%



%本例之\documentclass指令選擇以12pt之字體排版,此一選項同時也選定

%了行距大小。LATEX 之設計是以英文為對象, 內定之行距較小, 對中文並不適用。

%因此,排版中文稿時,我們須重新設定行距。第7行指令:

%\fontsize{12}{20pt}\selectfont

%選定字體為12pt,行距為20pt。1pt等於1/72.27吋,故20pt約為0.7公分。





%排版時, 條列項目將自成一個區域, 上下多留出一點空白, 各項目之間距也

%比正常行距稍大;

%\begin{enumerate}\itemsep=-2pt, 即

%設定使項目之間距比內定值小2pt。





%{\Large \ctxfbb 排版的原則}\\[5mm]

%緊接著的[5mm] 則設定行距加大0.5公分。





%\fontsize 指令。此一指令同時變更字體點數與行距。假設要選用14.4點字體,而行距要變成20點,指令為:

%\fontsize{14.4}{20pt plus.4pt minus.3pt}\selectfont

%第一個大括號內之14.4選用14.4點字體;第二個大括號內之數字選定行距為20點,其後為行距調整之伸縮彈性正0.4點與負0.3點。

%如果選擇版面高度為310點(pt), 而行距為20點, 則版面上可排入15行, 但第16行擠不進去。因此, 行距指令中若加入伸縮彈性, 則實

%際之行距可以因應版面高度而略作改變, 這有助於latex 程式調整出最佳行距。

%不過, 行距之伸縮彈性也不宜太大, 否則每一頁版面之行距可能大小不一, 版面

%看起來的感覺並不好



{\setlength{\textwidth}{100cm}

如果希望它即時產生效果,我

們可以在指令之後加上 其功能是把字體縮小一級之後, 又

立刻回復原來大小。因為字級已變更,行距指令即可發揮作用。

如果希望它即時產生效果,我

們可以在指令之後加上 其功能是把字體縮小一級之後, 又

立刻回復原來大小。因為字級已變更,行距指令即可發揮作用。

立刻回復原來大小。因為字級已變更,行距指令即可發揮作用。

如果希望它即時產生效果,我

們可以在指令之後加上

}

\small\normalsize

其功能是把字體縮小一級之後, 又

立刻回復原來大小。因為字級已變更,行距指令即可發揮作用。

立刻回復原來大小。因為字級已變更,行距指令即可發揮作用。

如果希望它即時產生效果,我

們可以在指令之後加上 其功能是把字體縮小一級之後, 又

立刻回復原來大小。因為字級已變更,行距指令即可發揮作用。

立刻回復原來大小。因為字級已變更,行距指令即可發揮作用。

如果希望它即時產生效果,我

們可以在指令之後加上 其功能是把字體縮小一級之後, 又

立刻回復原來大小。因為字級已變更,行距指令即可發揮作用。





\end{document}

[tex][pic] pic & reference pic


\documentclass[12pt,a4paper]{article}

\renewcommand{\figurename}{圖}

\usepackage[dvips]{graphicx}%----要加入這個才有圖型的效果----%



\begin{document}





\begin{figure}[h]

\centering

\includegraphics[width=0.6\textwidth]{pic1.jpg}

\caption{蜂巢式架構}

\label{pic}

\end{figure}



.圖\Z\ref{pic}

\end{document}