From: Wolfgang Schuster <schuster.wolfgang@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: caption setup
Date: Thu, 9 Apr 2015 13:59:58 +0200 [thread overview]
Message-ID: <DF322E7D-5C5D-46E2-8177-57ECB0694BE1@gmail.com> (raw)
In-Reply-To: <freemail.20150409131449.33139.1@fmxmldata02.freemail.hu>
> Am 09.04.2015 um 13:14 schrieb Csikos Bela <bcsikos425@freemail.hu>:
>
> 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
___________________________________________________________________________________
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
___________________________________________________________________________________
next prev parent reply other threads:[~2015-04-09 11:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-08 22:13 Csikos Bela
2015-04-09 6:57 ` Otared Kavian
2015-04-09 9:07 ` Wolfgang Schuster
2015-04-09 11:14 ` Csikos Bela
2015-04-09 11:37 ` Wolfgang Schuster
2015-04-09 11:59 ` Wolfgang Schuster [this message]
2015-04-10 12:46 ` Csikos Bela
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DF322E7D-5C5D-46E2-8177-57ECB0694BE1@gmail.com \
--to=schuster.wolfgang@gmail.com \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).