Switch between fraktur and standard fonts

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
5
down vote

favorite
1












I am trying to create a document which I can typeset either using the standard font or fraktur.



Consider the following MWE:



documentclass[a4paper]scrbook

usepackage[utf8]inputenc
usepackage[german]babel

usepackageyfonts

begindocument

frakfamily

Test

Tes:t

This:: should have one colon.

Another example: The colon should stay here.

enddocument


Typesetting it as-is, there is no problem. If I remove the frakfamily command to typeset the document with the standard font, the colon used for customizing the fraktur output is displayed inside the output.



How to switch between fraktur and standard fonts on-the-fly? And is there a way to declare the usage of fraktures for all document content inside the preamble?



To clarify it a bit more: The document should be typeset either completely with fraktur or with the standard fonts. As I do not want to create two different source files, I was searching for a way to automatically suppress single colons after an s when using the standard fonts. (This would be easy when using an external script, but I would need another intermediate source file beside the existing one in this case.)







share|improve this question






















  • in the fractur font s: is a ligature. In pdflatex it is imho not possible to add such a ligature on the fly to a font. With xelatex or lualatex it could be possible.
    – Ulrike Fischer
    Aug 18 at 13:31










  • @UlrikeFischer If I understand your comment correctly, one would have to define the s: ligature in the used standard font to behave the same like s to solve the problem? If it is not possible with pdflatex, I might be able to switch the engine - while I prefer lualatex over xelatex.
    – epR8GaYuh
    Aug 18 at 13:45











  • If you are willing to switch engines, maybe this answer will help: tex.stackexchange.com/a/218326/87678
    – David Purton
    Aug 18 at 14:24














up vote
5
down vote

favorite
1












I am trying to create a document which I can typeset either using the standard font or fraktur.



Consider the following MWE:



documentclass[a4paper]scrbook

usepackage[utf8]inputenc
usepackage[german]babel

usepackageyfonts

begindocument

frakfamily

Test

Tes:t

This:: should have one colon.

Another example: The colon should stay here.

enddocument


Typesetting it as-is, there is no problem. If I remove the frakfamily command to typeset the document with the standard font, the colon used for customizing the fraktur output is displayed inside the output.



How to switch between fraktur and standard fonts on-the-fly? And is there a way to declare the usage of fraktures for all document content inside the preamble?



To clarify it a bit more: The document should be typeset either completely with fraktur or with the standard fonts. As I do not want to create two different source files, I was searching for a way to automatically suppress single colons after an s when using the standard fonts. (This would be easy when using an external script, but I would need another intermediate source file beside the existing one in this case.)







share|improve this question






















  • in the fractur font s: is a ligature. In pdflatex it is imho not possible to add such a ligature on the fly to a font. With xelatex or lualatex it could be possible.
    – Ulrike Fischer
    Aug 18 at 13:31










  • @UlrikeFischer If I understand your comment correctly, one would have to define the s: ligature in the used standard font to behave the same like s to solve the problem? If it is not possible with pdflatex, I might be able to switch the engine - while I prefer lualatex over xelatex.
    – epR8GaYuh
    Aug 18 at 13:45











  • If you are willing to switch engines, maybe this answer will help: tex.stackexchange.com/a/218326/87678
    – David Purton
    Aug 18 at 14:24












up vote
5
down vote

favorite
1









up vote
5
down vote

favorite
1






1





I am trying to create a document which I can typeset either using the standard font or fraktur.



Consider the following MWE:



documentclass[a4paper]scrbook

usepackage[utf8]inputenc
usepackage[german]babel

usepackageyfonts

begindocument

frakfamily

Test

Tes:t

This:: should have one colon.

Another example: The colon should stay here.

enddocument


Typesetting it as-is, there is no problem. If I remove the frakfamily command to typeset the document with the standard font, the colon used for customizing the fraktur output is displayed inside the output.



How to switch between fraktur and standard fonts on-the-fly? And is there a way to declare the usage of fraktures for all document content inside the preamble?



