Comments (5)
Note that this no longer works. You should use wrap your raw latex in NoEscape
or use the Command
class in case you want to insert a command.
from pylatex.
Yes, any object inherits from one of the container baseclasses can also contain "raw" latex strings.
You can just do:
doc = Document()
doc.append(r'\newpage')
doc.append('This is on a new page')
This is also why you should always escape user supplied strings using the utils function.
In some cases it might be easier to use the Command class. This is mostly the case when your commands need arguments that aren't hard coded.
If you need a specific environment (like enumerate wiht a begin
and end
command) it might be easiest to inherit LatexNamedContainer, since that does that for you and you can use the with
syntax that way.
from pylatex.
Thank you for these infos and the fast reply!
I passed everything inside some r'text' strings and it works :)
from pylatex.
No problem. BTW the r
before r'text'
is just so you don't have to escape all the backslashes its something that is built in to python.
from pylatex.
Thank you for this info :)
from pylatex.
Related Issues (20)
- Add sympy support
- Texify to tableofcontents HOT 1
- fontenc and inputenc should not be included
- Store the generated PDF in byteIO
- How to properly add math and refs to captions
- No LaTex compiler was found (Windows 10) HOT 8
- How to to compile .tex file? HOT 2
- File not found for files with dots in relative or absolute path to file
- How to Specify LaTeX Compiler
- "PermissionError: [WinError 5] Access is denied" with document.generate_pdf()
- Adding pandas dataframes to pylatex sections breaks with pandas 2.0
- Negative values in TextBlock
- Two-Column document HOT 1
- Question: Tiny text size HOT 1
- Python 3.12 install fails HOT 2
- Missing Options Paramter in Section classes
- Proposal for `add_item`
- how add txt file content to tex file ?
- cannot use bytes as filename
- Research
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pylatex.