473,396 Members | 2,011 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Python LaTeX codec?

Does anyone have an implemented Python codec for converting between
unicode and LaTeX markup? E.g. I'd like 'ď' to be converted to '{\"\i}'
and vice versa. Preferably including at least the Latin Extended-A
characters as well as the basic Latin-1 Supplement.

If not, anyone with experience writing Python codecs have any advice on
how to do this?

--
David Eppstein http://www.ics.uci.edu/~eppstein/
Univ. of California, Irvine, School of Information & Computer Science
Jul 18 '05 #1
5 4431
David Eppstein wrote on Tue, 14 Oct 2003 08:27:09 -0700:
Does anyone have an implemented Python codec for converting between
unicode and LaTeX markup? E.g. I'd like 'ď' to be converted to '{\"\i}'
and vice versa. Preferably including at least the Latin Extended-A
characters as well as the basic Latin-1 Supplement.

If not, anyone with experience writing Python codecs have any advice on
how to do this?


There is Recodec
http://www.iro.umontreal.ca/~pinard/recodec/
which may fit the bill.

Karl M. Syring
Jul 18 '05 #2
In <comp.text.tex> David Eppstein <ep******@ics.uci.edu> wrote:
Does anyone have an implemented Python codec for converting between
unicode and LaTeX markup? E.g. I'd like '?' to be converted to '{\"\i}'
and vice versa. Preferably including at least the Latin Extended-A
characters as well as the basic Latin-1 Supplement.

If not, anyone with experience writing Python codecs have any advice on
how to do this?


For heaven's sake,
man tr
man sed
man awk
man bash

--
William Park, Open Geometry Consulting, <op**********@yahoo.ca>
Linux solution for data management and processing.
Jul 18 '05 #3
William Park wrote:
In <comp.text.tex> David Eppstein <ep******@ics.uci.edu> wrote:
Does anyone have an implemented Python codec for converting between
unicode and LaTeX markup? E.g. I'd like '?' to be converted to '{\"\i}'
and vice versa. Preferably including at least the Latin Extended-A
characters as well as the basic Latin-1 Supplement.

If not, anyone with experience writing Python codecs have any advice on
how to do this?

For heaven's sake,
man tr
man sed
man awk
man bash

Microsoft Windows 2000 [Version 5.00.2195]
(C) Copyright 1985-2000 Microsoft Corp.

C:\>man tr
'man' is not recognized as an internal or external command,
operable program or batch file.

C:\>man sed
'man' is not recognized as an internal or external command,
operable program or batch file.

C:\>man awk
'man' is not recognized as an internal or external command,
operable program or batch file.

C:\>man bash
'man' is not recognized as an internal or external command,
operable program or batch file.

.....and for good measure...

C:\>help sed
This command is not supported by the help utility. Try "sed /?".

....ducking and running.....

Yes, I have cygwin on my windows boxes and I've got Linux/BSD boxen,
etc. but the sort of kneejerk reaction to use the standard unix command
line tools isn't very helpful. What if the OP wanted to distribute his
program to users whom were unlikely to have access to such a tool chain?

Pointing out that there are some pre-existing tools can be useful, but
the "for heaven's sake" approach doesn't really help to address the
posters question about a _Python_ codec.... (one of the other responses
mentioning "recodec" does...)

--Paul

Jul 18 '05 #4
In article <bm***********@netnews.upenn.edu>,
"netnews.upenn.edu" <p.*******@snet.net> wrote:
William Park wrote:
In <comp.text.tex> David Eppstein <ep******@ics.uci.edu> wrote:
Does anyone have an implemented Python codec for converting between
unicode and LaTeX markup? E.g. I'd like '?' to be converted to '{\"\i}'
and vice versa. Preferably including at least the Latin Extended-A
characters as well as the basic Latin-1 Supplement.

If not, anyone with experience writing Python codecs have any advice on
how to do this?

For heaven's sake,
man tr
man sed
man awk
man bash

Microsoft Windows 2000 [Version 5.00.2195]
(C) Copyright 1985-2000 Microsoft Corp.


I am using a Mac, so Windows not having these isn't a problem.

But, Park's response doesn't really address my question at all.
For one thing, there was a reason I asked for this as Python code, which
is that I want to use this as a subroutine of a larger application, and
don't want the expense of firing up a separate program every time I want
to use this subroutine. More importantly, the difficult part is not so
much actually performing the conversion (whether by one of these
programs or more cleanly as a pure Python codec), but in coming up with
the tables of patterns to be converted.

--
David Eppstein http://www.ics.uci.edu/~eppstein/
Univ. of California, Irvine, School of Information & Computer Science
Jul 18 '05 #5
David Eppstein wrote:


Microsoft Windows 2000 [Version 5.00.2195]
(C) Copyright 1985-2000 Microsoft Corp.

I am using a Mac, so Windows not having these isn't a problem.

But, Park's response doesn't really address my question at all.
For one thing, there was a reason I asked for this as Python code, which
is that I want to use this as a subroutine of a larger application, and


That was essentially the point of the rest of my post -- the quoted unix
tools weren't universal and that you had asked for Python code. I used
Windows as an example because that was the box I was sitting at when I
read the post.

Actually, I think many (all?) of those tools may be available by default
if you're using OS X, but I'm too lazy to fire up my powerbook at the
moment...

--Paul

Jul 18 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Brian Elmegaard | last post by:
Hi group I hope this is not a faq... I try to understand how to use the new way of specifying a files encoding, but no matter what I do I get strange characters in the output. I have a...
22
by: Kenneth Miller | last post by:
Hello All, I am new to Python and i was wondering what graphing utlities would be available to me. I have already tried BLT and after weeks of unsuccesful installs i'd like to find something...
12
by: John Salerno | last post by:
Is 'Python 3000' just a code name for version 3.0, or will it really be called that when it's released?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.