How to temporarily replace Latin characters with GreekSpecifying a different font for polytonic Greek in pdfTeX with BabelFonts for PolyTonic GreekGreek language issue with moderncv in LyxConsistent macro for bold upright vectors in both latin and greekString comparisons not working with textgreekXeLaTeX with ucharclasses and Greek SupportHow to redefine one-letter commands?Font that supports both upright and italics Scandinavian and Greek characters in math?Greek and Latin letters in verbatimExport Greek font (italic, upright, bold) from 'newtxmath' package with libertine option
D&D Monsters and Copyright
Modern warfare theory in a medieval setting
How can I adjust the sequential numbering scheme when exporting Photos?
Is sleeping on the ground in cold weather better than on an air mattress?
Relation between signal processing and control systems engineering?
Should I withdraw my paper because the Editor is behaving so badly with me?
Low-magic medieval fantasy clothes that allow the wearer to grow?
How can I curtail abuse of the Illusion wizard's Illusory Reality feature?
How to temporarily replace Latin characters with Greek
Applications of schemes to mathematical physics
Why does unique_ptr<Derived> implicitly cast to unique_ptr<Base>?
Can you pitch an outline?
How to copy the path of current directory in ubuntu 18.04
Why didn't Kes send Voyager home?
Comultiplication on objects in an (abelian?) category
Overlay image with parts of another image
Can a Creature at 0 HP Take Damage?
A car vs the car - English Article
Translate "iconoclast" to classical Latin
How are steel imports supposed to threaten US national security?
Proving roots of a function cannot all be real
Reduction of carbamate with LAH
How to discipline overeager engineer
How do lasers measure short distances (<1cm) when electronics are too slow for time-of-flight to work?
How to temporarily replace Latin characters with Greek
Specifying a different font for polytonic Greek in pdfTeX with BabelFonts for PolyTonic GreekGreek language issue with moderncv in LyxConsistent macro for bold upright vectors in both latin and greekString comparisons not working with textgreekXeLaTeX with ucharclasses and Greek SupportHow to redefine one-letter commands?Font that supports both upright and italics Scandinavian and Greek characters in math?Greek and Latin letters in verbatimExport Greek font (italic, upright, bold) from 'newtxmath' package with libertine option
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;
Often I am typing equations with many Greek characters in them, and it becomes cumbersome to type out the commands for them all. I would like to make a command or environment that replaces Latin characters with analogous Greek ones. For example, something like greekabge
or begingreekabgeendgreek
would display the same as alphabetagammaepsilon
.
I've tried making letters active so that I can use something like let aalpha
, but the problem with that approach is that then I can't use them as part of commands - I'd like to be able to have something like greekadotbge
display as greekalphadotbetagammaepsilon
.
I also tried using DeclareUnicodeCharacter
to replace e.g. a
with the alpha character, but I get an error because the unicode value of a
is less than 00A0
. Is there some other way I can make this work?
macros greek
New contributor
add a comment
|
Often I am typing equations with many Greek characters in them, and it becomes cumbersome to type out the commands for them all. I would like to make a command or environment that replaces Latin characters with analogous Greek ones. For example, something like greekabge
or begingreekabgeendgreek
would display the same as alphabetagammaepsilon
.
I've tried making letters active so that I can use something like let aalpha
, but the problem with that approach is that then I can't use them as part of commands - I'd like to be able to have something like greekadotbge
display as greekalphadotbetagammaepsilon
.
I also tried using DeclareUnicodeCharacter
to replace e.g. a
with the alpha character, but I get an error because the unicode value of a
is less than 00A0
. Is there some other way I can make this work?
macros greek
New contributor
add a comment
|
Often I am typing equations with many Greek characters in them, and it becomes cumbersome to type out the commands for them all. I would like to make a command or environment that replaces Latin characters with analogous Greek ones. For example, something like greekabge
or begingreekabgeendgreek
would display the same as alphabetagammaepsilon
.
I've tried making letters active so that I can use something like let aalpha
, but the problem with that approach is that then I can't use them as part of commands - I'd like to be able to have something like greekadotbge
display as greekalphadotbetagammaepsilon
.
I also tried using DeclareUnicodeCharacter
to replace e.g. a
with the alpha character, but I get an error because the unicode value of a
is less than 00A0
. Is there some other way I can make this work?
macros greek
New contributor
Often I am typing equations with many Greek characters in them, and it becomes cumbersome to type out the commands for them all. I would like to make a command or environment that replaces Latin characters with analogous Greek ones. For example, something like greekabge
or begingreekabgeendgreek
would display the same as alphabetagammaepsilon
.
I've tried making letters active so that I can use something like let aalpha
, but the problem with that approach is that then I can't use them as part of commands - I'd like to be able to have something like greekadotbge
display as greekalphadotbetagammaepsilon
.
I also tried using DeclareUnicodeCharacter
to replace e.g. a
with the alpha character, but I get an error because the unicode value of a
is less than 00A0
. Is there some other way I can make this work?
macros greek
macros greek
New contributor
New contributor
New contributor
asked 8 hours ago
CarmeisterCarmeister
1161 silver badge3 bronze badges
1161 silver badge3 bronze badges
New contributor
New contributor
add a comment
|
add a comment
|
2 Answers
2
active
oldest
votes
Fill in the table:
documentclassarticle
newcommandgreek[1]begingroupsetuplatintogreek#1endgroup
newcommandsetuplatintogreek%
mathcode`a=alpha
mathcode`b=beta
mathcode`g=gamma
mathcode`d=delta
mathcode`e=varepsilon
%...
begindocument
$abgde+greekabgde$
enddocument
add a comment
|
This is just the kind of problem for which the tokcycle
package was made.
I've only implemented a handfull of the Greek, but you just need a tcmapto zzeta
type statement for each new mapping. In the MWE, I also use |...|
to escape characters back to the original Latin. Macros are automatically intercepted and preserved with the Latin interpretation of the name. All grouping considerations of the greek
environment are preserved in the transformed output.
documentclassarticle
usepackagetokcycle
tokcycleenvironmentgreek
addcytoks[4]tcremap##1
processtoks##1
addcytoks##1
addcytoks##1
newcommand*tcmapto[2]expandafterdefcsname tcmapto#1endcsname#2
newcommand*tcremap[1]ifcsname tcmapto#1endcsname
csname tcmapto#1expandafterendcsnameelseexpandafter#1fi
tcmapto aalpha tcmapto bbeta tcmapto eepsilon
tcmapto ggamma tcmapto ppi
begindocument
[
y = greek a^2bfrac2eg + p^endgreek + x
]
enddocument
I edited the answer to NOT make use of expanded
since not everyone has an updated TeX installation. So, addcytoks[4]...
indicates to perform 4 expansions on the argument before storing the result, which is sufficient here to achieve the goal. The alternate syntax of addcytoks[x]...
invokes expanded
on the argument before storing the result. With the [x]
option, the tcremap
macro can also be simplified, by eliminating the expandafter
s as such: newcommand*tcremap[1]ifcsname tcmapto#1endcsnamecsname tcmapto#1endcsnameelse#1fi
Note: MikTeX doesn't quite load the package properly. You will have to manually download tokcycle.tex to your localtexmf
at texgenerictokcycletokcycle.tex
. See https://www.ctan.org/pkg/tokcycle
add a comment
|
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "85"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Carmeister is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f510578%2fhow-to-temporarily-replace-latin-characters-with-greek%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Fill in the table:
documentclassarticle
newcommandgreek[1]begingroupsetuplatintogreek#1endgroup
newcommandsetuplatintogreek%
mathcode`a=alpha
mathcode`b=beta
mathcode`g=gamma
mathcode`d=delta
mathcode`e=varepsilon
%...
begindocument
$abgde+greekabgde$
enddocument
add a comment
|
Fill in the table:
documentclassarticle
newcommandgreek[1]begingroupsetuplatintogreek#1endgroup
newcommandsetuplatintogreek%
mathcode`a=alpha
mathcode`b=beta
mathcode`g=gamma
mathcode`d=delta
mathcode`e=varepsilon
%...
begindocument
$abgde+greekabgde$
enddocument
add a comment
|
Fill in the table:
documentclassarticle
newcommandgreek[1]begingroupsetuplatintogreek#1endgroup
newcommandsetuplatintogreek%
mathcode`a=alpha
mathcode`b=beta
mathcode`g=gamma
mathcode`d=delta
mathcode`e=varepsilon
%...
begindocument
$abgde+greekabgde$
enddocument
Fill in the table:
documentclassarticle
newcommandgreek[1]begingroupsetuplatintogreek#1endgroup
newcommandsetuplatintogreek%
mathcode`a=alpha
mathcode`b=beta
mathcode`g=gamma
mathcode`d=delta
mathcode`e=varepsilon
%...
begindocument
$abgde+greekabgde$
enddocument
answered 5 hours ago
egregegreg
772k91 gold badges2015 silver badges3375 bronze badges
772k91 gold badges2015 silver badges3375 bronze badges
add a comment
|
add a comment
|
This is just the kind of problem for which the tokcycle
package was made.
I've only implemented a handfull of the Greek, but you just need a tcmapto zzeta
type statement for each new mapping. In the MWE, I also use |...|
to escape characters back to the original Latin. Macros are automatically intercepted and preserved with the Latin interpretation of the name. All grouping considerations of the greek
environment are preserved in the transformed output.
documentclassarticle
usepackagetokcycle
tokcycleenvironmentgreek
addcytoks[4]tcremap##1
processtoks##1
addcytoks##1
addcytoks##1
newcommand*tcmapto[2]expandafterdefcsname tcmapto#1endcsname#2
newcommand*tcremap[1]ifcsname tcmapto#1endcsname
csname tcmapto#1expandafterendcsnameelseexpandafter#1fi
tcmapto aalpha tcmapto bbeta tcmapto eepsilon
tcmapto ggamma tcmapto ppi
begindocument
[
y = greek a^2bfrac2eg + p^endgreek + x
]
enddocument
I edited the answer to NOT make use of expanded
since not everyone has an updated TeX installation. So, addcytoks[4]...
indicates to perform 4 expansions on the argument before storing the result, which is sufficient here to achieve the goal. The alternate syntax of addcytoks[x]...
invokes expanded
on the argument before storing the result. With the [x]
option, the tcremap
macro can also be simplified, by eliminating the expandafter
s as such: newcommand*tcremap[1]ifcsname tcmapto#1endcsnamecsname tcmapto#1endcsnameelse#1fi
Note: MikTeX doesn't quite load the package properly. You will have to manually download tokcycle.tex to your localtexmf
at texgenerictokcycletokcycle.tex
. See https://www.ctan.org/pkg/tokcycle
add a comment
|
This is just the kind of problem for which the tokcycle
package was made.
I've only implemented a handfull of the Greek, but you just need a tcmapto zzeta
type statement for each new mapping. In the MWE, I also use |...|
to escape characters back to the original Latin. Macros are automatically intercepted and preserved with the Latin interpretation of the name. All grouping considerations of the greek
environment are preserved in the transformed output.
documentclassarticle
usepackagetokcycle
tokcycleenvironmentgreek
addcytoks[4]tcremap##1
processtoks##1
addcytoks##1
addcytoks##1
newcommand*tcmapto[2]expandafterdefcsname tcmapto#1endcsname#2
newcommand*tcremap[1]ifcsname tcmapto#1endcsname
csname tcmapto#1expandafterendcsnameelseexpandafter#1fi
tcmapto aalpha tcmapto bbeta tcmapto eepsilon
tcmapto ggamma tcmapto ppi
begindocument
[
y = greek a^2bfrac2eg + p^endgreek + x
]
enddocument
I edited the answer to NOT make use of expanded
since not everyone has an updated TeX installation. So, addcytoks[4]...
indicates to perform 4 expansions on the argument before storing the result, which is sufficient here to achieve the goal. The alternate syntax of addcytoks[x]...
invokes expanded
on the argument before storing the result. With the [x]
option, the tcremap
macro can also be simplified, by eliminating the expandafter
s as such: newcommand*tcremap[1]ifcsname tcmapto#1endcsnamecsname tcmapto#1endcsnameelse#1fi
Note: MikTeX doesn't quite load the package properly. You will have to manually download tokcycle.tex to your localtexmf
at texgenerictokcycletokcycle.tex
. See https://www.ctan.org/pkg/tokcycle
add a comment
|
This is just the kind of problem for which the tokcycle
package was made.
I've only implemented a handfull of the Greek, but you just need a tcmapto zzeta
type statement for each new mapping. In the MWE, I also use |...|
to escape characters back to the original Latin. Macros are automatically intercepted and preserved with the Latin interpretation of the name. All grouping considerations of the greek
environment are preserved in the transformed output.
documentclassarticle
usepackagetokcycle
tokcycleenvironmentgreek
addcytoks[4]tcremap##1
processtoks##1
addcytoks##1
addcytoks##1
newcommand*tcmapto[2]expandafterdefcsname tcmapto#1endcsname#2
newcommand*tcremap[1]ifcsname tcmapto#1endcsname
csname tcmapto#1expandafterendcsnameelseexpandafter#1fi
tcmapto aalpha tcmapto bbeta tcmapto eepsilon
tcmapto ggamma tcmapto ppi
begindocument
[
y = greek a^2bfrac2eg + p^endgreek + x
]
enddocument
I edited the answer to NOT make use of expanded
since not everyone has an updated TeX installation. So, addcytoks[4]...
indicates to perform 4 expansions on the argument before storing the result, which is sufficient here to achieve the goal. The alternate syntax of addcytoks[x]...
invokes expanded
on the argument before storing the result. With the [x]
option, the tcremap
macro can also be simplified, by eliminating the expandafter
s as such: newcommand*tcremap[1]ifcsname tcmapto#1endcsnamecsname tcmapto#1endcsnameelse#1fi
Note: MikTeX doesn't quite load the package properly. You will have to manually download tokcycle.tex to your localtexmf
at texgenerictokcycletokcycle.tex
. See https://www.ctan.org/pkg/tokcycle
This is just the kind of problem for which the tokcycle
package was made.
I've only implemented a handfull of the Greek, but you just need a tcmapto zzeta
type statement for each new mapping. In the MWE, I also use |...|
to escape characters back to the original Latin. Macros are automatically intercepted and preserved with the Latin interpretation of the name. All grouping considerations of the greek
environment are preserved in the transformed output.
documentclassarticle
usepackagetokcycle
tokcycleenvironmentgreek
addcytoks[4]tcremap##1
processtoks##1
addcytoks##1
addcytoks##1
newcommand*tcmapto[2]expandafterdefcsname tcmapto#1endcsname#2
newcommand*tcremap[1]ifcsname tcmapto#1endcsname
csname tcmapto#1expandafterendcsnameelseexpandafter#1fi
tcmapto aalpha tcmapto bbeta tcmapto eepsilon
tcmapto ggamma tcmapto ppi
begindocument
[
y = greek a^2bfrac2eg + p^endgreek + x
]
enddocument
I edited the answer to NOT make use of expanded
since not everyone has an updated TeX installation. So, addcytoks[4]...
indicates to perform 4 expansions on the argument before storing the result, which is sufficient here to achieve the goal. The alternate syntax of addcytoks[x]...
invokes expanded
on the argument before storing the result. With the [x]
option, the tcremap
macro can also be simplified, by eliminating the expandafter
s as such: newcommand*tcremap[1]ifcsname tcmapto#1endcsnamecsname tcmapto#1endcsnameelse#1fi
Note: MikTeX doesn't quite load the package properly. You will have to manually download tokcycle.tex to your localtexmf
at texgenerictokcycletokcycle.tex
. See https://www.ctan.org/pkg/tokcycle
edited 7 hours ago
answered 8 hours ago
Steven B. SegletesSteven B. Segletes
171k9 gold badges216 silver badges444 bronze badges
171k9 gold badges216 silver badges444 bronze badges
add a comment
|
add a comment
|
Carmeister is a new contributor. Be nice, and check out our Code of Conduct.
Carmeister is a new contributor. Be nice, and check out our Code of Conduct.
Carmeister is a new contributor. Be nice, and check out our Code of Conduct.
Carmeister is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f510578%2fhow-to-temporarily-replace-latin-characters-with-greek%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown