Okay. Good afternoon, morning or evening,
whatever it is in your airtime zone.
I'm Pedro Aranda and I'm going to be talking about
what I've been doing
with the latest backend in Org Mode
and the different Sorry, and the way it treats fonts.
Just a couple of words before
I am going to go through motivation,
the evolution and get you an idea of what you can get
from the feature branch that I have started
and give a couple of demos.
actually my motivation is I was using ox-latex currently
and b and ox-beamer for as a foundation for my activities
mainly for lecture notes and lecture slides
so i came from pure latex and beamers
and for me the real cool use case
or I would say this was
the killer use case for me was
I have a programming lecture
which is sort of a Python 101
and when I'm live in the lecture
I can go and if the pupils ask me I can modify code,
show modified code and results on the fly
and that's something that really impresses the kids
and makes them understand what we are talking about.
From my pro-subjective point of view, in some,
mainly in ox-beamer, some of the things that I was missing
is that emojis would really break the monotony
and I missed the support for emojis and stock Beamer themes.
And some fonts I also found were suboptimal
or difficult to adapt in case they need an adaptation.
So, for example, people who need special fonts
because of their special capabilities,
it's difficult to get those fonts from the stock themes
and from the stock font implementations you have there.
So, requirements on mice
from the Emacs site to do this is none,
because basically, okay, the only thing I want
is to work on a vanilla Emacs,
which is more or less recent,
because yes, I'm a bit of a freak
and I compile it every two, three,
I get it from master and compile it every two, three days.
And Yahoo, I had to change to Neumark,
and I'm able now to get my vanilla Neumarks within four.
So that was a big accomplishment in these last days.
What is the evolution?
I mean my personal evolution and my take of xLatex
was I put everything in a in a latex file
and I input it through the latex shader and that's it.
But that was not very beginner friendly
and once I had some people interested in this,
oh wow I can modify the code on the fly
and see the results on the fly,
it was more difficult for them to give it a go.
So I just, because they,
there are people who have not that big,
that much experience with LaTeX
and It can even be a bridge to introduce people into latex.
So, in any case, it was not very beginner-friendly
and I had complaints on that.
So, what I think was, we can do better.
My first attempt was something that was completely neutral
to Babel or Polyglosia.
and it was made basically for font Lattesch
although some of the things can for rural Lattesch
and some of the things can also be used with the latest.
So overriding template fonts
and taking into account pullback fonts
was something that I learned uh uh
when we started this conversation
and the only problem with this
is that fallback fonts only work for latex
and because uh because it doesn't support them
actually for fallback points is a lua feature
There was already something in the list
regarding script detection which helped me a lot.
So big recognition to Romano Lafias for that
and for his publishing the algorithm or the script
and the in the org mode mailing list.
And then came my sort of little nightmare,
which was when we started talking
about internationalization or localization.
Looking back, I have a very strange feeling
about a blurring target there.
Because the reality being very, very frank, did I need it?
Really no, because I just needed
to add Spanish with Babel and that was it.
Well actually for me it still is
and you can put the British, German or Italian
it continues to be true for me
so I had personally I had little interest in doing that
but I took it as a challenge
which has shown to be really tough.
What do you get from the feature branch? The feature branch
adds font management for font spec,
which is not strictly needed
when you are on Latin, Cyrillic, and Greek scripts
as long as the fonts in your template support them.
But again, it's a nice way to get better support here.
You don't need it if you're happy with the fonts you get
from the templates that you use both for Beamer
and the document classes in LaTeX.
If you don't want to use alternative fonts,
you don't need it, but you would need it.
Of course, if you don't want things like,
for example, emojis or need emojis,
you really don't need forward fonts.
So my idea is that the next thing that you can add
is Babel and Polyglos here
for enhanced localization and multilingual documents there.
And at the end, my vision was that the keywords involved
would be language, the main language.
And then a nice idea from Ihor
was to put all the secondary languages there too.
Then specify the LaTeX compiler
and then what I've added is a keyword
which is LaTeX Montylang
which can be fontspec or babel or polyglossia
for localized documents.
By default, this thing is nil and when it is nil,
you get the behavior from OrgBug
that you already are used to if you don't want to switch.
and I was there and I was really
was chirped into the conversation
and I'm really helpful and a big thanks to him
because he also had a an easy idea
to support Chinese and Japanese documents
so that the only thing that you need is to add the language
that you're going to write your document in
very very big thank you for that
because that was really a challenge
not being able to decipher
what I was what I was coding there
in terms of I have a document
I copy and paste it from some place
and from there I get my answer I get my my pdf
and I compare whether it is correct or not
So what is behind the scenes?
I've always suggested that in order
to use the feature branch efficiently
you create a file with the default values
you need for your variables
and that's the this famous.locals.el files.
What I do is I have a generic one
in my home documents directory
and this is used for all the org documents
that are in subdirectories from there.
Why? Because normally you will not be
changing your fonts that often.
and if you need you can always go
and have your configuration locally.
So it's this point where I'm collecting
my phone configuration and
For me, this gives me a very, very nice quick start
for new documents and presentations.
And there you can even configure a lot of compiler
and font language management too,
so you have everything in a file.
And the other nice thing for that
is that you can also include that in a subdirectory.
And if this subdirectory is something that you're sharing
in a project with other people,
you are already configuring the, say,
quote, unquote, corporate look and feel for your documents
in that project for everyone
and no one else has to care about
how this document has to be configured.
One of the things that I really like in this approach
is that it is a grow-as-you-go.
So, for example, you can start with something like that,
which is I have my fonts, my basic fonts for main,
which is the Serif font, for sans,
which is the Sans Serif font, for maths,
and for the mono, with some features like to make them scale.
This is something that is uh provided by you
through the font spec package
and you're happy with it and you work with it
and given a in a given moment
you go and you have your own problems
and or your own challenge
and you need to have for example emojis for one of the fonts
and what you do is in this case you just add the emojis
as a fallback font in in the font that where you want to replace this
is this is what i'm doing right now for this presentation and you will see
You can always, as I've said,
you can always have your dear locals
and you can copy that into a working directory
which needs special adaptations or has special needs
and from there you have that directory
with your modified or customized their local study l file
so font spec is normally enough
but sometimes you can't control all the fonts
with font spec only so and there you have a polyglot here
and babel coming to your help
this may also be the case
that you are working in an intended language
i don't know which but an intended language and you found
and you wanted to see how that was configured
and you found the latest example
that used Babel or Polyglossia.
The exporter provides you three variables
to configure both font spec, Polyglossia and Babel.
So just as an example of how I picture this is,
uh, you find it in the internet,
something like that, uh, something like this,
because you have your document and you need tie.
So, and I found an example in the internet
that tells me that I'm going to be using
Babel main is going to be English.
And I'm also going to have a tie.
and then they tell me that for english
i'm going to be using noto serif for the main
for the main of the serif font noto sans for the sans font
and then when i'm writing things in thai
i'm going to be using noto serif thai and noto sans thai
That's what I see in the internet.
So what you can always do, what you would do in this case,
is I'm going to get and map the font configurations
from the latest into this variable.
Things that you have to take into account here
is, for example, the language.
The language here is Thai. You have the language
that you're intending this font for is Thai.
So this appears here. In case you don't have any language,
like in the first two lines,
you just say that the language is nil,
which is the language for the default language.
The other thing is in my example,
in this example that I found in the internet,
I have my properties for the fonts in this part in Latex
and I put them as properties here.
That's the whole idea behind the feature branch.
The Babel provide part is also integrated
from the Org header, mainly from the language line.
We have a variable in case you need to tweak it,
but normally the defaults provided by Org are good enough.
So what is the rationale behind my take at Latex Fonts Management?
And that's something that might be something very personal.
When am I using FontSpec?
I'm using FontSpec when I'm with Lua or Zlatex
and I want fonts that are different
from those specified in the Latex class.
That's point number one. I will also go for font spec
when I need to support scripts,
but I'm missing in the fonts I use,
and I can use fallback fonts for that. I have two.
The only limitation I have here is the following.
All languages must be left to right.
And if you don't say anything at all,
the LATIC backend assumes that you want the dates,
standard names for the abstract and so on
in American English. if you're using them.
In many cases, you're not using any sort of
abstract table of contents and so on
and you don't need that.
The important thing is maybe date management.
If you need dates, headings
or anything in any other language or locale,
then yes, then you need to use Babel or Polyglosia.
Choice, Depends. Can use poly loss here,
or you can use Babel, whatever you want.
Also, in some cases, it will depend
if you've been researching a bit
of how this is done with pure latest,
it will be also depending on, uh,
on the examples that you get.
So, what can you, when you are using
Babel or Polygross here, what do you have?
You have your dates, your headings, and so on.
You might need to control the text
in the sense that what passage
is written in what language.
For example, for things like hyphenation
and some ways of writing the hyphens in a
and direct speech and things like that.
And the other place where you need
other Babel or polyglots here,
and you will see that because all examples
that you can get for later in this case
is when you have a language
that uses right to left alignment
like Arabic, Hebrew and others.
So One note of, I would say, care is you always use the,
if you use Unicode fonts
that includes the scripts as you need,
you will have done, that will be a great leap for you
because that simplifies the configuration a lot.
Now a couple of demos.
I don't know if you've noticed
first demo is that I'm using.
fonts but are not the official fonts
in this Beamer template
which is by the way Boadilla.
This would be the first thing
so I've been using other fonts
and they are at least from what I get in class
they are more readable than the official
than the default fonts in Poliglossi
that you get in Babel for the Boadilla theme.
Another thing is what I've told you,
I have my own things like emojis.
Now, if you allow me for a second,
I'm going to switch to the Emacs
which is running behind the scenes to show you what.
Okay, fine. So, this is the presentation.
that I have here, and as you see,
I'm using Lua Latex and just one spec.
given I don't know why I would I would need this
this is an English presentation
but just to show you what you can do
if I go back here and I go to the beginning of the presentation
and now what I don't think you're showing anything oh thank you
Okay, this is the presentation, right?
So what I'm going to do is I'm going to go back
and I'm going to show the full screen.
And in this full screen,
you see the presentation on one side
and you see Emacs on the other side. Oh, still nothing.
Yeah, we're not seeing your screen at the moment, sorry.
Oh, thank you. Thank you for that.
Now it's starting to come. Okay. Yay! Fine.
So this presentation, I've done it with Lua Latex,
and what I add here is font spec and English language.
Just to show you, but with the same configuration,
with the same font spec configuration,
but adding Polyglossia.
I just have enough with adding polygons here
with the Spanish language to get my dates correctly
and this is something I'm going to see the date in English
and if I now go and recompile it in a couple of seconds
you will see that the data is in Spanish.
We are using the same Which I can show by the way.
I see just by adding polyglyphs here.
I can get my dates in Spanish.
What I have included the the locals in the.
In this in this lines, but just to discuss it a bit more.
I have it for all the presentations.
I think it was here. No. For the demo.
For the presentations I use for MX conferences.
I have it and it's something like this.
actually you don't need a fallback
for for the main font here
because the presentations are done with the sans font
so the only thing that I would really need
would be something like this
this can be commented and the same happens here
with the model this can be also commented
and the only thing where I would really need
a full back font is here
and what this is telling me is that
you have a full back for the emoji
for the emoji script
and you need to use the apple color emoji font with A modifier
which in this case is that you need
to have the half-word renderer.
That's the only thing that you really need.
Where do I get all these things from?
All these things I get from the different parts
and from different scripts in the Internet.
I also have a couple of other things to show.
For example, first of all, I do not need this.
This is a letter that I've been writing this morning
and I'm not using the full feature branches at all
because I just needed a sans font
and it's going to be a letter that I'm writing in.
with the sans font and the only thing I need
was Spanish for the date anyhow
how did what was my first thing that I did
with the back end back in I think it was April
we had a this comes from the mailing list
we had someone who had this who had this problem right
and he wanted to add emojis
and he had problems with the verbatim font
And that's how everything got started.
If you now go and I get my period
of latex for that running.
Well, I actually, all my latex is supported for that.
And this was what I showed in one of the Emacs, Org Mode meetups.
And there you see that We have the emojis.
We had the fonts for the different things. We had maps.
And you could even go and add scripts
and little passages and different scripts.
And this was done with the same principles that I want.
I have my main font. I have the emojis.
and I want, I have my son's phone and I have the emojis,
the Han for Japanese and the Kana for Japanese,
so that these characters here,
both in the sons and in the serif passages
are included correctly in the PDF.
And a third thing of what you can do
I've also shown this so this is more
for people who have not seen it
this is a side-by-side package a passage of
well actually the beginning of the analysis by Xenophon
both in in Greek and in German with some comments
and if I go this is this is done with Polyglossia
so if I go once again and produce
the PDF for this just a second
Come on. There you are. You get this.
And there you see different fonts.
Which fonts am I using for this?
I'm using for the main font for me is Swissere.
This listing is produced with Deja Vu Sansponor.
And using Polyglos here, I'm able to go and define
the Greek polytone for the variant,
for the Serif variant with the Noto Serif font,
just to differentiate it from the German text.
And nice thing is that both in the German text
You see for example here and with the Greek text
everything is scaled to match
the lower case of the main font which is free serif.
So that everything looks
extremely uniform and nice to read.
So that's what you want to do.
That's what you can do with this.
Just a couple of final words on this.
I want to thank once again Juan Manuel Garcia and Jim Crump
for what they have shared.
And I also want to thank everybody
for productive contributions to the discussion.
I'm saying this because I think I need a longer rest
and I'm going to be leaving
the feature fund untouched for a couple of months
so that people can take the feature branch
untouched for a couple of months.
to see if people want to use it and how they want to use it
and then maybe in the future we can discuss
if we want to integrate it or not
or if people need it and all that. Now questions, comments?
I think there was one question on. Beautiful for.
I think that goes beyond fonts right.
Someone is asking what about how is about video
mainly MP4 support on ox-latex.
I started the presentations with many videos.
This is something that really pushed me back using ox-latex.
What I would say to this is I mean this goes beyond
what we're discussing here with fonts.
I would advise you to go and get the same
or have the same thing that I did
which was first of all try to write it in latex
and then Once you have the minimal working examples,
you can get the latest parts
integrated into your own presentation.
That's what I've been doing.
By the way, I still do it, for example, not in this,
but for my lectures,
I have a lot of I'm using a lot of ticks
to do graphs and animated graphs.
And that's begin export later and export later.
That's what I'm doing.
Videos are generally a bit tricky because you cannot
So I think there is something called PDF-PC that can,
this provides a lot of cloud package
where you can include videos
and then they can be played through that specific program.
And JavaScript embedding,
that can only be done through Acrobat Reader,
which is like also finicky. Sure, yes.
As you said there are many things that need to be changed.
But I mean it's always a thing of taking it
and trying to see what you can do
and what the specifics are.
Maybe this can be done with Acrobat
and with a couple of extra packages and who knows.
And you can always keep it as as late
as fragments inside Org, I think. Any other questions?