Hello: I have to setup caption formatting for Hungarian. In Hungarian I have to write "#. figure." instead of "Figure #:" The exact word for "figure" is "ábra", so what I want exactly is: "# ábra.", eg "1. ábra". How can I do it? (If I set the document language to Hungarian, the word "ábra" is shown correctly but the order is not correct; I get ,. ábra:#.) Another question: for caption text I want it to be justified and the last line of the caption centered. How can I do that? Thanks, bcsikos
Hi, Maybe something like the following gives what you want: \setupcaption[figure][numberstopper={ ábra.}] \setuplabeltext[figure={}] However I don’t know how you would like the reference to a figure appear in the text: maybe the above solution doesn’t give what you want, and so there is a need to setup alos the referencing commands. Best regards: OK
On 09 Apr 2015, at 00:13, Csikos Bela
wrote: Hello:
I have to setup caption formatting for Hungarian. In Hungarian I have to write "#. figure." instead of "Figure #:" The exact word for "figure" is "ábra", so what I want exactly is: "# ábra.", eg "1. ábra". How can I do it? (If I set the document language to Hungarian, the word "ábra" is shown correctly but the order is not correct; I get ,. ábra:#.)
Another question: for caption text I want it to be justified and the last line of the caption centered. How can I do that?
Thanks,
bcsikos
___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________
Am 09.04.2015 um 00:13 schrieb Csikos Bela
: Hello:
I have to setup caption formatting for Hungarian. In Hungarian I have to write "#. figure." instead of "Figure #:" The exact word for "figure" is "ábra", so what I want exactly is: "# ábra.", eg "1. ábra". How can I do it? (If I set the document language to Hungarian, the word "ábra" is shown correctly but the order is not correct; I get ,. ábra:#.)
Until the labels for hungarian are fixed you can use the \setuplabeltext command to set the right labels.
Another question: for caption text I want it to be justified and the last line of the caption centered. How can I do that?
\useMPlibrary[dum] \mainlanguage[hu] \setupcaption[figure][align=last,numberstopper=.] \setuplabeltext[hu][figure={, ábra}] \starttext \startplacefigure[title=\input{ward}] \externalfigure[dummy] \stopplacefigure \stoptext Wolfgang
Wolfgang Schuster írta:
Am 09.04.2015 um 00:13 schrieb Csikos Bela:
Hello:
I have to setup caption formatting for Hungarian. In Hungarian I have to write "#. figure." instead of "Figure #:" The exact word for "figure" is "ábra", so what I want exactly is: "# ábra.", eg "1. ábra". How can I do it? (If I set the document language to Hungarian, the word "ábra" is shown correctly but the order is not correct; I get ,. ábra:#.)
Until the labels for hungarian are fixed you can use the \setuplabeltext command to set the right labels.
Another question: for caption text I want it to be justified and the last line of the caption centered. How can I do that?
\useMPlibrary[dum]
\mainlanguage[hu]
\setupcaption[figure][align=last,numberstopper=.]
\setuplabeltext[hu][figure={, ábra}]
\starttext
\startplacefigure[title=\input{ward}] \externalfigure[dummy] \stopplacefigure
\stoptext
Wolfgang
Wolfgang, Otared: Thank you both for your suggestions. Unfortunately the caption modification works only partially. I could not make both the caption labels and the references look correct. When I use Wolfgang's example, I get the following: attachment file caption-example-2.pdf. I also tried different settings for caption label, here is the code: ------------------------------------------------ \starttext \setupcaption[figure][numberstopper={. ábra.}] \setuplabeltext[figure={}] Code: \verbatim{\setupcaption[figure][numberstopper={. ábra.}]} \par \verbatim{\setuplabeltext[figure={}]} Result: Reference to figure 1 (\in{figure}[figure-1]) \placefigure[][figure-1]{This is the caption}{\framed{Some figure}} \hairline \setupcaption[figure][suffix={. ábra},numberstopper={.}] \setuplabeltext[figure={}] Code: \verbatim{\setupcaption[figure][suffix={. ábra},numberstopper={.}]} \par \verbatim{\setuplabeltext[figure={}]} Result: Reference to figure 2 (\in{figure}[figure-2]) \placefigure[][figure-2]{This is the caption}{\framed{Another figure}} \hairline The caption should be: ``1. ábra. This is the caption'' The reference should be: ``(1. ábra)'' -- NO period after ``ábra'', without the word ``figure''. \stoptext ------------------------------------------------------------------------ I attach the generated pdf output: caption-example.pdf Unfortunately none of the above code variants gives the correct result. Despite of the bad "wording" I don't understand why numberstopper (.) doesn't appear after suffix (. ábra) in figure 2. Any way to fix these? The alignment=last option works. (This option is not mentioned among the options at the contextgarden wiki site, http://wiki.contextgarden.net/Command/setupcaptions.) Thanks, bcsikos
Am 09.04.2015 um 13:14 schrieb Csikos Bela
: Wolfgang Schuster írta:
Am 09.04.2015 um 00:13 schrieb Csikos Bela:
Hello:
I have to setup caption formatting for Hungarian. In Hungarian I have to write "#. figure." instead of "Figure #:" The exact word for "figure" is "ábra", so what I want exactly is: "# ábra.", eg "1. ábra". How can I do it? (If I set the document language to Hungarian, the word "ábra" is shown correctly but the order is not correct; I get ,. ábra:#.)
Until the labels for hungarian are fixed you can use the \setuplabeltext command to set the right labels.
Another question: for caption text I want it to be justified and the last line of the caption centered. How can I do that?
\useMPlibrary[dum]
\mainlanguage[hu]
\setupcaption[figure][align=last,numberstopper=.]
\setuplabeltext[hu][figure={, ábra}]
\starttext
\startplacefigure[title=\input{ward}] \externalfigure[dummy] \stopplacefigure
\stoptext
Wolfgang
Wolfgang, Otared:
Thank you both for your suggestions. Unfortunately the caption modification works only partially. I could not make both the caption labels and the references look correct.
When I use Wolfgang's example, I get the following: attachment file caption-example-2.pdf.
I also tried different settings for caption label, here is the code:
------------------------------------------------
\starttext
\setupcaption[figure][numberstopper={. ábra.}] \setuplabeltext[figure={}]
Code:
\verbatim{\setupcaption[figure][numberstopper={. ábra.}]} \par \verbatim{\setuplabeltext[figure={}]}
Result:
Reference to figure 1 (\in{figure}[figure-1])
\placefigure[][figure-1]{This is the caption}{\framed{Some figure}}
\hairline
\setupcaption[figure][suffix={. ábra},numberstopper={.}] \setuplabeltext[figure={}]
Code:
\verbatim{\setupcaption[figure][suffix={. ábra},numberstopper={.}]} \par \verbatim{\setuplabeltext[figure={}]}
Result:
Reference to figure 2 (\in{figure}[figure-2])
\placefigure[][figure-2]{This is the caption}{\framed{Another figure}}
\hairline
The caption should be: ``1. ábra. This is the caption''
The reference should be: ``(1. ábra)'' -- NO period after ``ábra'', without the word ``figure''.
\stoptext
------------------------------------------------------------------------
I attach the generated pdf output: caption-example.pdf
Unfortunately none of the above code variants gives the correct result. Despite of the bad "wording" I don't understand why numberstopper (.) doesn't appear after suffix (. ábra) in figure 2.
Any way to fix these?
The \setupcaption command needs a numbercommand key which can be used to set \setupcaption[numbercommand=\groupedcommand{}{…}]
The alignment=last option works. (This option is not mentioned among the options at the contextgarden wiki site, http://wiki.contextgarden.net/Command/setupcaptions.)
Take a look at the \setupalign page: http://wiki.contextgarden.net/Command/setupalign http://wiki.contextgarden.net/Command/setupalign Wolfgang
Am 09.04.2015 um 13:14 schrieb Csikos Bela
: Wolfgang Schuster írta:
Am 09.04.2015 um 00:13 schrieb Csikos Bela:
Hello:
I have to setup caption formatting for Hungarian. In Hungarian I have to write "#. figure." instead of "Figure #:" The exact word for "figure" is "ábra", so what I want exactly is: "# ábra.", eg "1. ábra". How can I do it? (If I set the document language to Hungarian, the word "ábra" is shown correctly but the order is not correct; I get ,. ábra:#.)
Until the labels for hungarian are fixed you can use the \setuplabeltext command to set the right labels.
Another question: for caption text I want it to be justified and the last line of the caption centered. How can I do that?
\useMPlibrary[dum]
\mainlanguage[hu]
\setupcaption[figure][align=last,numberstopper=.]
\setuplabeltext[hu][figure={, ábra}]
\starttext
\startplacefigure[title=\input{ward}] \externalfigure[dummy] \stopplacefigure
\stoptext
Wolfgang
Wolfgang, Otared:
Thank you both for your suggestions. Unfortunately the caption modification works only partially. I could not make both the caption labels and the references look correct.
When I use Wolfgang's example, I get the following: attachment file caption-example-2.pdf.
I also tried different settings for caption label, here is the code:
------------------------------------------------
\starttext
\setupcaption[figure][numberstopper={. ábra.}] \setuplabeltext[figure={}]
Code:
\verbatim{\setupcaption[figure][numberstopper={. ábra.}]} \par \verbatim{\setuplabeltext[figure={}]}
Result:
Reference to figure 1 (\in{figure}[figure-1])
\placefigure[][figure-1]{This is the caption}{\framed{Some figure}}
\hairline
\setupcaption[figure][suffix={. ábra},numberstopper={.}] \setuplabeltext[figure={}]
Code:
\verbatim{\setupcaption[figure][suffix={. ábra},numberstopper={.}]} \par \verbatim{\setuplabeltext[figure={}]}
Result:
Reference to figure 2 (\in{figure}[figure-2])
\placefigure[][figure-2]{This is the caption}{\framed{Another figure}}
\hairline
The caption should be: ``1. ábra. This is the caption''
The reference should be: ``(1. ábra)'' -- NO period after ``ábra'', without the word ``figure''.
\stoptext
------------------------------------------------------------------------
I attach the generated pdf output: caption-example.pdf
Unfortunately none of the above code variants gives the correct result. Despite of the bad "wording" I don't understand why numberstopper (.) doesn't appear after suffix (. ábra) in figure 2.
Any way to fix these?
Method 1 (set the left and right texts for the reference with the \in command): %%%% begin example \useMPlibrary[dum] \mainlanguage[hu] \setuplabeltext [hu] [figure={, ábra.}] \setupcaption[figure][numberstopper=.] \definereferenceformat[infigure][label=figurereference] \starttext \startplacefigure[reference=fig:dummy,title=Dummy figure] \externalfigure[dummy] \stopplacefigure See figure~1 (\in{}{ ábra}[fig:dummy]). \stoptext %%%% end example Method 2 (create your own reference command which uses a label without the period at the end): %%%% begin example \useMPlibrary[dum] \mainlanguage[hu] \setuplabeltext [hu] [figure={, ábra.}] \setuplabeltext [hu] [figurereference={, ábra}] \setupcaption[figure][numberstopper=.] \definereferenceformat[infigure][label=figurereference] \starttext \startplacefigure[reference=fig:dummy,title=Dummy figure] \externalfigure[dummy] \stopplacefigure See figure~1 (\infigure[fig:dummy]). \stoptext %%%% end example BTW: The plain TeX method for quotation marks (``…’’) doesn’t work with MkIV, use correct quotation marks (“…”) or the \quotation command (\quotation{…}). Wolfgang
Wolfgang Schuster írta: LONG CUT, see previous messages Thanks you, finally I chose the following setup: % begin code \mainlanguage[hu] \setuplabeltext[hu][figure={,. ábra.}] \setupcaption[figure][numberstopper=] \definereferenceformat[infigure][label=figurereference] \starttext placefigure[][figure-1]{Caption 1}{figure1} placefigure[][figure-2]{Caption 2}{figure2} \in[figure-1]. ábra and \in[figure-2]/A ábrán \stoptext % end code In this case the \in[] command only inserts the pure number without punctuation and any additional text. I add the punctuation and additional text manually in the text.
\setuplabeltext [hu] [figure={, ábra.}]
What is the function of the comma exactly? It isn't shown in the output.
BTW: The plain TeX method for quotation marks (``…’’) doesn’t work with MkIV, use correct quotation marks (“…”) or the \quotation command (\quotation{…}).
It's a pity. This is a very nice feature of tex. Wolfgang, thank you for your help. Probably I return soon with other questions because I'm learnig context. bcsikos
participants (3)
-
Csikos Bela
-
Otared Kavian
-
Wolfgang Schuster