title: Page numbers to the right in article class

text: How do I flush page numbers to the right in the footer of an article class?               \documentclass{article}     \usepackage[english]{babel}     \usepackage{fancyhdr}     \pagestyle{fancy}     \headheight=14pt     \renewcommand\headrule{}     \fancyhf{}     \rhead{\textit{header}}     \thispagestyle{fancy}               \begin{document}          \section{Lorem Ipsum}          Tart jelly-o oat cake gingerbread cupcake cake icing croissant. Bear claw cake halvah oat cake pie carrot cake bonbon. Tiramisu applicake bonbon oat cake toffee cheesecake candy croissant. Topping candy canes cotton candy apple pie tart croissant caramels. Cupcake toffee sweet roll sesame snaps dessert biscuit oat cake. Sweet roll powder applicake chocolate bar icing chocolate cake dessert. Lollipop bear claw sugar plum gummi bears caramels sugar plum wafer jelly beans. Drage gummi bears wafer. Pie wypas chocolate bar lemon drops tiramisu. Topping wafer biscuit cake liquorice. Jujubes marshmallow tart liquorice marzipan applicake applicake. Dragee sweet roll jelly macaroon sesame snaps. Donut applicake macaroon dessert.               \subsection{Cupcake Ipsum}     Cake sesame snaps jelly sugar plum. Cotton candy cheesecake chocolate cake bonbon sweet. Liquorice pastry drage muffin oat cake sugar plum lollipop topping. Lemon drops chocolate bonbon. Topping jujubes topping. Lollipop bear claw biscuit chupa chups. Ice cream oat cake sesame snaps oat cake jelly beans jelly sweet roll apple pie. Chocolate cake jelly beans jelly beans applicake chupa chups cupcake powder. Applicake sweet roll danish cheesecake jujubes sweet cotton candy pie. Caramels bear claw halvah. Toffee cupcake sweet roll topping cheesecake. Jelly-o danish croissant jelly brownie wypas sweet chocolate.           Topping powder candy canes. Jelly-o jelly topping macaroon bear claw.     Sweet roll danish souffle jujubes powder biscuit. Sesame snaps apple pie pie pie brownie jujubes. Gummi bears jujubes lemon drops tart fruitcake tart applicake tart macaroon. Muffin tart danish. Candy canes lemon drops liquorice marzipan gummies icing tootsie roll cupcake. Gummi bears chocolate tart fruitcake liquorice wafer applicake. Macaroon danish faworki jelly beans lollipop. Cupcake chupa chups dessert cake gummies halvah. Fruitcake cake brownie gummies sweet. Chocolate bar cotton candy applicake cotton candy biscuit toffee chocolate bar brownie souffle. Souffle lemon drops dragee bear claw oat cake bonbon chocolate cake tootsie roll. Candy topping marzipan gingerbread sweet roll pie. Carrot cake bear claw candy canes cake liquorice.     Chupa chups chupa chups gummi bears chocolate cake carrot cake gingerbread icing. Gummi bears sugar plum candy canes cookie sweet brownie cotton candy.          \section{Cupcake Ipsum}          Fruitcake gummi bears candy canes candy canes cheesecake sweet. Marzipan danish chocolate bar croissant applicake. Oat cake biscuit chocolate cake jujubes ice cream pudding. Dessert marzipan jujubes wafer jelly-o. Jelly jelly faworki bonbon cupcake wypas candy canes gummies jelly-o. Liquorice donut wafer sweet roll croissant. Sweet roll fruitcake lollipop jelly beans. Tart cotton candy marshmallow donut croissant souffle. Dragee chupa chups cookie dragee caramels. Cheesecake caramels sweet roll muffin wafer.     Sweet roll danish souffle jujubes powder biscuit. Sesame snaps apple pie pie pie brownie jujubes. Gummi bears jujubes lemon drops tart fruitcake tart applicake tart macaroon. Muffin tart danish. Candy canes lemon drops liquorice marzipan gummies icing tootsie roll cupcake.           Gummi bears chocolate tart fruitcake liquorice wafer applicake. Macaroon danish faworki jelly beans lollipop. Cupcake chupa chups dessert cake gummies halvah. Fruitcake cake brownie gummies sweet. Chocolate bar cotton candy applicake cotton candy biscuit toffee chocolate bar brownie souffle. Souffle lemon drops dragee bear claw oat cake bonbon chocolate cake tootsie roll. Candy topping marzipan gingerbread sweet roll pie. Carrot cake bear claw candy canes cake liquorice.     Chupa chups chupa chups gummi bears chocolate cake carrot cake gingerbread icing. Gummi bears sugar plum candy canes cookie sweet brownie cotton candy.          \end{document}


title: can I add a blueprint (technical drawing) to my document?

