GeneralLoops in a LaTeX Document

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
clar
Posts: 7
Joined: Fri Oct 21, 2011 6:22 pm

Loops in a LaTeX Document

Post by clar »

Hi,
I am very beginner to latex. I have one question Can I open one file and get some information from file Using latex document. I mean By using pattern match in file if that word or pattern matches, then get information from file. for example

Code: Select all

begin
if (match)
   get that information.
      if (match)
        get information.
     else(no information)
end
Thanks in advance.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

kaiserkarl13
Posts: 707
Joined: Tue Mar 25, 2008 5:02 pm

Re: Loops in a LaTeX Document

Post by kaiserkarl13 »

LaTeX is a typesetting language, not a data extraction language. You probably want to use something like grep or awk (or even perl/python) to do this sort of thing.

There is an ifthen package that allows for conditional processing, if that's what you're looking for. See that package's documentation for details. You can do things like set flags and then include files/graphics/bibliographies/etc. based on their values.
clar
Posts: 7
Joined: Fri Oct 21, 2011 6:22 pm

Re: Loops in a LaTeX Document

Post by clar »

thanks For your reply , i did with perl that problem .
clar
Posts: 7
Joined: Fri Oct 21, 2011 6:22 pm

Loops in a LaTeX Document

Post by clar »

clar wrote:Hi,
I am very beginner to latex. I have one question Can I open one file and get some information from file Using latex document. I mean By using pattern match in file if that word or pattern matches, then get information from file. for example

Code: Select all

begin
if (match)
   get that information.
      if (match)
        get information.
     else(no information)
end
Thanks in advance.
Post Reply