Latex: Text cannot be placed below image - layout

I'm having a problem with an image and some text. I have this code:
Some text...\\
\begin{figure}[ht]
\centering
\includegraphics[scale=0.75]{picture.jpg}
\caption{The caption}
\label{fig:picture}
\end{figure}
Some more text...
Basically, I want this:
Some text. (Above image in the code)
[end of page / new page]
image
Some more text. (Below the image in the code)
[start of new section]
But, what the above code gives me is this:
Some text. (Above image in the code)
Some more text. (Below the image in the code)
[end of page / new page]
image
[start of new section]
Latex insists on putting everything but a new section above the image even though its below the image in the code. Its probably because the image floats on top - but whats my alternative? There's not enough space on the first page to display the image there, to I cannot use [h] as the float-alignment.
I can "hack it", by creating an empty new section, like \section*{}, but this creates some white-space, which looks weird. Any suggestions?

If you really need to have the figure in that place, use the float package:
In the preamble:
\usepackage{float}
then, in the text:
Some text...
\begin{figure}[H]
\centering
\includegraphics[scale=0.75]{picture.jpg}
\caption{The caption}
\label{fig:picture}
\end{figure}
Some more text...
Even though, is more preferable to let LaTeX place the floats.
Another way to do the same thing is by using the caption package.
In the preamble:
\usepackage{caption}
then, in the text:
Some text...
\begin{center}
\includegraphics[scale=0.75]{picture.jpg}
\captionof{figure}[LOF entry]{The caption}
\label{fig:picture}
\end{center}
Some more text...

Use captionof instead of caption:
\usepackage{caption}
Some text...
\begin{center}
\includegraphics[width=0.6\textwidth]{picture.jpg}
\captionof{figure}{Caption contents}
\label{fig:picture}
\end{center}
Some more text...

Related

How can I change the font sizing within multiple lines of a string in Lua? (WoW Lua Question)

I am currently beginning to write functions for WoW WeakAura addons that use the WoW Lua in order to create the addon. I am trying to change the fonts within the printed string so that I have a Header essentially.
The code is essentially as follows:
return string.format("|cFFFFFFFFHeader Text|r\nRegular Text|r\nMore Regular Text|r\nEven More Regular Text")
The current printing returns all of the text the same size, but I just want to make the "Header Text" a size larger. I've found how to modify the colors, but I have yet to find anything similar for font size. Can someone assist?

NodeJS pdfkit text width

I'm trying to do a PDF using node's pdfkit but I'm having some problems related to the text width.
The result i want is something like this.
Overall comments: This is the comment
that will display here bla bla
extra text here
But what i get with my current code is this
Overall comments: This is the comment
that will display here blab bla extra text here
To write this piece of text i use the following code:
doc.font('Courier-Bold').text(padRight('Overall Comments:',28),{continued: true});
doc.font('Courier').text(audit.comment,{width: 100,align: 'justify'});
Where audit.comment is the text on the right and padRight returns the string with a fixed size of 28, adding spaces to the right.
It seems that it's ignoring the width option or I don't know how to use it.

Adding crop marks to existing PDF files

I'm kind of new to all the PDF crop/bleed/trim technicalities... but what I have is business cards in PDF format of about 9 x 5 cm. I just want to add the bleed and crop marks, or if not bleed margins then at least just the crop marks, at specified mm from the edges.
Is there anyway I can do this programmatically in linux? Like maybe by using pdftk or ghostscript or imagemagick or some php library? By crop marks I mean the little lines at each corner of the document. Is it possible to maybe just draw lines on the PDF using imagemagick, if there's no direct function available to do this? Please keep in mind I want to add the crop marks to existing cards, so I'm not making cards from scratch. I'm not sure but this might be called "imposition".
Can it be done easily via a desktop application?
try with latex
create file foobar-crop.tex
\documentclass{article}
\usepackage{pdfpages}
\usepackage[paperwidth=9cm,paperheight=5cm]{geometry}
\usepackage[cam,a4,center,pdftex]{crop}
\begin{document}
\includepdf[pages=-]{foobar.pdf}
\end{document}
compiling with
$ pdflatex foobar-crop.tex
will get you foobar-crop.pdf.
from: http://www.thbimage.com/pdf/adding_crop_marks_to_pdf_pan_2008_10_08_21_47_33_lutrina_.html