To clarify it a bit more: The document should be typeset either completely with fraktur or with the standard fonts. As I do not want to create two different source files, I was searching for a way to automatically suppress single colons after an s when using the standard fonts. (This would be easy when using an external script, but I would need another intermediate source file beside the existing one in this case.)







share|improve this question














I am trying to create a document which I can typeset either using the standard font or fraktur.



Consider the following MWE:



documentclass[a4paper]scrbook

usepackage[utf8]inputenc
usepackage[german]babel

usepackageyfonts

begindocument

frakfamily

Test

Tes:t

This:: should have one colon.

Another example: The colon should stay here.

enddocument


Typesetting it as-is, there is no problem. If I remove the frakfamily command to typeset the document with the standard font, the colon used for customizing the fraktur output is displayed inside the output.



How to switch between fraktur and standard fonts on-the-fly? And is there a way to declare the usage of fraktures for all document content inside the preamble?



To clarify it a bit more: The document should be typeset either completely with fraktur or with the standard fonts. As I do not want to create two different source files, I was searching for a way to automatically suppress single colons after an s when using the standard fonts. (This would be easy when using an external script, but I would need another intermediate source file beside the existing one in this case.)









share|improve this question













share|improve this question




share|improve this question








edited Aug 18 at 13:16

























asked Aug 18 at 11:47









epR8GaYuh

7771416




7771416











  • in the fractur font s: is a ligature. In pdflatex it is imho not possible to add such a ligature on the fly to a font. With xelatex or lualatex it could be possible.
    – Ulrike Fischer
    Aug 18 at 13:31










  • @UlrikeFischer If I understand your comment correctly, one would have to define the s: ligature in the used standard font to behave the same like s to solve the problem? If it is not possible with pdflatex, I might be able to switch the engine - while I prefer lualatex over xelatex.
    – epR8GaYuh
    Aug 18 at 13:45











  • If you are willing to switch engines, maybe this answer will help: tex.stackexchange.com/a/218326/87678
    – David Purton
    Aug 18 at 14:24
















  • in the fractur font s: is a ligature. In pdflatex it is imho not possible to add such a ligature on the fly to a font. With xelatex or lualatex it could be possible.
    – Ulrike Fischer
    Aug 18 at 13:31










  • @UlrikeFischer If I understand your comment correctly, one would have to define the s: ligature in the used standard font to behave the same like s to solve the problem? If it is not possible with pdflatex, I might be able to switch the engine - while I prefer lualatex over xelatex.
    – epR8GaYuh
    Aug 18 at 13:45











  • If you are willing to switch engines, maybe this answer will help: tex.stackexchange.com/a/218326/87678
    – David Purton
    Aug 18 at 14:24















in the fractur font s: is a ligature. In pdflatex it is imho not possible to add such a ligature on the fly to a font. With xelatex or lualatex it could be possible.
– Ulrike Fischer
Aug 18 at 13:31




in the fractur font s: is a ligature. In pdflatex it is imho not possible to add such a ligature on the fly to a font. With xelatex or lualatex it could be possible.
– Ulrike Fischer
Aug 18 at 13:31












@UlrikeFischer If I understand your comment correctly, one would have to define the s: ligature in the used standard font to behave the same like s to solve the problem? If it is not possible with pdflatex, I might be able to switch the engine - while I prefer lualatex over xelatex.
– epR8GaYuh
Aug 18 at 13:45





@UlrikeFischer If I understand your comment correctly, one would have to define the s: ligature in the used standard font to behave the same like s to solve the problem? If it is not possible with pdflatex, I might be able to switch the engine - while I prefer lualatex over xelatex.
– epR8GaYuh
Aug 18 at 13:45













If you are willing to switch engines, maybe this answer will help: tex.stackexchange.com/a/218326/87678
– David Purton
Aug 18 at 14:24




If you are willing to switch engines, maybe this answer will help: tex.stackexchange.com/a/218326/87678
– David Purton
Aug 18 at 14:24










2 Answers
2






active

oldest

votes

















up vote
6
down vote



accepted










With pdflatex you could try something like this:



documentclass[a4paper]scrbook

