learn.jade 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714
  1. extends ../layout
  2. block content
  3. .container
  4. .row
  5. .offset2.span8
  6. #bodyContent
  7. h1 Positioning images and tables
  8. #mw-content-text.mw-content-ltr(lang='en', dir='ltr')
  9. p
  10. span.texhtml(style='font-family: \'CMU Serif\', cmr10, LMRoman10-Regular, \'Times New Roman\', \'Nimbus Roman No9 L\', Times, serif;')
  11. | L
  12. span(style='text-transform: uppercase; font-size: 70%; margin-left: -0.36em; vertical-align: 0.3em; line-height: 0; margin-right: -0.15em;') a
  13. | T
  14. span(style='text-transform: uppercase; margin-left: -0.1667em; vertical-align: -0.5ex; line-height: 0; margin-right: -0.125em;') e
  15. | X
  16. | is an editing tool that takes care of the format so you only have to worry about the contents of your document. Nevertheless, sometimes a better control of floating elements is necessary. This article explains how to position images and tables in a
  17. span.texhtml(style='font-family: \'CMU Serif\', cmr10, LMRoman10-Regular, \'Times New Roman\', \'Nimbus Roman No9 L\', Times, serif;')
  18. | L
  19. span(style='text-transform: uppercase; font-size: 70%; margin-left: -0.36em; vertical-align: 0.3em; line-height: 0; margin-right: -0.15em;') a
  20. | T
  21. span(style='text-transform: uppercase; margin-left: -0.1667em; vertical-align: -0.5ex; line-height: 0; margin-right: -0.125em;') e
  22. | X
  23. | document.
  24. table#toc.toc
  25. tbody
  26. tr
  27. td
  28. #toctitle
  29. h2 Contents
  30. span.toctoggle
  31. | [
  32. a#togglelink.internal(href='#') hide
  33. | ]
  34. ul
  35. li.toclevel-1.tocsection-1
  36. a(href='#Introduction')
  37. span.tocnumber 1
  38. span.toctext Introduction
  39. li.toclevel-1.tocsection-2
  40. a(href='#Positioning_images')
  41. span.tocnumber 2
  42. span.toctext Positioning images
  43. ul
  44. li.toclevel-2.tocsection-3
  45. a(href='#Basic_positioning')
  46. span.tocnumber 2.1
  47. span.toctext Basic positioning
  48. li.toclevel-2.tocsection-4
  49. a(href='#The_figure_environment')
  50. span.tocnumber 2.2
  51. span.toctext The figure environment
  52. li.toclevel-2.tocsection-5
  53. a(href='#Multiple_images_in_one_figure')
  54. span.tocnumber 2.3
  55. span.toctext Multiple images in one figure
  56. li.toclevel-2.tocsection-6
  57. a(href='#Wrapping_text_around_a_figure')
  58. span.tocnumber 2.4
  59. span.toctext Wrapping text around a figure
  60. li.toclevel-1.tocsection-7
  61. a(href='#Positioning_tables')
  62. span.tocnumber 3
  63. span.toctext Positioning tables
  64. ul
  65. li.toclevel-2.tocsection-8
  66. a(href='#Basic_positioning_2')
  67. span.tocnumber 3.1
  68. span.toctext Basic positioning
  69. li.toclevel-2.tocsection-9
  70. a(href='#The_table_environment')
  71. span.tocnumber 3.2
  72. span.toctext The table environment
  73. li.toclevel-2.tocsection-10
  74. a(href='#Wrapping_text_around_a_table')
  75. span.tocnumber 3.3
  76. span.toctext Wrapping text around a table
  77. li.toclevel-1.tocsection-11
  78. a(href='#Reference_guide')
  79. span.tocnumber 4
  80. span.toctext Reference guide
  81. li.toclevel-1.tocsection-12
  82. a(href='#Further_reading')
  83. span.tocnumber 5
  84. span.toctext Further reading
  85. h1
  86. span#Introduction.mw-headline Introduction
  87. p
  88. | The default alignment for images and tables is set to
  89. i left
  90. figure.wikifigure
  91. .row-fluid
  92. .span6
  93. pre(data-number)
  94. | \nLorem ipsum dolor sit amet, consectetuer adipiscing elit.
  95. | Etiam lobortis facilisis sem. Nullam nec mi et neque pharetra
  96. | sollicitudin.
  97. br
  98. br
  99. | Praesent imperdiet mi nec
  100. | ante. Donec ullamcorper, felis non sodales commodo, lectus velit
  101. | ultrices augue, a dignissim nibh lectus placerat pede.
  102. | Vivamus nunc nunc, molestie ut, ultricies
  103. | vel, semper in, velit. Ut porttitor.
  104. .span6
  105. a(href='/learn/File:PositioningTnIEX1.png')
  106. img(alt='PositioningTnIEX1.png', src='/learn-scripts/images/thumb/2/23/PositioningTnIEX1.png/300px-PositioningTnIEX1.png', width='300', height='233')
  107. figcaption
  108. strong Figure 1.
  109. | Positioning floats within a document.
  110. p
  111. p
  112. | This is a simple example, for a description of this and other ways to include images in your
  113. span.texhtml(style='font-family: \'CMU Serif\', cmr10, LMRoman10-Regular, \'Times New Roman\', \'Nimbus Roman No9 L\', Times, serif;')
  114. | L
  115. span(style='text-transform: uppercase; font-size: 70%; margin-left: -0.36em; vertical-align: 0.3em; line-height: 0; margin-right: -0.15em;') a
  116. | T
  117. span(style='text-transform: uppercase; margin-left: -0.1667em; vertical-align: -0.5ex; line-height: 0; margin-right: -0.125em;') e
  118. | X
  119. | file see the article
  120. a(href='/learn/Inserting_Images', title='Inserting Images') Inserting Images
  121. | .
  122. p
  123. a.external.text(rel='nofollow', href='https://www.sharelatex.com/project/new/template?zipUrl=/project/532cda2653f42c100f002b56/download/zip&templateName=PositioningTablesandFigures&compiler=pdflatex')
  124. img(alt='Open.png', src='/learn-scripts/images/7/7f/Open.png', width='24', height='24', style='vertical-align: middle;')
  125. | Open an example in ShareLaTeX
  126. h1
  127. span#Positioning_images.mw-headline Positioning images
  128. h2
  129. span#Basic_positioning.mw-headline Basic positioning
  130. p
  131. | To change the default alignment of a image from
  132. i left
  133. | or
  134. i right
  135. | an easy manner is to add
  136. .mw-geshi.mw-code.mw-content-ltr(dir='ltr')
  137. .latex.source-latex
  138. pre.de1.
  139. p
  140. | to the preamble of your file and then use an additional option in your image importing statement
  141. p
  142. figure.wikifigure
  143. .row-fluid
  144. .span6
  145. pre(data-number)
  146. | \nLorem ipsum dolor sit amet, consectetuer adipiscing elit.
  147. | Etiam lobortis facilisis sem. Nullam nec mi et neque pharetra
  148. | sollicitudin.
  149. br
  150. br
  151. | Praesent imperdiet mi nec
  152. | ante. Donec ullamcorper, felis non sodales commodo, lectus velit
  153. | ultrices augue, a dignissim nibh lectus placerat pede.
  154. | Vivamus nunc nunc, molestie ut, ultricies
  155. | vel, semper in, velit. Ut porttitor.
  156. .span6
  157. a(href='/learn/File:PositioningTnIEX1.png')
  158. img(alt='PositioningTnIEX1.png', src='/learn-scripts/images/thumb/2/23/PositioningTnIEX1.png/300px-PositioningTnIEX1.png', width='300', height='233')
  159. figcaption
  160. strong Figure 1.
  161. | Positioning floats within a document.
  162. p
  163. | The package
  164. b adjustbox
  165. | enables an additional option in the
  166. code \includegraphics
  167. | command, in the example the picture is aligned to
  168. code right
  169. | . The available values are:
  170. i left
  171. | ,
  172. i right
  173. | ,
  174. i center
  175. | ,
  176. i outer
  177. | and
  178. i inner
  179. | , the last two are intended for two-sided documents.
  180. p
  181. a.external.text(rel='nofollow', href='https://www.sharelatex.com/project/new/template?zipUrl=/project/532cda2653f42c100f002b56/download/zip&templateName=PositioningTablesandFigures&compiler=pdflatex')
  182. img(alt='Open.png', src='/learn-scripts/images/7/7f/Open.png', width='24', height='24', style='vertical-align: middle;')
  183. | Open an example in ShareLaTeX
  184. h2
  185. span#The_figure_environment.mw-headline The figure environment
  186. p
  187. | The figure environment (see
  188. a(href='/learn/Inserting_Images', title='Inserting Images') Inserting Images
  189. | ) is intended to provide automatic positioning.
  190. p
  191. figure.wikifigure
  192. .row-fluid
  193. .span6
  194. pre(data-number)
  195. | \nLorem ipsum dolor sit amet, consectetuer adipiscing elit.
  196. | Etiam lobortis facilisis sem. Nullam nec mi et neque pharetra
  197. | sollicitudin.
  198. br
  199. br
  200. | Praesent imperdiet mi nec
  201. | ante. Donec ullamcorper, felis non sodales commodo, lectus velit
  202. | ultrices augue, a dignissim nibh lectus placerat pede.
  203. | Vivamus nunc nunc, molestie ut, ultricies
  204. | vel, semper in, velit. Ut porttitor.
  205. .span6
  206. a(href='/learn/File:PositioningTnIEX1.png')
  207. img(alt='PositioningTnIEX1.png', src='/learn-scripts/images/thumb/2/23/PositioningTnIEX1.png/300px-PositioningTnIEX1.png', width='300', height='233')
  208. figcaption
  209. strong Figure 1.
  210. | Positioning floats within a document.
  211. p
  212. | This environment uses a positioning parameter passed inside brackets, it can take the next values:
  213. table.wikitable
  214. tbody
  215. tr
  216. th
  217. | Parameter
  218. th
  219. | Position
  220. tr
  221. td
  222. tt h
  223. td
  224. | Place the float
  225. i here
  226. | , i.e.,
  227. i approximately
  228. | at the same point it occurs in the source text (however, not
  229. i exactly
  230. | at the spot)
  231. tr
  232. td
  233. tt t
  234. td
  235. | Position at the
  236. i top
  237. | of the page.
  238. tr
  239. td
  240. tt b
  241. td
  242. | Position at the
  243. i bottom
  244. | of the page.
  245. tr
  246. td
  247. tt p
  248. td
  249. | Put on a special
  250. i page
  251. | for floats only.
  252. tr
  253. td
  254. tt !
  255. td
  256. | Override internal parameters LaTeX uses for determining "good" float positions.
  257. tr
  258. td
  259. tt H
  260. td
  261. | Places the float at precisely the location in the
  262. span.texhtml(style='font-family: \'CMU Serif\', cmr10, LMRoman10-Regular, \'Times New Roman\', \'Nimbus Roman No9 L\', Times, serif;')
  263. | L
  264. span(style='text-transform: uppercase; font-size: 70%; margin-left: -0.36em; vertical-align: 0.3em; line-height: 0; margin-right: -0.15em;') a
  265. | T
  266. span(style='text-transform: uppercase; margin-left: -0.1667em; vertical-align: -0.5ex; line-height: 0; margin-right: -0.125em;') e
  267. | X
  268. | code. Requires the
  269. code float
  270. | package. This is somewhat equivalent to
  271. tt h!
  272. | .
  273. p
  274. | You can put more than one value in the parameter, for instance, if you write
  275. code [ht]
  276. span.texhtml(style='font-family: \'CMU Serif\', cmr10, LMRoman10-Regular, \'Times New Roman\', \'Nimbus Roman No9 L\', Times, serif;')
  277. | L
  278. span(style='text-transform: uppercase; font-size: 70%; margin-left: -0.36em; vertical-align: 0.3em; line-height: 0; margin-right: -0.15em;') a
  279. | T
  280. span(style='text-transform: uppercase; margin-left: -0.1667em; vertical-align: -0.5ex; line-height: 0; margin-right: -0.125em;') e
  281. | X
  282. | will try to position the figure
  283. b here
  284. | , but if it's not possible (the space may be insufficient) then the figure will appear at the
  285. b top
  286. | of the page. It is recommended to use more than one positioning parameter to prevent unexpected results.
  287. p
  288. a.external.text(rel='nofollow', href='https://www.sharelatex.com/project/new/template?zipUrl=/project/532cda2653f42c100f002b56/download/zip&templateName=PositioningTablesandFigures&compiler=pdflatex')
  289. img(alt='Open.png', src='/learn-scripts/images/7/7f/Open.png', width='24', height='24', style='vertical-align: middle;')
  290. | Open an example in ShareLaTeX
  291. h2
  292. span#Multiple_images_in_one_figure.mw-headline Multiple images in one figure
  293. p
  294. | It is possible to insert several images in one figure, each one with its own reference and label
  295. p
  296. figure.wikifigure
  297. .row-fluid
  298. .span6
  299. pre(data-number)
  300. | \nLorem ipsum dolor sit amet, consectetuer adipiscing elit.
  301. | Etiam lobortis facilisis sem. Nullam nec mi et neque pharetra
  302. | sollicitudin.
  303. br
  304. br
  305. | Praesent imperdiet mi nec
  306. | ante. Donec ullamcorper, felis non sodales commodo, lectus velit
  307. | ultrices augue, a dignissim nibh lectus placerat pede.
  308. | Vivamus nunc nunc, molestie ut, ultricies
  309. | vel, semper in, velit. Ut porttitor.
  310. .span6
  311. a(href='/learn/File:PositioningTnIEX1.png')
  312. img(alt='PositioningTnIEX1.png', src='/learn-scripts/images/thumb/2/23/PositioningTnIEX1.png/300px-PositioningTnIEX1.png', width='300', height='233')
  313. figcaption
  314. strong Figure 1.
  315. | Positioning floats within a document.
  316. p
  317. | First, you must import the package
  318. b subcaption
  319. | by adding to the preamble
  320. .mw-geshi.mw-code.mw-content-ltr(dir='ltr')
  321. .latex.source-latex
  322. pre.de1.
  323. p
  324. | then you can use the environment
  325. code \subfigure
  326. | that takes one parameter, the width of the figure. This environment must be used inside a
  327. code figure
  328. | environment, captions and labels can be set to each
  329. i subfigure
  330. | .
  331. p
  332. a.external.text(rel='nofollow', href='https://www.sharelatex.com/project/new/template?zipUrl=/project/532cda2653f42c100f002b56/download/zip&templateName=PositioningTablesandFigures&compiler=pdflatex')
  333. img(alt='Open.png', src='/learn-scripts/images/7/7f/Open.png', width='24', height='24', style='vertical-align: middle;')
  334. | Open an example in ShareLaTeX
  335. h2
  336. span#Wrapping_text_around_a_figure.mw-headline Wrapping text around a figure
  337. p
  338. | The package
  339. b wrapfig
  340. | provides a useful feature, text can be floated around the images.
  341. p
  342. figure.wikifigure
  343. .row-fluid
  344. .span6
  345. pre(data-number)
  346. | \nLorem ipsum dolor sit amet, consectetuer adipiscing elit.
  347. | Etiam lobortis facilisis sem. Nullam nec mi et neque pharetra
  348. | sollicitudin.
  349. br
  350. br
  351. | Praesent imperdiet mi nec
  352. | ante. Donec ullamcorper, felis non sodales commodo, lectus velit
  353. | ultrices augue, a dignissim nibh lectus placerat pede.
  354. | Vivamus nunc nunc, molestie ut, ultricies
  355. | vel, semper in, velit. Ut porttitor.
  356. .span6
  357. a(href='/learn/File:PositioningTnIEX1.png')
  358. img(alt='PositioningTnIEX1.png', src='/learn-scripts/images/thumb/2/23/PositioningTnIEX1.png/300px-PositioningTnIEX1.png', width='300', height='233')
  359. figcaption
  360. strong Figure 1.
  361. | Positioning floats within a document.
  362. p
  363. | First import the package
  364. i wrapfig
  365. | by adding
  366. .mw-geshi.mw-code.mw-content-ltr(dir='ltr')
  367. .latex.source-latex
  368. pre.de1.
  369. p
  370. | to the preamble.
  371. p
  372. | After that you can use the environment
  373. code wrapfig
  374. | , it takes two parameters that are passed inside braces: the alignement that can be
  375. i l
  376. | ,
  377. i r
  378. | ,
  379. i c
  380. | ,
  381. i i
  382. | or
  383. i o
  384. | ; this letters stand for left, right, centre, inner and outer (the last two intended for two-sided documents). The second parameter is the width of the figure, in the example is 0.25 the width of the text. See the
  385. a(href='#Reference_guide') reference guide
  386. | for a list of possible length units.
  387. p
  388. a.external.text(rel='nofollow', href='https://www.sharelatex.com/project/new/template?zipUrl=/project/532cda2653f42c100f002b56/download/zip&templateName=PositioningTablesandFigures&compiler=pdflatex')
  389. img(alt='Open.png', src='/learn-scripts/images/7/7f/Open.png', width='24', height='24', style='vertical-align: middle;')
  390. | Open an example in ShareLaTeX
  391. h1
  392. span#Positioning_tables.mw-headline Positioning tables
  393. p
  394. | Options for table positioning are similar to those available for figures
  395. h2
  396. span#Basic_positioning_2.mw-headline Basic positioning
  397. p
  398. | Default position of the tabular environment is
  399. i centre
  400. | .
  401. p
  402. figure.wikifigure
  403. .row-fluid
  404. .span6
  405. pre(data-number)
  406. | \nLorem ipsum dolor sit amet, consectetuer adipiscing elit.
  407. | Etiam lobortis facilisis sem. Nullam nec mi et neque pharetra
  408. | sollicitudin.
  409. br
  410. br
  411. | Praesent imperdiet mi nec
  412. | ante. Donec ullamcorper, felis non sodales commodo, lectus velit
  413. | ultrices augue, a dignissim nibh lectus placerat pede.
  414. | Vivamus nunc nunc, molestie ut, ultricies
  415. | vel, semper in, velit. Ut porttitor.
  416. .span6
  417. a(href='/learn/File:PositioningTnIEX1.png')
  418. img(alt='PositioningTnIEX1.png', src='/learn-scripts/images/thumb/2/23/PositioningTnIEX1.png/300px-PositioningTnIEX1.png', width='300', height='233')
  419. figcaption
  420. strong Figure 1.
  421. | Positioning floats within a document.
  422. p
  423. | To learn about how to create tables see the
  424. a(href='/learn/Tables', title='Tables') Tables
  425. | article.
  426. p
  427. a.external.text(rel='nofollow', href='https://www.sharelatex.com/project/new/template?zipUrl=/project/532cda2653f42c100f002b56/download/zip&templateName=PositioningTablesandFigures&compiler=pdflatex')
  428. img(alt='Open.png', src='/learn-scripts/images/7/7f/Open.png', width='24', height='24', style='vertical-align: middle;')
  429. | Open an example in ShareLaTeX
  430. h2
  431. span#The_table_environment.mw-headline The table environment
  432. p
  433. | The table environment is intended to automatically position tables so they fit nicely in the flow of your document.
  434. p
  435. figure.wikifigure
  436. .row-fluid
  437. .span6
  438. pre(data-number)
  439. | \nLorem ipsum dolor sit amet, consectetuer adipiscing elit.
  440. | Etiam lobortis facilisis sem. Nullam nec mi et neque pharetra
  441. | sollicitudin.
  442. br
  443. br
  444. | Praesent imperdiet mi nec
  445. | ante. Donec ullamcorper, felis non sodales commodo, lectus velit
  446. | ultrices augue, a dignissim nibh lectus placerat pede.
  447. | Vivamus nunc nunc, molestie ut, ultricies
  448. | vel, semper in, velit. Ut porttitor.
  449. .span6
  450. a(href='/learn/File:PositioningTnIEX1.png')
  451. img(alt='PositioningTnIEX1.png', src='/learn-scripts/images/thumb/2/23/PositioningTnIEX1.png/300px-PositioningTnIEX1.png', width='300', height='233')
  452. figcaption
  453. strong Figure 1.
  454. | Positioning floats within a document.
  455. p
  456. | A position parameter, inside brackets, can be passed to the
  457. b table
  458. | environment. This parameter can take the next values:
  459. table.wikitable
  460. tbody
  461. tr
  462. th
  463. | Parameter
  464. th
  465. | Position
  466. tr
  467. td
  468. tt h
  469. td
  470. | Place the float
  471. i here
  472. | , i.e.,
  473. i approximately
  474. | at the same point it occurs in the source text (however, not
  475. i exactly
  476. | at the spot)
  477. tr
  478. td
  479. tt t
  480. td
  481. | Position at the
  482. i top
  483. | of the page.
  484. tr
  485. td
  486. tt b
  487. td
  488. | Position at the
  489. i bottom
  490. | of the page.
  491. tr
  492. td
  493. tt p
  494. td
  495. | Put on a special
  496. i page
  497. | for floats only.
  498. tr
  499. td
  500. tt !
  501. td
  502. | Override internal parameters LaTeX uses for determining "good" float positions.
  503. tr
  504. td
  505. tt H
  506. td
  507. | Places the float at precisely the location in the
  508. span.texhtml(style='font-family: \'CMU Serif\', cmr10, LMRoman10-Regular, \'Times New Roman\', \'Nimbus Roman No9 L\', Times, serif;')
  509. | L
  510. span(style='text-transform: uppercase; font-size: 70%; margin-left: -0.36em; vertical-align: 0.3em; line-height: 0; margin-right: -0.15em;') a
  511. | T
  512. span(style='text-transform: uppercase; margin-left: -0.1667em; vertical-align: -0.5ex; line-height: 0; margin-right: -0.125em;') e
  513. | X
  514. | code. Requires the
  515. code float
  516. | package. This is somewhat equivalent to
  517. tt h!
  518. | .
  519. p
  520. | You can set more than one value in the parameter, for instance, if you write
  521. code [ht]
  522. span.texhtml(style='font-family: \'CMU Serif\', cmr10, LMRoman10-Regular, \'Times New Roman\', \'Nimbus Roman No9 L\', Times, serif;')
  523. | L
  524. span(style='text-transform: uppercase; font-size: 70%; margin-left: -0.36em; vertical-align: 0.3em; line-height: 0; margin-right: -0.15em;') a
  525. | T
  526. span(style='text-transform: uppercase; margin-left: -0.1667em; vertical-align: -0.5ex; line-height: 0; margin-right: -0.125em;') e
  527. | X
  528. | will try to position the table
  529. b here
  530. | , but if it's not possible (the space may be insufficient) then the table will appear at the
  531. b top
  532. | of the page. It is recommended to use more than one positioning parameter to prevent unexpected results.
  533. p
  534. | Notice also the command
  535. code \centering
  536. | . This changes the alignment of the table within its container to
  537. i centre
  538. | instead of the default
  539. i left
  540. | .
  541. p
  542. a.external.text(rel='nofollow', href='https://www.sharelatex.com/project/new/template?zipUrl=/project/532cda2653f42c100f002b56/download/zip&templateName=PositioningTablesandFigures&compiler=pdflatex')
  543. img(alt='Open.png', src='/learn-scripts/images/7/7f/Open.png', width='24', height='24', style='vertical-align: middle;')
  544. | Open an example in ShareLaTeX
  545. h2
  546. span#Wrapping_text_around_a_table.mw-headline Wrapping text around a table
  547. p
  548. | If your table don't take all available space and you want to put text next or before it, is possible with the package
  549. b wraptable
  550. | .
  551. p
  552. figure.wikifigure
  553. .row-fluid
  554. .span6
  555. pre(data-number)
  556. | \nLorem ipsum dolor sit amet, consectetuer adipiscing elit.
  557. | Etiam lobortis facilisis sem. Nullam nec mi et neque pharetra
  558. | sollicitudin.
  559. br
  560. br
  561. | Praesent imperdiet mi nec
  562. | ante. Donec ullamcorper, felis non sodales commodo, lectus velit
  563. | ultrices augue, a dignissim nibh lectus placerat pede.
  564. | Vivamus nunc nunc, molestie ut, ultricies
  565. | vel, semper in, velit. Ut porttitor.
  566. .span6
  567. a(href='/learn/File:PositioningTnIEX1.png')
  568. img(alt='PositioningTnIEX1.png', src='/learn-scripts/images/thumb/2/23/PositioningTnIEX1.png/300px-PositioningTnIEX1.png', width='300', height='233')
  569. figcaption
  570. strong Figure 1.
  571. | Positioning floats within a document.
  572. p
  573. | First, import the package
  574. .mw-geshi.mw-code.mw-content-ltr(dir='ltr')
  575. .latex.source-latex
  576. pre.de1.
  577. p
  578. | then you can use the environment
  579. i wraptable
  580. | which takes two parameters: The first one is the alignment that can be
  581. i l
  582. | ,
  583. i r
  584. | ,
  585. i c
  586. | ,
  587. i i
  588. | or
  589. i o
  590. | for left, right, centre, inner and outer respectively. The second one is the width of the table container, keep in mind that this latter parameter must be the same as the width of the table, otherwise things may not be properly aligned.
  591. p
  592. a.external.text(rel='nofollow', href='https://www.sharelatex.com/project/new/template?zipUrl=/project/532cda2653f42c100f002b56/download/zip&templateName=PositioningTablesandFigures&compiler=pdflatex')
  593. img(alt='Open.png', src='/learn-scripts/images/7/7f/Open.png', width='24', height='24', style='vertical-align: middle;')
  594. | Open an example in ShareLaTeX
  595. h1
  596. span#Reference_guide.mw-headline Reference guide
  597. p
  598. b
  599. span.texhtml(style='font-family: \'CMU Serif\', cmr10, LMRoman10-Regular, \'Times New Roman\', \'Nimbus Roman No9 L\', Times, serif;')
  600. | L
  601. span(style='text-transform: uppercase; font-size: 70%; margin-left: -0.36em; vertical-align: 0.3em; line-height: 0; margin-right: -0.15em;') a
  602. | T
  603. span(style='text-transform: uppercase; margin-left: -0.1667em; vertical-align: -0.5ex; line-height: 0; margin-right: -0.125em;') e
  604. | X
  605. | units and lengths
  606. table.wikitable
  607. tbody
  608. tr
  609. th
  610. | Abbreviation
  611. th
  612. | Definition
  613. tr
  614. td
  615. tt pt
  616. td
  617. | A point, is the default length unit. About 0.3515mm
  618. tr
  619. td
  620. tt mm
  621. td
  622. | a millimetre
  623. tr
  624. td
  625. tt cm
  626. td
  627. | a centimetre
  628. tr
  629. td
  630. tt in
  631. td
  632. | an inch
  633. tr
  634. td
  635. tt ex
  636. td
  637. | the height of an
  638. b x
  639. | in the current font
  640. tr
  641. td
  642. tt em
  643. td
  644. | the width of an
  645. b m
  646. | in the current font
  647. tr
  648. td
  649. tt \columnsep
  650. td
  651. | distance between columns
  652. tr
  653. td
  654. tt \columnwidth
  655. td
  656. | width of the column
  657. tr
  658. td
  659. tt \linewidth
  660. td
  661. | width of the line in the current environment
  662. tr
  663. td
  664. tt \paperwidth
  665. td
  666. | width of the page
  667. tr
  668. td
  669. tt \paperheight
  670. td
  671. | height of the page
  672. tr
  673. td
  674. tt \textwidth
  675. td
  676. | width of the text
  677. tr
  678. td
  679. tt \textheight
  680. td
  681. | height of the text
  682. tr
  683. td
  684. tt \unitleght
  685. td
  686. | units of length in the
  687. i picture
  688. | environment.
  689. h1
  690. span#Further_reading.mw-headline Further reading
  691. p
  692. | For more information see the full package documentation
  693. p
  694. a.external.text(rel='nofollow', href='http://tug.ctan.org/tex-archive/macros/latex/contrib/floatrow/floatrow.pdf')
  695. b floatrow
  696. | package for advanced caption managing of floating elements (tables and figures)
  697. p
  698. a.external.text(rel='nofollow', href='ftp://ctan.tug.org/tex-archive/macros/latex/contrib/sidecap/sidecap.pdf')
  699. b sidecap
  700. | package documentation, for side-figure captions
  701. .printfooter
  702. | Retrieved from "
  703. a(href='http://www.sharelatex.com/learn-scripts/index.php?title=Positioning_images_and_tables&oldid=2521')
  704. | http://www.sharelatex.com/learn-scripts/index.php?title=Positioning_images_and_tables&oldid=2521
  705. | "
  706. include ../general/small-footer