Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'd like to format my captions of figures. The main source of the problem is in my native language, Hungarian I need to reverse the figure number and the word 'figure'. My current code:


\renewcommand{\figurename}{}
\renewcommand{\thefigure}{\textbf{\arabic{figure}. ábra}}

And it looks like this, under the figures (ábra means figure):
1. ábra: The caption.
This is exactly what I want there, but this code has side effects.

First of it. When I refer to a figure with the code \ref{fig:marker}, it will look like this:
You can see it on the figure 1.
And I don't want it to be bold in the reference.

Second. With this code, the list of figure look like this: enter image description here
So it is also bold, contains the word 'figure' and overlapped with the caption. I know this is due to my renewcommand codes...

And the last one, which is the least important, and I think I need to write a macro to it.
When I refer to a figure I'd need to add a suffix to the word 'figure' in Hungarian, in order to get the meaning ON the figure. This thing is more complicated because the suffix has 3 forms according to the number. So I'd need to check if the number is 1 or 2 then the refered word would be this and if it is 3 or 6... then another.
My question about it: Is this possible to achieve at all? If not I will use another sentence when I refer, which is acceptable, but not so elegant. :)

Thank you in advance, Greg

share|improve this question
add comment

2 Answers 2

You should use the babel package and set the language to hungarian. This also changes the typesetting rules. If Number Figure is the proper sequence in Hungarian, it should automatically change this. On this (Hungarian) site you can find Babel documentation.

Edit: If you check page 207 of this document is says:

In the part, chapter, appendix name the number (or letter) goes before the name, so ‘Part I’ translates to ‘I. rész’.

The same is true with captions (‘Table 2.1’ goes to ‘2.1. táblázat’).

the command you should use in your preamble is:

\usepackage[hungarian]{babel}

or

\usepackage[magyar]{babel}
share|improve this answer
    
Thanks! This babel package works like charm. –  Greg May 16 '12 at 11:23
add comment

Those changes get easier when you use the caption package:

\documentclass[11pt]{article}
\usepackage{caption}
  \DeclareCaptionLabelFormat{swapped}{#2. \`{a}bra}
  \captionsetup[figure]{labelformat=swapped,labelfont=bf}
\begin{document}
\begin{figure}
  \caption[foo]{bar}
\end{figure}
\end{document} 

You can use DeclareCaptionLabelFormat to change the order, as well as the names itself. I'm not entirely sure that this is the nicest way to do this, I have the feeling that the babel package should take care of that. With:

\usepackage[hungarian]{babel} 

Formatting the text and the captions is also easier with the captions package, it takes care to only change the formatting at the site where the caption is, not for references or in lists, etc.

share|improve this answer
    
Thank you as well, I used the \usepackage{caption} \captionsetup[figure]{labelfont=bf} part of your code and the babel package. Now, it looks exactly what I wanted. –  Greg May 16 '12 at 11:24
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.