GeneralHelp with translation

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
Banny
Posts: 5
Joined: Mon Apr 30, 2012 7:12 pm

Help with translation

Post by Banny »

Hi everyone,

I am not an originally english speaking person and I am translating some parts from etoolbox Package documentation for my work. But to tell the truth i have no idea how to translate that text because of high english terms and phrases. And when i am translating this text literary it does not make any sense.
Well i am not asking you to translate this text to my language :) but to rewrite it with a lil bit easier english to understand.

I would really appreciate your effort here. Thank you very much.

Text to rewrite:
Environment Hooks:
The tools in this section provide hooks for arbitrary environments. Note that they will not modify the definition of the environment. They hook into the \begin and \end commands instead. Redefining the environment will not clear the corresponding hooks. The code may be arbitrary TeX code. Parameter characters in
the code argument are permissible and need not be doubled.

•\AtBeginEnvironment{environment}{code}
Appends arbitrary code to a hook executed by the \begin command at the beginning
of a given environment, immediately before \environment, inside the
group opened by \begin.
Last edited by Banny on Fri May 11, 2012 10:41 am, edited 1 time in total.

Recommended reading 2024:

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

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

User avatar
Stefan Kottwitz
Site Admin
Posts: 10321
Joined: Mon Mar 10, 2008 9:44 pm

Re: Help with translation

Post by Stefan Kottwitz »

Hi Banny,

the meaning of which words are unknown to you? Do you need to know what a hook means?
Instead of choosing completely different words and description for the complete text, perhaps you just need an explanation of certain parts.

Stefan
LaTeX.org admin
Banny
Posts: 5
Joined: Mon Apr 30, 2012 7:12 pm

Re: Help with translation

Post by Banny »

Thank you Stefan for reply.
Exactly, i have no idea what does the word hook in LaTeX mean.
Can you please explain it to me? And also explain the last sentence " Parameter characters in the code argument are permissible and need not be doubled."

Thank you

Tomas
User avatar
Stefan Kottwitz
Site Admin
Posts: 10321
Joined: Mon Mar 10, 2008 9:44 pm

Help with translation

Post by Stefan Kottwitz »

Hi Tomas,

a hook is a macro which is implictly called. This can be empty by default. But a user can redefine it, so you can modify the behavior of the code or extend it, without needing to redefine the code itself.

Imagine you are a programmer, and you program a complex environment:

Code: Select all

\newenvironment{muchcode}{code here}{code there}
If you would like to allow a user to modify or to extend this muchcode environment, without completely redefining it (using \renewenvironment), you can add some macros.

Code: Select all

\newcommand{\beginhook}{}% empty
\newcommand{\endhook}{}% empty
\newenvironment{muchcode}{%
  \beginhook%
  code here}{%
  code there%
  \endhook}
Now, a user could use a hook to extend functionality. For example, simply define

Code: Select all

\renewcommand{\beginhook}{\bfseries}
\renewcommand{\endhook}{\normalfont}
to have this environment in bold font, but switch to the normal font at the end. The hooks are implicitly called, as defined in the environment. Sometimes class authors and package writers provide hooks for user convenience.

Regarding the last sentence: a parameter character means the # character, which is followed by a number. For example, #1 means the first parameter. It means, that such # are allowed and don't need to be doubled, i.e. you don't need to write ##1 or ##2. The latter may be required when nesting definitions.

Stefan
LaTeX.org admin
Banny
Posts: 5
Joined: Mon Apr 30, 2012 7:12 pm

Re: Help with translation

Post by Banny »

Thank you Stephan very much :)it was really helpful.
Post Reply