Andika fractions
I have hand made the exercise with svg. See attachment. It was very cumbersome.
If I could write the étude in markdown and then do pandoc magic I could perhaps learn how to create a library of basic exercises.
As simple as possible, but also as "schoolbook-like" as possible with Andika's open four, seven with a bar etc.
Below the markdown that I hope to learn how to tweak with more complex pandoc command line arguments than this:
~/lk$ pandoc --variable mainfont="Andika" lk-markdown-base-file.md --pdf-engine=xelatex -o lk-md-xelatex-pdf.pdf
I copied that line from https://pandoc.org/demos.html, here's the markdown:
Andika fractions 0123456789
$frac{1}{1}+frac{1}{4}=frac{4}{4}·frac{1}{1}+frac{1}{1}·frac{1}{4}=frac{4}{4}+frac{1}{4}=frac{5}{4}$
$frac{1}{2}+frac{1}{5}=frac{5}{5}·frac{1}{2}+frac{2}{2}·frac{1}{5}=frac{5}{10}+frac{2}{10}=$
$frac{1}{3}+frac{1}{6}=frac{6}{6}·frac{1}{3}+frac{3}{3}·frac{1}{6}=frac{6}{18}+$
$frac{1}{4}+frac{1}{7}=frac{7}{7}·frac{1}{4}+frac{4}{4}·frac{1}{7}=$
$frac{1}{5}+frac{1}{8}=frac{8}{8}·frac{1}{5}+frac{5}{5}·$
$frac{1}{6}+frac{1}{9}=frac{9}{9}·frac{1}{6}+$
$frac{1}{7}+frac{1}{10}=frac{10}{10}·$
$frac{1}{8}+frac{1}{11}=$
$frac{1}{9}+$
If I could make such a fractions exercise with Andika without having to program svg, that would be fantastic!
fonts xetex luatex fontspec pandoc
|
show 1 more comment
I have hand made the exercise with svg. See attachment. It was very cumbersome.
If I could write the étude in markdown and then do pandoc magic I could perhaps learn how to create a library of basic exercises.
As simple as possible, but also as "schoolbook-like" as possible with Andika's open four, seven with a bar etc.
Below the markdown that I hope to learn how to tweak with more complex pandoc command line arguments than this:
~/lk$ pandoc --variable mainfont="Andika" lk-markdown-base-file.md --pdf-engine=xelatex -o lk-md-xelatex-pdf.pdf
I copied that line from https://pandoc.org/demos.html, here's the markdown:
Andika fractions 0123456789
$frac{1}{1}+frac{1}{4}=frac{4}{4}·frac{1}{1}+frac{1}{1}·frac{1}{4}=frac{4}{4}+frac{1}{4}=frac{5}{4}$
$frac{1}{2}+frac{1}{5}=frac{5}{5}·frac{1}{2}+frac{2}{2}·frac{1}{5}=frac{5}{10}+frac{2}{10}=$
$frac{1}{3}+frac{1}{6}=frac{6}{6}·frac{1}{3}+frac{3}{3}·frac{1}{6}=frac{6}{18}+$
$frac{1}{4}+frac{1}{7}=frac{7}{7}·frac{1}{4}+frac{4}{4}·frac{1}{7}=$
$frac{1}{5}+frac{1}{8}=frac{8}{8}·frac{1}{5}+frac{5}{5}·$
$frac{1}{6}+frac{1}{9}=frac{9}{9}·frac{1}{6}+$
$frac{1}{7}+frac{1}{10}=frac{10}{10}·$
$frac{1}{8}+frac{1}{11}=$
$frac{1}{9}+$
If I could make such a fractions exercise with Andika without having to program svg, that would be fantastic!
fonts xetex luatex fontspec pandoc
Welcome to TeX.SE! Please what is "Andika"? A font? Do you have a link to it?
– Kurt
Jan 26 at 8:27
2
@Kurt:--variable mainfont="Andika"
... ;-)
– user31729
Jan 26 at 8:29
Hello Kurt! Here's a SIL pdf with the special numbers 1, 4, 6, 7 and 9 that I want: software.sil.org/wp-content/uploads/sites/19/2015/12/… To make them show with css+svg you do <css> font-family: Andika; font-feature-settings: "dig1" 1, "dig4" 1, "dg69" 1, "dig7" 1 </css>
– Erik Josefsson
Jan 26 at 9:20
1
Hi Jonas, the pdf with "Font Features for Andika" lists variants (e.g. "open four") of the numerals 1, 4, 6, 7 and 9, see bottom of page: software.sil.org/wp-content/uploads/sites/19/2015/12/… Best regards. //Erik
– Erik Josefsson
Jan 26 at 20:44
@ErikJosefsson I see, one has to generate it first for a quick preview scripts.sil.org/ttw/fonts2go.cgi
– Jonas Stein
Jan 26 at 20:59
|
show 1 more comment
I have hand made the exercise with svg. See attachment. It was very cumbersome.
If I could write the étude in markdown and then do pandoc magic I could perhaps learn how to create a library of basic exercises.
As simple as possible, but also as "schoolbook-like" as possible with Andika's open four, seven with a bar etc.
Below the markdown that I hope to learn how to tweak with more complex pandoc command line arguments than this:
~/lk$ pandoc --variable mainfont="Andika" lk-markdown-base-file.md --pdf-engine=xelatex -o lk-md-xelatex-pdf.pdf
I copied that line from https://pandoc.org/demos.html, here's the markdown:
Andika fractions 0123456789
$frac{1}{1}+frac{1}{4}=frac{4}{4}·frac{1}{1}+frac{1}{1}·frac{1}{4}=frac{4}{4}+frac{1}{4}=frac{5}{4}$
$frac{1}{2}+frac{1}{5}=frac{5}{5}·frac{1}{2}+frac{2}{2}·frac{1}{5}=frac{5}{10}+frac{2}{10}=$
$frac{1}{3}+frac{1}{6}=frac{6}{6}·frac{1}{3}+frac{3}{3}·frac{1}{6}=frac{6}{18}+$
$frac{1}{4}+frac{1}{7}=frac{7}{7}·frac{1}{4}+frac{4}{4}·frac{1}{7}=$
$frac{1}{5}+frac{1}{8}=frac{8}{8}·frac{1}{5}+frac{5}{5}·$
$frac{1}{6}+frac{1}{9}=frac{9}{9}·frac{1}{6}+$
$frac{1}{7}+frac{1}{10}=frac{10}{10}·$
$frac{1}{8}+frac{1}{11}=$
$frac{1}{9}+$
If I could make such a fractions exercise with Andika without having to program svg, that would be fantastic!
fonts xetex luatex fontspec pandoc
I have hand made the exercise with svg. See attachment. It was very cumbersome.
If I could write the étude in markdown and then do pandoc magic I could perhaps learn how to create a library of basic exercises.
As simple as possible, but also as "schoolbook-like" as possible with Andika's open four, seven with a bar etc.
Below the markdown that I hope to learn how to tweak with more complex pandoc command line arguments than this:
~/lk$ pandoc --variable mainfont="Andika" lk-markdown-base-file.md --pdf-engine=xelatex -o lk-md-xelatex-pdf.pdf
I copied that line from https://pandoc.org/demos.html, here's the markdown:
Andika fractions 0123456789
$frac{1}{1}+frac{1}{4}=frac{4}{4}·frac{1}{1}+frac{1}{1}·frac{1}{4}=frac{4}{4}+frac{1}{4}=frac{5}{4}$
$frac{1}{2}+frac{1}{5}=frac{5}{5}·frac{1}{2}+frac{2}{2}·frac{1}{5}=frac{5}{10}+frac{2}{10}=$
$frac{1}{3}+frac{1}{6}=frac{6}{6}·frac{1}{3}+frac{3}{3}·frac{1}{6}=frac{6}{18}+$
$frac{1}{4}+frac{1}{7}=frac{7}{7}·frac{1}{4}+frac{4}{4}·frac{1}{7}=$
$frac{1}{5}+frac{1}{8}=frac{8}{8}·frac{1}{5}+frac{5}{5}·$
$frac{1}{6}+frac{1}{9}=frac{9}{9}·frac{1}{6}+$
$frac{1}{7}+frac{1}{10}=frac{10}{10}·$
$frac{1}{8}+frac{1}{11}=$
$frac{1}{9}+$
If I could make such a fractions exercise with Andika without having to program svg, that would be fantastic!
fonts xetex luatex fontspec pandoc
fonts xetex luatex fontspec pandoc
edited Jan 26 at 17:46
Jonas Stein
3,20142644
3,20142644
asked Jan 26 at 8:23