text: I would like to add a technical drawing to my document. Until now, I have exported it as a figure and included that. Sadly, it loses its vector properties during the process. Furthermore, I have seen `.pdf` files including objects that can be e.g. rotated by the reader. Having a 3D technical drawing I thought it might be possible to include it in a similar manner? The file is in the `.dwfx` format (an export format for CAD), but I could save it to almost all common formats for CAD. Any suggestions, thoughts and of course solutions are welcome (:


title: How do I expand this number into full decimal (non-scientific) notation?

text: I need to typeset the result of 88.6 to the 53rd power multiplied by 9216. What I need is the full number, as part of a 6 page long equation of how long it would take to walk to the Andromeda Galaxy at 4 Mph. It should not be in scientific notation.


title: Use function to scale x axis

text: Please consider the following plot (code see bottom). The curves are the result of the function q[D]=sqrt(2*s*D/h), whereas h=0.01 and s is equal to 0.1 (blue) respectively 0.01 (green). ![pgfplot](http://i.stack.imgur.com/LZu09.png) Now, I would like to add two more axis on the top of the upper plot as in the following plot. These two axis must be scaled via the function n[D]=D/(q[D])=sqrt(D*h/(2*s)). Maybe there is an alternative workaround of which I did not think up to now? ![keynoteplot](http://i.stack.imgur.com/t9kF8.png)               \documentclass[11pt]{article}     \usepackage{tikz}     \usepackage{pgfplots}          \begin{document}          \begin{tikzpicture}       \begin{axis}[         xlabel=$D$,         ylabel={$q$},axis x line=bottom, axis y line=left       ]          \addplot[blue,mark=none,domain=0:100, samples=50, smooth,enlargelimits=upper] {sqrt(2*0.1*x/0.01)};          \addplot[green,mark=none,domain=0:100, samples=50, smooth,enlargelimits=upper] {sqrt(2*0.01*x/0.01)};        \end{axis}     \end{tikzpicture}          \end{document}


title: \usepackage{parskip} and \tabular

text: As I had issue with line breaks, How should I do manual line breaks?, I used `\usepackage{parskip}`. This worked fine. But, when I have a tabular environment, there is a lot of vertical spacing before and after the enviroment. Code:               \documentclass{article}     \usepackage{tabto}     \usepackage{parskip}          \newcommand{\inlinecode}[1]{\texttt{\small\color{blue}{#1}}}     \newcommand{\n}[0]{\\[3mm]}          \begin{document}          This is a line.          This a new paragraph.          \subsubsection{Closing Windows}     \begin{flushright}     \begin{tabular}{p{10mm}p{40mm}p{80mm}}     1 & dskhkdfahsk & khskdahfkhk\n     2 & two & three\n     \end{tabular}     \end{flushright}          Hello1          Hello2          \end{document}      Is there any way I can disable `parskip` for `tabular` alone?


title: Identical executable files with different names in MiKTeX

text: What is the difference between `miktex-*.exe` and `*.exe`, where `*` is any one of `bibtex`, `kpsewhich`, `luatex`, `makeindex`, `mf`, `mpost`, `omega`, `pdftex`, `tex`, `texlua`, `texluac`, `texworks`, or `xetex`? These files are all in `texmf\miktex\bin`. In all of these cases, the two files have identical sizes and (almost) identical timestamps. Why do they seem to be duplicated?


title: Spacing bar between bars is too high in a bar plot with error bars

text: \documentclass{standalone}     \usepackage{pgfplots}     \begin{document}     \begin{tikzpicture}     \begin{axis}[     title = {ring enrich.},     ybar,     width=10cm,     xtick={1,2},     xticklabels={%         before,         after,     }]     \addplot[        fill=blue!25,        draw=black,        error bars/.cd,        y dir=both,        y explicit     ]      table [y error=error] {     x   y       error     1   6.63    3.95     };          \addplot[        fill=red!25,        draw=black,        error bars/.cd,        y dir=both,        y explicit     ]      table [y error=c] {     x   y       c     2   41.58   8.48     };          \end{axis}     \end{tikzpicture}     \end{document}


title: Viewer-independent copyable spaces at the beginning of a line?

text: I need to include a couple of Python code listings, where the indentation of the lines (using some number of spaces) is significant. I would like for the code listings to be copyable, so the spaces at the beginning of the line need to be be copied along with the text. This question has been asked in various ways before (e.g. How to make listings code correct copyable from PDF and with hyperlink, or How can I make source code included with minted copyable?). Those questions focus on making line numbers uncopyable, though. Making the spaces at the beginning of a line copyable seems to be harder: "I am not sure it is possible to specify in the PDF (at least in a viewer- independent way) that the indentation should be copied too" (CyberSingularity). At How to make listings code indentation remain unchanged when copied from PDF?, Philippe Goutet suggests a solution (turning the spaces into visible spaces, and coloring them in the background color so that they _appear_ invisible) that works using Acrobat Reader, but not all readers. He says "It works under Acrobat Reader and it's extremely pleasant to be able to quickly copy/paste code without problem (perhaps the problem can be circumvented by writing direct PDF code to tell that it's a space, I've never had the time to try)". Is it possible to produce a PDF with a code listing with copyable real spaces at the beginning of a line? Minimal example: The line `return x` should start with four spaces.               \documentclass{article}          \begin{document}     \begin{verbatim}     def myfunction(x):         return x     \end{verbatim}     \end{document}      I know that I could attach the code to the PDF as a file, but that's not what I want.


title: How to get listings right with lmodern and MnSymbol?

text: How do I have to setup `listings` so that code can be copied with indentation and everything looks good in the pdf? I found a lot of partial answers but I wasn't able to put it all together. I manged to make line numbers uncopyable, but I couldn't get proper whitespaces and `columns=flexible` messes up the width of the embedded math. Here is the MWE:               \documentclass{article}          \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{MnSymbol}     \usepackage{lmodern}     \input glyphtounicode     \pdfgentounicode=1          \usepackage[space=true]{accsupp}     \newcommand\emptyaccsupp[1]{\BeginAccSupp{ActualText={}}#1\EndAccSupp{}}          \usepackage{listings}     \lstset{         basicstyle=\small\ttfamily,          columns=fixed,          basewidth={0.5em, 0.45em},          showstringspaces=false,          keepspaces=true,         upquote=true,         prebreak=\raisebox{0ex}[0ex][0ex]{\ensuremath{\rhookswarrow}},         postbreak=\raisebox{0ex}[0ex][0ex]{\ensuremath{\rcurvearrowse\space}},         breaklines=true,          breakatwhitespace=true         numbers=left,         numberstyle=\tiny\emptyaccsupp,         numbersep=5pt,         stepnumber=1,     }     \lstdefinelanguage{code}{         morestring=[d]',         style=codestyle,     }     \lstdefinestyle{codestyle}{       literate={:=}{{\(\gets\)}}2     }          \begin{document}          \begin{lstlisting}[language=code,gobble=2,numbers=left]       a := b |          'c' |       asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf     \end{lstlisting}          \end{document}      When copying the first two lines of the listing (it should work at least in Adobe Reader or Acrobat), I expect to get either               a ← b |        'c' |      or               a := b |        'c' |      When copying the `asdf`s, I would like to have them without the automatic linebreak and the arrows. In the pdf, the vertical bars should be aligned correctly.


title: Source code listings - proper indenting

text: I'm doing a project where I need programming source code printed throughout a PDF, with syntax highlighting and keeping the original spacing and indentation intact so copy/pasting works. Because I also need the `fontspec` package, I can't use the answer from here. I've been able to get it almost perfect with the `listings` package, but, although it prints the indenting fine, all leading indents/spaces aren't copyable! I have tried most of the `listings` settings, many random hacks found online (most resulted in crashes or weird underscores rather than spaces), `minted` (crashed xetex (and yes, I am using `--shell-escape`)), `verbatim`, and `verbments` (crashed xetex also). This is what I have so far:               \documentclass[12pt]{article}          \usepackage{color}     \usepackage{fancyvrb}     \usepackage{listings}     \usepackage{textcomp}          \usepackage{fontspec}     \setmonofont[Scale=0.8, Path=/usr/share/fonts/OTF/]{Inconsolata.otf}      %\setmonofont[Scale=0.8]{inconsolata} % can't find the font unless I do the above...          \lstset{         basicstyle=\small\ttfamily,         keywordstyle=\color{red},         identifierstyle=,         commentstyle=\color{blue},         stringstyle=\color{green},         showstringspaces=false,         tabsize=4,         numbers=left,         captionpos=b,         numberstyle=\tiny,         keepspaces=true,         numbers=none,         columns=fullflexible,         fancyvrb=true,         language=python         }          \begin{document}          And so we have the following...          \begin{lstlisting}     # sample code     def main():         i = 0         while i < 5:             print(i)             i += 1     \end{lstlisting}          \end{document}      Note that this appears fine on the pdf, but it loses the indentation spaces on copy/paste. Surely, by now, there is an up-to-date solution that will work with xelatex and not be pdf-viewer specific?


title: Copy-pasting leading whitespace and blank lines in listings package (pdf)

text: I'm trying to use the `listings` package to typeset some code in a PDF document, in a way that allows me to copy-paste the resulting code. This mostly works well, if `basicstyle=\ttfamily,columns=flexible` is used as suggested here: Phantom spaces in listings (pdf) The problem is that the leading whitespace is not copy-pasted correctly. Sure, it _visually_ shows up correctly in the PDF, but selecting it and copy-pasting it omits leading whitespace and blank lines.               \documentclass{article}     \usepackage{listings}     \lstset{basicstyle=\ttfamily, columns=flexible}     \begin{document}     Some text.          \begin{lstlisting}     def f(x):         return x+1          Previous line intentionally left blank.     \end{lstlisting}     \end{document}      Is there anything I can do to make it copy-paste correctly? I prefer using listings unless it's absolutely impossible with this package. (The document base I'm working on is pretty large so I'd like to make as few changes as possible to prevent unforeseen bugs.)


title: Disable doublespacing in multi-line header

text: In my latex file, I am including a multi-line header through:               \AddToShipoutPicture{%     \AtPageUpperLeft{%     \makebox(480,-70)[r]{\resizebox{380pt}{!}{%%     \textsf{\textbf{\color{lightgray}     \begin{tabular}{rl}          Author:         & \authorname\\          Title:          & \title\\          Date:           & {\today}           \end{tabular}      And later in the document, I am using               \doublespacing      to have double spacing in the document. However, this command also affects the multi-line header and results in double spacing in the header as well. This looks bad. How can I achieve double spacing in the document but NOT in the multi-line header?


title: Creating triangle commutative diagram with tikz-cd

text: I've just started using TikZ and need to create a simple triangle commutative diagram like this one. ![enter image description here](http://i.stack.imgur.com/O0mwB.jpg) The closest I've been able to get is this. ![enter image description here](http://i.stack.imgur.com/nywVM.png) How do I get the _h_ arrow to go from A2 to A3? Everything I've tried just causes errors. Here's my current code:               \begin{tikzcd}[column sep=small]     A \arrow{r}{i}  \arrow{rd}{g}        & A3 \arrow{d}{h} \\         & A2     \end{tikzcd}


title: Hide button after it's selected in Beamer

text: I am attempting to create a custom LaTeX Beamer Jeopardy board. So far I've run into two major questions/issues: With help from @cyberSingularity, I was able to hide the question button on the main game board using the ocgx package (Please see the updated code below). However, I am still interested in finding a seemless way to allow navigation using ONLY the buttons (no scrolling, arrow keys, spacebar, etc.) so that the question slides are completely "hidden" from the user. Any guidance or support you can offer would be much appreciated.               \documentclass[hyperref={bookmarksdepth=1}]{beamer}     \usepackage{hyperref}     \usepackage{ocgx}          \newcommand{\home}{\hyperlink{gameboard}{\beamergotobutton{Game Board}}}          \setbeamertemplate{navigation symbols}{} %Removes default navigation symbols     \begin{document}          \section{Game Board}     \begin{frame}[label=gameboard]     \frametitle{\Large Mental Math Competition -- Spring 2013}     \begin{tabular}{ccccc}     Geometry & Wuzzles & Probability & Math Ed. & Algebra\\[2ex]     {\begin{ocg}{g100}{g100}{1}\hyperlink{Geometry100}{\beamerbutton{100}}\end{ocg}}&     {\begin{ocg}{w100}{w100}{1}\hyperlink{Wuzzles100}{\beamerbutton{100}}\end{ocg}}&     {\begin{ocg}{p100}{p100}{1}\hyperlink{Probability100}{\beamerbutton{100}}\end{ocg}}&     {\begin{ocg}{m100}{m100}{1}\hyperlink{MathEd100}{\beamerbutton{100}}\end{ocg}}&     {\begin{ocg}{a100}{a100}{1}\hyperlink{Algebra100}{\beamerbutton{100}}\end{ocg}}\\[2ex]     {\begin{ocg}{g200}{g200}{1}\hyperlink{Geometry200}{\beamerbutton{200}}\end{ocg}}&     {\begin{ocg}{w200}{w200}{1}\hyperlink{Wuzzles200}{\beamerbutton{200}}\end{ocg}}&     {\begin{ocg}{p200}{p200}{1}\hyperlink{Probability200}{\beamerbutton{200}}\end{ocg}}&     {\begin{ocg}{m200}{m200}{1}\hyperlink{MathEd200}{\beamerbutton{200}}\end{ocg}}&     {\begin{ocg}{a200}{a200}{1}\hyperlink{Algebra200}{\beamerbutton{200}}\end{ocg}}\\[2ex]     {\begin{ocg}{g300}{g300}{1}\hyperlink{Geometry300}{\beamerbutton{300}}\end{ocg}}&     {\begin{ocg}{w300}{w300}{1}\hyperlink{Wuzzles300}{\beamerbutton{300}}\end{ocg}}&     {\begin{ocg}{p300}{p300}{1}\hyperlink{Probability300}{\beamerbutton{300}}\end{ocg}}&     {\begin{ocg}{m300}{m300}{1}\hyperlink{MathEd300}{\beamerbutton{300}}\end{ocg}}&     {\begin{ocg}{a300}{a300}{1}\hyperlink{Algebra300}{\beamerbutton{300}}\end{ocg}}\\[2ex]     {\begin{ocg}{g400}{g400}{1}\hyperlink{Geometry400}{\beamerbutton{400}}\end{ocg}}&     {\begin{ocg}{w400}{w400}{1}\hyperlink{Wuzzles400}{\beamerbutton{400}}\end{ocg}}&     {\begin{ocg}{p400}{p400}{1}\hyperlink{Probability400}{\beamerbutton{400}}\end{ocg}}&     {\begin{ocg}{m400}{m400}{1}\hyperlink{MathEd400}{\beamerbutton{400}}\end{ocg}}&     {\begin{ocg}{a400}{a400}{1}\hyperlink{Algebra400}{\beamerbutton{400}}\end{ocg}}\\[2ex]     {\begin{ocg}{g500}{g500}{1}\hyperlink{Geometry500}{\beamerbutton{500}}\end{ocg}}&     {\begin{ocg}{w500}{w500}{1}\hyperlink{Wuzzles500}{\beamerbutton{500}}\end{ocg}}&     {\begin{ocg}{p500}{p500}{1}\hyperlink{Probability500}{\beamerbutton{500}}\end{ocg}}&     {\begin{ocg}{m500}{m500}{1}\hyperlink{MathEd500}{\beamerbutton{500}}\end{ocg}}&     {\begin{ocg}{a500}{a500}{1}\hyperlink{Algebra500}{\beamerbutton{500}}\end{ocg}}\\     \end{tabular}     \end{frame}               \subsection{Geometry}     \begin{frame}[label=Geometry100]{Geometry 100}     ...Question(s) or Image(s) Here...     \vfill     \hideocg{g100}{\beamerbutton{Correct?}}     \home     \end{frame}     \begin{frame}[label=Geometry200]{Geometry 200}     \hideocg{g200}{\beamerbutton{Correct?}}     \home     \end{frame}     \begin{frame}[label=Geometry300]{Geometry 300}     \hideocg{g300}{\beamerbutton{Correct?}}     \home     \end{frame}     \begin{frame}[label=Geometry400]{Geometry 400}     \hideocg{g400}{\beamerbutton{Correct?}}     \home     \end{frame}     \begin{frame}[label=Geometry500]{Geometry 500}     \hideocg{g500}{\beamerbutton{Correct?}}     \home     \end{frame}          \subsection{Wuzzles}     \begin{frame}[label=Wuzzles100]{Wuzzles 100}     \hideocg{w100}{\beamerbutton{Correct?}}     \home     \end{frame}     \begin{frame}[label=Wuzzles200]{Wuzzles 200}     \hideocg{w200}{\beamerbutton{Correct?}}     \home     \end{frame}     \begin{frame}[label=Wuzzles300]{Wuzzles 300}     \hideocg{w300}{\beamerbutton{Correct?}}     \home     \end{frame}     \begin{frame}[label=Wuzzles400]{Wuzzles 400}     \hideocg{w400}{\beamerbutton{Correct?}}     \home     \end{frame}     \begin{frame}[label=Wuzzles500]{Wuzzles 500}     \hideocg{w500}{\beamerbutton{Correct?}}     \home     \end{frame}          \subsection{Probability}     \begin{frame}[label=Probability100]{Probability 100}     What is the sample space produced when two coins are flipped?     \vfill     \hideocg{p100}{\beamerbutton{Correct?}}     \home     \end{frame}      \begin{frame}[label=Probability200]{Probability 200}     In the United States, 43\% of people wear a seat belt while driving. If two people are chosen at random, what is the probability that both of them wear a seat belt?      \vfill     \hideocg{p200}{\beamerbutton{Correct?}}     \home     \end{frame}     \begin{frame}[label=Probability300]{Probability 300}     In a national lottery, five numbers from 1 to 50 and one bonus number from 1 to 40 are chosen randomly. Any tickets matching four of the five numbers and the bonus number win \$250,000. What is the probability that any given player will win the \$250,000 prize?     \vfill     \hideocg{p300}{\beamerbutton{Correct?}}     \home     \end{frame}     \begin{frame}[label=Probability400]{Probability 400}     In a shipment of 150 televisions, 9 are defective. If someone buys two televisions from that shipment, what is the probability that both are defective?     \vfill     \hideocg{p400}{\beamerbutton{Correct?}}     \home     \end{frame}     \begin{frame}[label=Probability500]{Probability 500}     A small combination lock on a suitcase has three wheels, each labeled with the ten digits from 0 to 9. If an opening combination is a particular sequence of three digits with no repeats, what is the probability of a person guessing the right combination? (Give the solution as a fraction.)     \vfill     \hideocg{p500}{\beamerbutton{Correct?}}     \home     \end{frame}          \subsection{Math Ed.}     \begin{frame}[label=MathEd100]{Math Ed. 100}     \hideocg{m100}{\beamerbutton{Correct?}}     \home     \end{frame}     \begin{frame}[label=MathEd200]{Math Ed. 200}     \hideocg{m200}{\beamerbutton{Correct?}}     \home     \end{frame}     \begin{frame}[label=MathEd300]{Math Ed. 300}     \hideocg{m300}{\beamerbutton{Correct?}}     \home     \end{frame}     \begin{frame}[label=MathEd400]{Math Ed. 400}     \hideocg{m400}{\beamerbutton{Correct?}}     \home     \end{frame}     \begin{frame}[label=MathEd500]{Math Ed. 500}     \hideocg{m500}{\beamerbutton{Correct?}}     \home     \end{frame}          \subsection{Algebra}     \begin{frame}[label=Algebra100]{Algebra 100}     \hideocg{a100}{\beamerbutton{Correct?}}     \home     \end{frame}     \begin{frame}[label=Algebra200]{Algebra 200}     \hideocg{a200}{\beamerbutton{Correct?}}     \home     \end{frame}     \begin{frame}[label=Algebra300]{Algebra 300}     \hideocg{a300}{\beamerbutton{Correct?}}     \home     \end{frame}     \begin{frame}[label=Algebra400]{Algebra 400}     \hideocg{a400}{\beamerbutton{Correct?}}     \home     \end{frame}     \begin{frame}[label=Algebra500]{Algebra 500}     \hideocg{a500}{\beamerbutton{Correct?}}     \home     \end{frame}          \end{document}


title: Should the sectioning command \paragraph be used to delimit blocks of text of more than one paragraph?

text: **1 An example section** I've read that `\paragraph` is a sectioning command one level lower than `\subsubsection`. However, it seems to work a little differently. For one thing, it is unnumbered (unless modified). **An example paragraph** Furthermore, it seems to "stick" to the text of the paragraph of text following it, i.e. it doesn't appear on a line of its own, like other sectioning commands do. Instead, its title just appears as the first few words of the paragraph in question. This leads me to wonder: is `\paragraph` intended to be used simply as an unnumbered version of the nonexistent `\subsubsubsection`, i.e. so that it might be used to delimit multi-paragraph blocks of text, or is its significance limited only to the paragraph in which it is included (as suggested by the fact that it "sticks" to it)? This question is formatted as an example of the first kind of usage of `\paragraph` mentioned above (as an unnumbered `\subsubsubsection`), i.e. the paragraph beginning with "This leads me to wonder" above, as well as this one, is here meant to be included under the paragraph "An example paragraph". Is this the correct usage? **2 A second example section** lorem ipsum


title: \frac command: height of the numerator vs height of denominator

text: I have the following code:               \begin{equation}      \underline{W}^1_{\,q,\rho} =  \left\lceil      \frac{\sum\limits_{v \in     Q, v \neq q}\underline{C}_{\,v} + \sum\limits_{i=\rho+1}^{|\Omega^{(U)}_q|}p_i+     \sum\limits_{i \in U \backslash \Omega^{(U)}_q}p_i%     +\underline{TT}_{\,q, \rho} }{m-1}      \right\rceil\,,     \end{equation}      that is rendered as: ![enter image description here](http://i.stack.imgur.com/Ajudx.png) As you may see, the numerator height is the same as the denominator. I don't need all this waste of empty space. How can I avoid this situation?


title: Cannot create bibliography in Texmaker

text: I am tearing my hair out with TexMaker. I have a bibliography file written in Jabref. It is called `filename.bib`. In my tex document have a bibliography style and source command like this:               \bibliographystyle{aea}     \bibliography{filename}      The cites match the "handles" in my bib file and look like this: `\cite{basker2013change}` The bib file is in the directory with my tex file. I run latex, no errors. Bibtex, no errors. Latex, no errors. Latex, no errors. DviPDF. Look at the file and all the cites are ?. The `bbl` file is generated but blank. I have seen similar questions here but they all seem to be solved by following the `latex, bibtex, latex, bibtex` sequence. But that is not working for me.


title: Drawing figures in LaTeX

text: ![Figure 1 ](http://i.stack.imgur.com/9NI0B.png) Can I make the figure which I just posted here in LaTeX?


title: Draw a plane in space and a coordinate system using tikz

text: Suppose I have a plane $E: a*x_1 + b*x_2 + c*x_3 = d$ (a,..,d should be concrete numbers) in space and a point P. Is there a way to draw a 3-d coordinate system, E, P and perpendicular line to E through P?


title: How can I create links within the document to other sectiongs/chapters etc.?

text: > **Possible Duplicate:**   >  How to make clickable links and cross-references in pdfs produced by LaTeX? In LaTeX with TeX Live, how can I add links to other parts of the document, e.g. to headings? (real, clickable links, at least in pdf they should be clickable ;) )


title: How can I make a clickable Table of Contents?

text: > **Possible Duplicate:**   >  How to make clickable links and cross-references in pdfs produced by LaTeX? I need links for the Table of Contents, so that I can navigate fast to different sections. I apparently need some package. I tried the package `url` unsuccessfully.


title: Clickable tableofcontents

text: How to obtain clickable items in a table of contents? I mean, they should also appear in blue. I have the preamble:               \documentclass[12pt]{iopart}          \usepackage{graphicx,color}     \usepackage{iopams}     \usepackage{hyperref}      As you can see, I'm using the `iopart` class (specific for IOP journals).


title: How to access toc entries with titletoc

text: I'm bit lost with the content of `titletoc.sty`. I'd like to access toc entries, meaning chapter title, section title and so on to put them in a colorbox. I think it is somewhere in the `\def\ttl@tocentry` and I'd like to be able to write something like:               \titlecontents{chapter}[0pc]     {\colorbox{red}{chapter title}}     {}     {}     {}%      **EDIT** : MWE:               \documentclass[12pt]{report}     \usepackage{xcolor}     \usepackage{titletoc}     \titlecontents{chapter}%section     [0pc]%left     {}%above     {}%before with label     {}%before without label      {}%filler and page      []%after          \begin{document}     \tableofcontents     \chapter{chapter title}     \end{document}


title: Can I get a normal footnote in a minipage environment in LaTeX? How?

text: I need to use a minipage environment and I need a footnote in that minipage. I want the footnote to be numbered in the normal footnote sequence and to occur together with the rest of the footnotes in my document. But, as this minimal example shows:               \documentclass{article}          \begin{document}          Spam          \begin{minipage}{.5\linewidth}         Foo\footnote{bar}     \end{minipage}          Ham          \end{document}      the obvious thing produces a footnote that 1) appears at the bottom of the minipage, and not the page itself, and 2) is "numbered" alphabetically. How can I get a regular footnote in a minipage?


title: How to find the \textwidth in two-column mode?

text: Sometimes I find that floats don't fit nicely on a page, so I use               \resizebox{\textwidth}{!}{ <blah blah blah> }      so that the borders match the margins. However, I'm now working on a paper in two-column format (specifically using sigplanconf.cls) and if I use the above command, it stretches the table over both columns. Is there a way I can find the "proper" \textwidth? As in, a variable that describes the width of a single column.


title: Can't use biblatex-chicago with clean TeX Live 2014 install; textcitedelim undefined

text: After a clean install of Cygwin 64-bit with TeX Live 2014 (all packages), I can no longer use biblatex-chicago cleanly. MWE:               \documentclass[]{article}          \usepackage{biblatex-chicago}     \addbibresource{biblatex-examples.bib}          \begin{document}     a~\autocite{kastenholz}.     \end{document}      This works with a clean 2013 install. Did something change, or am I doing this wrong? First error:               ! LaTeX Error: \textcitedelim undefined.          See the LaTeX manual or LaTeX Companion for explanation.     Type  H <return>  for immediate help.      ...          l.795 \renewcommand*{\textcitedelim}                                         {%      Second error:               ! LaTeX Error: \iffinalcitedelim undefined.          See the LaTeX manual or LaTeX Companion for explanation.     Type  H <return>  for immediate help.      ...          l.2765 \renewcommand*{\iffinalcitedelim}                                             {%


title: navigation bullets not displaying

text: I'm trying to use the Singapore theme with the navigation bullets on top but they do not appear unless I add a subsection within each section. Is there a way to avoid this? Here is my code:               \documentclass{beamer}     \usepackage[spanish]{babel}     \usepackage[latin1]{inputenc}     \selectlanguage{spanish}          \usetheme{Singapore}     \useoutertheme{miniframes}          \usepackage{amsmath,amssymb}     \usepackage{graphicx}     \usepackage{fancyvrb}          \title{Título}     \author{Autor}     \institute{Institute}     \date{\today} %               \begin{document}          \frame{\maketitle}      \begin{frame}      \frametitle{Contenido}       \tableofcontents[]      \end{frame}          \section{Without bullets}          \begin{frame}     \frametitle{Contenido}     Contenido     \end{frame}           \begin{frame}       \frametitle{Objetivo}       Objetivos      \end{frame}               \begin{frame}        \frametitle{Bibiliografía}      Bibliografía      \end{frame}            \section{With bullets}     \subsection{this will put the bullets}     \begin{frame}     \frametitle{Contenido}     Contenido     \end{frame}           \begin{frame}       \frametitle{Objetivo}       Objetivos      \end{frame}               \begin{frame}        \frametitle{Bibiliografía}      Bibliografía      \end{frame}          \end{document}      I am working on a MAC with Lion. I am compiling with LaTEX and I use TexShop. I have saved my code as a latin-1 file.


title: Can I use \clap, \rlap and \llap in math mode?

text: The commands `\clap`, `\llap` and `\rlap` are useful "horizontal" analogues of `\smash`: they reduce the horizontal width of a box to zero, aligning the box with either the middle, left or right of the typeset contents. Unfortunately they don't work in math mode. > Can someone suggest a math mode macro that has the effect of `\clap` and > friends?


title: figure environment and contiguous images

text: > **Possible Duplicate:**   >  How do I ensure that figures appear in the section they're associated with? I have a set of images and I want them all to appear in the same `\section` of my document, obviously in the section I "defined" them. The problem is that, using the `figure` environment, some images are spreading inside the next section. Something like this:               *start of section n*     IMG 1     IMG 2     ...          *start of section n+1*     IMG N-M     ...     IMG N      I want to force all N images on staying inside the n-th section. How can I do this? The code I wrote is something like this:                      \section{n}                 some text                 \begin{figure}[ht]             ...            \end{figure}            \begin{figure}[ht]             ...            \end{figure}            \begin{figure}[ht]             ... n-th figure here            \end{figure}                 \section{n+1}


title: Forcing bibliography to the end

text: > **Possible Duplicate:**   >  How do I ensure that figures appear in the section they're associated with? I'm using the `thebibliography` environment, in a paper that has three floating figures. Now, for some odd reason, LaTeX is throwing two of those figures after the References, and one before, which seems to make no logical or typographical sense. It looks absolutely terrible. Why does it do this and how can I stop it?


title: How can I inhibit LaTeX to float a table across a section boundary?

text: > **Possible Duplicates:** > > How to avoid splitting tables between sections. > > How do I ensure that figures appear in the section they're associated with? I have a couple of tables that are written consecutively (8 tables) and after all tables, I start a new section. I want that LaTeX floats all those tables in some way (order of them is not important), but that it floats them before I start a new section, as it's really confusing when suddenly a table of the previous section appears in the new section. Is this possible somehow?


title: distributing each image in its section

text: Good evening, I'm writing my thesis in Latex, with which I already had the pleasure to work for some other projects, but I'm now facing a problem I don't know how to solve. I'll try to get to the point as straight as possible: let's say I have a chapter of simulation results, which includes a huge set of images. This chapter is subdivided itself in some sections, among which the images are distributed. Now, what I would like to have is a way to have all the images related to section A inseted before section B starts and so on. I don't mean I want to precisely insert them where I want (the most of them are set of subfigures, difficult to be fit anywhere), it would be enough to be able to tell the compiler to put them all before the next section starts. Do someone of you have any suggestion on the matter ? Thanks a lot in advance Michele


title: Image appearing in the middle of itemize

text: > **Possible Duplicate:**   >  How do I ensure that figures appear in the section they’re associated with? Basically I have something like this:               \section{first section}     [sometext]          \begin{figure}     \centering     \includegraphics[scale=0.35]{i/kbexample.png}     \caption{---}     \label{kbexample}     \end{figure}          \section{second section}          [sometext]          \begin{itemize}     \item An item     \end{itemize}      That image is appearing in the middle of my lists (`\begin{itemize}`). It even belongs to previous section but LaTeX prints it after the second section. I know I can use `\clearpage` or `\newpage` but isn't that kind of silly?


title: Placing all floats before continuing

text: > **Possible Duplicate:**   >  How do I ensure that figures appear in the section they're associated with?   >  Keeping tables/figures close to where they are mentioned   >  How to avoid splitting tables between sections What I want to do is really simple: I want to make sure that at a certain point, latex simply inserts all floats that have been created, before continuing to the next section. Right now I get:               Sec 1     Float 1.1          Section 2     Float 1.2     Float 2.1      Is there a way to tell latex to dump all remaining floats before continuing with whatever comes next? So that Float 1.2 is inserted before Section 2 starts?


title: Placing the text in a new page after figures

text: > **Possible Duplicate:**   >  How do I ensure that figures appear in the section they're associated with?   >  Keeping tables/figures close to where they are mentioned I am a new user of LaTeX. I am facing a problem while trying to write a report. I have some text that ends at the middle of the page. The text is followed by a page which has only figures. I need the next line of text in a new page after the figures. but when i write anything new after the commands for the figures, LaTeX place the writings in the earlier page (after where the text ended at the middle of the page). Can anyone please help me with a solution for this problem?


title: How to prevent plots being printed out of document's sections?

text: I am preparing a document using `knitr` in which I have multiple charts within two or more sections. The majority of the plots is printed at the end of the document but I would like them to stay within the section, how can I do that?


title: Force LaTeX image to appear in the section in which it's declared

text: > **Possible Duplicates:**   >  How do I ensure that figures appear in the section they're associated with?   >  Keeping tables/figures close to where they are mentioned How can I force an image in a LaTeX documents to appear in the section in which I declared it? I don't want that an image about "Section A" to appear in "Section F". :( I actually include an image with               \begin{figure}[ht]     \begin{center}     \includegraphics[scale=0.7]{./img/RobotManipulator3D_WorkSpace.png}     \end{center}     \caption{3D View of the robotic workspace (in red).}     \label{Img:3DRobotWorkspace}     \end{figure}


title: \subsubsection <-- How do I ensure that figures appear in the section they're associated with?

text: > **Possible Duplicate:**   >  How do I ensure that figures appear in the section they're associated with? How do I ensure that figures appear in the section they're associated with? thanks, @Rob Hyndman @all: does this also apply to `\subsubsection`?


title: strange figure floats

text: I don't understand why my figure floats to the "wrong places". For example:                 \documentclass[12pt,a4paper,oneside]{book}       \usepackage{graphicx}            \begin{document}            \section{My section}       \begin{figure}[htbp!]       \centering       \includegraphics[width=16.6cm]{figure.png}       \caption{My caption}       \end{figure}            \end{document}      The problem is that the figure appears before the section name, and not after it, like I want it to be... How can I correct this?


title: Mismatch between code and position of figures with LATEX

text: I use the following code to add figures:               \begin{figure}     \centering         \includegraphics[width=0.8\textwidth]{orig.png}         \caption{pic}         %\label{fig:awesome_image}     \end{figure}      However the figure doesn't appear where it should. For example:               \subsection{A}          \subsubsection{a}          text          [the figure code]          \subsubsection{b}          text          [This is where the figure shows up]          \subsection{B}      What could be the problem? Thanks.


title: Place a figure at position which want

text: I want to place a figure at some position that i want such that, after/before some word, or line. But the output result may be different, the word/line i want after/before the figure, it do inverse (before/after). Please help me place the figure at any position that i want. Thanks


title: Preventing caption in new page

text: This is not about keeping the picture or table close to where they have been mentioned. It is about keeping the caption of the picture (or table) together with the picture. Otherwise the picture and the caption will be displayed in different pages (or columns). Then, how to do it?.               \documentclass[journal,twoside]{IEEEtran}     \usepackage[spanish,english]{babel}     \usepackage{circuitikz}     \usepackage[justification=centering]{caption}          \begin{document}     \title{Minimal Working}          \maketitle          \begin{center}     \includegraphics[scale=0.2444]{MultiplierSimulationI.png}     \captionof{figure}{\small Multiplier circuit x3.}     \end{center}          \begin{center}     \begin{circuitikz}[american]     \draw (-0.5,-0.5) to[open, l=$Anode$] (0,-0.5);     \draw (-1,0) to[D, v=$V_D$] (-1,-2);     \draw (-1,0) to[open, o-o] (-1,-2);     \draw (0,-0.5) -- (0,-1.3) to[short, i=$i_D$] (0,-1.5);     \draw (-0.5,-2.3) to[open, l=$Cathode$] (0,-2.3);     \end{circuitikz}     \captionof{figure}{\small Ideal Diode.}     \end{center}          \end{document}      This is how I insert pictures (correct me if I am wrong, I insert them like this to put them wherever I want and avoid that the position itself anywhere in the page, and to give them a location). Anyway, if you add forced spaces before the picture there is a time where the picture will stay in the first column and the caption in the first line of the second column (same situation with the circuit).


title: Increase badness based on distance between float and reference

text: One thing I really often struggle with when writing a latex document (and I belive a lot of people are in the same case) is float placement. In particular, I often find myself with a figure or table located several pages away from the place where ther were referenced. As I understand it, the way latex choses where to put a float is by trying to minimize the "badness", which is a numeric value used to characterize how bad a certain placement would be. And in this regard, I think we can agree that placing a figure several pages away from the place where it is needed is pretty bad. Therefore, is there a way to increase the badness of this when I need to do so ? To be more specific, I see two possible kinds of badness :   * the vertical distance between the paragraph where it is referenced and the float   * The presence of page breaks between these two.  Alternatively, how could it be implemented, or even, would this be the right way to approach this problem ?


title: Figure alignment

text: I am using the TikZ package to create braids for my 4th year project. But everytime I hit the button to run the code, my braid jumps to the top of the page rather than sitting where I want it. Can anyone help? I am using the following packages,               \usepackage{amsmath, amsfonts, amsthm, amssymb}     \usepackage{graphicx}     \usepackage{tikz}     \usepackage{braids}          \begin{document}          \begin{figure}              \centering             \begin{tikzpicture}                 \braid[rotate=90, line width=.4mm] a_1 a_2 a_2 a_1 a_2^-1;             \end{tikzpicture}              Figure~1 shows an example of a $3$-braid.     \end{figure}          \end{document}


title: Float positioned in the middle of an otherwise empty page

text: > **Possible Duplicate:**   >  Set table position to top My document (`book`) has text and floats. There is not enough text, so that all floats can be placed before the text finishes. Then pdfLaTeX puts the remaining float right in the middle of an otherwise empty page. This does not look good. Is there a way to position these floats at the top of the page instead in the middle? Placement specifiers are already given `[t]`. Also combinations of `[h,t,!,H]` don't help.


title: How to avoid splitting tables between sections

text: I have 5 tables and a section after them. After creation of an output file I have two tables on one page, then a section and last 3 tables on next page. What I want to achieve is to put tables and section below them.               \begin{table}[ht]\footnotesize     \centering     \begin{tabular}{|ll|}     ......     \end{tabular}     \label{tab:result}     \end{table}          \section{Section below tables}


title: Plots going to the wrong page

text: > **Possible Duplicate:**   >  Keeping tables/figures close to where they are mentioned In the end of a section, I added two plots and. So, I finished this section and started a new one. However, this new section appears before the plots. To illustrate (apologies for non-necessary packages because I don't know which is necessary):               \documentclass{article}     \usepackage{amsmath}      \usepackage{amssymb}     \usepackage{natbib}      \usepackage{graphicx}      \usepackage{epstopdf}     \usepackage{url}     \usepackage[titletoc]{appendix}     \usepackage{eurosym}     \usepackage{listings}      \usepackage{setspace}     \usepackage{float}     \usepackage{booktabs}     \usepackage{pdfpages}     \usepackage{array}     \begin{document}           \section{One}               xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx     xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx      \begin{figure}[p]     \centering     \includegraphics[scale=0.51]{bp1.pdf}      \caption{Observed choice probabilities versus fitted  choice probabilities generated    by logit model using regression coefficients derived from TTO data}      \label{bp9}      \includegraphics[scale=0.51]{bp2.pdf}       \caption{Observed choice probabilities versus fitted choice probabilities generated     by probit model using regression coefficients derived from TTO data}      \label{bp10}      \end{figure}                \section{Two}            cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc       cccccccccccccccccccccccccccccccccc            \end{document}      Here is the output. Note that the plots appear on the second section whereas they were meant to be in the first section ![enter image description here](http://i.stack.imgur.com/fIgTP.png)


title: Image vs Text Arrangement

text: When I write a multi-page paper with imported images, I usually try to group the picture with the text referencing it. Sometimes, there is not enough room at the end of the page for the picture, and the picture is moved to the top of the next page. This often leaves some white space at the end of the previous page. In order to remove the white space, LaTeX automatically fills the space with text that is meant to come after the image. Is there a way to prevent this?


title: How to align table or figure caption where the table starts?

text: HI How can I start the caption where table starts or figure starts?               \captionsetup{justification=justified, singlelinecheck=false}      does not work for me because it places the caption at the beginning of the paragraph not the beginning of the table. Thanks!!


title: Why is my table appearing before my text?

text: > **Possible Duplicate:**   >  How to influence the position of float environments like figure and table > in LaTeX? I am trying to create a table after some text:               Some text. foobar foobar \\          \begin{table}[t]     \centering     \begin{tabular}{|c|c|c|c|c|c|}     \hline      & a & c & & &  \\     \hline     $\{X, X', Y\}$ & & b &  & &  \\     \hline     \hline     \end{tabular}     \end{table}      However, the table is appearing before the text even though I type if after I type the text. Why?


title: How to use the placement options [t], [h] with figures?

text: I want to control the placement of figures. The paper that I am currently writing contains a lot of figures, resulting in some figures ending up in the bibliography section. Therefore I want to manually control their placement. I know options like `[t]` and `[h]` will help, but I am unable to find a good tutorial.


title: Latex float so no stretching appears, but everything is placed on top

text: It has probably been already answered, but I cannot find it. If I include images as floats, LaTeX places the last one on a single page in the middle. How do I make LaTeX to put in on the top of the single page? A similar question: if I make a new section and a large table (3/4 of the page long), LaTeX stretches the spacing between the section header and table. How do I place the table right after the section header?


**How to influence the position of float environments like figure and table in LaTeX?** This is a general question and should collect useful answers for all users. I hope we can use this as a reference


title: How do I force LaTeX to show tables in the section where they are made?

text: I have the following problem: My section 7.2 contains a lot of tables. Now it shows 2 tables, and then there is a space left on the page, that is not big enough for the next table. Therefore, section 7.3 starts at that empty space. However, after that, there are still two pages full of tables that belong to section 7.2, so I prefer section 7.3 to start after these tables. Is this possible?


title: How could I fix position of figures with KOMA-Script?

text: As a beginner, I will ask a question from a beginner. And I am a little bit lost with Latex packages documentation since there is, well, a lot of text ! (I prefer figures). I read in Koma-Script manual this: > But often these floating environments are slightly misunderstood by > beginners. They often ask for a fixed position of a table or figure within > the text. I need to write course materials (but not a book) with a lot figures and images and maths formulas. I would like to position the figures in the order and as close as possible from the text that reference them. Having an image at the top or at the bottom of the page is _sometimes_ not correct for me. I tried to do this:               \documentclass[fontsize=12,a4paper,twoside,headheight=0.5cm,headsepline]{scrreprt}     \usepackage[T1]{fontenc}     \usepackage[bottom=2cm,footskip=15mm]{geometry}     \usepackage{scrlayer-scrpage}     \usepackage[utf8]{inputenc}     \usepackage[frenchb]{babel}     \usepackage{lipsum}     \usepackage{a4}     \title{Trying to Latexize my materials}          \KOMAoptions{BCOR=2mm,DIV=22}          \usepackage{eso-pic}     \usepackage{graphicx}     \usepackage{geometry,color,float}          \AddToShipoutPictureBG{%         \AtPageUpperLeft{             \put(10,-10){%                 \raisebox{-\height}{\includegraphics[width=2cm]{example-image-c}}             }         }     }          \usepackage{mwe} % for blindtext and example-image-a in example     \usepackage{wrapfig} %not KOMA: is it compatible ?          \pagestyle{scrheadings}     \cfoot{Le pied de page}     \rehead{En haut à droite pair}     \rohead{En haut à droite impair}     \cehead{centre pair}     \cohead{centre impair}               \begin{document}     \maketitle     \chapter{Starting}     \section{My first section}     \subsection{a subsection: introduction}     This is my first \LaTeX document !               \begin{figure}[th]             \centering             \includegraphics[width=300pt]{example-image-a}             \caption{capt}     \end{figure}               \lipsum[2]     \subsection{an image in this section}     There is an image below I want to comment now.          \begin{wrapfigure}{l}{0.5\textwidth}     \centering     \includegraphics[width=.98\linewidth]{example-image-a}     \caption{A caption}     \end{wrapfigure}          \lipsum[4]          \subsection{another image in this section}     And another one here          \begin{wrapfigure}{r}{0.5\textwidth}     \centering     \includegraphics[width=.98\linewidth]{example-image-b}     \caption{A caption}     \end{wrapfigure}          \lipsum[6]     \fbox{\begin{minipage}{0.9\textwidth}          ''text''     \end{minipage}}          \end{document}      But as you can see in document which is here (to download the document follow the link and then click the download button, do not right-click then "Save target as..."). the second A image is misplaced at the bottom (as well as the following text). And I don't want the second A image (left placed) to be so close to the bottom. I don't want neither the 1.1.3 subsubsection to be shifted to the right like this. I would like the paragraph to be wrapped and the the 1.1.3 section to be left justified. I am less interested in a perfect typographic layout than in a technical documentation layout with, sometimes, more text (I have 30% text, 70% figures/tables/images). What is a good way to do this using KOMA-script ? Or am I on a wrong path and should I change my way of writing it ? My target type of document can be found here this.


title: 2 images described in two sections , but they appears in same section

text: I have two images . One of them is to be shown in section 4.1 and another is to shown in section 4.2 . For this purpose , I have the following code .               \section{Linear Algebra}             A hyper-plane in $R^n$ is the set of points $x = \{x_1 , x_2, \dots , x_n\}$ that satisfy $ax = b$ , where $a \epsilon R^n$ and $ b \epsilon R$. Examples: This equation $a_1x_1 + a_2x_2 = b$ is a line  in $R^2$ .             Each hyper-plane divides the space into two half-spaces . The following figure illustrates this concept .                       \begin{figure}                         \centerfloat                          \includegraphics[width=8cm,height=8cm,keepaspectratio]{Image/fig4_1.jpg}                         \caption{ Concept Of Hyperplane }                         \label{fig4_1}                     \end{figure}               Now  $H^+ = \{x : ax = b\}$ is the positive half-space. As we know that vector a is gradient of the linear function $f(x) = ax$ , and so is normal to H. Here, A polyhedral set is the intersection of  half-spaces.                 \section{Convexity}                  A set S is convex if for any two points $x , y \epsilon S$, the line segment xy also lies in S . That is, $\alpha x + (1 - \alpha)y \epsilon S $ if $x, y \epsilon S $, for all $ \alpha \epsilon [0, 1]$.               Examples: A hyper-plane is convex. A halfspace is convex. Intersection of convex sets is convex. In the following figure,a set of convex structures are shown .                           \begin{figure}                         \centerfloat                          \includegraphics[width=8cm,height=8cm,keepaspectratio]{Image/fig4_2.jpg}                         \caption{ Concept Of Hyperplane }                         \label{fig4_2}               \end{figure}      But I have two images appeared in one section named 4.1 . The output is given in the following snapshot . ![enter image description here](http://i.stack.imgur.com/p75Ga.png) Why do the images appeared in one section ? What have I to do to get my desired output ?


title: Why does \begin{figure} center my image vertically?

text: If I insert image into my document as such:               \includegraphics{spss24fore.png}      The image is aligned at top of the page, but when I use:               \begin{figure}         \includegraphics{spss24fore.png}             \caption{Kuva 1.1}     \end{figure}      to get the caption to the picture as well, the image moves vertically down more towards the center of the page and more to the left?...Why so?...I only want to add caption for the image, I want it to stay where it is =)


title: Tabularx textwidth tables jump to last page

text: I am using tabularx to get a table that automatically stretches to the full width of the paper. However, my tables seem to be put at the last page when I apply this code (see below). How can I avoid this? I want it to be within the text.               \begin{table}[h]     \caption{ \textsc{Implied parameters} }     {\centering \small     \caption*{\small     Description }      \begin{center}     \begin{tabularx}{\textwidth}{XXXXXXX}     \toprule      Parameters     & B1 & B2 & B3 & B4  & B5 & B6\\      \midrule     $\sigma$ & 0.13 & 0.18 & 0.34 & 0.17 & 0.14 & 0.14 \\     & (0.08) & (0.08) & (0.05) & (0.08) & (0.08) & (0.07) \\                     \bottomrule     \end{tabularx}%     \end{center}     \label{tab:parameters}     } % end centering     \end{table}


title: Customize the position of a figure

text: Hello although this question has been asked several times, I still can't position my figures at the right place. I have installed the `float` and the `here` packages. and the code is as follow:               \begin{figure}[H]     \centering     \includegraphics[scale=0.7]{pictures/pic.png}     \caption{The Pulse Co-Oxymetrie}     \label{fig: Massimo}     \end{figure}       even though there is more than enough space left for the image,a new page is created and the figure goes at the top of this new page,while the caption stays at the bottom meaning I have a lot of blank spaces in my thesis.


title: How can I fix image positioning?

text: > **Possible Duplicate:**   >  Keeping tables/figures close to where they are mentioned               \usepackage{amsfonts}     \usepackage{pdfpages}     \usepackage[hidelinks,unicode]{hyperref} %- to zeby byly polskie znaki w bookmarkach + konwersja na utf8     %\usepackage[hidelinks]{hyperref}     \usepackage{etoolbox}     \usepackage[T1,OT4]{fontenc}          \usepackage{graphicx}          \usepackage{hypcap}          \usepackage{anysize}     \marginsize{3.5cm}{2.5cm}{2cm}{2cm}          \let\origfigure\figure     \let\endorigfigure\endfigure          \renewcommand\baselinestretch{1.5}     \patchcmd{\thebibliography}{*}{}{}{}          \makeatletter     \g@addto@macro\@floatboxreset\centering     \makeatother               \SetSectionFormatting[breakbefore]{chapter} {24pt plus5pt minus2pt}     {\FormatHangHeading{\fontsize{17}{17}\textbf}} {10pt plus3pt}     \SetSectionFormatting{section} {24pt plus5pt minus2pt}     {\FormatHangHeading{\fontsize{14}{14}\textbf}} {10pt plus3pt}     \SetSectionFormatting{subsection} {24pt plus5pt minus2pt}     {\FormatHangHeading{\fontsize{12}{12}\textbf}} {10pt plus3pt}          \makeatletter     \pretocmd{\tableofcontents}{%       \if@openright\cleardoublepage\else\clearpage\fi       \pdfbookmark[0]{\contentsname}{toc}%     }{}{}%     \makeatother          \begin{document}     %\language 12345 % wyłącza dzielenie wyrazów     \pagenumbering{Alph}     \begin{titlepage}     \pdfbookmark{Strona tytułowa}{}     \includepdf[pages=1-]{strona_tytulowa.pdf}     \end{titlepage}     \pagenumbering{arabic}     \tableofcontents     \input{tresc.tex}     \input{bibliografia.tex}     \end{document}      tresc.tex:               \chapter{Bzdety}\label{rozdzial-bzdety}     W rozdziale \ref{rozdzial-bzdety} ze strony \pageref{rozdzial-bzdety} znajduje się obrazek \ref{obraz-jesien} na stronie \pageref{obraz-jesien}.          The first paragraph.          \begin{figure}         \includegraphics[scale=1]{a.jpg}         \caption[Opcjonalny skrócony opis do spisu obrazków]{Opis}         \label{obraz-jesien}     \end{figure}               The second paragraph.      I expected something like:               The first paragraph.          [image]     [caption]          The second paragraph.      I got:               The first paragraph.              The second paragraph.          [image]     [caption]      Image is at the very center of next page. How can I fix this?


title: Managing floats when there is not much text

text: I have a section in my document where I discuss results of my simulation, pictured as graphs, which in turn are included as floating images in the document. However, $\latex$ seems to put only one floating picture per page, which causes most of the images to float all over references, and hence matching pictures with text is rather difficult. How can I manage this situation? I would still like to benefit from all the automatic positioning of floats, I just want more of them on one page. The floats are included like this:               \begin{figure}[ht]     %\begin{center}     \includegraphics[scale=0.8]{CVaR_vs_xi}     \caption{\label{f9}CVaR for different values of project volatility ($\xi$), expressed as a fraction of the initial loan amount.}     %\end{center}     \end{figure}


title: Figure with ganttchart above section title

text: I'm fairly new to using LaTeX, so don't blame me for asking obvious questions. The ganttchart in the code below will be placed above the section title, and I have no clue why. Any help would be appreciated.               \section{Tables}          \begin{figure}[ftbp]          \begin{ganttchart}[y unit title=0.4cm,     y unit chart=0.5cm,     vgrid,hgrid,      title label anchor/.style={below=-1.6ex},     title left shift=.05,     title right shift=-.05,     title height=1,     bar/.style={fill=gray!50},     incomplete/.style={fill=white},     progress label text={},     bar height=0.7,     group right shift=0,     group top shift=.6,     group height=.3,     group peaks={}{}{.2}]{20}          \gantttitle{Maand}{20} \\     \gantttitle{Month1}{4}      \gantttitle{Month2}{4}      \gantttitle{Month3}{4}      \gantttitle{Month4}{4}      \gantttitle{Month5}{4} \\          \ganttbar{Fase1}{1}{3} \\     \ganttbar{Fase2}{4}{5} \\     \ganttbar{Fase3}{6}{7} \\     \ganttbar{Fase4}{8}{16} \\     \ganttbar{Fase5}{17}{20}     \end{ganttchart}          \caption{Planning}     \end{figure}


title: Forcing latex to place table floats before the end of subsection

text: I have a chapter, where my data tables are big and cover whole page. I have few subsections with different results shown in tables and I don't want them to mix up. So, right now I have more or less following layout               \chapter{Some chapter}     \section{results}     \subsection{Test 1}     1-2 pages of text here     \begin{table}[!p]     Table 1     ... really big table that takes whole page     \end{table}     \begin{table}[!p]     Table 2     ... really big table that takes whole page     \end{table}     \subsection{Test 2}     1-2 pages of text here     \begin{table}[!p]     Table 3     ... really big table that takes whole page     \end{table}     \begin{table}[!p]     Table 4     ... really big table that takes whole page     \end{table}      But what I get is more or less:               Beginning of "Test 1" subsection     Table 1     Beginning of "Test 2" subsection     Table 2     Table 3     Table 4      Is there a way to force full-page floats to place before the end of the subsection where they were placed?


title: Size and position of array

text: The following is an extract from my LaTeX file which describes a `table`. The table has a fair amount of space below it. I would, therefore, like to increase the `arraystretch`. However, by increasing it slightly, the table moves to the next page. Why does LaTeX think the table is too big for the first page? How can I force it to put the table right after the text? Thanks!               \documentclass[a4paper,12pt]{article}          \usepackage{amsmath,graphicx,fullpage,microtype,hyperref,subfig,hypcap,amsfonts,parskip,multirow,titlesec}          \titlespacing\section{0pt}{20pt plus 4pt minus 2pt}{2pt plus 4pt minus 2pt}     \titlespacing\subsection{0pt}{16pt plus 4pt minus 2pt}{2pt plus 4pt minus 2pt}          \widowpenalty=2000     \clubpenalty=2000     \hyphenpenalty=400     \interfootnotelinepenalty=400     \DisableLigatures{encoding=*,family=*}     \numberwithin{equation}{section}     \hypersetup{colorlinks,citecolor=black,filecolor=black,linkcolor=black,urlcolor=black}          \begin{document}          \section{Payoff Matrix}     \label{sec:Payoff Matrix}          From the brief description in section~\ref{sec:Model and Assumptions} and the full description of section~\ref{sec:Extensive Form}, it is straight forward to create the payoff matrix, which shows the expected payoff to the sender and to the receiver as a function of their strategies.          \vspace{6mm}          \begin{table}[h]     \small     \renewcommand\arraystretch{1.05}     \begin{center}     \begin{tabular}{l||lr|lr}      &\multicolumn{2}{c|}{AA}&\multicolumn{2}{c}{AK}\\     \hline     \hline     \multirow{2}{*}{GGGG}& &$1$& &$1$\\     &&&&\\      &$p$& &$p$& \\     \hline     \multirow{7}{*}{GGGB}& &$p(1-e_{1})+$& &$p(1-e_{1})+$\\      & &$p(e_{1})(1-e_{3})+$& &$p(e_{1})(1-e_{3})+$\\      & &$(1-p)(e_{1})+$& &$(1-p)(e_{2})+$\\      & &$(1-p)(1-e_{1})(1-e_{3})$& &$(1-p)(1-e_{2})(e_{3})$\\     &&&&\\      &$p(1-e_{1})+$& &$p(1-e_{1})+$& \\      &$p(e_{3})(1-e_{3})+$& &$p(e_{1})(1-e_{3})+$& \\      &$(1-p)(1-e_{1})(e_{3})$& &$(1-p)(1-e_{2})(e_{3})$& \\     \hline     \multirow{4}{*}{GGBB}& &$p(1-e_{1})+$& &$p(1-e_{1})$\\      & &$(1-p)(e_{1})$& &$(1-p)(e_{2})$\\     &&&&\\      &$1-e_{1}$& &$p(1-e_{1})+$& \\      &$ $& &$(1-p)(1-e_{2})$& \\     \hline     \multirow{4}{*}{GBGB}& &$x$& &$x$\\      & &$x$& &$x$\\     &&&&\\      &$x$& &$x$& \\      &$x$& &$x$& \\     \hline     \multirow{7}{*}{GBBB}& &$x$& &$x$\\      & &$x$& &$x$\\      & &$x$& &$x$\\      & &$x$& &$x$\\     &&&&\\      &$x$& &$x$& \\      &$x$& &$x$& \\      &$x$& &$x$& \\     \hline     \multirow{2}{*}{BBBB}& &$0$& &$0$\\     &&&&\\      &$1-p$& &$1-p$&      \end{tabular}     \end{center}     \caption{The payoff matrix}     \label{eq:Label}     \end{table}          \end{document}


title: How to control the position of floating images?

text: > **Possible Duplicate:**   >  Keeping tables/figures close to where they are mentioned I want to make it like this:               text     image     text     image      But even if I put `[h!]` to the position the figures, the figure is moved to the next page because it is too large. The text which should be under the figure goes up over it!!! How I can fix it?


title: Best way to get an image just HERE

text: > **Possible Duplicate:**   >  Force figure placement in text I often needed to attach an image yo my latex document and wanted it to appear just there when I imported it. I know latex is meant to put the image wherever it's best for him, but sometimes that isn't acceptable. As an example I have big images which are meant to take almost the whole page. So I only want a page with a subsection title and then the image. It looks like there is enough space for both, but after compiling I see the subsection alone in an empty page, and then the image into the next page alone too. Or If I have to repeat this for 4 subsections, I can get 4 empty pages in a row with the subsections and then 4 pages in a row with the images. I'm working this way because they are big schemas and I don't need to put a reference into the text, just a title and the image. I remember using H! instead of h other times, and it didn't worked as expected either. So... how can I do this? I took @Mico 's answer and works with one of the images I tested, but it'd doesn't for ![this table:](http://i.stack.imgur.com/3TsH5.png) The code used is:               \afterpage{     \chapter{Esquemáticos y PCB}     \clearpage     % flush out other floats waiting to be typeset     \begin{table}     \centering     \begin{tabular}{@{}cp{10cm}@{}}     \toprule     Nº referencia & Descripción \\     \cmidrule(l){1-1}\cmidrule(l){2-2}     3113067-01 & Esquemático del primer prototipo de placa (página 1)\\     3113067-02 & Esquemático del primer prototipo de placa (página 2)\\     3113067-03 & Esquemático del primer prototipo de placa (página 3)\\     3113067-04 & Cara TOP de la PCB del primer prototipo de placa\\     3113067-05 & Cara BOTTOM de la PCB del primer prototipo de placa\\     3113067-06 & Vías de la PCB del primer prototipo de placa\\          3113067-07 & Esquemático del diseño final de placa (página 1)\\     3113067-08 & Esquemático del diseño final de placa (página 2)\\     3113067-09 & Esquemático del diseño final de placa (página 3)\\     3113067-10 & Cara TOP de la PCB del diseño final de placa\\     3113067-11 & Cara BOTTOM de la PCB del diseño final de placa\\     3113067-12 & Vías de la PCB del diseño final de placa\\          3113067-13 & Esquemático de la placa de la tarjeta SD \\     3113067-14 & Cara TOP de la PCB de la placa de la tarjeta SD\\     3113067-15 & Cara BOTTOM de la PCB de la placa de la tarjeta SD\\     3113067-16 & Vías de la PCB de la placa de la tarjeta SD\\     \bottomrule     \end{tabular}     \caption{Referencia y descripción de los planos del Apéndice A}     \label{planostable}     \end{table}           \clearpage}  % prevent other material from being placed on this page


title: Picture "stuck" in a position

text: I am inserting several figures in my text with the `\includegraphics` command but some of them are not being placed correctly and they don't move when I change the command's parameters. This works correctly:               \begin{figure}[h]\caption{\label{f5}Innovation intensity}     \includegraphics[width=10.9cm,height=6cm]{c:/RESULTADO15.eps}     \end{figure}      But this does not work:               \begin{figure}[h]\caption{\label{f9}Chi-Square for trigger factors group}     \includegraphics[width=10.9cm,height=6cm]{c:/clustertrigger.pdf}     \end{figure}      and               \begin{figure}[h]\caption{\label{f9}Chi-Square for trigger factors group}     \includegraphics[bb=100 130 300 200,viewport=0 150 1000 380,scale=.6]{c:/clustertrigger.pdf}     \end{figure}      and also:               \begin{figure}[h]\caption{\label{dkpt} IT Employment in Denmark and Portugal}     \begin{center}     \includegraphics[bb=-90 130 300 200,viewport=0 0 1000 380,scale=.4]{c:/dkpt.eps}     \end{center}     \end{figure}      So, I have the problem both with EPS and PDF files. I tried changing `bb`, `viewport`, `scale`, `width` and `height` many many times with different values and the pictures are always in the same place. They don't move!! But some files are OK! I don't understand what's going on. Can someone help me? I don't know what to try next because it seams as if the commands are not working proprely. I am using MiKTeX.


title: Display table in correct subsection

text: > **Possible Duplicate:**   >  Keeping tables/figures close to where they are mentioned In my example I have two subsections. Each of them contains single table. I need each table to be displayed under the correct heading. Now I have:   1\. text of subsection C   2\. text of subsection E   3\. table D   4\. table F I want the order to be: 1\. text of subsection C 2\. table D 3\. text of subsection E 4\. table F I don't care if there would be half page blank.               \documentclass{article}     \usepackage{lipsum}     \begin{document}          \section{B}     \subsection{C}     \lipsum[1]     \begin{table}     \begin{tabular}{c}     a\\     a\\     a\\     a\\     a\\     a\\     a\\     a\\     a\\     a\\     a\\     a\\     a\\     a\\     a\\     a\\     a\\     a\\     a\\     a\\     a\\     a\\     a\\     a\\     a\\     a\\     a\\     a\\     a     \end{tabular}     \caption{D}     \end{table}          \subsection{E}     \lipsum[2-4]     \begin{table}     \begin{tabular}{c}     b\\     b\\     b\\     b\\     b\\     b\\     b\\     b\\     b\\     b\\     b\\     b\\     b\\     b\\     b\\     b\\     b\\     b\\     b\\     b\\     b\\     b\\     b\\     b\\     b\\     b\\     b\\     b     \end{tabular}     \caption{F}     \end{table}          \end{document}


title: How to avoid later content appear before a subfloat figure?

text: My LaTeX is like this:               Here is the result figure:          \begin{figure}       \begin{tabular}{cccc}         \subfloat[Original]{\includegraphics[foo.png]}         %...       \end{tabular}     \end{figure}          (Content after the figure but shown before the figure)      If there can be too much space below the figure, LaTeX will move the content after the figure backward to before the figure. How to change this behavior, i.e., ensure there's no other content between the line "Here is the result figure" and the actual figure?


title: Figure not being places in correct area

text: I have a document where I have typed some text and want a figure to occur below it. The code is shown below:               Consider the figure below:          \begin{figure}[h]     \begin{center}     \includegraphics[scale=0.6]{plot2.png}     \end{center}     \caption{This is a figure}     \end{figure}      But the figure ends up going onto the next page. How would I fix this?


title: Graphics not showing up where I want them to

text: > **Possible Duplicate:**   >  Force figure placement in text Quite new to LaTeX so I apologize if this is a rookie/obvious error. I'm trying to include some figures in a college report I'm doing. However, the figures keep popping up all over the place. My source looks something like this:               Lorem ipsum dolor sit amet, consectetur adipiscing elit.Curabitur convallis      augue et nisl eleifend vitae convallis massa ultricies. Cras iaculis sem nec     turpis euismod interdum. Vestibulum eget ligula metus, sit amet pulvinar lorem.          \begin{figure}     \begin{center}     \includegraphics[scale=1]{my_graphic}     \caption{My graphic}     \end{center}     \end{figure}          Sed vulputate ligula non quam congue consectetur. Ut erat massa, lacinia sed      mattis vitae, pretium nec quam. Pellentesque faucibus hendrerit lacinia. Sed      in massa erat. Praesent massa mauris, dapibus at euismod at, iaculis      eleifend nulla.      However, instead of the graphic showing up between the two paragraphs when I build it, it pops up somewhere seemingly randomly nearby. Why is it not appearing between my two paragraphs like I have in my source? Urgently need help solving this, thanks.


title: Using \includegraphics before my new line of text, but on pdf image is after the text

text: > **Possible Duplicate:**   >  How to influence the position of float environments like figure and table > in LaTeX? sometimes im in trouble with my images. Because if there is no space on one page, the images is getting printed on the next page. Thats fine, but if I write a text **after** the image on the pdf the text is before the image. Something like this:               \begin{figure}[htb]     \centering     \includegraphics*[width=1\textwidth]{myimage.pdf}     \caption{\em Description}     \label{fig:myimage}     \end{figure}          \hspace{0pt}     \\          MyText. But this text appears sometimes before the image and not after how it should be.      I saw this question. People are explaining h,t,b but its not helping me. How can I solve this problem? Thank you Edit: I could solve this problem with adding a lot of new lines, something like this:               \begin{figure}[htb]     \centering     \includegraphics*[width=1\textwidth]{myimage.pdf}     \caption{\em Description}     \label{fig:myimage}     \end{figure}          \hspace{0pt}     \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\          Now its fine.      But this cannot be the solution...


title: Positioning figures

text: I want to force a table and a figure to appear in a page with nothing except them. I've tried `\clearpage` but it makes lots of extra spaces in the document. Also some of the figs appear in the end of the document although I have placed them in the middle of the document. This is the code I'm using :               \begin{figure*}[ht]     {\includegraphics[width=\linewidth]{pic1}}\caption{example_fig}      \label{fig1}     \end{figure*}          \begin{table*}[ht]     \begin{tabularx}{\linewidth}{@{}>{\hsize=0.8\hsize}X *2{>{\hsize=1.1\hsize}X}@{}}     a & b & c \\[0.7ex]     \end{tabularx}     \caption{example}     \label{tab:template}     \end{table*}      So if anyone could please assist me.


title: knitr : Figure are not appearing at the correct place

text: I'm trying to use knitr while learning LaTeX but all my figures are placed at a seemingly random place. It's driving me insane. Any ideas? Example Input PDF Output I tried reinstalling TeX Live and R but nothing changed EDIT : Ok, I solved more or less the problem by wrapping all chunk in \begin{figure}[H] \end{figure} LaTeX is complaining but it works ( R 2.15.2, Rstudio, Tex live )


title: What are graphics being displayed at the end of the section?

text: > **Possible Duplicate:**   >  Keeping tables/figures close to where they are mentioned I am including graphics into my latex documents as below:               \begin{figure}[abc]     \begin{center}     \includegraphics[width=\textwidth]{abc.eps}     \end{center}     \caption{Same caption}     \label{fig:abc}     \end{figure}      Only the first image is being displayed where I have inserted it. Rest all images are being displayed at the end of the section. Note: I have designed some images in Dia diagram editor and converted them to PNG. Then I used `convert abc.png eps3:abc.eps` to convert them to EPS format.


title: How can I make a graphic appear underneath the \subsection it is inserted under?

text: > **Possible Duplicate:**   >  Keeping tables/figures close to where they are mentioned I have a .tex document which generates a several paged .pdf document. I have inserted several images of charts / graphs into the document like this:               \section*{section header}          \subsection*{sub section header}     \begin{figure}[htbp]     \centering         \includegraphics{C:/Documents/Samples/image 1.png}     \caption{A caption}     \label{fig:reference}     \end{figure}      What this produces in my multi-paged document is that the image appears on its own page and the section header and sub section header appear after the image despite being inserted before the image in the .tex document. When I test this out as in a sample document:               \documentclass{article}     \usepackage{graphicx}     \usepackage{grffile}     \begin{document}     \section*{section header}     \subsection*{subsection header}          \subsubsection*{(i)}          \begin{figure}[htbp]     \centering         \includegraphics{C:/Documents/Samples/image 1.png}     \caption{A caption}     \label{fig:reference}     \end{figure}     \end{document}      I do not get this problem. It only seems to occur in my multi-paged document when the image is inserted either side of pages that would otherwise be filled with text. The images have been inserted using the Insert > Picture option in TeXnicCenter toolbar. Is there a way to make the graphic appear after the relevant section and subsection and not on its own page before the section and subsection?


title: How to remove vertical spacing before tables?

text: I'm using the book class and I created a table. The table is alone on page and the spacing to the upper edge of the paper is too big. How can I reduce? I tried using `\setlength{\textfloatsep}{0.1cm}` but nothing happened. Here is my code:               \documentclass{book}      \usepackage[german]{babel}     \usepackage[utf8]{inputenc}     \usepackage{graphicx}     \usepackage{caption}     \usepackage{booktabs,dcolumn}     \usepackage[figureposition=bottom]{caption}     \usepackage{fancyhdr}     \fancyhf{}     \fancyhead[C]{\leftmark}     \fancyhead[R]{\thepage}     \pagestyle{fancy}     \renewcommand{\headrulewidth}{0.4pt}     \renewcommand{\chaptermark}[1]{      \markboth{#1}{}}     \newcolumntype{d}[1]{D{.}{.}{#1}}     \newcommand*{\mc}[1]{\multicolumn{1}{c}{#1}}     \newcommand*{\mcTwo}[1]{\multicolumn{2}{c}{#1}}     \linespread{1.8}     \setlength\parindent{0pt}     \begin{document}      \chapter {Hello world}      \section{Hello world}      \lipsum     \begin{table}[htbp]          \centering          \caption{Zusammensetzungen einiger SX-Nickelbasislegierungen in wt\%.}          \label{tbl:1}           \begin{tabular}{c d{2.1} d{2.1} d{2.1} d{1.1} d{1.1} d{1.2} d{1.1} d{1.1} d{1.1} d{1.1} d{1.0} d{1.2}}            \toprule             Alloy & \mc{Ni} & \mc{Cr} & \mc{Co} & \mc{Mo} & \mc{W} & \mc{Al} & \mc{Ti} & \mc{Ta} & \mc{Re} & \mc{Nb} & \mc{V} & \mc{Hf} \\            \midrule             \mcTwo{First generation} & & & & & & & & & & & \\            \midrule             PWA~1480    & 62.5 & 10   &  5   & \mc{---} & 4        & 5    & 1.5      & 12   & \mc{---} & \mc{---} & \mc{---} & \mc{---} \\[1ex]             Ren{\'e}~N4 & 62.6 &  9   &  8   & 2        & 6        & 3.7  & 4.2      &  4   & \mc{---} & 0.5 & \mc{---} & \mc{---}      \\[1ex]             CMSX-2      & 66.6 &  8   &  4.6 & 0.6      & 7.9      & 5.6  & 0.9      &  5.8 & \mc{---} & \mc{---} & \mc{---} & \mc{---} \\[1ex]             SRR~99      & 66.5 &  8.5 &  5   & \mc{---} & 9.5      & 5.5  & 2.2      &  2.8 & \mc{---} & \mc{---} & \mc{---} & \mc{---} \\            \midrule             \mcTwo{Second generation} & & & & & & & & & & & \\            \midrule             PWA~1484    & 59.4 &  5   & 10   & 2        & 6        & 5.6  & \mc{---} &  9   & 3        & \mc{---} & \mc{---} & \mc{---} \\[1ex]             Ren{\'e}~N5 & 61.8 &  7   &  8   & 2        & 5        & 6.2  & \mc{---} &  7   & 3        & 0.5      & \mc{---} & 0.2      \\[1ex]             CMSX~4      & 61.8 &  6.5 &  9   & 0.6      & 6        & 5.6  & 1        &  6.5 & 3        & \mc{---} & \mc{---} & 0.1      \\[1ex]             CMSX~6      & 70.4 & 10   &  5   & 3        & \mc{---} & 4.8  & 4.7      &  2   & \mc{---} & \mc{---} & \mc{---} & 0.1      \\[1ex]            \midrule             \mcTwo{Third generation} & & & & & & & & & & & \\            \midrule             CMSX-10     & 69.6 &  2   &  3   & 0.4      & 5        & 5.7  & 0.2      &  8   & 6        & 0.1      & \mc{---} & 0.03     \\[1ex]             Ren{\'e}~N6 & 57.4 &  4.2 & 12.5 & 1.4      & 6        & 5.75 & 0        &  7.2 & 5.4      & 0        & 0        & 0.15     \\            \bottomrule           \end{tabular}         \end{table}         \end{document}


title: How to ensure table is on a certain page

text: > **Possible Duplicate:**   >  Keeping tables/figures close to where they are mentioned I have a doc that has several tables in it. Each section of my end document is in a separate .tex file. In some of my files I have tables in them. Say, for example, section 4 has two tables. Currently the first table for section four does not begin on any of the pages that section 4 is on. Section 5 starts at the end of the last page, but the first section 4 table appears on the next page, which does not have any of the section 4 text in it. How do I ensure these tables appear on pages that have section 4 text on them?


title: Image positioning in new page

text: If i use the following code, my image is placed in the center of the page, horizontal as vertical. I think this happens, because the section above ended on the page before. I want it to go to the top of the page and then continue with text in a new page. If i would insert new text above the image, it should move down only as much as necessary.               \begin{figure}[h]     \begin{center}     \includegraphics[width=15cm]{images/g550}\caption{G550 \cite{bild_g550}}     \end{center}     \end{figure}     \clearpage{}      I'm using the `scrrprt` class.


title: The place of my table

text: > **Possible Duplicate:**   >  Keeping tables/figures close to where they are mentioned   >  How to influence the position of float environments like figure and table > in LaTeX? My problem is that my table isn't insert in the right place despite I specify when I would like to place it. This is my code:               \subsubsection{* Réseau 3:}     Nous allons maintenant partager la publication dans le réseau 3.      \paragraph{Page ayant le nombre minimal d'amis:}     Pour ce type de page nous allons partager la même publication avec les dix pages qui ont le nombre minimal d'amis dans le réseau.          \begin{table}[h]     \begin{center}     \begin{tabular}{|c|c|c|c|}      %\begin{tabular}{|p{2cm}|p{2.1cm}|p{3.5cm}|p{3.3cm}|p{1.6cm}|p{1.7cm}|p{1.7cm}|}       \hline      \bf Id Page  & \bf Politique de Partage & \bf Nombre Amis & \bf Nombre Pages qui ont reçu la pub \\       \hline        156 & Amis et leurs Amis & 64&237 \\        231&Amis Seulement&66&66\\        124&Amis et leurs Amis&67&217\\        182&Amis Seulement&68&68\\        70&Tout le Monde&68& 250\\        241&Amis Seulement&68&68\\        102&Amis et leurs Amis&68&233\\        171&Amis Seulement&68&68\\        59&Tout le Monde &69&250\\        81&Amis et leurs Amis&69&209\\                  \hline        \multicolumn{3}{|c|}{Moyenne des pages qui ont reçu la publication }&7              \\         \hline       \end{tabular}     \end{center}     \bf {\caption{Publication partagée avec une page ayant un nombre minimal d'amis dans réseau 3}}     \end{table}          \paragraph{Page ayant le nombre moyen d'amis:}     Pour ce type de page nous allons partager la même publication avec les dix pages qui ont le nombre moyen d'amis dans le réseau.     \begin{table}[!h]     \begin{center}     \begin{tabular}{|c|c|c|c|}      %\begin{tabular}{|p{2cm}|p{2.1cm}|p{3.5cm}|p{3.3cm}|p{1.6cm}|p{1.7cm}|p{1.7cm}|}       \hline      \bf Id Page  & \bf Politique de Partage & \bf Nombre Amis & \bf Nombre Pages qui ont reçu la pub \\       \hline        42 & Tout le Monde & 42&250 \\        83&Amis et leurs Amis&82&245\\        109&Amis et leurs Amis&82&220\\        141&Amis et leurs Amis &82&235\\        153&Amis et leurs Amis&82&249\\        209&Amis Seulement&82&82\\        218&Amis Seulement&82&82\\        141&Amis et leurs Amis&82&244\\        5&Tout le Monde &82&250\\        56&Tout le Monde&82&250\\                  \hline        \multicolumn{3}{|c|}{Moyenne des pages qui ont reçu  la publication }&210.7              \\         \hline       \end{tabular}     \end{center}     \bf {\caption{Publication partagée avec une page ayant un nombre moyen d'amis dans réseau 3}}     \end{table}      \paragraph{Page ayant le nombre maximal d'amis:}     Pour ce type de page nous allons partager la même publication avec les dix pages qui ont le nombre maximal d'amis dans le réseau.     \begin{table}[!h]     \begin{center}     \begin{tabular}{|c|c|c|c|}      %\begin{tabular}{|p{2cm}|p{2.1cm}|p{3.5cm}|p{3.3cm}|p{1.6cm}|p{1.7cm}|p{1.7cm}|}       \hline      \bf Id Page  & \bf Politique de Partage & \bf Nombre Amis & \bf Nombre Pages qui ont reçu la pub \\       \hline        161 & Amis Seulement & 101&101 \\        137&Amis et leurs Amis &99&237\\        243&Amis Seulement&98&98\\        44&Tout le Monde &98&250\\        133&Amis et leurs Amis &97&214\\        8&Tout Le Monde&97&250\\        188&Amis Seulement&96&96\\        20&Tout le Monde&95&250\\        53&Tout le Monde&95&250\\        11&Tout le Monde&94&250\\                  \hline        \multicolumn{3}{|c|}{Moyenne des pages qui ont reçu la publication} &199.6\\                    \hline       \end{tabular}     \end{center}     \bf {\caption{Publication partagée avec une page ayant un nombre maximal d'amis dans réseau 3}}     \end{table}


title: How do I place a tikz picture?

text: Suppose i have a tikz picture, and in the latex code, I put it between a theorem and a definition, but when I compile, the picture shows up in the middle of the theorem's proof. I think its because the compiler doesn't want any blank space, so it puts the picture where its convenient. How do I specify where exactly to place the picture?


title: figure positioning

text: I have this code               \documentclass{article}          \usepackage[demo]{graphicx}          \begin{document}          \subsection{Local Analysis: Steady State A}              \begin{figure}[ht!]         \centering         \includegraphics[width=70mm]{local_Analysis.jpg}         \caption{Local Analysis}         \label{local_analysis_A}         \end{figure}          \end{document}      As you can see the figure is after the `\subsection` command, but when i compile my document it appears before the subsection. Can someone help me on this ? Thanks


title: How to make a non-float subfigure environment?

text: I am writing a document class `report` that has a maximum page limit. I tend to stay away from float environments for tables and figures since I like to have them where I code them in (I try `[h]`, and sometimes it works, sometimes it doesn't). For example, for figures I usually do this:               \begin{center}       \includegraphics[scale=0.6]{figure.png}       \captionof{figure}{caption}       \label{fig:figure}     \end{center}      But I have to make a subfigure for some of my report's pictures. Here is the code for the subfigure:               \begin{figure}[h]       \centering       \begin{subfigure}{0.5\textwidth}         \centering         \includegraphics[width=\linewidth]{figure1.png}         \caption{caption}         \label{fig:figure1}       \end{subfigure}       \begin{subfigure}{0.5\textwidth}         \centering         \includegraphics[width=\linewidth]{figure2.png}         \caption{figure2 caption}         \label{fig:figure2}       \end{subfigure}       \caption{figures}       \label{fig:figures}     \end{figure}      Is there a way to convert this into a non float environment or some package to ensure it will be always where I code it in?


title: Figure goes automatically to next page

text: > **Possible Duplicate:**   >  How to influence the position of float environments like figure and table > in LaTeX? I've created a PNG image with Microsoft Visio and I want to put it in a document I'm making with LaTeX. The problem is that the image automatically goes to the next page whenever I try to insert it, when there is a lot of space under the paragraph above it. I already try trimming and clipping it to see if maybe the figure simply had lots of blank space above it, but it doesn't, annd it goes to the next page for no reason. I tried the following:               \begin{figure}         \begin{center}         \includegraphics[width=0.8\textwidth]{fig_name}         \caption{insert caption}         \label{fig: figure}         \end{center}     \end{figure}      The problem is that it doesn't work. Does anyone know where the problem is?


title: Controlling placement of figures in text

text: > **Possible Duplicate:**   >  How to influence the position of float environments like figure and table > in LaTeX? How does one manipulate the placement of figures within text? I can't seem to control which text appears before the diagram and which comes after. Here is the sample code for my figure:               \begin{figure}     \begin{tikzpicture}     \matrix (m) [matrix of math nodes,row sep=0.5em,column sep=0.5em,minimum width=0.5em]     {     D1  &          & F1 &             & D2  \\                 &   \alpha &      & \beta     &         \\     F2          &        &      &               & F2      \\                 &   -\beta &          & -\alpha &             \\     D2  &            & F2 &         &   D1  \\           };     \path[-] (m-1-1) edge [] node [] {} (m-5-5);     \path[-] (m-1-3) edge [] node [] {} (m-5-3);     \path[-] (m-3-1) edge [] node [] {} (m-3-5);     \path[-] (m-1-5) edge [] node [] {} (m-5-1);     \end{tikzpicture}     \end{figure}      Anyways I just need to learn how to control the placement insofar as before or after certain paragraphs, I don't care about any kind of strict control. Is this something that is simple?


title: Inserting Images in LaTeX

text: I just installed MikTeX on my computer, and I'd like to know how to insert centered images within the body of a solution set I'm composing for an honors linear algebra class.


title: How to force LaTeX to place a figure exactly where I want

text: > **Possible Duplicate:**   >  Force figure placement in text   >  How to influence the position of float environments like figure and table > in LaTeX? How can I force LaTeX to insert a figure exactly where I want. Here's the code I use:               \lstset{framexleftmargin=0mm, frame=shadowbox, rulesepcolor=\color{black},basicstyle=\ttfamily\small,breaklines,     columns=fullflexible}     \begin{figure} [htbp!]     \begin{lstlisting}     root@bt:~# nmap -O www.we****t***.com          Starting Nmap 6.01 ( http://nmap.org ) at 2012-12-21 15:38 CET     Nmap scan report for www.we****t***.com (217.6*.***.**)     Host is up (0.0087s latency).     Not shown: 990 filtered ports     PORT     STATE  SERVICE     21/tcp   open   ftp     22/tcp   open   ssh     53/tcp   open   domain     80/tcp   open   http     110/tcp  open   pop3     143/tcp  open   imap     443/tcp  open   https     587/tcp  closed submission     3306/tcp open   mysql     Device type: general purpose     Running (JUST GUESSING): Linux 2.6.x (90%)          Aggressive OS guesses: Linux 2.6.22 (90%),     OpenWrt Kamikaze 7.09 (Linux 2.6.27) (89%),     Linux 2.6.18 - 2.6.24 (89%),     Linux 2.6.23 (86%)          No exact OS matches for host (test conditions non-ideal).          OS detection performed.     Please report any incorrect results at http://nmap.org/submit/ .     Nmap done: 1 IP address (1 host up) scanned in 79.16 seconds     \end{lstlisting}     \caption{Nmap -O}     \end{figure}      LaTeX places the figure on another page which is astonishing since it makes the whole work ugly. Here's the preamble I use:               \documentclass[a4paper,singleside,11pt]{report}     \usepackage{ia_urb_thesis}     \usepackage[italian]{babel}     \usepackage[latin1]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{graphicx}     \usepackage{color}     %\usepackage {listingsutf8}     %\usepackage{tikz}     \usepackage[thinlines]{easytable}     \usepackage{upquote}     \setcounter{secnumdepth}{5}     \setcounter{tocdepth}{5}          \usepackage{listings}     %\lstset{language=PHP}     \usepackage{url}     %\usepackage[pdftex]{graphicx}     \usepackage{amsmath}% http://ctan.org/pkg/amsmath     %\usepackage{epsfig}     %\usepackage{textcomp}          \begin{document}          \titolo{...Injection ...     \\[5mm]}     \candidato{xxx}     \relatore{Chiar.mo xxxx}     \annoaccademico{2011-2012}          \copertinatesi          \dedica{Ai miei genitori}     \indice     \indicefigure     \indicetabelle     \iniziatesto          \include{cap_1}     \include{cap_2}     \include{cap_3}     \include{cap_4}          \appendix     \include{app_a}     \include{biblio}          \ringraziamenti     Vorrei ringraziare ...          \end{document}


title: Formatting table caption

text: So I have my table               \begin{table}     \center     \begin{tabular}{| l | l | l | l |}\hline     table stuff     \end{tabular}     \caption{Lots of words about table}     \end{table}      I want it so that the caption fits to the table, kind of the same as changing the indents in Word. Is there a way to do this? Additionally, I have something similar to:               \newpage     \subsection{NAme}     TABLE STUFF INCLUDED ABOVE     \subsubsection{Name}      And the table appears at the top of the page, not in between the title of the subsection and the sub subsection. Can I change this?


title: I'm having trouble inserting an image in a TeX file

text: After reading some related question on how to insert an image into a TeX file I tried to do the following:                   \documentclass[11pt,a4paper]{report}         \usepackage[utf8]{inputenc}         \usepackage[T1]{fontenc}         \usepackage{lmodern}         \usepackage{graphicx}         \begin{document}         \section*{a section}         \subsection*{a subsection}         some text\         \begin{figure}         \centering         \includegraphics[width=0.7\linewidth]{vagabon}         \caption[]{an image}         \label{fig:vagabon}         \end{figure}\         some other text         \end{document}      ` but the output was: ![enter image description here](http://i.stack.imgur.com/xDTq8.png) with the image before the sections, and not in between the 2 lines of text. why is that? and what's the proper way to insert an image in the middle of a paragraph?


title: Set image in latex

text: I inserted an image, but LaTeX always put it on the top of the page, even if the example is down of the page, and I want to put it in an example. What do I have to do? Here is my `.tex` code:               \begin{exmp}     \begin{figure}     \floatbox[{\capbeside\thisfloatsetup{capbesideposition={left,top},     capbesidewidth=6cm}}]{figure}[\FBwidth]     {\caption{Asociemos a $v=\lbrace x_{1}, x_{2}, x_{3}\rbrace$ con el conjunto $\lbrace1,2,3\rbrace$ y el grupo $S_{3}$. }}     {\includegraphics[scale=.5]{g-permutacion.jpg} }     \end{figure}          \end{exmp}


title: How to fix the location of tables when they're imported with \input?

text: > **Possible Duplicate:**   >  Keeping tables/figures close to where they are mentioned I'm using MiKTeX and TexMaker 2.2.2. Using the latabstat command in Stata I create small tex files of some tables. They look like:               \begin{table}[htbp]\centering     \begin{tabular}     (table content)     \end{tabular}     \end{table}      When I compile my main document               \begin{document}     \input{tablefromstata}     \end{document}      The tables float around - and I want to fix them. Since the files contain the table command, putting table outside (in the main document), like               \begin{table}     \input{tablefromstata}     \end{table}      gives error messages. I tried the floating option `[H]` after the input string `input{}[h]` but it seems not to work on `input{}`. Does anybody know how I can determine the exact location of tables imported using `\input`? Thanks! **UPDATE:** Problem solved. Anyone with the same problem, just type [h] after the caption command in stata.