bwoods / tex-- Goto Github PK
View Code? Open in Web Editor NEWA TeX implementation in a single C++11 class.
A TeX implementation in a single C++11 class.
Bryan,
first of all, thanks for the amazing job!
I just tried to rebuild tex.p from tex.web/tex.ch (to increase TeX's constants further) by running $ ./tangle tex.web tex.ch
with a tangle I built from a kertex distribution. My tangle does not recognize the underline option, however, thus stripping out all underscores, which consequently breaks tex.sh (expecting identifiers with underscores).
Can you please either include the tangle binary in the repo, or add instructions on how to build tangle from some TeX distribution?
many thanks,
Karl
Hi there, I just test the project on Mac OSX 10.9, it works very well.
The only problem is that tex.pool
is not found under tex/
, maybe it should be moved from web/
to tex/
, otherwise the program utters:
$ ./a.out test.tex
! I can't read tex.pool.
I want to port this to iOS and Android so that I can compile TeX scripts to get some images of formula. So I need to convert the .dvi
files to .png
or .svg
, I'm currently investigating dvisvgm and dvipng, do you know any other better options?
Thanks.
Specifically, TeX goes out of its way to detect non-ASCII paths and returns with an error: ! Text line contains an invalid character.
Hi there, I'm trying this project out. I tried to load tex.hpp
with g++ -std=c++11
but received several errors. I'm using fedora and the version of my compiler:
$ g++ --version
g++ (GCC) 4.8.2 20131212 (Red Hat 4.8.2-7)
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
My ultimate goal is to port this to mobile platforms, and I want to make sure this solution works. Which platform did you use to test things out?
The error message:
g++ -std=c++11 main.cpp
In file included from main.cpp:2:0:
tex.hpp:343:1: error: ‘bitset’ in namespace ‘std’ does not name a type
std::bitset<trie_size> trie_taken;
^
In file included from main.cpp:2:0:
tex.hpp: In member function ‘void tex::tex::first_fit(tex::tex::trie_pointer)’:
tex.hpp:13521:5: error: ‘trie_taken’ was not declared in this scope
trie_taken[ trie_max - 1] = 0;
^
tex.hpp:13526:7: error: ‘trie_taken’ was not declared in this scope
if (trie_taken[ h - 1])
^
tex.hpp:13539:2: error: ‘trie_taken’ was not declared in this scope
trie_taken[ h - 1] = 1;
^
tex.hpp: In static member function ‘static std::iostream* tex::tex::fopen(const char*, const char*)’:
tex.hpp:20441:123: error: invalid conversion from ‘int’ to ‘std::ios_base::openmode {aka std::_Ios_Openmode}’ [-fpermissive]
std::fstream file(name, (mode[0] == 'r' ? std::ios::in+std::ios::binary : std::ios::out+std::ios::binary+std::ios::trunc));
^
In file included from tex.hpp:41:0,
from main.cpp:2:
/usr/include/c++/4.8.2/fstream:816:7: error: initializing argument 2 of ‘std::basic_fstream<_CharT, _Traits>::basic_fstream(const char*, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::ios_base::openmode = std::_Ios_Openmode]’ [-fpermissive]
basic_fstream(const char* __s,
^
In file included from main.cpp:2:0:
tex.hpp:20445:41: error: use of deleted function ‘std::basic_fstream<char>::basic_fstream(const std::basic_fstream<char>&)’
return new std::fstream(std::move(file));
^
In file included from tex.hpp:41:0,
from main.cpp:2:
/usr/include/c++/4.8.2/fstream:776:11: note: ‘std::basic_fstream<char>::basic_fstream(const std::basic_fstream<char>&)’ is implicitly deleted because the default definition would be ill-formed:
class basic_fstream : public basic_iostream<_CharT, _Traits>
^
/usr/include/c++/4.8.2/fstream:776:11: error: use of deleted function ‘std::basic_iostream<char>::basic_iostream(const std::basic_iostream<char>&)’
In file included from /usr/include/c++/4.8.2/iostream:40:0,
from main.cpp:1:
/usr/include/c++/4.8.2/istream:795:11: note: ‘std::basic_iostream<char>::basic_iostream(const std::basic_iostream<char>&)’ is implicitly deleted because the default definition would be ill-formed:
class basic_iostream
^
/usr/include/c++/4.8.2/istream:795:11: error: use of deleted function ‘std::basic_istream<char>::basic_istream(const std::basic_istream<char>&)’
/usr/include/c++/4.8.2/istream:58:11: note: ‘std::basic_istream<char>::basic_istream(const std::basic_istream<char>&)’ is implicitly deleted because the default definition would be ill-formed:
class basic_istream : virtual public basic_ios<_CharT, _Traits>
^
/usr/include/c++/4.8.2/istream:58:11: error: use of deleted function ‘std::basic_ios<char>::basic_ios(const std::basic_ios<char>&)’
In file included from /usr/include/c++/4.8.2/ios:44:0,
from /usr/include/c++/4.8.2/ostream:38,
from /usr/include/c++/4.8.2/iostream:39,
from main.cpp:1:
/usr/include/c++/4.8.2/bits/basic_ios.h:66:11: note: ‘std::basic_ios<char>::basic_ios(const std::basic_ios<char>&)’ is implicitly deleted because the default definition would be ill-formed:
class basic_ios : public ios_base
^
In file included from /usr/include/c++/4.8.2/ios:42:0,
from /usr/include/c++/4.8.2/ostream:38,
from /usr/include/c++/4.8.2/iostream:39,
from main.cpp:1:
/usr/include/c++/4.8.2/bits/ios_base.h:786:5: error: ‘std::ios_base::ios_base(const std::ios_base&)’ is private
ios_base(const ios_base&);
^
In file included from /usr/include/c++/4.8.2/ios:44:0,
from /usr/include/c++/4.8.2/ostream:38,
from /usr/include/c++/4.8.2/iostream:39,
from main.cpp:1:
/usr/include/c++/4.8.2/bits/basic_ios.h:66:11: error: within this context
class basic_ios : public ios_base
^
In file included from /usr/include/c++/4.8.2/iostream:40:0,
from main.cpp:1:
/usr/include/c++/4.8.2/istream:795:11: error: use of deleted function ‘std::basic_ostream<char>::basic_ostream(const std::basic_ostream<char>&)’
class basic_iostream
^
In file included from /usr/include/c++/4.8.2/iostream:39:0,
from main.cpp:1:
/usr/include/c++/4.8.2/ostream:58:11: note: ‘std::basic_ostream<char>::basic_ostream(const std::basic_ostream<char>&)’ is implicitly deleted because the default definition would be ill-formed:
class basic_ostream : virtual public basic_ios<_CharT, _Traits>
^
/usr/include/c++/4.8.2/ostream:58:11: error: use of deleted function ‘std::basic_ios<char>::basic_ios(const std::basic_ios<char>&)’
In file included from /usr/include/c++/4.8.2/iostream:40:0,
from main.cpp:1:
/usr/include/c++/4.8.2/istream:795:11: error: use of deleted function ‘std::basic_ios<char>::basic_ios(const std::basic_ios<char>&)’
class basic_iostream
^
In file included from tex.hpp:41:0,
from main.cpp:2:
/usr/include/c++/4.8.2/fstream:776:11: error: use of deleted function ‘std::basic_ios<char>::basic_ios(const std::basic_ios<char>&)’
class basic_fstream : public basic_iostream<_CharT, _Traits>
^
/usr/include/c++/4.8.2/fstream:776:11: error: use of deleted function ‘std::basic_filebuf<char>::basic_filebuf(const std::basic_filebuf<char>&)’
/usr/include/c++/4.8.2/fstream:72:11: note: ‘std::basic_filebuf<char>::basic_filebuf(const std::basic_filebuf<char>&)’ is implicitly deleted because the default definition would be ill-formed:
class basic_filebuf : public basic_streambuf<_CharT, _Traits>
^
In file included from /usr/include/c++/4.8.2/ios:43:0,
from /usr/include/c++/4.8.2/ostream:38,
from /usr/include/c++/4.8.2/iostream:39,
from main.cpp:1:
/usr/include/c++/4.8.2/streambuf:802:7: error: ‘std::basic_streambuf<_CharT, _Traits>::basic_streambuf(const std::basic_streambuf<_CharT, _Traits>&) [with _CharT = char; _Traits = std::char_traits<char>]’ is private
basic_streambuf(const basic_streambuf& __sb)
^
In file included from tex.hpp:41:0,
from main.cpp:2:
/usr/include/c++/4.8.2/fstream:72:11: error: within this context
class basic_filebuf : public basic_streambuf<_CharT, _Traits>
^
make: *** [all] Error 1
Do you have a simple example on how you intend people to use TeX-- with LaTeX? Is the idea to overload the tex
class similar to what you did with plain
?
Consider for example the simple tex file:
test.tex with content:
"
This is \TeX
\end
"
DVI output generated by TeX-Live:
DVI output generated by the program:
These HEX 0D (corresponding to unsigned int 13) should not be there. For some reason when Font Def 1(DVI command 243) gets executed the program adds this hexadecimal in the dvi, causing the DVI to be improper DVI output.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.