Erik JosefssonErik Josefsson
393
393
Welcome to TeX.SE! Please what is "Andika"? A font? Do you have a link to it?
– Kurt
Jan 26 at 8:27
2
@Kurt:--variable mainfont="Andika"
... ;-)
– user31729
Jan 26 at 8:29
Hello Kurt! Here's a SIL pdf with the special numbers 1, 4, 6, 7 and 9 that I want: software.sil.org/wp-content/uploads/sites/19/2015/12/… To make them show with css+svg you do <css> font-family: Andika; font-feature-settings: "dig1" 1, "dig4" 1, "dg69" 1, "dig7" 1 </css>
– Erik Josefsson
Jan 26 at 9:20
1
Hi Jonas, the pdf with "Font Features for Andika" lists variants (e.g. "open four") of the numerals 1, 4, 6, 7 and 9, see bottom of page: software.sil.org/wp-content/uploads/sites/19/2015/12/… Best regards. //Erik
– Erik Josefsson
Jan 26 at 20:44
@ErikJosefsson I see, one has to generate it first for a quick preview scripts.sil.org/ttw/fonts2go.cgi
– Jonas Stein
Jan 26 at 20:59
|
show 1 more comment
Welcome to TeX.SE! Please what is "Andika"? A font? Do you have a link to it?
– Kurt
Jan 26 at 8:27
2
@Kurt:--variable mainfont="Andika"
... ;-)
– user31729
Jan 26 at 8:29
Hello Kurt! Here's a SIL pdf with the special numbers 1, 4, 6, 7 and 9 that I want: software.sil.org/wp-content/uploads/sites/19/2015/12/… To make them show with css+svg you do <css> font-family: Andika; font-feature-settings: "dig1" 1, "dig4" 1, "dg69" 1, "dig7" 1 </css>
– Erik Josefsson
Jan 26 at 9:20
1
Hi Jonas, the pdf with "Font Features for Andika" lists variants (e.g. "open four") of the numerals 1, 4, 6, 7 and 9, see bottom of page: software.sil.org/wp-content/uploads/sites/19/2015/12/… Best regards. //Erik
– Erik Josefsson
Jan 26 at 20:44
@ErikJosefsson I see, one has to generate it first for a quick preview scripts.sil.org/ttw/fonts2go.cgi
– Jonas Stein
Jan 26 at 20:59
Welcome to TeX.SE! Please what is "Andika"? A font? Do you have a link to it?
– Kurt
Jan 26 at 8:27
Welcome to TeX.SE! Please what is "Andika"? A font? Do you have a link to it?
– Kurt
Jan 26 at 8:27
2
2
@Kurt:
--variable mainfont="Andika"
... ;-)– user31729
Jan 26 at 8:29
@Kurt:
--variable mainfont="Andika"
... ;-)– user31729
Jan 26 at 8:29
Hello Kurt! Here's a SIL pdf with the special numbers 1, 4, 6, 7 and 9 that I want: software.sil.org/wp-content/uploads/sites/19/2015/12/… To make them show with css+svg you do <css> font-family: Andika; font-feature-settings: "dig1" 1, "dig4" 1, "dg69" 1, "dig7" 1 </css>
– Erik Josefsson
Jan 26 at 9:20
Hello Kurt! Here's a SIL pdf with the special numbers 1, 4, 6, 7 and 9 that I want: software.sil.org/wp-content/uploads/sites/19/2015/12/… To make them show with css+svg you do <css> font-family: Andika; font-feature-settings: "dig1" 1, "dig4" 1, "dg69" 1, "dig7" 1 </css>
– Erik Josefsson
Jan 26 at 9:20
1
1
Hi Jonas, the pdf with "Font Features for Andika" lists variants (e.g. "open four") of the numerals 1, 4, 6, 7 and 9, see bottom of page: software.sil.org/wp-content/uploads/sites/19/2015/12/… Best regards. //Erik
– Erik Josefsson
Jan 26 at 20:44
Hi Jonas, the pdf with "Font Features for Andika" lists variants (e.g. "open four") of the numerals 1, 4, 6, 7 and 9, see bottom of page: software.sil.org/wp-content/uploads/sites/19/2015/12/… Best regards. //Erik
– Erik Josefsson
Jan 26 at 20:44
@ErikJosefsson I see, one has to generate it first for a quick preview scripts.sil.org/ttw/fonts2go.cgi
– Jonas Stein
Jan 26 at 20:59
@ErikJosefsson I see, one has to generate it first for a quick preview scripts.sil.org/ttw/fonts2go.cgi
– Jonas Stein
Jan 26 at 20:59
|
show 1 more comment
2 Answers
2
active
oldest
votes
TL;DR:
You need to tell pandoc, which font to use in the YAML header:
---
mainfont: Andika
mainfontoptions:
- CharacterVariant=1
- CharacterVariant=4
- CharacterVariant=6
- CharacterVariant=7
mathspec: true
mathfont: Andika
mathfontoptions:
- CharacterVariant=1
- CharacterVariant=4
- CharacterVariant=6
- CharacterVariant=7
---
# Markdown below
This works only for XeLaTeX. If you need a solution that works with LuaLaTeX see Mico's answer.
The open digits can be activated by using the otf font features¹. You can do that with fontspec
:
documentclass{article}
usepackage{fontspec}
setmainfont[CharacterVariant={1,4,6,7}]{Andika}
usepackage{parskip}
setlength{parindent}{0pt}
setlength{parskip}{6pt plus 2pt minus 1pt}
begin{document}
Andika fractions 0123456789
end{document}
Andika now works in text mode but not in math mode. To use Andika also in math mode you have to load mathspec
instead of fontspec
:
documentclass{article}
usepackage{mathspec}
setmainfont[CharacterVariant={1,4,6,7}]{Andika}
setmathfont(Digits,Latin)[CharacterVariant={1,4,6,7}]{Andika}
usepackage{parskip}
setlength{parindent}{0pt}
setlength{parskip}{6pt plus 2pt minus 1pt}
begin{document}
Andika fractions 0123456789
(frac{1}{1}+frac{1}{4}=frac{4}{4}cdotfrac{1}{1}+frac{1}{1}cdotfrac{1}{4}=frac{4}{4}+frac{1}{4}=frac{5}{4})
(frac{1}{2}+frac{1}{5}=frac{5}{5}cdotfrac{1}{2}+frac{2}{2}cdotfrac{1}{5}=frac{5}{10}+frac{2}{10}=)
(frac{1}{3}+frac{1}{6}=frac{6}{6}cdotfrac{1}{3}+frac{3}{3}cdotfrac{1}{6}=frac{6}{18}+)
(frac{1}{4}+frac{1}{7}=frac{7}{7}cdotfrac{1}{4}+frac{4}{4}cdotfrac{1}{7}=)
(frac{1}{5}+frac{1}{8}=frac{8}{8}cdotfrac{1}{5}+frac{5}{5}cdot)
(frac{1}{6}+frac{1}{9}=frac{9}{9}cdotfrac{1}{6}+)
(frac{1}{7}+frac{1}{10}=frac{10}{10}cdot)
(frac{1}{8}+frac{1}{11}=)
(frac{1}{9}+)
end{document}
To use this solution with pandoc
you have to tell it to use mathspec
and specify the main and math font with the option above. You can do that in the YAML header²:
---
mainfont: Andika
mainfontoptions:
- CharacterVariant=1
- CharacterVariant=4
- CharacterVariant=6
- CharacterVariant=7
mathspec: true
mathfont: Andika
mathfontoptions:
- CharacterVariant=1
- CharacterVariant=4
- CharacterVariant=6
- CharacterVariant=7
---
Andika fractions 0123456789
$frac{1}{1}+frac{1}{4}=frac{4}{4}cdotfrac{1}{1}+frac{1}{1}cdotfrac{1}{4}=frac{4}{4}+frac{1}{4}=frac{5}{4}$
$frac{1}{2}+frac{1}{5}=frac{5}{5}cdotfrac{1}{2}+frac{2}{2}cdotfrac{1}{5}=frac{5}{10}+frac{2}{10}=$
$frac{1}{3}+frac{1}{6}=frac{6}{6}cdotfrac{1}{3}+frac{3}{3}cdotfrac{1}{6}=frac{6}{18}+$
$frac{1}{4}+frac{1}{7}=frac{7}{7}cdotfrac{1}{4}+frac{4}{4}cdotfrac{1}{7}=$
$frac{1}{5}+frac{1}{8}=frac{8}{8}cdotfrac{1}{5}+frac{5}{5}cdot$
$frac{1}{6}+frac{1}{9}=frac{9}{9}cdotfrac{1}{6}+$
$frac{1}{7}+frac{1}{10}=frac{10}{10}cdot$
$frac{1}{8}+frac{1}{11}=$
$frac{1}{9}+$
You can call pandoc now as usual:
$ pandoc input.md --pdf-engine=xelatex -o output.pdf
–––
- You can use
otfinfo -f Andika-R.ttf
to list all available font features. - Multiple option values can be set with a simple YAML sequence.
Wow! I have spent days trying to make this happen on my own!! Is it possible to have all CharacterVariants active (i.e. 1, 4, 6, 7 and 9)? I tried to list with comma separation, but this did not work: CharacterVariant=4,7
– Erik Josefsson
Jan 26 at 11:17
@ErikJosefsson If you want to have more than one feature activated, you need to put curly braces around them:CharacterVariant={4,7}
– DG'
Jan 26 at 11:19
Sorry, didn't work with curly braces {4,7} in the YAML header: --- mainfont: Andika mainfontoptions: CharacterVariant={4,7} mathspec: true mathfont: Andika mathfontoptions: CharacterVariant={4,7} --- This is what pandoc said: Error producing PDF. ! Missing number, treated as zero. <to be read again> protect l.21 ifxetex I think I have all of Andika installed since I made the svg with font-feature-settings: "dig1" 1, "dig4" 1, "dg69" 1, "dig7" 1; Almost there! :-) Thanks!!
– Erik Josefsson
Jan 26 at 11:32
You are right. Doesn't work that way. You have to use a YAML sequence. See edit.
– DG'
Jan 26 at 15:47
add a comment |
Here's a solution that works with both LuaLaTeX and XeLaTeX, while using the non-default variants of the numerals 1
, 4
, 6
, 7
, and 9
. In addition, it employs an array
environment, to help align all fraction terms, +
symbols, and =
symbols horizontally as well as vertically.
Observe that since Andika is a text font, not a math font, only the numerals in the math terms employ Andika; all other glyphs (such as +
and =
) are rendered using Latin Modern Math.
The code below actually presents two solutions, rather than just one solution. The first uses display-style math, while the secod uses text-style math. The difference is most readily apparent in the size of the frac
terms.
documentclass{article}
usepackage{array} % for 'newcolumntype' macro
usepackage{booktabs} % for 'addlinespace' macro
newcolumntype{C}{>{{}}c<{{}}} % column type for = and + operators
newcolumntype{H}{>{displaystyle}c}
usepackage{unicode-math}
setmainfont{Andika}[CharacterVariant={1,4,6,7}]
setmathfont{Latin Modern Math}
setmathfont{Andika}[range=up/{num},
CharacterVariant={1,4,6,7}]
begin{document}
Andika numerals 0123456789
Solution 1: display-style math and fractions
[
setlength{arraycolsep}{0pt}
begin{array}{*{8}{HC}H}
frac{1}{1} &+&frac{1}{4} &=& frac{4}{4} &cdot& frac{1}{1} &+&
frac{1}{1} &cdot& frac{1}{4} &=& frac{4}{4} &+&frac{1}{4} &=&
frac{5}{4}\ addlinespace
frac{1}{2} &+&frac{1}{5} &=& frac{5}{5} &cdot& frac{1}{2} &+&
frac{2}{2} &cdot& frac{1}{5} &=& frac{5}{10} &+&frac{2}{10}&=&
\ addlinespace
frac{1}{3} &+&frac{1}{6} &=& frac{6}{6} &cdot& frac{1}{3} &+&
frac{3}{3} &cdot& frac{1}{6} &=& frac{6}{18} &+&\
addlinespace
frac{1}{4} &+&frac{1}{7} &=& frac{7}{7} &cdot& frac{1}{4} &+&
frac{4}{4} &cdot& frac{1}{7} &=& \ addlinespace
frac{1}{5} &+&frac{1}{8} &=& frac{8}{8} &cdot& frac{1}{5} &+&
frac{5}{5} &cdot& \ addlinespace
frac{1}{6} &+&frac{1}{9} &=& frac{9}{9} &cdot& frac{1}{6} &+&
\ addlinespace
frac{1}{7} &+&frac{1}{10} &=& frac{10}{10} &cdot&
\ addlinespace
frac{1}{8} &+&frac{1}{11} &=& \ addlinespace
frac{1}{9} &+&\
end{array}
]
Solution 2: text-style math and fractions
[
setlength{arraycolsep}{0pt}
begin{array}{*{8}{cC}c}
frac{1}{1} &+&frac{1}{4} &=& frac{4}{4} &cdot& frac{1}{1} &+&
frac{1}{1} &cdot& frac{1}{4} &=& frac{4}{4} &+&frac{1}{4} &=&
frac{5}{4}\ addlinespace
frac{1}{2} &+&frac{1}{5} &=& frac{5}{5} &cdot& frac{1}{2} &+&
frac{2}{2} &cdot& frac{1}{5} &=& frac{5}{10} &+&frac{2}{10}&=&
\ addlinespace
frac{1}{3} &+&frac{1}{6} &=& frac{6}{6} &cdot& frac{1}{3} &+&
frac{3}{3} &cdot& frac{1}{6} &=& frac{6}{18} &+&\
addlinespace
frac{1}{4} &+&frac{1}{7} &=& frac{7}{7} &cdot& frac{1}{4} &+&
frac{4}{4} &cdot& frac{1}{7} &=& \ addlinespace
frac{1}{5} &+&frac{1}{8} &=& frac{8}{8} &cdot& frac{1}{5} &+&
frac{5}{5} &cdot& \ addlinespace
frac{1}{6} &+&frac{1}{9} &=& frac{9}{9} &cdot& frac{1}{6} &+&
\ addlinespace
frac{1}{7} &+&frac{1}{10} &=& frac{10}{10} &cdot&
\ addlinespace
frac{1}{8} &+&frac{1}{11} &=& \ addlinespace
frac{1}{9} &+&\
end{array}
]
end{document}
This is very helpful and useful and fantastic! You also helped solve how to send more than one CharacterVariant through pandoc's YAMLcode
--- mainfont: Andika mainfontoptions: [CharacterVariant=1, CharacterVariant=4, CharacterVariant=6, CharacterVariant=7] mathspec: true mathfont: Andika mathfontoptions: [CharacterVariant=1, CharacterVariant=4, CharacterVariant=6, CharacterVariant=7] ---code
I'll try to unwrap the snippet {C}{>{{}}c<{{}}} to see if I can reproduce that level of precision myself:code
begin{array}{*{8}{HC}H}code
Again, thank you! //Erik
– Erik Josefsson
Jan 26 at 14:29
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/3.0/"u003ecc by-sa 3.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
});
}
});
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%2f471927%2fandika-fractions%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
TL;DR:
You need to tell pandoc, which font to use in the YAML header:
---
mainfont: Andika
mainfontoptions:
- CharacterVariant=1
- CharacterVariant=4
- CharacterVariant=6
- CharacterVariant=7
mathspec: true
mathfont: Andika
mathfontoptions:
- CharacterVariant=1
- CharacterVariant=4
- CharacterVariant=6
- CharacterVariant=7
---
# Markdown below
This works only for XeLaTeX. If you need a solution that works with LuaLaTeX see Mico's answer.
The open digits can be activated by using the otf font features¹. You can do that with fontspec
:
documentclass{article}
usepackage{fontspec}
setmainfont[CharacterVariant={1,4,6,7}]{Andika}
usepackage{parskip}
setlength{parindent}{0pt}
setlength{parskip}{6pt plus 2pt minus 1pt}
begin{document}
Andika fractions 0123456789
end{document}
Andika now works in text mode but not in math mode. To use Andika also in math mode you have to load mathspec
instead of fontspec
:
documentclass{article}
usepackage{mathspec}
setmainfont[CharacterVariant={1,4,6,7}]{Andika}
setmathfont(Digits,Latin)[CharacterVariant={1,4,6,7}]{Andika}
usepackage{parskip}
setlength{parindent}{0pt}
setlength{parskip}{6pt plus 2pt minus 1pt}
begin{document}
Andika fractions 0123456789
(frac{1}{1}+frac{1}{4}=frac{4}{4}cdotfrac{1}{1}+frac{1}{1}cdotfrac{1}{4}=frac{4}{4}+frac{1}{4}=frac{5}{4})
(frac{1}{2}+frac{1}{5}=frac{5}{5}cdotfrac{1}{2}+frac{2}{2}cdotfrac{1}{5}=frac{5}{10}+frac{2}{10}=)
(frac{1}{3}+frac{1}{6}=frac{6}{6}cdotfrac{1}{3}+frac{3}{3}cdotfrac{1}{6}=frac{6}{18}+)
(frac{1}{4}+frac{1}{7}=frac{7}{7}cdotfrac{1}{4}+frac{4}{4}cdotfrac{1}{7}=)
(frac{1}{5}+frac{1}{8}=frac{8}{8}cdotfrac{1}{5}+frac{5}{5}cdot)
(frac{1}{6}+frac{1}{9}=frac{9}{9}cdotfrac{1}{6}+)
(frac{1}{7}+frac{1}{10}=frac{10}{10}cdot)
(frac{1}{8}+frac{1}{11}=)
(frac{1}{9}+)
end{document}
To use this solution with pandoc
you have to tell it to use mathspec
and specify the main and math font with the option above. You can do that in the YAML header²:
---
mainfont: Andika
mainfontoptions:
- CharacterVariant=1
- CharacterVariant=4
- CharacterVariant=6
- CharacterVariant=7
mathspec: true
mathfont: Andika
mathfontoptions:
- CharacterVariant=1
- CharacterVariant=4
- CharacterVariant=6
- CharacterVariant=7
---
Andika fractions 0123456789
$frac{1}{1}+frac{1}{4}=frac{4}{4}cdotfrac{1}{1}+frac{1}{1}cdotfrac{1}{4}=frac{4}{4}+frac{1}{4}=frac{5}{4}$
$frac{1}{2}+frac{1}{5}=frac{5}{5}cdotfrac{1}{2}+frac{2}{2}cdotfrac{1}{5}=frac{5}{10}+frac{2}{10}=$
$frac{1}{3}+frac{1}{6}=frac{6}{6}cdotfrac{1}{3}+frac{3}{3}cdotfrac{1}{6}=frac{6}{18}+$
$frac{1}{4}+frac{1}{7}=frac{7}{7}cdotfrac{1}{4}+frac{4}{4}cdotfrac{1}{7}=$
$frac{1}{5}+frac{1}{8}=frac{8}{8}cdotfrac{1}{5}+frac{5}{5}cdot$
$frac{1}{6}+frac{1}{9}=frac{9}{9}cdotfrac{1}{6}+$
$frac{1}{7}+frac{1}{10}=frac{10}{10}cdot$
$frac{1}{8}+frac{1}{11}=$
$frac{1}{9}+$
You can call pandoc now as usual:
$ pandoc input.md --pdf-engine=xelatex -o output.pdf
–––
- You can use
otfinfo -f Andika-R.ttf
to list all available font features. - Multiple option values can be set with a simple YAML sequence.
Wow! I have spent days trying to make this happen on my own!! Is it possible to have all CharacterVariants active (i.e. 1, 4, 6, 7 and 9)? I tried to list with comma separation, but this did not work: CharacterVariant=4,7
– Erik Josefsson
Jan 26 at 11:17
@ErikJosefsson If you want to have more than one feature activated, you need to put curly braces around them:CharacterVariant={4,7}
– DG'
Jan 26 at 11:19
Sorry, didn't work with curly braces {4,7} in the YAML header: --- mainfont: Andika mainfontoptions: CharacterVariant={4,7} mathspec: true mathfont: Andika mathfontoptions: CharacterVariant={4,7} --- This is what pandoc said: Error producing PDF. ! Missing number, treated as zero. <to be read again> protect l.21 ifxetex I think I have all of Andika installed since I made the svg with font-feature-settings: "dig1" 1, "dig4" 1, "dg69" 1, "dig7" 1; Almost there! :-) Thanks!!
– Erik Josefsson
Jan 26 at 11:32
You are right. Doesn't work that way. You have to use a YAML sequence. See edit.
– DG'
Jan 26 at 15:47
add a comment |
TL;DR:
You need to tell pandoc, which font to use in the YAML header:
---
mainfont: Andika
mainfontoptions:
- CharacterVariant=1
- CharacterVariant=4
- CharacterVariant=6
- CharacterVariant=7
mathspec: true
mathfont: Andika
mathfontoptions:
- CharacterVariant=1
- CharacterVariant=4
- CharacterVariant=6
- CharacterVariant=7
---
# Markdown below
This works only for XeLaTeX. If you need a solution that works with LuaLaTeX see Mico's answer.
The open digits can be activated by using the otf font features¹. You can do that with fontspec
:
documentclass{article}
usepackage{fontspec}
setmainfont[CharacterVariant={1,4,6,7}]{Andika}
usepackage{parskip}
setlength{parindent}{0pt}
setlength{parskip}{6pt plus 2pt minus 1pt}
begin{document}
Andika fractions 0123456789
end{document}
Andika now works in text mode but not in math mode. To use Andika also in math mode you have to load mathspec
instead of fontspec
:
documentclass{article}
usepackage{mathspec}
setmainfont[CharacterVariant={1,4,6,7}]{Andika}
setmathfont(Digits,Latin)[CharacterVariant={1,4,6,7}]{Andika}
usepackage{parskip}
setlength{parindent}{0pt}
setlength{parskip}{6pt plus 2pt minus 1pt}
begin{document}
Andika fractions 0123456789
(frac{1}{1}+frac{1}{4}=frac{4}{4}cdotfrac{1}{1}+frac{1}{1}cdotfrac{1}{4}=frac{4}{4}+frac{1}{4}=frac{5}{4})
(frac{1}{2}+frac{1}{5}=frac{5}{5}cdotfrac{1}{2}+frac{2}{2}cdotfrac{1}{5}=frac{5}{10}+frac{2}{10}=)
(frac{1}{3}+frac{1}{6}=frac{6}{6}cdotfrac{1}{3}+frac{3}{3}cdotfrac{1}{6}=frac{6}{18}+)
(frac{1}{4}+frac{1}{7}=frac{7}{7}cdotfrac{1}{4}+frac{4}{4}cdotfrac{1}{7}=)
(frac{1}{5}+frac{1}{8}=frac{8}{8}cdotfrac{1}{5}+frac{5}{5}cdot)
(frac{1}{6}+frac{1}{9}=frac{9}{9}cdotfrac{1}{6}+)
(frac{1}{7}+frac{1}{10}=frac{10}{10}cdot)
(frac{1}{8}+frac{1}{11}=)
(frac{1}{9}+)
end{document}
To use this solution with pandoc
you have to tell it to use mathspec
and specify the main and math font with the option above. You can do that in the YAML header²:
---
mainfont: Andika
mainfontoptions:
- CharacterVariant=1
- CharacterVariant=4
- CharacterVariant=6
- CharacterVariant=7
mathspec: true
mathfont: Andika
mathfontoptions:
- CharacterVariant=1
- CharacterVariant=4
- CharacterVariant=6
- CharacterVariant=7
---
Andika fractions 0123456789
$frac{1}{1}+frac{1}{4}=frac{4}{4}cdotfrac{1}{1}+frac{1}{1}cdotfrac{1}{4}=frac{4}{4}+frac{1}{4}=frac{5}{4}$
$frac{1}{2}+frac{1}{5}=frac{5}{5}cdotfrac{1}{2}+frac{2}{2}cdotfrac{1}{5}=frac{5}{10}+frac{2}{10}=$
$frac{1}{3}+frac{1}{6}=frac{6}{6}cdotfrac{1}{3}+frac{3}{3}cdotfrac{1}{6}=frac{6}{18}+$
$frac{1}{4}+frac{1}{7}=frac{7}{7}cdotfrac{1}{4}+frac{4}{4}cdotfrac{1}{7}=$
$frac{1}{5}+frac{1}{8}=frac{8}{8}cdotfrac{1}{5}+frac{5}{5}cdot$
$frac{1}{6}+frac{1}{9}=frac{9}{9}cdotfrac{1}{6}+$
$frac{1}{7}+frac{1}{10}=frac{10}{10}cdot$
$frac{1}{8}+frac{1}{11}=$
$frac{1}{9}+$
You can call pandoc now as usual:
$ pandoc input.md --pdf-engine=xelatex -o output.pdf
–––
- You can use
otfinfo -f Andika-R.ttf
to list all available font features. - Multiple option values can be set with a simple YAML sequence.
Wow! I have spent days trying to make this happen on my own!! Is it possible to have all CharacterVariants active (i.e. 1, 4, 6, 7 and 9)? I tried to list with comma separation, but this did not work: CharacterVariant=4,7
– Erik Josefsson
Jan 26 at 11:17
@ErikJosefsson If you want to have more than one feature activated, you need to put curly braces around them:CharacterVariant={4,7}
– DG'
Jan 26 at 11:19
Sorry, didn't work with curly braces {4,7} in the YAML header: --- mainfont: Andika mainfontoptions: CharacterVariant={4,7} mathspec: true mathfont: Andika mathfontoptions: CharacterVariant={4,7} --- This is what pandoc said: Error producing PDF. ! Missing number, treated as zero. <to be read again> protect l.21 ifxetex I think I have all of Andika installed since I made the svg with font-feature-settings: "dig1" 1, "dig4" 1, "dg69" 1, "dig7" 1; Almost there! :-) Thanks!!
– Erik Josefsson
Jan 26 at 11:32
You are right. Doesn't work that way. You have to use a YAML sequence. See edit.
– DG'
Jan 26 at 15:47
add a comment |
TL;DR:
You need to tell pandoc, which font to use in the YAML header:
---
mainfont: Andika
mainfontoptions:
- CharacterVariant=1
- CharacterVariant=4
- CharacterVariant=6
- CharacterVariant=7
mathspec: true
mathfont: Andika
mathfontoptions:
- CharacterVariant=1
- CharacterVariant=4
- CharacterVariant=6
- CharacterVariant=7
---
# Markdown below
This works only for XeLaTeX. If you need a solution that works with LuaLaTeX see Mico's answer.
The open digits can be activated by using the otf font features¹. You can do that with fontspec
:
documentclass{article}
usepackage{fontspec}
setmainfont[CharacterVariant={1,4,6,7}]{Andika}
usepackage{parskip}
setlength{parindent}{0pt}
setlength{parskip}{6pt plus 2pt minus 1pt}
begin{document}
Andika fractions 0123456789
end{document}
Andika now works in text mode but not in math mode. To use Andika also in math mode you have to load mathspec
instead of fontspec
:
documentclass{article}
usepackage{mathspec}
setmainfont[CharacterVariant={1,4,6,7}]{Andika}
setmathfont(Digits,Latin)[CharacterVariant={1,4,6,7}]{Andika}
usepackage{parskip}
setlength{parindent}{0pt}
setlength{parskip}{6pt plus 2pt minus 1pt}
begin{document}
Andika fractions 0123456789
(frac{1}{1}+frac{1}{4}=frac{4}{4}cdotfrac{1}{1}+frac{1}{1}cdotfrac{1}{4}=frac{4}{4}+frac{1}{4}=frac{5}{4})
(frac{1}{2}+frac{1}{5}=frac{5}{5}cdotfrac{1}{2}+frac{2}{2}cdotfrac{1}{5}=frac{5}{10}+frac{2}{10}=)
(frac{1}{3}+frac{1}{6}=frac{6}{6}cdotfrac{1}{3}+frac{3}{3}cdotfrac{1}{6}=frac{6}{18}+)
(frac{1}{4}+frac{1}{7}=frac{7}{7}cdotfrac{1}{4}+frac{4}{4}cdotfrac{1}{7}=)
(frac{1}{5}+frac{1}{8}=frac{8}{8}cdotfrac{1}{5}+frac{5}{5}cdot)
(frac{1}{6}+frac{1}{9}=frac{9}{9}cdotfrac{1}{6}+)
(frac{1}{7}+frac{1}{10}=frac{10}{10}cdot)
(frac{1}{8}+frac{1}{11}=)
(frac{1}{9}+)
end{document}
To use this solution with pandoc
you have to tell it to use mathspec
and specify the main and math font with the option above. You can do that in the YAML header²:
---
mainfont: Andika
mainfontoptions:
- CharacterVariant=1
- CharacterVariant=4
- CharacterVariant=6
- CharacterVariant=7
mathspec: true
mathfont: Andika
mathfontoptions:
- CharacterVariant=1
- CharacterVariant=4
- CharacterVariant=6
- CharacterVariant=7
---
Andika fractions 0123456789
$frac{1}{1}+frac{1}{4}=frac{4}{4}cdotfrac{1}{1}+frac{1}{1}cdotfrac{1}{4}=frac{4}{4}+frac{1}{4}=frac{5}{4}$
$frac{1}{2}+frac{1}{5}=frac{5}{5}cdotfrac{1}{2}+frac{2}{2}cdotfrac{1}{5}=frac{5}{10}+frac{2}{10}=$
$frac{1}{3}+frac{1}{6}=frac{6}{6}cdotfrac{1}{3}+frac{3}{3}cdotfrac{1}{6}=frac{6}{18}+$
$frac{1}{4}+frac{1}{7}=frac{7}{7}cdotfrac{1}{4}+frac{4}{4}cdotfrac{1}{7}=$
$frac{1}{5}+frac{1}{8}=frac{8}{8}cdotfrac{1}{5}+frac{5}{5}cdot$
$frac{1}{6}+frac{1}{9}=frac{9}{9}cdotfrac{1}{6}+$
$frac{1}{7}+frac{1}{10}=frac{10}{10}cdot$
$frac{1}{8}+frac{1}{11}=$
$frac{1}{9}+$
You can call pandoc now as usual:
$ pandoc input.md --pdf-engine=xelatex -o output.pdf
–––
- You can use
otfinfo -f Andika-R.ttf
to list all available font features. - Multiple option values can be set with a simple YAML sequence.
TL;DR:
You need to tell pandoc, which font to use in the YAML header:
---
mainfont: Andika
mainfontoptions:
- CharacterVariant=1
- CharacterVariant=4
- CharacterVariant=6
- CharacterVariant=7
mathspec: true
mathfont: Andika
mathfontoptions:
- CharacterVariant=1
- CharacterVariant=4
- CharacterVariant=6
- CharacterVariant=7
---
# Markdown below
This works only for XeLaTeX. If you need a solution that works with LuaLaTeX see Mico's answer.
The open digits can be activated by using the otf font features¹. You can do that with fontspec
:
documentclass{article}
usepackage{fontspec}
setmainfont[CharacterVariant={1,4,6,7}]{Andika}
usepackage{parskip}
setlength{parindent}{0pt}
setlength{parskip}{6pt plus 2pt minus 1pt}
begin{document}
Andika fractions 0123456789
end{document}
Andika now works in text mode but not in math mode. To use Andika also in math mode you have to load mathspec
instead of fontspec
:
documentclass{article}
usepackage{mathspec}
setmainfont[CharacterVariant={1,4,6,7}]{Andika}
setmathfont(Digits,Latin)[CharacterVariant={1,4,6,7}]{Andika}
usepackage{parskip}
setlength{parindent}{0pt}
setlength{parskip}{6pt plus 2pt minus 1pt}
begin{document}
Andika fractions 0123456789
(frac{1}{1}+frac{1}{4}=frac{4}{4}cdotfrac{1}{1}+frac{1}{1}cdotfrac{1}{4}=frac{4}{4}+frac{1}{4}=frac{5}{4})
(frac{1}{2}+frac{1}{5}=frac{5}{5}cdotfrac{1}{2}+frac{2}{2}cdotfrac{1}{5}=frac{5}{10}+frac{2}{10}=)
(frac{1}{3}+frac{1}{6}=frac{6}{6}cdotfrac{1}{3}+frac{3}{3}cdotfrac{1}{6}=frac{6}{18}+)
(frac{1}{4}+frac{1}{7}=frac{7}{7}cdotfrac{1}{4}+frac{4}{4}cdotfrac{1}{7}=)
(frac{1}{5}+frac{1}{8}=frac{8}{8}cdotfrac{1}{5}+frac{5}{5}cdot)
(frac{1}{6}+frac{1}{9}=frac{9}{9}cdotfrac{1}{6}+)
(frac{1}{7}+frac{1}{10}=frac{10}{10}cdot)
(frac{1}{8}+frac{1}{11}=)
(frac{1}{9}+)
end{document}
To use this solution with pandoc
you have to tell it to use mathspec
and specify the main and math font with the option above. You can do that in the YAML header²:
---
mainfont: Andika
mainfontoptions:
- CharacterVariant=1
- CharacterVariant=4
- CharacterVariant=6
- CharacterVariant=7
mathspec: true
mathfont: Andika
mathfontoptions:
- CharacterVariant=1
- CharacterVariant=4
- CharacterVariant=6
- CharacterVariant=7
---
Andika fractions 0123456789
$frac{1}{1}+frac{1}{4}=frac{4}{4}cdotfrac{1}{1}+frac{1}{1}cdotfrac{1}{4}=frac{4}{4}+frac{1}{4}=frac{5}{4}$
$frac{1}{2}+frac{1}{5}=frac{5}{5}cdotfrac{1}{2}+frac{2}{2}cdotfrac{1}{5}=frac{5}{10}+frac{2}{10}=$
$frac{1}{3}+frac{1}{6}=frac{6}{6}cdotfrac{1}{3}+frac{3}{3}cdotfrac{1}{6}=frac{6}{18}+$
$frac{1}{4}+frac{1}{7}=frac{7}{7}cdotfrac{1}{4}+frac{4}{4}cdotfrac{1}{7}=$
$frac{1}{5}+frac{1}{8}=frac{8}{8}cdotfrac{1}{5}+frac{5}{5}cdot$
$frac{1}{6}+frac{1}{9}=frac{9}{9}cdotfrac{1}{6}+$
$frac{1}{7}+frac{1}{10}=frac{10}{10}cdot$
$frac{1}{8}+frac{1}{11}=$
$frac{1}{9}+$
You can call pandoc now as usual:
$ pandoc input.md --pdf-engine=xelatex -o output.pdf
–––
- You can use
otfinfo -f Andika-R.ttf
to list all available font features. - Multiple option values can be set with a simple YAML sequence.
edited Jan 26 at 16:01
answered Jan 26 at 10:31


