the figure is not placed in the correct position, LATEX with figure float position - latex

the figure is not placed in the correct position, I would like it to continue with the text instead it is positioned at the beginning of the page.
I tried putting [H] but it doesn't work
This is the code from jpp::
\newcounter{figure}
\renewcommand\thefigure{\#arabic\c#figure}
\def\fps#figure{tp}
\def\ftype#figure{2}
\def\ext#figure{lof}
\newcommand\figurename{Figure}
\def\fnum#figure{\figurename~\thefigure}
\newenvironment{figure}{\#float{figure}\fstyle#figure}{\end#float}
\def\fstyle#figure{\normalfont\small\rmfamily}
\def\fjust#figure{\centering}
\def\fcapjust#figure{\centering}
\def\fcapsize#figure{\normalfont\small\scshape}
\def\fcapstyle#figure{\normalfont\small\rmfamily}

Related

Position text in margin relative to paper border

I'm trying to write a macro that positions text in the margin of a LaTeX document. The text should appear in the same line the macro is called. Horizontal text position should be relative to the absolute border of the paper rather than the left side of the text.
I tried with the tabto package using the \tabto* command and then jump back to the location in the text with \tabto*{\TabPrevPos}. This works well but since tabto positions relative to the border of the text the result is different if you are in a list environment or similar.
So the whole command looks similar to:
\newcommand{\sidenote}[1]{%
\tabto*{\sidenoteskip}%
\smash{%
\begin{minipage}[t][1ex][t]{\sidenotewidth}%
\textbf{#1}%
\end{minipage}%
}%
\tabto*{\TabPrevPos}%
}
Does anywone have an idea how I can position the minipage relative to left paper border and jump back to the location where the macro was called?

CSS sprite position problem

I trying to create a fixed border to the site that dynamically change size with the browser window from this sprite (it isn't perfect I know.): http://fc07.deviantart.net/fs70/f/2011/269/7/0/bordersprite_by_nakos-d4ayzne.png
DEMO on jSFiddle
My problem as you can see is the vertical wall part. As the #falJ and #falB are height:100% they include the bottom wall's end too with the space between the two wall sprites. Is there a way to force backround-position to only use vertical wall part without bottom wall's end?
Thanks in advance.
Solution: http://jsfiddle.net/vonkly/Ld43B/
It's not the prettiest thing in the world, but it achieves what you want. Check out the source code & direct link for the background images to see what you'll need to do. It's currently set at 299px wide; I imagine you'll be using something wider.
I'd also suggest adding some padding around your content (either with a p tag, span, another div, etc.) - the way it is currently set up isn't what I'd recommend for readability.
EDIT
The only way I can imagine achieving a fluid width + height box with the borders that you have in the way that you want is to use a second image for the west and east containing divs. This should work with your current method.

Adjust white fill between paragraphs in LaTeX

Latex seems to fill in white space between the paragraphs by default, to get every page to end at approx the same height (at least with the book and scrreprt class). This is all fine, but I have a couple of pages with only two paragraphs. Latex insists on putting in 2cm of white space between them, which looks bad. I know that I can use \raggedrift for the whole document, but I kind of like the white fill except for the pages with only two paragraphs. I have also tried to adjust manually with \vspace{-1cm}, but it doesn't seem to work.
Is there a way to set a maximum value to the height of white fill between paragraphs?
If your mostly-empty pages are because the following content starts on a new page (at the end of a chapter, for example), then the easiest way to fix it is probably to insert a vertical fill after your last paragraph. The vertical fill should expand to occupy the extra space, keeping the inter-paragraph fill small.
You can change the vertical space applied to every paragraph by setting the value of \parskip.
The solution is very simple. At the end of the last paragraph of the page, add '\vfill'. This will fill up the rest of the page, making the two paragraphs on it move as close to each other as they would normally.
I just tested it myself and it works.

Aligning text to always be on the outside of line

I know how to align text diagonally, but I'm having trouble aligning the text to be always on the outside, as the diagram shows:
http://i38.tinypic.com/rs4zlj.png
The lines will always be positioned as a triangle.
What I get instead is, depending on the angle, text is inside or out (and upside down). Is there any math that can help me out here? I have the angle of every line, if that is helpful at all.

dealing with large figures in Latex

I have a large figure that appears at the end of my document rather than in the section that I want to be in. Even \begin{figure}[h] doesn't help. Without scaling it down, how can I put it at the end of the section I want it in?
Using the afterpage package can be a good solution. However, using the option here you are trying to tell LaTeX where you want to put the image. Instead, you need to tell LaTeX where the image is good to be put:
use \begin{figure}[tb] for figures that fit well in a page with text (say, half of the text height for the figure and the other half for the text)
use \begin{figure}[p] for floats large enough to require a dedicated page.
Setting a proper option increase your chances to have the image almost where you want, having at the same time a good page layout.
If the figure is still too far from the page where it should be placed, you can set some "barriers" for floats positioning with the packages placeins or afterpage (already mentioned).
Here is a small tutorial for float placement. The thing you want to do is put an \afterpage{\clearpage} command at the end of the section. This will create an additional page after the current one and place the floats that are left in the queque there. If the float still doesn't get placed, you have to resize it. If you really don't want to resize it and it should fit on the page, then you could try changing the margins and text area temporarily (i.e. just for that one page) and see if that lets the float get placed.
i forget if it's the float or array package that provides this, but,
\begin{figure}[H]
...
\end{figure}
The upper case H will put the figure exactly where it is in your code.

Resources