algorithm

\begin{figure}[!t]
\vspace*{\dimexpr\fboxsep+\fboxrule}
  \fbox{%
    \parbox{\dimexpr\linewidth-2\fboxsep-2\fboxrule}{\raggedright
	\begin{algorithmic}[1]
	\STATE $L(p) = -1$, $p = 1,\ldots,N$.
	\STATE $D(p) = +\infty$, $p = 1,\ldots,N$.
	\FOR{$t=1$ to $T$}
	  \FOR{$k=1$ to $K$}
	    \FOR{$p \in S^t(k)$}
	      \IF{$D(p,k) < D(p)$}
	        \STATE $D(p) = D(p,k)$
	        \STATE $L(p) = k$
	      \ENDIF
	    \ENDFOR
	  \ENDFOR
	  \STATE Update new cluster center.
	  \STATE Update new search space.
	\ENDFOR
	\end{algorithmic}%
    }}
\caption{caption.}
\label{fig:lkm_algo}
\end{figure}

adjustbox

% user@host:~/$ pdflatex
%\usepackage{graphicx} % graphicx must before adjustbox!!
%\usepackage{adjustbox}
\begin{figure}[!ht]
\centering
\adjustbox{width=\columnwidth,trim={.05\width} 0 {.09\width} {.05\height},clip}%
{%
\includegraphics[width=\columnwidth]{test.png}%
}
\caption{Caption here.}
\label{fig:lb}
\end{figure}

subfigures cross column

% \usepackage{graphicx}

\begin{figure*}[!ht]
\centering
\subfloat[]
{\includegraphics[width=0.32\linewidth]{1.png}%
\label{fig:m_r1}}
\hfil
\subfloat[]
{\includegraphics[width=0.32\linewidth]{2.png}%
\label{fig:m_r2}}
\hfil
\subfloat[]
{\includegraphics[width=0.32\linewidth]{3.png}%
\label{fig:m_r3}}\\
\subfloat[]
{\includegraphics[width=0.32\linewidth]{4.png}%
\label{fig:m_f1}}
\hfil
\subfloat[]
{\includegraphics[width=0.32\linewidth]{5.png}%
\label{fig:m_f2}}
\hfil
\subfloat[]
{\includegraphics[width=0.32\linewidth]{6.png}%
\label{fig:m_f3}}
%
\caption{caption here!}
\label{fig:m}
\end{figure*}

subfigure with adjustbox

\documentclass{IEEEtran}

\usepackage{graphicx}
\usepackage{adjustbox}
\usepackage{lipsum}
\ifCLASSOPTIONcompsoc
  \usepackage[caption=false,font=normalsize,labelfont=sf,textfont=sf]{subfig}
\else
  \usepackage[caption=false,font=footnotesize]{subfig}
\fi
%%
\begin{figure}[!htb]
\centering
\vfill
\subfloat[]%
{\adjustbox{width=\columnwidth,trim={.04\width} 0 {.09\width} {.05\height},clip}%
{%
\includegraphics[width=\columnwidth]{1.jpg}%
}}\\
\subfloat[]%
{\adjustbox{width=\columnwidth,trim={.04\width} 0 {.09\width} {.05\height},clip}%
{%
\includegraphics[width=\columnwidth]{1.jpg}%
}}
\caption{caption}
\label{fig:kalkuebr}
\end{figure}

text width

\hsize is the main parameter that TeX uses when typesetting: whenever it finishes a paragraph it looks at the current value of \hsize for breaking it into horizontal boxes. Next, there are \leftskip and \rightskip and possibly other paragraph shape parameters (\hangindent and \hangafter or the more general \parshape).

LaTeX uses an indirect approach and maintains many \...width parameters.

\textwidth is generally the global width of the text area, while \columnwidth is the width of a column of text (it will be different from \textwidth when typesetting in two or more columns). However, inside a minipage, \textwidth will be set to the given argument along with \hsize, \columnwidth, and \linewidth (they will revert to the previous values at the end of the minipage because it forms a group). Note that \parbox doesn’t reset \textwidth; the size is available as \linewidth.

The parameter \linewidth contains the line length inside a list (or derived) environment and it may change in a nested list (while \hsize, \textwidth and \columnwidth don’t change).

When we have to specify a length depending on current conditions, we have to use the correct parameter. For example, the width of a figure should be specified in terms of \columnwidth in a figure environment and of \textwidth in a figure* environment; however this is done rarely when it’s known that the document will be typeset in one column format. The same should be for a tabular* or tabularx environment.

Instead, when we need something centered with respect to a line in a list, we should use \linewidth:

\begin{enumerate}
\item some text that contains a `here' table
      \begin{center}
      \begin{tabularx}{.9\linewidth}{lXX}
      ...
      \end{tabularx}
      \end{center}
      and some other text that follows.
\item ...
\end{enumerate}

In this case it would be wrong to use \textwidth or \columnwidth, as the line length is “unknown” at typing time.

Notice that LaTeX uses \hangindent only for typesetting sectional titles and \leftskip and rightskip for \centering, \raggedright and \raggedleft; the indentation of a list environment is obtained via \parshape.

[LaTeX] box algorithm adjustbox subfigures, textwidth的更多相关文章

  1. Latex 算法Algorithm

    在计算机科学当中,论文当中经常需要排版算法.相信大家在读论文中也看见了很多排版精美的算法.本文就通过示例来简要介绍一下 algorithms 束的用法.该束主要提供了两个宏包,包含两种进行算法排版的环 ...

  2. Latex Notes

    latex Table of Contents 1. Presentation/Slides with Beamer 2. Drawing in LaTex With TikZ 3. Tracked ...

  3. POJ 1442 Black Box

    第k大数维护,我推荐Treap..谁用谁知道....                                                           Black Box Time ...

  4. Black Box 分类: POJ 栈和队列 2015-08-05 14:07 2人阅读 评论(0) 收藏

    Black Box Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 8754 Accepted: 3599 Description ...

  5. 【POJ1442】【Treap】Black Box

    Description Our Black Box represents a primitive database. It can save an integer array and has a sp ...

  6. Black Box《优先队列》

    Description Our Black Box represents a primitive database. It can save an integer array and has a sp ...

  7. 数据结构(堆):POJ 1442 Black Box

    Black Box Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 10658   Accepted: 4390 Descri ...

  8. [ACM] POJ 1442 Black Box (堆,优先队列)

    Black Box Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 7099   Accepted: 2888 Descrip ...

  9. 【优先队列-求第Ki大的数】Black Box

    Black Box Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 8637   Accepted: 3542 Descrip ...

随机推荐

  1. break跳出循环的妙用

    while True: temp = input('请输入一个整数:') try: temp = int(temp)#这里如果不是整数的话会引发报错,直接进入 except后面的reason,如果是整 ...

  2. angularJs-route路由详解

    本篇基于ng-route来讲下angular中的路由,路由功能主要是 $routeProvider服务 与 ng-view 实现. ng-view的实现原理,是根据路由的切换,动态编译html模板-- ...

  3. js实现继承的5种方式

    js是门灵活的语言,实现一种功能往往有多种做法,ECMAScript没有明确的继承机制,而是通过模仿实现的,根据js语言的本身的特性,js实现继承有以下通用的几种方式1.使用对象冒充实现继承(该种实现 ...

  4. 三.SQL语句实例

    1.查询A表中存在而B表中不存在的数据 1.1 描述:表A中有一tel字段,表B中有一tel字段,两个字段存储的内容部分相同,现要查询A表tel字段中有而B表tel字段中没有的数据 1.2 有三个se ...

  5. es6第一章 continue

    块级作用域 ES6内允许块级作用域任意嵌套 {{{{let insane = 'Hello World'}}}} 这段代码使用了一个五层的作用域. {{{{ {let c = ''hello worl ...

  6. java学习历程,一年三年五年计划

    学习这一部分其实也算是今天的重点,这一部分用来回答很多群里的朋友所问过的问题,那就是你是如何学习Java的,能不能给点建议?今天我是打算来点干货,因此咱们就不说一些学习方法和技巧了,直接来谈每个阶段要 ...

  7. [C#]Google Chrome 书签导出并生成 MHTML 文件

    目的 因为某些原因需要将存放在 Google Chrome 内的书签导出到本地,所幸 Google Chrome 提供了导出书签的功能. 分析 首先在 Google Chrome 浏览器当中输入 ch ...

  8. [LeetCode] Word Abbreviation 单词缩写

    Given an array of n distinct non-empty strings, you need to generate minimal possible abbreviations ...

  9. 实验吧_Guess Next Session&Once More(代码审计)

    Guess Next Session 看题目提示,是一道代码审计: <?php session_start(); if (isset ($_GET['password'])) { if ($_G ...

  10. [BZOJ 3332]旧试题

    Description 圣诞节将至.一年一度的难题又摆在wyx面前——如何给妹纸送礼物. wyx的后宫有n人,这n人之间有着复杂的关系网,相互认识的人有m对.wyx想要量化后宫之间的亲密度,于是准备给 ...