usepackage[utf8]inputenc
usepackage[german]babel

usepackageyfonts

sfcode`s=1001
catcode`:=active
DeclareRobustCommand:ifnumspacefactor=1001 spacefactor=1000 else string:fi

begindocument

%frakfamily

Test

Tes:t

This:: should have one colon.

Another example: The colon should stay here.

enddocument


enter image description here



With lualatex you could do something like this:



documentclass[a4paper]scrbook

usepackage[german]babel
usepackagefontspec
directlua
fonts.handlers.otf.addfeature(
name = "ligc",
type = "ligature",
data =
["s"] = "s", ":" ,
)

setmainfontTeX Gyre Pagella[RawFeature=+ligc]
begindocument

Test

Tes:t

This:: should have one colon.

Another example: The colon should stay here.

enddocument





share|improve this answer






















  • Thanks, the lualatex solution works fine, while the pdflatex solution seems to fail with an Improper spacefactor error when used within section headers (sectionTes:t for example).
    – epR8GaYuh
    Aug 18 at 14:31







  • 2




    Make the : robust: DeclareRobustCommand:
    – Ulrike Fischer
    Aug 18 at 14:37

















up vote
3
down vote













With help from this answer, here's a solution with xelatex:



Find on your system the file tex-text.map and copy it to your working directory under the name fraktur.map (or whatever you want). Then append to it a line so that it looks like:



; TECkit mapping for TeX input conventions <-> Unicode characters

LHSName "TeX-text"
RHSName "UNICODE"

pass(Unicode)

; ligatures from Knuth's original CMR fonts
U+002D U+002D <> U+2013 ; -- -> en dash
U+002D U+002D U+002D <> U+2014 ; --- -> em dash

U+0027 <> U+2019 ; ' -> right single quote
U+0027 U+0027 <> U+201D ; '' -> right double quote
U+0022 > U+201D ; " -> right double quote

