Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9233827
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:38:39+00:00 2026-06-18T06:38:39+00:00

I am converting a document from LaTeX (XeTeX) to ReStructuredText using Pandoc. The document

  • 0

I am converting a document from LaTeX (XeTeX) to ReStructuredText using Pandoc. The document has a large number of index entries, and Pandoc does not handle indices. The index entries are stripped out when Pandoc converts, leaving just the text of the entry. So, what I need is a way to convert the index entries to ReST syntax in the LaTeX file before Pandoc strips them out upon conversion. In my tests, this sort of works: Pandoc preserves the index entries but escapes the backticks. I can strip those out. Here’s how it looks when I do it manually:

\index{Some index item}    # The LaTex entry
:index:`Some index item`   # Modified for ReST format (still in the LaTeX file)
:index:\`Some index item\` # Result after Pandoc conversion to ReST

I can replace the final escaped backticks with proper backticks in the final ReST file. What I can’t seem to figure out is how to create a workable method (Regex?) for the replacements in the LaTeX file. Suggestions most welcome (including suggestions about a better way to do this whole production).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T06:38:40+00:00Added an answer on June 18, 2026 at 6:38 am

    It seems you are looking to replace entries that match the following regular expression

    ^\\index\{([^}]*)\}
    

    with

    :index:`$1`
    

    where $1 is a reference to the regex’s capture group ([^}]*).

    You could automate this process with, for example, a shell script or do it manually in a text editor.

    Note, the above regex assumes there is no } inside the {}.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating a docx file from an HTML page using pandoc , but for
Can anyone help with converting data from an XML document into an associative array?
I am writing a converter from XML&MathML to MS Word document. I'm using MFC
Background Converting a document from OpenOffice to DocBook format. Problem Parts of the document
I'm a converting my Word document into pdf using the built-in microsoft office converter
I'm struggling converting a Response from http-conduit to an XML document via xml-conduit. The
Converting json to oher type should be easy. From the Play! documentation : var
Converting to ODB.NET from System.Data.OracleClient and need help converting my connection string. Here is
I am converting absolute file-system path to relative path using following code. public static
I'm converting some html parsing code from BeautifulSoup to lxml. I'm trying to figure

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.