pylatex Change Font
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
How do I change the font to "helvetica" in pylatex ?
I tried it, but this does not worK:
doc = pylatex.Document(fontenc = 'helvet')
python pylatex
New contributor
 |Â
show 2 more comments
up vote
1
down vote
favorite
How do I change the font to "helvetica" in pylatex ?
I tried it, but this does not worK:
doc = pylatex.Document(fontenc = 'helvet')
python pylatex
New contributor
Welcome to TeX.SX! The font encoding has nothing to do with the font name. I do not know pylatex that well, but can't you simply include a font package (usepackage
in LaTeX)?
â TeXnician
3 hours ago
@TeXnician Thank you for your comment. This would be helpful, but I don't know how to do it in pylatex.
â james
3 hours ago
According to the docs it is possible to append packages and raw LaTeX strings, but as this solely revolves around Python and a library I'm voting to close as off-topic. Maybe you should simply ask the question how to include a package as issue.
â TeXnician
3 hours ago
2
Trydoc.preamble.append(Command('usepackage', 'helvet'))
in your python code.
â Skillmon
2 hours ago
@Skillmon Yes ! This works ! Thank you very much. I just had to add 'pl.' in front of 'Command' to make it work: 'doc.preamble.append(pl.Command('usepackage', 'helvet'))'
â james
1 hour ago
 |Â
show 2 more comments
up vote
1
down vote
favorite
up vote
1
down vote
favorite
How do I change the font to "helvetica" in pylatex ?
I tried it, but this does not worK:
doc = pylatex.Document(fontenc = 'helvet')
python pylatex
New contributor
How do I change the font to "helvetica" in pylatex ?
I tried it, but this does not worK:
doc = pylatex.Document(fontenc = 'helvet')
python pylatex
python pylatex
New contributor
New contributor
edited 4 hours ago
New contributor
asked 4 hours ago
james
1084
1084
New contributor
New contributor
Welcome to TeX.SX! The font encoding has nothing to do with the font name. I do not know pylatex that well, but can't you simply include a font package (usepackage
in LaTeX)?
â TeXnician
3 hours ago
@TeXnician Thank you for your comment. This would be helpful, but I don't know how to do it in pylatex.
â james
3 hours ago
According to the docs it is possible to append packages and raw LaTeX strings, but as this solely revolves around Python and a library I'm voting to close as off-topic. Maybe you should simply ask the question how to include a package as issue.
â TeXnician
3 hours ago
2
Trydoc.preamble.append(Command('usepackage', 'helvet'))
in your python code.
â Skillmon
2 hours ago
@Skillmon Yes ! This works ! Thank you very much. I just had to add 'pl.' in front of 'Command' to make it work: 'doc.preamble.append(pl.Command('usepackage', 'helvet'))'
â james
1 hour ago
 |Â
show 2 more comments
Welcome to TeX.SX! The font encoding has nothing to do with the font name. I do not know pylatex that well, but can't you simply include a font package (usepackage
in LaTeX)?
â TeXnician
3 hours ago
@TeXnician Thank you for your comment. This would be helpful, but I don't know how to do it in pylatex.
â james
3 hours ago
According to the docs it is possible to append packages and raw LaTeX strings, but as this solely revolves around Python and a library I'm voting to close as off-topic. Maybe you should simply ask the question how to include a package as issue.
â TeXnician
3 hours ago
2
Trydoc.preamble.append(Command('usepackage', 'helvet'))
in your python code.
â Skillmon
2 hours ago
@Skillmon Yes ! This works ! Thank you very much. I just had to add 'pl.' in front of 'Command' to make it work: 'doc.preamble.append(pl.Command('usepackage', 'helvet'))'
â james
1 hour ago
Welcome to TeX.SX! The font encoding has nothing to do with the font name. I do not know pylatex that well, but can't you simply include a font package (
usepackage
in LaTeX)?â TeXnician
3 hours ago
Welcome to TeX.SX! The font encoding has nothing to do with the font name. I do not know pylatex that well, but can't you simply include a font package (
usepackage
in LaTeX)?â TeXnician
3 hours ago
@TeXnician Thank you for your comment. This would be helpful, but I don't know how to do it in pylatex.
â james
3 hours ago
@TeXnician Thank you for your comment. This would be helpful, but I don't know how to do it in pylatex.
â james
3 hours ago
According to the docs it is possible to append packages and raw LaTeX strings, but as this solely revolves around Python and a library I'm voting to close as off-topic. Maybe you should simply ask the question how to include a package as issue.
â TeXnician
3 hours ago
According to the docs it is possible to append packages and raw LaTeX strings, but as this solely revolves around Python and a library I'm voting to close as off-topic. Maybe you should simply ask the question how to include a package as issue.
â TeXnician
3 hours ago
2
2
Try
doc.preamble.append(Command('usepackage', 'helvet'))
in your python code.â Skillmon
2 hours ago
Try
doc.preamble.append(Command('usepackage', 'helvet'))
in your python code.â Skillmon
2 hours ago
@Skillmon Yes ! This works ! Thank you very much. I just had to add 'pl.' in front of 'Command' to make it work: 'doc.preamble.append(pl.Command('usepackage', 'helvet'))'
â james
1 hour ago
@Skillmon Yes ! This works ! Thank you very much. I just had to add 'pl.' in front of 'Command' to make it work: 'doc.preamble.append(pl.Command('usepackage', 'helvet'))'
â james
1 hour ago
 |Â