U+0060 <> U+2018 ; ` -> left single quote
U+0060 U+0060 <> U+201C ; `` -> left double quote

U+0021 U+0060 <> U+00A1 ; !` -> inverted exclam
U+003F U+0060 <> U+00BF ; ?` -> inverted question

; additions supported in T1 encoding
U+002C U+002C <> U+201E ; ,, -> DOUBLE LOW-9 QUOTATION MARK
U+003C U+003C <> U+00AB ; << -> LEFT POINTING GUILLEMET
U+003E U+003E <> U+00BB ; >> -> RIGHT POINTING GUILLEMET

; additions to suppress fraktur ligature
U+0073 U+003A <> U+0073 ; s: -> LATIN SMALL LETTER S


Then run



teckit_compile fraktur.map


which will create a file named fraktur.tec.



Then, you can use this mapping file with xelatex like this:



documentclassarticle
usepackage[german]babel
usepackagefontspec
usepackageyfonts

setmainfontLatin Modern Roman[Mapping=fraktur]

begindocument

Test

Tes:t

This:: should have one colon.

Another example: The colon should stay here.


frakfamily

Test

Tes:t

This:: should have one colon.

Another example: The colon should stay here.

enddocument


enter image description here






share|improve this answer




















  • This does not seem to affect section titles, see sectionTes:t for example.
    – epR8GaYuh
    Aug 18 at 14:57






  • 1




    @epR8GaYuh you are using scrbook, which sets the section titles in sans serif, so you will have to add the mapping instruction also to the sans family with e.g. setsansfontLatin Modern Sans[Mapping=fraktur]
    – Ulrike Fischer
    Aug 18 at 16:10










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',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f446546%2fswitch-between-fraktur-and-standard-fonts%23new-answer', 'question_page');

);

Post as a guest






























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
6
down vote



accepted










With pdflatex you could try something like this:



documentclass[a4paper]scrbook

usepackage[utf8]inputenc
usepackage[german]babel

usepackageyfonts

sfcode`s=1001
catcode`:=active
DeclareRobustCommand:ifnumspacefactor=1001 spacefactor=1000 else string:fi

begindocument

%frakfamily

Test

Tes:t

This:: should have one colon.

Another example: The colon should stay here.

enddocument


enter image description here



With lualatex you could do something like this:



documentclass[a4paper]scrbook

usepackage[german]babel
usepackagefontspec
directlua
fonts.handlers.otf.addfeature(
name = "ligc",
type = "ligature",
data =
["s"] = "s", ":" ,
)

setmainfontTeX Gyre Pagella[RawFeature=+ligc]
begindocument

Test

Tes:t

This:: should have one colon.

Another example: The colon should stay here.

enddocument





share|improve this answer






















  • Thanks, the lualatex solution works fine, while the pdflatex solution seems to fail with an Improper spacefactor error when used within section headers (sectionTes:t for example).
    – epR8GaYuh
    Aug 18 at 14:31







  • 2




    Make the : robust: DeclareRobustCommand:
    – Ulrike Fischer
    Aug 18 at 14:37














up vote
6
down vote



accepted










With pdflatex you could try something like this:



documentclass[a4paper]scrbook

usepackage[utf8]inputenc
usepackage[german]babel

usepackageyfonts

sfcode`s=1001
catcode`:=active
DeclareRobustCommand:ifnumspacefactor=1001 spacefactor=1000 else string:fi

begindocument

%frakfamily

Test

Tes:t

This:: should have one colon.

Another example: The colon should stay here.

enddocument


enter image description here



With lualatex you could do something like this:



documentclass[a4paper]scrbook

usepackage[german]babel
usepackagefontspec
directlua
fonts.handlers.otf.addfeature(
name = "ligc",
type = "ligature",
data =
["s"] = "s", ":" ,
)

setmainfontTeX Gyre Pagella[RawFeature=+ligc]
begindocument

Test

Tes:t

This:: should have one colon.

Another example: The colon should stay here.

enddocument





share|improve this answer






















  • Thanks, the lualatex solution works fine, while the pdflatex solution seems to fail with an Improper spacefactor error when used within section headers (sectionTes:t for example).
    – epR8GaYuh
    Aug 18 at 14:31







  • 2




    Make the : robust: DeclareRobustCommand:
    – Ulrike Fischer
    Aug 18 at 14:37












up vote
6
down vote



accepted







up vote
6
down vote



accepted






With pdflatex you could try something like this:



documentclass[a4paper]scrbook

usepackage[utf8]inputenc
usepackage[german]babel

usepackageyfonts

sfcode`s=1001
catcode`:=active
DeclareRobustCommand:ifnumspacefactor=1001 spacefactor=1000 else string:fi

begindocument

%frakfamily

Test

Tes:t

This:: should have one colon.

Another example: The colon should stay here.

enddocument


enter image description here



With lualatex you could do something like this:



documentclass[a4paper]scrbook

usepackage[german]babel
usepackagefontspec
directlua
fonts.handlers.otf.addfeature(
name = "ligc",
type = "ligature",
data =
["s"] = "s", ":" ,
)

setmainfontTeX Gyre Pagella[RawFeature=+ligc]
begindocument

Test

Tes:t

This:: should have one colon.

Another example: The colon should stay here.

enddocument





share|improve this answer














With pdflatex you could try something like this:



documentclass[a4paper]scrbook

usepackage[utf8]inputenc
usepackage[german]babel

usepackageyfonts

sfcode`s=1001
catcode`:=active
DeclareRobustCommand:ifnumspacefactor=1001 spacefactor=1000 else string:fi

begindocument

%frakfamily

Test

Tes:t

This:: should have one colon.

Another example: The colon should stay here.

enddocument


enter image description here



With lualatex you could do something like this:



documentclass[a4paper]scrbook

usepackage[german]babel
usepackagefontspec
directlua
fonts.handlers.otf.addfeature(
name = "ligc",
type = "ligature",
data =
["s"] = "s", ":" ,
)

setmainfontTeX Gyre Pagella[RawFeature=+ligc]
begindocument

Test

Tes:t

This:: should have one colon.

Another example: The colon should stay here.

enddocument






share|improve this answer














share|improve this answer



share|improve this answer








edited Aug 18 at 16:07

























answered Aug 18 at 14:18









Ulrike Fischer

177k7281649




177k7281649











  • Thanks, the lualatex solution works fine, while the pdflatex solution seems to fail with an Improper spacefactor error when used within section headers (sectionTes:t for example).
    – epR8GaYuh
    Aug 18 at 14:31







  • 2




    Make the : robust: DeclareRobustCommand:
    – Ulrike Fischer
    Aug 18 at 14:37
















  • Thanks, the lualatex solution works fine, while the pdflatex solution seems to fail with an Improper spacefactor error when used within section headers (sectionTes:t for example).
    – epR8GaYuh
    Aug 18 at 14:31







  • 2




    Make the : robust: DeclareRobustCommand:
    – Ulrike Fischer
    Aug 18 at 14:37















Thanks, the lualatex solution works fine, while the pdflatex solution seems to fail with an Improper spacefactor error when used within section headers (sectionTes:t for example).
– epR8GaYuh
Aug 18 at 14:31





Thanks, the lualatex solution works fine, while the pdflatex solution seems to fail with an Improper spacefactor error when used within section headers (sectionTes:t for example).
– epR8GaYuh
Aug 18 at 14:31





2




2




Make the : robust: DeclareRobustCommand:
– Ulrike Fischer
Aug 18 at 14:37




Make the : robust: DeclareRobustCommand:
– Ulrike Fischer
Aug 18 at 14:37










up vote
3
down vote













With help from this answer, here's a solution with xelatex:



Find on your system the file tex-text.map and copy it to your working directory under the name fraktur.map (or whatever you want). Then append to it a line so that it looks like:



; TECkit mapping for TeX input conventions <-> Unicode characters

LHSName "TeX-text"
RHSName "UNICODE"

pass(Unicode)

; ligatures from Knuth's original CMR fonts
U+002D U+002D <> U+2013 ; -- -> en dash
U+002D U+002D U+002D <> U+2014 ; --- -> em dash

U+0027 <> U+2019 ; ' -> right single quote
U+0027 U+0027 <> U+201D ; '' -> right double quote
U+0022 > U+201D ; " -> right double quote

U+0060 <> U+2018 ; ` -> left single quote
U+0060 U+0060 <> U+201C ; `` -> left double quote

