日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Latex论文排版技巧再总结

發布時間:2025/3/21 编程问答 15 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Latex论文排版技巧再总结 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

1、Q:幾個作者同時共享機構地址,怎么搞?

A:拿ACM的模版為例,

Yes, and we suggest you do the following...

Insert this piece of coding just before the

\begin{document}

like so...?

%
\def\sharedaffiliation{%
\end{tabular}
\begin{tabular}{c}}
%
\begin{document}

and then adjust your particular 'author block' like so (example shown for 3 authors)...

\title{Alternate {\ttlit ACM} SIG Proceedings Paper in LaTeX
Format\titlenote{(Produces...}}

\numberofauthors{3}
% Three authors sharing the same affiliation.
??? \author{
????? \alignauthor Ben King\\
????? \email{king@cs.berkeley.edu}
%
????? \alignauthor Georgia Tobin\\
????? \email{tobin@cs.berkeley.edu}
%
????? \alignauthor Gerald Murray\\
????? \email{murrray@cs.berkeley.edu}
%
????? \sharedaffiliation
????? \affaddr{Department of Electrical Engineering and Computer Science }? \\
????? \affaddr{University of California, Berkeley }?? \\
????? \affaddr{Berkeley, CA 94720-1776 }
????????? }
%
\maketitle

When compiled/previewed/rendered, this is the effect:

?

2、Latex如何正確輸入引號?

答:Tab鍵上方(1鍵左邊)的那個鍵,按兩下,輸入··,然后輸入兩個單引號'', 就是左右雙引號了。單引號同理啊。

3、如何使得雙欄文檔保持底部對齊?特別是參考文獻

在LATEX 標準文檔類中使用twocolumn 選項產生雙欄格式文檔的時候,如果一頁的內容不足以排滿頁
面時, LATEX 的結果是先排滿左欄,然后再排版右欄。這樣就造成了兩欄的長度不相等,底部不齊。很多
時候我們不希望這種排版結果。
這個問題只有在用標準文檔類的twocolumn 模式的時候才會遇到,使用multicol 宏包就可以避免這個
問題(參見問題36 )。但是multicol 宏包也有一些缺點,例如不允許單欄的浮動對象(參見問題56 )。
要使標準文檔類的twocolumn 模式下也能做到雙欄底部對齊,可以通過手工調整分欄的位置。在
twocolumn 模式下\newpage 命令使LATEX 開始在新的一欄上排版,如果單前欄是左欄,就換到右欄上開始
排版。在合適的地方使用\newpage 命令可以使得雙欄底部對齊(注意,不能用\clearpage 命令,這個命
令會開始在新的一頁上排版,而不管當前在哪一欄上)。幾乎沒有人愿意使用這種方法,不僅因為它需要
你手工計算需要插入命令的位置,每次改動文檔都有可能需要變動\newpage 命令的位置,而且對于一些自
動生成的文檔內容(例如參考文獻和索引),要插入\newpage 命令十分困難。
°ushend 宏包通過修改LATEX 核心定義來解決這個問題。使用它提供的\flushend 命令可以使得雙欄底
部對齊,而\raggedend 命令則取消底部對齊。\flushend 命令會在宏包裝入的時候自動運行。°ushend 宏
包只對文檔最后一頁有效,也就是說所有中間的強制換頁,或者章節的自動換頁導致的雙欄底部不齊現象
都無法解決。
balance 宏包是另外一個更好的方法。它比balance 更加完善,而且對整個文檔的任何位置都有
效。balance 宏包提供了\balance 命令來打開雙欄底部對齊機制, \nobalance 命令來關閉這個機制。和
°ushend 宏包不同,它在裝入的時候缺省不打開對齊機制,因此需要在文檔中加入\balance 命令來啟用底
部對齊。
在使用這些宏包的時候需要注意,單欄的浮動對象有可能破壞這些宏包的對齊機制。這種時候需要手
工調整浮動對象的位置來改善排版效果。這也是multicol 宏包不支持單欄浮動對象的原因之一。

4、Latex怎么對算法進行排版?

排版可能需要的包:

\usepackage{algorithm}?????????????? //format of the algorithm

\usepackage{algorithmic}???????????? //format of the algorithm

\usepackage{multirow}??????????????? //multirow for format of table

\usepackage{amsmath}

\usepackage{xcolor}

\DeclareMathOperator*{\argmin}{argmin}???????? //argmin或argmax公式的排版

\renewcommand{\algorithmicrequire}{\textbf{Input:}}?? //Use Input in the format of Algorithm

\renewcommand{\algorithmicensure}{\textbf{Output:}}? //UseOutput in the format of Algorithm

排版圖片可能需要的包:

\usepackage{graphics}

\usepackage{graphicx}

\usepackage{epsfig}

算法的排版舉例:

\begin{algorithm}[htb]???????? %算法的開始

\caption{ Framework of ensemble learning for our system.}???????????? %算法的標題

\label{alg:Framwork}????????????????? %給算法一個標簽,這樣方便在文中對算法的引用

\begin{algorithmic}[1]??????????????? %不知[1]是干嘛的?

\REQUIRE ~~\\????????????????????????? %算法的輸入參數:Input

??? The set of positive samples for current batch, $P_n$;\\

??? The set of unlabelled samples for current batch, $U_n$;\\

??? Ensemble of classifiers on former batches, $E_{n-1}$;

\ENSURE ~~\\?????????????????????????? %算法的輸出:Output

??? Ensemble of classifiers on the current batch,? $E_n$;

\STATE Extracting the set of reliable negative and/or positive samples $T_n$ from $U_n$? with help of $P_n$; \label{code:fram:extract}????? %算法的一個陳述,對應算法的一個步驟或公式之類的; \label{ code:fram:extract }對此行的標記,方便在文中引用算法的某個步驟

\STATE Training ensemble of classifiers $E$ on $T_n \cup P_n$, with help of data in former batches; \label{code:fram:trainbase}

\STATE $E_n=E_{n-1}\cup E$; \label{code:fram:add}

\STATE Classifying samples in $U_n-T_n$ by $E_n$; \label{code:fram:classify}

\STATE Deleting some weak classifiers in $E_n$ so as to keep the capacity of $E_n$; \label{code:fram:select}

\RETURN $E_n$;??????????????? %算法的返回值

\end{algorithmic}

\end{algorithm}

排版效果圖:

?

在文中對算法和算法的某個步驟的引用:Therefore, in step?????of algorithm????, we extract $T_n$, a set of reliable negative samples

1、? For和While循環語句的排版舉例

(1)?????? 排版效果圖

?

(2)?????? 排版代碼

\begin{algorithm}[h]

??? \caption{An example for format For \& While Loop in Algorithm}

??? \begin{algorithmic}[1]

??????? \FOR{each $i\in [1,9]$}

??????????? \STATE initialize a tree $T_{i}$ with only a leaf (the root);\\

??????????? \STATE $T=T\bigcup T_{i};$\\

??????? \ENDFOR

????????

??????? \FORALL {$c$ such that $c\in RecentMBatch(E_{n-1})$} \label{code:TrainBase:getc}

??????????? \STATE? $T=T \cup PosSample(c)$; \label{code:TrainBase:pos}

??????? \ENDFOR;

????????

??????? \FOR{$i=1$; $i<n$; $i++$ }

??????????? \STATE $//$ Your source here;

??????? \ENDFOR

????????

??????? \FOR{$i=1$ to $n$}

??????????? \STATE $//$ Your source here;

??????? \ENDFOR

????????

??????? \STATE? $//$ Reusing recent base classifiers. \label{code:recentStart}

??????? \WHILE {$(|E_n| \leq L_1 )and( D \neq \phi)$}

??????????? \STATE? Selecting the most recent classifier $c_i$ from $D$;

??????????? \STATE? $D=D-c_i$;

??????????? \STATE? $E_n=E_n+c_i$;

??????? \ENDWHILE \label{code:recentEnd}

????????

??? \end{algorithmic}

\end{algorithm}

5、圖片或者表格的里是有標記腳注的“1”和“2”了,但是頁面下沒有腳注……

答案:[一]??? 在tabular 環境中添加腳注,不能簡單地使用\footnote{……}。應該在要添加腳注的地方使用\footnotemark[n]標記,其中n表示腳注的編號; 在tabular環境外則用\footnotetext[n]{……}填入腳注內容,注意這里的[n]應該與表格中的\footnotemark中的 [n]一一對應。
示例:

\begin{tabular}{|c|c|c|}?
\hline?
類型名稱&占用空間&表示范圍\?
\hline?
real&6字節\footnotemark[3]&.9?\times?10^{-39}?\sim?1.7?\times?10^{38}$\?
\hline?
single&4字節&.5?\times?10^{-45}?\sim?3.4?\times?10^{38}$\?
\hline?
double&8字節&.0?\times?10^{-324}?\sim?1.7?\times?10^{308}$\?
\hline?
extended&10字節&.4?\times?10^{-4932}?\sim?1.1?\times?10^{4932}$\?
\hline?
\end{tabular}

\footnotetext[3]{在~Free Pascal~中,real~類型可以自動轉換成~single~或~double~類型,所以占用的空間大小也不固定。}
[二]使用\footnotemark在表格中插入腳注符號,然后在表格外面使用\footnotetext命令寫入腳注文字。如果在表格中多次使用了\footnotemark,在表格外面需要使用\addtocounter和stepcounter命令為每個腳注寫入文字。參考下面的代碼:Reference

?

begin{footnotesize}

\begin{table}[htbp]?
\centering?
\renewcommand{\baselinestretch}{1.5}?
\fontsize{9pt}{9pt}\selectfont?\caption{Test?results}?
\begin{tabular}{c?@{}?c??c??c??c?@{}?c?@{}?c?@{}?c?}?
\hlinewd{1.5pt}?
Test?No.?????&?Liner????&?Target?????&?\multicolumn{2}{c}{Cumulative?damage}??&?Diameter?of?&?Hit?density?around??&?Ejection?angle?\\?
?????????????&?angle????&?distance???&?\multicolumn{2}{c}{region?(ellipse)}???&?the?dense???&?the?cumulative??????&?of?fragment?in?\\?
\cline{4-5}??&?/degree??&?/m?????????&?Major?axis????&?Minor?axis?????????????&?fragment????&?damage?region???????&?the?focused????\\?
?????????????&??????????&????????????&?/mm???????????&?/mm????????????????????&?region/mm???&?/(pieces/m$^{2}$)???&?region/degree??\\?
\hlinewd{0.75pt}?2001-6-5-1&?10&?1&?185&?150&?525&?1017(9100?in?
the?hole)\footnotemark?&?9.5?\\?
2001-6-5-2&?10&?2&?160&?155&?360&?1565\footnotemark?&4.5?\\?
2001-6-5-3&?20&?3&?150&?110&?210&?3443&4.0?\\?
2001-6-6-1&?20&?5.25&?122&?70&?235&?3708&2.5?\\?
2001-6-6-2&?30&?4&?96&?82&?290&?3633&4.1?\\?
2001-6-6-3&?30&?6&?78&?47&?320&?3385&3.1?\\?
\hlinewd{1.5pt}?
\end{tabular}?
\label{Tab:2.1}?
\end{table}

\end{footnotesize}

\addtocounter{footnote}{-1} \footnotetext{Since the distance was
only 1m, almost all the fragments hit the target, so that the hit
density of that test in the cumulative damage region can be
estimated.} \stepcounter{footnote}\footnotetext{1565.}?
? 6、如何生成固定寬度的表格?

在LATEX 中生成固定寬度的表格有兩種方法,一種是通過擴展列之間的空隙,另一種是擴展某些指定
的列。
第一種方法通過tabular* 環境來實現。在tabular* 環境的第一個參數中指定表格的總寬度,然后在
表格的列格式參數中使用\extracolsep 命令來增加列之間的空隙。

\begin{tabular*}{5cm}{@{\extracolsep{\fill}}lllr}?
\hline?
1?&?2?&?3?&?4?\\?
21?&?22?&?23?&?24?\\?
\hline?
\end{tabular*}

如圖:


這種方法的一個缺點是列之間如果加入分隔符,則列之間的空隙是放在下一列的左邊而不是在兩列之間平
均分配。我們來看上面的例子加入分隔符后的樣子
\begin{tabular*}{5cm}
{@{\extracolsep{\fill}}|l|l|l|r|}
\hline
1 & 2 & 3 & 4 \\
21 & 22 & 23 & 24 \\
\hline
\end{tabular*}

效果圖:


另一種方法可以通過使用tabular 環境的列格式參數之一ph寬度i 來指定相應列的固定寬度。這種方法
需要用戶手工計算分配每個列的具體寬度。另外,由于p 參數不能和其他控制對齊方式的參數同時作用在
一個列上,因此需要使用額外的方法來控制這些列的對齊方式(參見問題53 )。
tabularx 宏包提供了一個自動計算分配列寬度的表格環境tabularx 。這個環境的使用方法和tabular*
相同。不同之處在于它增加了一個X 參數。所有使用X 參數的列會平均分配多余的空間,然后轉換為p
參數來指定列的寬度。該宏包也提供了方法讓你可以指定如何轉換或者轉換為其他的列參數。該宏包需要
array 宏包的支持。
ltxtable 宏包則結合了longtable 和tabularx 宏包的特點。但是它的用法有點復雜,請仔細閱讀它的文
檔。

7、關于論文最后參考文獻 兩欄對齊,長度一樣的問題?

答:\usepackage{balance}

拿ACM的論文模板為例:

\bibliographystyle{abbrv}
\balance
\bibliography{sigproc}
====================

1、Latex排版工作室:http://blog.sina.com.cn/wangzhaoli11

2、冰河的博客:http://www.icyhe.com


from:?http://blog.csdn.net/lishoubox/article/details/7386741

總結

以上是生活随笔為你收集整理的Latex论文排版技巧再总结的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。