[LaTeX] box algorithm adjustbox subfigures, textwidth
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的更多相关文章
- Latex 算法Algorithm
在计算机科学当中,论文当中经常需要排版算法.相信大家在读论文中也看见了很多排版精美的算法.本文就通过示例来简要介绍一下 algorithms 束的用法.该束主要提供了两个宏包,包含两种进行算法排版的环 ...
- Latex Notes
latex Table of Contents 1. Presentation/Slides with Beamer 2. Drawing in LaTex With TikZ 3. Tracked ...
- POJ 1442 Black Box
第k大数维护,我推荐Treap..谁用谁知道.... Black Box Time ...
- Black Box 分类: POJ 栈和队列 2015-08-05 14:07 2人阅读 评论(0) 收藏
Black Box Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 8754 Accepted: 3599 Description ...
- 【POJ1442】【Treap】Black Box
Description Our Black Box represents a primitive database. It can save an integer array and has a sp ...
- Black Box《优先队列》
Description Our Black Box represents a primitive database. It can save an integer array and has a sp ...
- 数据结构(堆):POJ 1442 Black Box
Black Box Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 10658 Accepted: 4390 Descri ...
- [ACM] POJ 1442 Black Box (堆,优先队列)
Black Box Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 7099 Accepted: 2888 Descrip ...
- 【优先队列-求第Ki大的数】Black Box
Black Box Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 8637 Accepted: 3542 Descrip ...
随机推荐
- C++ namespace的作用
namespace:命名空间或者叫名字空间,传统的c++只有一个全局的namespace,但是由于现在的程序规模越来越大,程序的分工越来越细,全局作用域就变得越来越拥挤,每个人都可能使用相同的名字来实 ...
- Resource 的 IsSealed 问题
WFP 的 Generic.xaml ,App.xaml 等中的资源会被调用 Freezable. 在后台对该资源进行修改等操作会被提示.资源为密封对象. 如果,确定需要在后台对资源进行修改. 则需要 ...
- spring clound微服务架构实践(1)——搭建服务注册中心
一.创建一个空maven parent模板 1-1.新建project,选择maven 1-2.给此模板起名 1-3.此模板的保存位置,此处放入我的git项目spring-clound-learnin ...
- ES6(正则扩展)
ES6中正则的扩展 正则新增特性 一.构造函数的变化 1.ES5中new一个正则对象方法 (一行中2个参数,二行中1个参数) (第一行中的第一个参数必须是字符串) 2.ES6中新增一种方法(构造函数) ...
- hzoj 2301(莫比乌斯反演)
题意 对于给出的n个询问,每次求有多少个数对(x,y),满足a≤x≤b,c≤y≤d,且gcd(x,y) = k,gcd(x,y)函数为x和y的最大公 数. 思路: 与先前的那个相比,这次a,c并不一定 ...
- bzoj 4010: [HNOI2015]菜肴制作
Description 知名美食家小 A被邀请至ATM 大酒店,为其品评菜肴. ATM 酒店为小 A 准备了 N 道菜肴,酒店按照为菜肴预估的质量从高到低给予 1到N的顺序编号,预估质量最高的菜肴编号 ...
- 面试(二)---synchronized
一.前言 本来计划将ConcurrentHashMap和HashMap对比着来说下,奈何看的源码有点懵逼,我在思考思考,等等有个清晰的思路在搞起来,我们先来谈一下synchronized ...
- SpringBoot学习之集成dubbo
一.摘自官网的一段描述 1.背景 随着互联网的发展,网站应用的规模不断扩大,常规的垂直应用架构已无法应对,分布式服务架构以及流动计算架构势在必行,亟需一个治理系统确保架构有条不紊的演进. 单一应用架构 ...
- 基于pytorch实现HighWay Networks之Highway Networks详解
(一)简述---承接上文---基于pytorch实现HighWay Networks之Train Deep Networks 上文已经介绍过Highway Netwotrks提出的目的就是解决深层神经 ...
- Cisco 的基本配置实例之五----交换机的路由功能与DHCP 功能
5.配置交换机的路由功能 说明:只有在三层交换机上才有路由功能,其他的二层接入交换机要想在不同的vlan之间传送数据需要通过trunk口到核心交换机上进行完路由交换后才可以. TEST(config) ...