U+0021 U+0060 <> U+00A1 ; !` -> inverted exclam
U+003F U+0060 <> U+00BF ; ?` -> inverted question

; additions supported in T1 encoding
U+002C U+002C <> U+201E ; ,, -> DOUBLE LOW-9 QUOTATION MARK
U+003C U+003C <> U+00AB ; << -> LEFT POINTING GUILLEMET
U+003E U+003E <> U+00BB ; >> -> RIGHT POINTING GUILLEMET

; additions to suppress fraktur ligature
U+0073 U+003A <> U+0073 ; s: -> LATIN SMALL LETTER S


Then run



teckit_compile fraktur.map


which will create a file named fraktur.tec.



Then, you can use this mapping file with xelatex like this:



documentclassarticle
usepackage[german]babel
usepackagefontspec
usepackageyfonts

setmainfontLatin Modern Roman[Mapping=fraktur]

begindocument

Test

Tes:t

This:: should have one colon.

Another example: The colon should stay here.


frakfamily

Test

Tes:t

This:: should have one colon.

Another example: The colon should stay here.

enddocument


enter image description here






share|improve this answer




















  • This does not seem to affect section titles, see sectionTes:t for example.
    – epR8GaYuh
    Aug 18 at 14:57






  • 1




    @epR8GaYuh you are using scrbook, which sets the section titles in sans serif, so you will have to add the mapping instruction also to the sans family with e.g. setsansfontLatin Modern Sans[Mapping=fraktur]
    – Ulrike Fischer
    Aug 18 at 16:10














up vote
3
down vote













With help from this answer, here's a solution with xelatex:



Find on your system the file tex-text.map and copy it to your working directory under the name fraktur.map (or whatever you want). Then append to it a line so that it looks like:



; TECkit mapping for TeX input conventions <-> Unicode characters

LHSName "TeX-text"
RHSName "UNICODE"

pass(Unicode)

; ligatures from Knuth's original CMR fonts
U+002D U+002D <> U+2013 ; -- -> en dash
U+002D U+002D U+002D <> U+2014 ; --- -> em dash

U+0027 <> U+2019 ; ' -> right single quote
U+0027 U+0027 <> U+201D ; '' -> right double quote
U+0022 > U+201D ; " -> right double quote

U+0060 <> U+2018 ; ` -> left single quote
U+0060 U+0060 <> U+201C ; `` -> left double quote

U+0021 U+0060 <> U+00A1 ; !` -> inverted exclam
U+003F U+0060 <> U+00BF ; ?` -> inverted question

; additions supported in T1 encoding
U+002C U+002C <> U+201E ; ,, -> DOUBLE LOW-9 QUOTATION MARK
U+003C U+003C <> U+00AB ; << -> LEFT POINTING GUILLEMET
U+003E U+003E <> U+00BB ; >> -> RIGHT POINTING GUILLEMET

; additions to suppress fraktur ligature
U+0073 U+003A <> U+0073 ; s: -> LATIN SMALL LETTER S


Then run



teckit_compile fraktur.map


which will create a file named fraktur.tec.



Then, you can use this mapping file with xelatex like this:



documentclassarticle
usepackage[german]babel
usepackagefontspec
usepackageyfonts

setmainfontLatin Modern Roman[Mapping=fraktur]

begindocument

Test

Tes:t

This:: should have one colon.

Another example: The colon should stay here.


frakfamily

Test

Tes:t

This:: should have one colon.

Another example: The colon should stay here.

enddocument


enter image description here






share|improve this answer




















  • This does not seem to affect section titles, see sectionTes:t for example.
    – epR8GaYuh
    Aug 18 at 14:57






  • 1




    @epR8GaYuh you are using scrbook, which sets the section titles in sans serif, so you will have to add the mapping instruction also to the sans family with e.g. setsansfontLatin Modern Sans[Mapping=fraktur]
    – Ulrike Fischer
    Aug 18 at 16:10












up vote
3
down vote










up vote
3
down vote









With help from this answer, here's a solution with xelatex:



Find on your system the file tex-text.map and copy it to your working directory under the name fraktur.map (or whatever you want). Then append to it a line so that it looks like:



; TECkit mapping for TeX input conventions <-> Unicode characters

LHSName "TeX-text"
RHSName "UNICODE"

pass(Unicode)

; ligatures from Knuth's original CMR fonts
U+002D U+002D <> U+2013 ; -- -> en dash
U+002D U+002D U+002D <> U+2014 ; --- -> em dash

U+0027 <> U+2019 ; ' -> right single quote
U+0027 U+0027 <> U+201D ; '' -> right double quote
U+0022 > U+201D ; " -> right double quote

U+0060 <> U+2018 ; ` -> left single quote
U+0060 U+0060 <> U+201C ; `` -> left double quote

U+0021 U+0060 <> U+00A1 ; !` -> inverted exclam
U+003F U+0060 <> U+00BF ; ?` -> inverted question

; additions supported in T1 encoding
U+002C U+002C <> U+201E ; ,, -> DOUBLE LOW-9 QUOTATION MARK
U+003C U+003C <> U+00AB ; << -> LEFT POINTING GUILLEMET
U+003E U+003E <> U+00BB ; >> -> RIGHT POINTING GUILLEMET

; additions to suppress fraktur ligature
U+0073 U+003A <> U+0073 ; s: -> LATIN SMALL LETTER S


Then run



teckit_compile fraktur.map


which will create a file named fraktur.tec.



Then, you can use this mapping file with xelatex like this:



documentclassarticle
usepackage[german]babel
usepackagefontspec
usepackageyfonts

setmainfontLatin Modern Roman[Mapping=fraktur]

begindocument

Test

Tes:t

This:: should have one colon.

Another example: The colon should stay here.