show 2 more comments
1 Answer
1
active
oldest
votes
up vote
3
down vote
accepted
You can add stuff to your preamble using doc.preamble.append()
. To add helvet
to your preamble use:
doc.preamble.append(Command('usepackage', 'helvet'))
This needs
from pylatex import Command
to work out, if you imported pylatex
and not only submodules and functions from it, use pylatex.Command
instead.
From what I gathered by a quick look on the documentation of pylatex
you might be able to add arbitrary stuff to your document (making a horizontal line possible) by doing:
from pylatex.utils import NoEscape
and then
doc.append(NoEscape(r'hrule')) # or whichever macro you want to use for your horizontal line
I'm not sure what NoEscape
is needed for, perhaps it isn't needed, but I can't try because I don't have pylatex
installed.
This is great ! Thank you very much ! Just a quick question: How can I change the thickness of the line ? I tried "doc.append(pl.Command('rule','0.4pt','linewidth'))" but it does not work.
â james
35 mins ago
I also tried: doc.append(NoEscape(r'ruletextwidth0.4pt'))
â james
33 mins ago
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
accepted
You can add stuff to your preamble using doc.preamble.append()
. To add helvet
to your preamble use:
doc.preamble.append(Command('usepackage', 'helvet'))
This needs
from pylatex import Command
to work out, if you imported pylatex
and not only submodules and functions from it, use pylatex.Command
instead.
From what I gathered by a quick look on the documentation of pylatex
you might be able to add arbitrary stuff to your document (making a horizontal line possible) by doing:
from pylatex.utils import NoEscape
and then
doc.append(NoEscape(r'hrule')) # or whichever macro you want to use for your horizontal line
I'm not sure what NoEscape
is needed for, perhaps it isn't needed, but I can't try because I don't have pylatex
installed.
This is great ! Thank you very much ! Just a quick question: How can I change the thickness of the line ? I tried "doc.append(pl.Command('rule','0.4pt','linewidth'))" but it does not work.
â james
35 mins ago
I also tried: doc.append(NoEscape(r'ruletextwidth0.4pt'))
â james
33 mins ago
add a comment |Â
up vote
3
down vote
accepted
You can add stuff to your preamble using doc.preamble.append()
. To add helvet
to your preamble use:
doc.preamble.append(Command('usepackage', 'helvet'))
This needs
from pylatex import Command
to work out, if you imported pylatex
and not only submodules and functions from it, use pylatex.Command
instead.
From what I gathered by a quick look on the documentation of pylatex
you might be able to add arbitrary stuff to your document (making a horizontal line possible) by doing:
from pylatex.utils import NoEscape
and then
doc.append(NoEscape(r'hrule')) # or whichever macro you want to use for your horizontal line
I'm not sure what NoEscape
is needed for, perhaps it isn't needed, but I can't try because I don't have pylatex
installed.
This is great ! Thank you very much ! Just a quick question: How can I change the thickness of the line ? I tried "doc.append(pl.Command('rule','0.4pt','linewidth'))" but it does not work.
â james
35 mins ago
I also tried: doc.append(NoEscape(r'ruletextwidth0.4pt'))
â james
33 mins ago
add a comment |Â
up vote
3
down vote
accepted
up vote
3
down vote
accepted
You can add stuff to your preamble using doc.preamble.append()
. To add helvet
to your preamble use:
doc.preamble.append(Command('usepackage', 'helvet'))
This needs
from pylatex import Command
to work out, if you imported pylatex
and not only submodules and functions from it, use pylatex.Command
instead.
From what I gathered by a quick look on the documentation of pylatex
you might be able to add arbitrary stuff to your document (making a horizontal line possible) by doing:
from pylatex.utils import NoEscape
and then
doc.append(NoEscape(r'hrule')) # or whichever macro you want to use for your horizontal line
I'm not sure what NoEscape
is needed for, perhaps it isn't needed, but I can't try because I don't have pylatex
installed.
You can add stuff to your preamble using doc.preamble.append()
. To add helvet
to your preamble use:
doc.preamble.append(Command('usepackage', 'helvet'))
This needs
from pylatex import Command
to work out, if you imported pylatex
and not only submodules and functions from it, use pylatex.Command
instead.
From what I gathered by a quick look on the documentation of pylatex
you might be able to add arbitrary stuff to your document (making a horizontal line possible) by doing:
from pylatex.utils import NoEscape
and then
doc.append(NoEscape(r'hrule')) # or whichever macro you want to use for your horizontal line
I'm not sure what NoEscape
is needed for, perhaps it isn't needed, but I can't try because I don't have pylatex
installed.
answered 42 mins ago
Skillmon
18k11636
18k11636
This is great ! Thank you very much ! Just a quick question: How can I change the thickness of the line ? I tried "doc.append(pl.Command('rule','0.4pt','linewidth'))" but it does not work.
â james
35 mins ago
I also tried: doc.append(NoEscape(r'ruletextwidth0.4pt'))
â james
33 mins ago
add a comment |Â
This is great ! Thank you very much ! Just a quick question: How can I change the thickness of the line ? I tried "doc.append(pl.Command('rule','0.4pt','linewidth'))" but it does not work.
â james
35 mins ago
I also tried: doc.append(NoEscape(r'ruletextwidth0.4pt'))
â james
33 mins ago
This is great ! Thank you very much ! Just a quick question: How can I change the thickness of the line ? I tried "doc.append(pl.Command('rule','0.4pt','linewidth'))" but it does not work.
â james
35 mins ago
This is great ! Thank you very much ! Just a quick question: How can I change the thickness of the line ? I tried "doc.append(pl.Command('rule','0.4pt','linewidth'))" but it does not work.
â james
35 mins ago
I also tried: doc.append(NoEscape(r'ruletextwidth0.4pt'))
â james
33 mins ago
I also tried: doc.append(NoEscape(r'ruletextwidth0.4pt'))
â james
33 mins ago
add a comment |Â
james is a new contributor. Be nice, and check out our Code of Conduct.
james is a new contributor. Be nice, and check out our Code of Conduct.
james is a new contributor. Be nice, and check out our Code of Conduct.
james is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f452078%2fpylatex-change-font%23new-answer', 'question_page');
);
Post as a guest
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
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
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
Welcome to TeX.SX! The font encoding has nothing to do with the font name. I do not know pylatex that well, but can't you simply include a font package (
usepackage
in LaTeX)?â TeXnician
3 hours ago
@TeXnician Thank you for your comment. This would be helpful, but I don't know how to do it in pylatex.
â james
3 hours ago
According to the docs it is possible to append packages and raw LaTeX strings, but as this solely revolves around Python and a library I'm voting to close as off-topic. Maybe you should simply ask the question how to include a package as issue.
â TeXnician
3 hours ago
2
Try
doc.preamble.append(Command('usepackage', 'helvet'))
in your python code.â Skillmon
2 hours ago
@Skillmon Yes ! This works ! Thank you very much. I just had to add 'pl.' in front of 'Command' to make it work: 'doc.preamble.append(pl.Command('usepackage', 'helvet'))'
â james
1 hour ago