Python LaTeX codec?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • David Eppstein

    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
  • Karl M Syring

    #2
    Re: Python LaTeX codec?

    David Eppstein wrote on Tue, 14 Oct 2003 08:27:09 -0700:[color=blue]
    > 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?[/color]

    There is Recodec

    which may fit the bill.

    Karl M. Syring

    Comment

    • William Park

      #3
      Re: Python LaTeX codec?

      In <comp.text.te x> David Eppstein <eppstein@ics.u ci.edu> wrote:[color=blue]
      > 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?[/color]

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

      --
      William Park, Open Geometry Consulting, <opengeometry@y ahoo.ca>
      Linux solution for data management and processing.

      Comment

      • netnews.upenn.edu

        #4
        Re: Python LaTeX codec?

        William Park wrote:[color=blue]
        > In <comp.text.te x> David Eppstein <eppstein@ics.u ci.edu> wrote:
        >[color=green]
        >>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?[/color]
        >
        >
        > For heaven's sake,
        > man tr
        > man sed
        > man awk
        > man bash
        >[/color]


        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

        Comment

        • David Eppstein

          #5
          Re: Python LaTeX codec?

          In article <bmhb54$3dae$1@ netnews.upenn.e du>,
          "netnews.upenn. edu" <p.magwene@snet .net> wrote:
          [color=blue]
          > William Park wrote:[color=green]
          > > In <comp.text.te x> David Eppstein <eppstein@ics.u ci.edu> wrote:
          > >[color=darkred]
          > >>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?[/color]
          > >
          > >
          > > For heaven's sake,
          > > man tr
          > > man sed
          > > man awk
          > > man bash
          > >[/color]
          >
          >
          > Microsoft Windows 2000 [Version 5.00.2195]
          > (C) Copyright 1985-2000 Microsoft Corp.[/color]

          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

          Comment

          • netnews.upenn.edu

            #6
            Re: Python LaTeX codec?

            David Eppstein wrote:
            [color=blue][color=green]
            >>
            >>
            >>Microsoft Windows 2000 [Version 5.00.2195]
            >>(C) Copyright 1985-2000 Microsoft Corp.[/color]
            >
            >
            > 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[/color]

            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

            Comment

            Working...