GeneralPutting a character above another character

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
Whazupp
Posts: 9
Joined: Mon Nov 24, 2008 10:04 am

Putting a character above another character

Post by Whazupp »

Hello,

I'm looking for a way to put a character above another character, like putting a circle over A, such as in Å. Specifically, i'm trying to find out how to put characters over hebrew characters. I'm writing hebrew using a package called cjhebrew. Below is a picture of what i'm thinking about.

I can't use math mode because cjhebrew doesn't work there as far as i know.

Thanks in advance for any comments/ideas.
Attachments
Adding characters above others.
Adding characters above others.
hebrew.PNG (4.15 KiB) Viewed 13687 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

PGScooter
Posts: 31
Joined: Mon Jul 14, 2008 2:47 pm

Re: Putting a character above another character

Post by PGScooter »

Hi Wazupp,

I was waiting for someone more knowledgeable to respond to you, but now I guess I'll give it a go.

You can put the two characters that you want on top of each other in a box and then move the box up and down (with \raisebox maybe?).

Code: Select all

\parbox{1in}{\char1 \\ \char2}[\code]

Or, you can use a minipage and do pretty much the same thing but minipage allows you to align it vertically so I don't think you would need to raise or lower anything. I think either top or bottom alignment would work for you.

Did that help at all?

good luck!
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Putting a character above another character

Post by Stefan Kottwitz »

Hi,

a simple possibility using amsmath in math mode could be

Code: Select all

\stackrel{\circ}{\text{A}}
or use \genfrac (amsmath) or the old TeX command \atop or \limits.

Stefan
LaTeX.org admin
barcense
Posts: 10
Joined: Sun Jun 10, 2007 2:16 pm

Re: Putting a character above another character

Post by barcense »

I don't know anything about hebrew nor cjhebrew package but, perhaps, you can use the \diatop command from the ipa package including the package via \usepackage or copying its definition from ipa.sty.

good luck!
Whazupp
Posts: 9
Joined: Mon Nov 24, 2008 10:04 am

Putting a character above another character

Post by Whazupp »

Thanks for the tips! :)

I tested your ideas, and after getting inspired even more I came across the perfect and most flexible solution: The picture environment!

Code: Select all

\begin{picture}(width,height)%
	\put(x-coordinate,y-coordinate){The object you want there.}%
\end{picture}%
The hebrew worked perfectly with it. I created a picture with zero width, and then just inserted a circle (using \circle} or another symbol using the \put command. The objects can apparently be put outside of the picture, so it can have zero dimensions.

Thanks for all the help! :)
User avatar
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

Putting a character above another character

Post by Juanjo »

You can even use \put out of the picture environment (*). In such a case, the coordinates x and y in \put(x,y){text} refer to the current insertion point. Try this (with 12pt in \documentclass):

Code: Select all

\cjRL{\put(1,8){\tiny$\circ$}l'`\put(1,8){\put(0,7){\tiny$\circ$}\footnotesize r}dyh}
(*) \put, however, cannot be used in vertical mode, that is, for example, at the beginning of a paragraph. In such a case, it suffices to enclose \put in \mbox: \mbox{\put(x,y){text}}.
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
Post Reply