frakfamily

Test

Tes:t

This:: should have one colon.

Another example: The colon should stay here.

enddocument


enter image description here






share|improve this answer












With help from this answer, here's a solution with xelatex:



Find on your system the file tex-text.map and copy it to your working directory under the name fraktur.map (or whatever you want). Then append to it a line so that it looks like:



; TECkit mapping for TeX input conventions <-> Unicode characters

LHSName "TeX-text"
RHSName "UNICODE"

pass(Unicode)

; ligatures from Knuth's original CMR fonts
U+002D U+002D <> U+2013 ; -- -> en dash
U+002D U+002D U+002D <> U+2014 ; --- -> em dash

U+0027 <> U+2019 ; ' -> right single quote
U+0027 U+0027 <> U+201D ; '' -> right double quote
U+0022 > U+201D ; " -> right double quote

U+0060 <> U+2018 ; ` -> left single quote
U+0060 U+0060 <> U+201C ; `` -> left double quote

U+0021 U+0060 <> U+00A1 ; !` -> inverted exclam
U+003F U+0060 <> U+00BF ; ?` -> inverted question

; additions supported in T1 encoding
U+002C U+002C <> U+201E ; ,, -> DOUBLE LOW-9 QUOTATION MARK
U+003C U+003C <> U+00AB ; << -> LEFT POINTING GUILLEMET
U+003E U+003E <> U+00BB ; >> -> RIGHT POINTING GUILLEMET

; additions to suppress fraktur ligature
U+0073 U+003A <> U+0073 ; s: -> LATIN SMALL LETTER S


Then run



teckit_compile fraktur.map


which will create a file named fraktur.tec.



Then, you can use this mapping file with xelatex like this:



documentclassarticle
usepackage[german]babel
usepackagefontspec
usepackageyfonts

setmainfontLatin Modern Roman[Mapping=fraktur]

begindocument

Test

Tes:t

This:: should have one colon.

Another example: The colon should stay here.


frakfamily

Test

Tes:t

This:: should have one colon.

Another example: The colon should stay here.

enddocument


enter image description here







share|improve this answer












share|improve this answer



share|improve this answer










answered Aug 18 at 14:41









David Purton

6,3921529




6,3921529











  • This does not seem to affect section titles, see sectionTes:t for example.
    – epR8GaYuh
    Aug 18 at 14:57






  • 1




    @epR8GaYuh you are using scrbook, which sets the section titles in sans serif, so you will have to add the mapping instruction also to the sans family with e.g. setsansfontLatin Modern Sans[Mapping=fraktur]
    – Ulrike Fischer
    Aug 18 at 16:10
















  • This does not seem to affect section titles, see sectionTes:t for example.
    – epR8GaYuh
    Aug 18 at 14:57






  • 1




    @epR8GaYuh you are using scrbook, which sets the section titles in sans serif, so you will have to add the mapping instruction also to the sans family with e.g. setsansfontLatin Modern Sans[Mapping=fraktur]
    – Ulrike Fischer
    Aug 18 at 16:10















This does not seem to affect section titles, see sectionTes:t for example.
– epR8GaYuh
Aug 18 at 14:57




This does not seem to affect section titles, see sectionTes:t for example.
– epR8GaYuh
Aug 18 at 14:57




1




1




@epR8GaYuh you are using scrbook, which sets the section titles in sans serif, so you will have to add the mapping instruction also to the sans family with e.g. setsansfontLatin Modern Sans[Mapping=fraktur]
– Ulrike Fischer
Aug 18 at 16:10




@epR8GaYuh you are using scrbook, which sets the section titles in sans serif, so you will have to add the mapping instruction also to the sans family with e.g. setsansfontLatin Modern Sans[Mapping=fraktur]
– Ulrike Fischer
Aug 18 at 16:10

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f446546%2fswitch-between-fraktur-and-standard-fonts%23new-answer', 'question_page');

);

Post as a guest













































































Comments

Popular posts from this blog

What does second last employer means? [closed]

Installing NextGIS Connect into QGIS 3?

One-line joke