DG'DG'
11k21846
11k21846
Wow! I have spent days trying to make this happen on my own!! Is it possible to have all CharacterVariants active (i.e. 1, 4, 6, 7 and 9)? I tried to list with comma separation, but this did not work: CharacterVariant=4,7
– Erik Josefsson
Jan 26 at 11:17
@ErikJosefsson If you want to have more than one feature activated, you need to put curly braces around them:CharacterVariant={4,7}
– DG'
Jan 26 at 11:19
Sorry, didn't work with curly braces {4,7} in the YAML header: --- mainfont: Andika mainfontoptions: CharacterVariant={4,7} mathspec: true mathfont: Andika mathfontoptions: CharacterVariant={4,7} --- This is what pandoc said: Error producing PDF. ! Missing number, treated as zero. <to be read again> protect l.21 ifxetex I think I have all of Andika installed since I made the svg with font-feature-settings: "dig1" 1, "dig4" 1, "dg69" 1, "dig7" 1; Almost there! :-) Thanks!!
– Erik Josefsson
Jan 26 at 11:32
You are right. Doesn't work that way. You have to use a YAML sequence. See edit.
– DG'
Jan 26 at 15:47
add a comment |
Wow! I have spent days trying to make this happen on my own!! Is it possible to have all CharacterVariants active (i.e. 1, 4, 6, 7 and 9)? I tried to list with comma separation, but this did not work: CharacterVariant=4,7
– Erik Josefsson
Jan 26 at 11:17
@ErikJosefsson If you want to have more than one feature activated, you need to put curly braces around them:CharacterVariant={4,7}
– DG'
Jan 26 at 11:19
Sorry, didn't work with curly braces {4,7} in the YAML header: --- mainfont: Andika mainfontoptions: CharacterVariant={4,7} mathspec: true mathfont: Andika mathfontoptions: CharacterVariant={4,7} --- This is what pandoc said: Error producing PDF. ! Missing number, treated as zero. <to be read again> protect l.21 ifxetex I think I have all of Andika installed since I made the svg with font-feature-settings: "dig1" 1, "dig4" 1, "dg69" 1, "dig7" 1; Almost there! :-) Thanks!!
– Erik Josefsson
Jan 26 at 11:32
You are right. Doesn't work that way. You have to use a YAML sequence. See edit.
– DG'
Jan 26 at 15:47
Wow! I have spent days trying to make this happen on my own!! Is it possible to have all CharacterVariants active (i.e. 1, 4, 6, 7 and 9)? I tried to list with comma separation, but this did not work: CharacterVariant=4,7
– Erik Josefsson
Jan 26 at 11:17
Wow! I have spent days trying to make this happen on my own!! Is it possible to have all CharacterVariants active (i.e. 1, 4, 6, 7 and 9)? I tried to list with comma separation, but this did not work: CharacterVariant=4,7
– Erik Josefsson
Jan 26 at 11:17
@ErikJosefsson If you want to have more than one feature activated, you need to put curly braces around them:
CharacterVariant={4,7}
– DG'
Jan 26 at 11:19
@ErikJosefsson If you want to have more than one feature activated, you need to put curly braces around them:
CharacterVariant={4,7}
– DG'
Jan 26 at 11:19
Sorry, didn't work with curly braces {4,7} in the YAML header: --- mainfont: Andika mainfontoptions: CharacterVariant={4,7} mathspec: true mathfont: Andika mathfontoptions: CharacterVariant={4,7} --- This is what pandoc said: Error producing PDF. ! Missing number, treated as zero. <to be read again> protect l.21 ifxetex I think I have all of Andika installed since I made the svg with font-feature-settings: "dig1" 1, "dig4" 1, "dg69" 1, "dig7" 1; Almost there! :-) Thanks!!
– Erik Josefsson
Jan 26 at 11:32
Sorry, didn't work with curly braces {4,7} in the YAML header: --- mainfont: Andika mainfontoptions: CharacterVariant={4,7} mathspec: true mathfont: Andika mathfontoptions: CharacterVariant={4,7} --- This is what pandoc said: Error producing PDF. ! Missing number, treated as zero. <to be read again> protect l.21 ifxetex I think I have all of Andika installed since I made the svg with font-feature-settings: "dig1" 1, "dig4" 1, "dg69" 1, "dig7" 1; Almost there! :-) Thanks!!
– Erik Josefsson
Jan 26 at 11:32
You are right. Doesn't work that way. You have to use a YAML sequence. See edit.
– DG'
Jan 26 at 15:47
You are right. Doesn't work that way. You have to use a YAML sequence. See edit.
– DG'
Jan 26 at 15:47
add a comment |
Here's a solution that works with both LuaLaTeX and XeLaTeX, while using the non-default variants of the numerals 1
, 4
, 6
, 7
, and 9
. In addition, it employs an array
environment, to help align all fraction terms, +
symbols, and =
symbols horizontally as well as vertically.
Observe that since Andika is a text font, not a math font, only the numerals in the math terms employ Andika; all other glyphs (such as +
and =
) are rendered using Latin Modern Math.
The code below actually presents two solutions, rather than just one solution. The first uses display-style math, while the secod uses text-style math. The difference is most readily apparent in the size of the frac
terms.
documentclass{article}
usepackage{array} % for 'newcolumntype' macro
usepackage{booktabs} % for 'addlinespace' macro
newcolumntype{C}{>{{}}c<{{}}} % column type for = and + operators
newcolumntype{H}{>{displaystyle}c}
usepackage{unicode-math}
setmainfont{Andika}[CharacterVariant={1,4,6,7}]
setmathfont{Latin Modern Math}
setmathfont{Andika}[range=up/{num},
CharacterVariant={1,4,6,7}]
begin{document}
Andika numerals 0123456789
Solution 1: display-style math and fractions
[
setlength{arraycolsep}{0pt}
begin{array}{*{8}{HC}H}
frac{1}{1} &+&frac{1}{4} &=& frac{4}{4} &cdot& frac{1}{1} &+&
frac{1}{1} &cdot& frac{1}{4} &=& frac{4}{4} &+&frac{1}{4} &=&
frac{5}{4}\ addlinespace
frac{1}{2} &+&frac{1}{5} &=& frac{5}{5} &cdot& frac{1}{2} &+&
frac{2}{2} &cdot& frac{1}{5} &=& frac{5}{10} &+&frac{2}{10}&=&
\ addlinespace
frac{1}{3} &+&frac{1}{6} &=& frac{6}{6} &cdot& frac{1}{3} &+&
frac{3}{3} &cdot& frac{1}{6} &=& frac{6}{18} &+&\
addlinespace
frac{1}{4} &+&frac{1}{7} &=& frac{7}{7} &cdot& frac{1}{4} &+&
frac{4}{4} &cdot& frac{1}{7} &=& \ addlinespace
frac{1}{5} &+&frac{1}{8} &=& frac{8}{8} &cdot& frac{1}{5} &+&
frac{5}{5} &cdot& \ addlinespace
frac{1}{6} &+&frac{1}{9} &=& frac{9}{9} &cdot& frac{1}{6} &+&
\ addlinespace
frac{1}{7} &+&frac{1}{10} &=& frac{10}{10} &cdot&
\ addlinespace
frac{1}{8} &+&frac{1}{11} &=& \ addlinespace
frac{1}{9} &+&\
end{array}
]
Solution 2: text-style math and fractions
[
setlength{arraycolsep}{0pt}
begin{array}{*{8}{cC}c}
frac{1}{1} &+&frac{1}{4} &=& frac{4}{4} &cdot& frac{1}{1} &+&
frac{1}{1} &cdot& frac{1}{4} &=& frac{4}{4} &+&frac{1}{4} &=&
frac{5}{4}\ addlinespace
frac{1}{2} &+&frac{1}{5} &=& frac{5}{5} &cdot& frac{1}{2} &+&
frac{2}{2} &cdot& frac{1}{5} &=& frac{5}{10} &+&frac{2}{10}&=&
\ addlinespace
frac{1}{3} &+&frac{1}{6} &=& frac{6}{6} &cdot& frac{1}{3} &+&
frac{3}{3} &cdot& frac{1}{6} &=& frac{6}{18} &+&\
addlinespace
frac{1}{4} &+&frac{1}{7} &=& frac{7}{7} &cdot& frac{1}{4} &+&
frac{4}{4} &cdot& frac{1}{7} &=& \ addlinespace
frac{1}{5} &+&frac{1}{8} &=& frac{8}{8} &cdot& frac{1}{5} &+&
frac{5}{5} &cdot& \ addlinespace
frac{1}{6} &+&frac{1}{9} &=& frac{9}{9} &cdot& frac{1}{6} &+&
\ addlinespace
frac{1}{7} &+&frac{1}{10} &=& frac{10}{10} &cdot&
\ addlinespace
frac{1}{8} &+&frac{1}{11} &=& \ addlinespace
frac{1}{9} &+&\
end{array}
]
end{document}
This is very helpful and useful and fantastic! You also helped solve how to send more than one CharacterVariant through pandoc's YAMLcode
--- mainfont: Andika mainfontoptions: [CharacterVariant=1, CharacterVariant=4, CharacterVariant=6, CharacterVariant=7] mathspec: true mathfont: Andika mathfontoptions: [CharacterVariant=1, CharacterVariant=4, CharacterVariant=6, CharacterVariant=7] ---code
I'll try to unwrap the snippet {C}{>{{}}c<{{}}} to see if I can reproduce that level of precision myself:code
begin{array}{*{8}{HC}H}code
Again, thank you! //Erik
– Erik Josefsson
Jan 26 at 14:29
add a comment |
Here's a solution that works with both LuaLaTeX and XeLaTeX, while using the non-default variants of the numerals 1
, 4
, 6
, 7
, and 9
. In addition, it employs an array
environment, to help align all fraction terms, +
symbols, and =
symbols horizontally as well as vertically.
Observe that since Andika is a text font, not a math font, only the numerals in the math terms employ Andika; all other glyphs (such as +
and =
) are rendered using Latin Modern Math.
The code below actually presents two solutions, rather than just one solution. The first uses display-style math, while the secod uses text-style math. The difference is most readily apparent in the size of the frac
terms.
documentclass{article}
usepackage{array} % for 'newcolumntype' macro
usepackage{booktabs} % for 'addlinespace' macro
newcolumntype{C}{>{{}}c<{{}}} % column type for = and + operators
newcolumntype{H}{>{displaystyle}c}
usepackage{unicode-math}
setmainfont{Andika}[CharacterVariant={1,4,6,7}]
setmathfont{Latin Modern Math}
setmathfont{Andika}[range=up/{num},
CharacterVariant={1,4,6,7}]
begin{document}
Andika numerals 0123456789
Solution 1: display-style math and fractions
[
setlength{arraycolsep}{0pt}
begin{array}{*{8}{HC}H}
frac{1}{1} &+&frac{1}{4} &=& frac{4}{4} &cdot& frac{1}{1} &+&
frac{1}{1} &cdot& frac{1}{4} &=& frac{4}{4} &+&frac{1}{4} &=&
frac{5}{4}\ addlinespace
frac{1}{2} &+&frac{1}{5} &=& frac{5}{5} &cdot& frac{1}{2} &+&
frac{2}{2} &cdot& frac{1}{5} &=& frac{5}{10} &+&frac{2}{10}&=&
\ addlinespace
frac{1}{3} &+&frac{1}{6} &=& frac{6}{6} &cdot& frac{1}{3} &+&
frac{3}{3} &cdot& frac{1}{6} &=& frac{6}{18} &+&\
addlinespace
frac{1}{4} &+&frac{1}{7} &=& frac{7}{7} &cdot& frac{1}{4} &+&
frac{4}{4} &cdot& frac{1}{7} &=& \ addlinespace
frac{1}{5} &+&frac{1}{8} &=& frac{8}{8} &cdot& frac{1}{5} &+&
frac{5}{5} &cdot& \ addlinespace
frac{1}{6} &+&frac{1}{9} &=& frac{9}{9} &cdot& frac{1}{6} &+&
\ addlinespace
frac{1}{7} &+&frac{1}{10} &=& frac{10}{10} &cdot&
\ addlinespace
frac{1}{8} &+&frac{1}{11} &=& \ addlinespace
frac{1}{9} &+&\
end{array}
]
Solution 2: text-style math and fractions
[
setlength{arraycolsep}{0pt}
begin{array}{*{8}{cC}c}
frac{1}{1} &+&frac{1}{4} &=& frac{4}{4} &cdot& frac{1}{1} &+&
frac{1}{1} &cdot& frac{1}{4} &=& frac{4}{4} &+&frac{1}{4} &=&
frac{5}{4}\ addlinespace
frac{1}{2} &+&frac{1}{5} &=& frac{5}{5} &cdot& frac{1}{2} &+&
frac{2}{2} &cdot& frac{1}{5} &=& frac{5}{10} &+&frac{2}{10}&=&
\ addlinespace
frac{1}{3} &+&frac{1}{6} &=& frac{6}{6} &cdot& frac{1}{3} &+&
frac{3}{3} &cdot& frac{1}{6} &=& frac{6}{18} &+&\
addlinespace
frac{1}{4} &+&frac{1}{7} &=& frac{7}{7} &cdot& frac{1}{4} &+&
frac{4}{4} &cdot& frac{1}{7} &=& \ addlinespace
frac{1}{5} &+&frac{1}{8} &=& frac{8}{8} &cdot& frac{1}{5} &+&
frac{5}{5} &cdot& \ addlinespace
frac{1}{6} &+&frac{1}{9} &=& frac{9}{9} &cdot& frac{1}{6} &+&
\ addlinespace
frac{1}{7} &+&frac{1}{10} &=& frac{10}{10} &cdot&
\ addlinespace
frac{1}{8} &+&frac{1}{11} &=& \ addlinespace
frac{1}{9} &+&\
end{array}
]
end{document}
This is very helpful and useful and fantastic! You also helped solve how to send more than one CharacterVariant through pandoc's YAMLcode
--- mainfont: Andika mainfontoptions: [CharacterVariant=1, CharacterVariant=4, CharacterVariant=6, CharacterVariant=7] mathspec: true mathfont: Andika mathfontoptions: [CharacterVariant=1, CharacterVariant=4, CharacterVariant=6, CharacterVariant=7] ---code
I'll try to unwrap the snippet {C}{>{{}}c<{{}}} to see if I can reproduce that level of precision myself:code
begin{array}{*{8}{HC}H}code
Again, thank you! //Erik
– Erik Josefsson
Jan 26 at 14:29
add a comment |
Here's a solution that works with both LuaLaTeX and XeLaTeX, while using the non-default variants of the numerals 1
, 4
, 6
, 7
, and 9
. In addition, it employs an array
environment, to help align all fraction terms, +
symbols, and =
symbols horizontally as well as vertically.
Observe that since Andika is a text font, not a math font, only the numerals in the math terms employ Andika; all other glyphs (such as +
and =
) are rendered using Latin Modern Math.
The code below actually presents two solutions, rather than just one solution. The first uses display-style math, while the secod uses text-style math. The difference is most readily apparent in the size of the frac
terms.
documentclass{article}
usepackage{array} % for 'newcolumntype' macro
usepackage{booktabs} % for 'addlinespace' macro
newcolumntype{C}{>{{}}c<{{}}} % column type for = and + operators
newcolumntype{H}{>{displaystyle}c}
usepackage{unicode-math}
setmainfont{Andika}[CharacterVariant={1,4,6,7}]
setmathfont{Latin Modern Math}
setmathfont{Andika}[range=up/{num},
CharacterVariant={1,4,6,7}]
begin{document}
Andika numerals 0123456789
Solution 1: display-style math and fractions
[
setlength{arraycolsep}{0pt}
begin{array}{*{8}{HC}H}
frac{1}{1} &+&frac{1}{4} &=& frac{4}{4} &cdot& frac{1}{1} &+&
frac{1}{1} &cdot& frac{1}{4} &=& frac{4}{4} &+&frac{1}{4} &=&
frac{5}{4}\ addlinespace
frac{1}{2} &+&frac{1}{5} &=& frac{5}{5} &cdot& frac{1}{2} &+&
frac{2}{2} &cdot& frac{1}{5} &=& frac{5}{10} &+&frac{2}{10}&=&
\ addlinespace
frac{1}{3} &+&frac{1}{6} &=& frac{6}{6} &cdot& frac{1}{3} &+&
frac{3}{3} &cdot& frac{1}{6} &=& frac{6}{18} &+&\
addlinespace
frac{1}{4} &+&frac{1}{7} &=& frac{7}{7} &cdot& frac{1}{4} &+&
frac{4}{4} &cdot& frac{1}{7} &=& \ addlinespace
frac{1}{5} &+&frac{1}{8} &=& frac{8}{8} &cdot& frac{1}{5} &+&
frac{5}{5} &cdot& \ addlinespace
frac{1}{6} &+&frac{1}{9} &=& frac{9}{9} &cdot& frac{1}{6} &+&
\ addlinespace
frac{1}{7} &+&frac{1}{10} &=& frac{10}{10} &cdot&
\ addlinespace
frac{1}{8} &+&frac{1}{11} &=& \ addlinespace
frac{1}{9} &+&\
end{array}
]
Solution 2: text-style math and fractions
[
setlength{arraycolsep}{0pt}
begin{array}{*{8}{cC}c}
frac{1}{1} &+&frac{1}{4} &=& frac{4}{4} &cdot& frac{1}{1} &+&
frac{1}{1} &cdot& frac{1}{4} &=& frac{4}{4} &+&frac{1}{4} &=&
frac{5}{4}\ addlinespace
frac{1}{2} &+&frac{1}{5} &=& frac{5}{5} &cdot& frac{1}{2} &+&
frac{2}{2} &cdot& frac{1}{5} &=& frac{5}{10} &+&frac{2}{10}&=&
\ addlinespace
frac{1}{3} &+&frac{1}{6} &=& frac{6}{6} &cdot& frac{1}{3} &+&
frac{3}{3} &cdot& frac{1}{6} &=& frac{6}{18} &+&\
addlinespace
frac{1}{4} &+&frac{1}{7} &=& frac{7}{7} &cdot& frac{1}{4} &+&
frac{4}{4} &cdot& frac{1}{7} &=& \ addlinespace
frac{1}{5} &+&frac{1}{8} &=& frac{8}{8} &cdot& frac{1}{5} &+&
frac{5}{5} &cdot& \ addlinespace
frac{1}{6} &+&frac{1}{9} &=& frac{9}{9} &cdot& frac{1}{6} &+&
\ addlinespace
frac{1}{7} &+&frac{1}{10} &=& frac{10}{10} &cdot&
\ addlinespace
frac{1}{8} &+&frac{1}{11} &=& \ addlinespace
frac{1}{9} &+&\
end{array}
]
end{document}
Here's a solution that works with both LuaLaTeX and XeLaTeX, while using the non-default variants of the numerals 1
, 4
, 6
, 7
, and 9
. In addition, it employs an array
environment, to help align all fraction terms, +
symbols, and =
symbols horizontally as well as vertically.
Observe that since Andika is a text font, not a math font, only the numerals in the math terms employ Andika; all other glyphs (such as +
and =
) are rendered using Latin Modern Math.
The code below actually presents two solutions, rather than just one solution. The first uses display-style math, while the secod uses text-style math. The difference is most readily apparent in the size of the frac
terms.
documentclass{article}
usepackage{array} % for 'newcolumntype' macro
usepackage{booktabs} % for 'addlinespace' macro
newcolumntype{C}{>{{}}c<{{}}} % column type for = and + operators
newcolumntype{H}{>{displaystyle}c}
usepackage{unicode-math}
setmainfont{Andika}[CharacterVariant={1,4,6,7}]
setmathfont{Latin Modern Math}
setmathfont{Andika}[range=up/{num},
CharacterVariant={1,4,6,7}]
begin{document}
Andika numerals 0123456789
Solution 1: display-style math and fractions
[
setlength{arraycolsep}{0pt}
begin{array}{*{8}{HC}H}
frac{1}{1} &+&frac{1}{4} &=& frac{4}{4} &cdot& frac{1}{1} &+&
frac{1}{1} &cdot& frac{1}{4} &=& frac{4}{4} &+&frac{1}{4} &=&
frac{5}{4}\ addlinespace
frac{1}{2} &+&frac{1}{5} &=& frac{5}{5} &cdot& frac{1}{2} &+&
frac{2}{2} &cdot& frac{1}{5} &=& frac{5}{10} &+&frac{2}{10}&=&
\ addlinespace
frac{1}{3} &+&frac{1}{6} &=& frac{6}{6} &cdot& frac{1}{3} &+&
frac{3}{3} &cdot& frac{1}{6} &=& frac{6}{18} &+&\
addlinespace
frac{1}{4} &+&frac{1}{7} &=& frac{7}{7} &cdot& frac{1}{4} &+&
frac{4}{4} &cdot& frac{1}{7} &=& \ addlinespace
frac{1}{5} &+&frac{1}{8} &=& frac{8}{8} &cdot& frac{1}{5} &+&
frac{5}{5} &cdot& \ addlinespace
frac{1}{6} &+&frac{1}{9} &=& frac{9}{9} &cdot& frac{1}{6} &+&
\ addlinespace
frac{1}{7} &+&frac{1}{10} &=& frac{10}{10} &cdot&
\ addlinespace
frac{1}{8} &+&frac{1}{11} &=& \ addlinespace
frac{1}{9} &+&\
end{array}
]
Solution 2: text-style math and fractions
[
setlength{arraycolsep}{0pt}
begin{array}{*{8}{cC}c}
frac{1}{1} &+&frac{1}{4} &=& frac{4}{4} &cdot& frac{1}{1} &+&
frac{1}{1} &cdot& frac{1}{4} &=& frac{4}{4} &+&frac{1}{4} &=&
frac{5}{4}\ addlinespace
frac{1}{2} &+&frac{1}{5} &=& frac{5}{5} &cdot& frac{1}{2} &+&
frac{2}{2} &cdot& frac{1}{5} &=& frac{5}{10} &+&frac{2}{10}&=&
\ addlinespace
frac{1}{3} &+&frac{1}{6} &=& frac{6}{6} &cdot& frac{1}{3} &+&
frac{3}{3} &cdot& frac{1}{6} &=& frac{6}{18} &+&\
addlinespace
frac{1}{4} &+&frac{1}{7} &=& frac{7}{7} &cdot& frac{1}{4} &+&
frac{4}{4} &cdot& frac{1}{7} &=& \ addlinespace
frac{1}{5} &+&frac{1}{8} &=& frac{8}{8} &cdot& frac{1}{5} &+&
frac{5}{5} &cdot& \ addlinespace
frac{1}{6} &+&frac{1}{9} &=& frac{9}{9} &cdot& frac{1}{6} &+&
\ addlinespace
frac{1}{7} &+&frac{1}{10} &=& frac{10}{10} &cdot&
\ addlinespace
frac{1}{8} &+&frac{1}{11} &=& \ addlinespace
frac{1}{9} &+&\
end{array}
]
end{document}
edited Jan 26 at 13:56
answered Jan 26 at 13:41