how do i create a text on path?

i really want to know how to create texts in a background using corel draw 4, for example on some currencies and certificates, you may have, "Bank of Ghana, Bank of Ghana", written plenty in a wavy style with small sized fonts in the background or if its a school, you have the name of the school written plenty but small small font size in the background. Any help please??
How to Create Text on Path as per Example
Draw a path
Type Text
Example
Select Both Path and ext
Click Text from Menu and Click Fit Text to Path
Example
Finish
If you find my answer helpful please mark it, So others can take the benefits of it.
You can add any text along the path of an open object like line or a closed object like squre or circle.
Draw any path (cirlce, squre, lines)
Type Text
Type Text
With Pick tool , select a path.
Select Path
Click Text Fit text to path.
Text-> Fit to Path
You can also edit fit text to a path by clicking these icons.
Edit Setting

LaTeX: How to make a fullpage vertical rule on every page?

I'm using LaTeX and I would like to have vertical rule along left side of page, topmargin to bottommargin, 0.5in from the left edge of the page. I want this on every page, so I assume that means it must somehow be tied to the header or the footer?
I've made no progress at all, so I need help with (1) making the full-length rule itself and (2) making it happen automatically on every page of the document.
Can someone tell me how to do that?
I got a working answer to my question on the Latex Community forum: http://www.latex-community.org/forum/viewtopic.php?f=5&t=9072&p=34877#p34877
The answer I got uses the 'Background' package and this code:
\documentclass{article}
\usepackage{background}
\usepackage{lipsum}% just to generate filler text for the example
\SetBgScale{1}
\SetBgAngle{0}
\SetBgColor{black}
\SetBgContents{\rule{.4pt}{\paperheight}}
\SetBgHshift{-9cm}
\begin{document}
\lipsum[1-90]
\end{document}
Works great and was easy to adjust to put one vrule in left margin area and one in the right margin area.
There could be a LaTeX package to do this for you, but I'm more of a TeX person, so I tried to come up with a TeX solution (not always the best idea to mix plain TeX with LaTeX but I think I have it working).
Try this. Box 255 is the box register that TeX places the page contents into before the page is output. What I've done is taken the existing output routine, and changed it to insert into box 255: a 0-height, 0-width infinitely shrinkable-but-overflowing set of boxes containing a rule that is the height of the page, 0.4pt thick and with any luck, half an inch away into the left. The existing contents of box 255 is then added after this rule. Then I call the previous output routine which outputs the page (which now includes a rule), and also the headers and footers.
\newtoks\oldoutput
\oldoutput=\expandafter{\the\output}%
\output{%
\setbox255\vbox to 0pt{%
\hbox to 0pt{%
\vsize\ht255%
\vbox to \ht255{%
\vss
\hbox to -0.5in{%
\hss
\vrule height \ht255 width 0.4pt%
}%
}\hss
}\vss
\box255%
}%
\the\oldoutput
}%
Put it before your \begin{document} command. This might not solve your problem completely, but hopefully it should get you started. Here's a great page for learning about TeX primitives and built-in things.
Have a look at the eso-pic package. From memory, what you want would look like this:
\AddToShipoutPicture{%
\setlength\unitlength{1in}%
\AtPageUpperLeft{%
\put(0.5,\topmargin){\vrule width .5pt height \textheight}%
}%
}
It's not clear in your question if you want the line to span the text area or the whole paper height. Depending on the case, you have to replace \topmargin and \textheight by the correct values, either 0pt or whatever your top margin is, or by \paperheight. See the geometry package if you don't already use it for how to control those dimensions.

Resources