MicoMico
284k31388777
284k31388777
This is very helpful and useful and fantastic! You also helped solve how to send more than one CharacterVariant through pandoc's YAMLcode
--- mainfont: Andika mainfontoptions: [CharacterVariant=1, CharacterVariant=4, CharacterVariant=6, CharacterVariant=7] mathspec: true mathfont: Andika mathfontoptions: [CharacterVariant=1, CharacterVariant=4, CharacterVariant=6, CharacterVariant=7] ---code
I'll try to unwrap the snippet {C}{>{{}}c<{{}}} to see if I can reproduce that level of precision myself:code
begin{array}{*{8}{HC}H}code
Again, thank you! //Erik
– Erik Josefsson
Jan 26 at 14:29
add a comment |
This is very helpful and useful and fantastic! You also helped solve how to send more than one CharacterVariant through pandoc's YAMLcode
--- mainfont: Andika mainfontoptions: [CharacterVariant=1, CharacterVariant=4, CharacterVariant=6, CharacterVariant=7] mathspec: true mathfont: Andika mathfontoptions: [CharacterVariant=1, CharacterVariant=4, CharacterVariant=6, CharacterVariant=7] ---code
I'll try to unwrap the snippet {C}{>{{}}c<{{}}} to see if I can reproduce that level of precision myself:code
begin{array}{*{8}{HC}H}code
Again, thank you! //Erik
– Erik Josefsson
Jan 26 at 14:29
This is very helpful and useful and fantastic! You also helped solve how to send more than one CharacterVariant through pandoc's YAML
code
--- mainfont: Andika mainfontoptions: [CharacterVariant=1, CharacterVariant=4, CharacterVariant=6, CharacterVariant=7] mathspec: true mathfont: Andika mathfontoptions: [CharacterVariant=1, CharacterVariant=4, CharacterVariant=6, CharacterVariant=7] --- code
I'll try to unwrap the snippet {C}{>{{}}c<{{}}} to see if I can reproduce that level of precision myself: code
begin{array}{*{8}{HC}H} code
Again, thank you! //Erik– Erik Josefsson
Jan 26 at 14:29
This is very helpful and useful and fantastic! You also helped solve how to send more than one CharacterVariant through pandoc's YAML
code
--- mainfont: Andika mainfontoptions: [CharacterVariant=1, CharacterVariant=4, CharacterVariant=6, CharacterVariant=7] mathspec: true mathfont: Andika mathfontoptions: [CharacterVariant=1, CharacterVariant=4, CharacterVariant=6, CharacterVariant=7] --- code
I'll try to unwrap the snippet {C}{>{{}}c<{{}}} to see if I can reproduce that level of precision myself: code
begin{array}{*{8}{HC}H} code
Again, thank you! //Erik– Erik Josefsson
Jan 26 at 14:29
add a comment |
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%2f471927%2fandika-fractions%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
Welcome to TeX.SE! Please what is "Andika"? A font? Do you have a link to it?
– Kurt
Jan 26 at 8:27
2
@Kurt:
--variable mainfont="Andika"
... ;-)– user31729
Jan 26 at 8:29
Hello Kurt! Here's a SIL pdf with the special numbers 1, 4, 6, 7 and 9 that I want: software.sil.org/wp-content/uploads/sites/19/2015/12/… To make them show with css+svg you do <css> font-family: Andika; font-feature-settings: "dig1" 1, "dig4" 1, "dg69" 1, "dig7" 1 </css>
– Erik Josefsson
Jan 26 at 9:20
1
Hi Jonas, the pdf with "Font Features for Andika" lists variants (e.g. "open four") of the numerals 1, 4, 6, 7 and 9, see bottom of page: software.sil.org/wp-content/uploads/sites/19/2015/12/… Best regards. //Erik
– Erik Josefsson
Jan 26 at 20:44
@ErikJosefsson I see, one has to generate it first for a quick preview scripts.sil.org/ttw/fonts2go.cgi
– Jonas Stein
Jan 26 at 20:59