LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-11-2012, 03:17 AM   #1
centguy
Member
 
Registered: Feb 2008
Posts: 627
Blog Entries: 1

Rep: Reputation: 48
cpp and \\ not compatible ?


How to ask cpp not to interpret the latex \\ command ?

%cat a.tex
\\
\hline

Now
% cpp -P -C -traditional a.tex
\\hline

i.e., cpp joins two lines together and breaks my Latex src code badly..

Thanks!
 
Old 07-11-2012, 05:33 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
If cpp means the C preprocessor, then why would you be running that on a Latex file??

Regardless, I suspect that the solution involves some kind of quoting.
 
Old 07-11-2012, 10:27 PM   #3
centguy
Member
 
Registered: Feb 2008
Posts: 627

Original Poster
Blog Entries: 1

Rep: Reputation: 48
i use cpp's #define to choose which journal style I want to adopt. Just for simplicity. I can even choose to compile using
native latex that uses eps figures or pdflatex that uses any non-eps figures (such as png, pdf, ..)

I don't want cpp to be too smart to reinterpret the latex commands.

any help is appreciated.
 
Old 07-12-2012, 04:31 AM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
I still don't understand what you are doing. I am sure that I'm not the only one here that has never used Latex, but I have seen it used. I don't think "compile" has the same meaning as when compiling source code that will eventually become executable.

If cpp (C preprocessor) encounters a Latex source file, what would you expect it to do with it? ( I would expect it to fail with along list of error messages)
 
Old 07-12-2012, 05:20 AM   #5
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware64 15; SlackwareARM-current (aarch64); Debian 12
Posts: 8,297
Blog Entries: 61

Rep: Reputation: Disabled
I'm no expert in LaTeX or any sort of programming, but this is from the cpp info page:
Quote:
The C preprocessor is intended to be used only with C, C++, and Objective-C source code. In the past, it has been abused as a general text processor.
 
Old 07-12-2012, 06:15 AM   #6
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
I use LaTeX, but have never used cpp for processing it. Perhaps this thread is of use, particularly post 3.
 
Old 07-13-2012, 02:21 AM   #7
centguy
Member
 
Registered: Feb 2008
Posts: 627

Original Poster
Blog Entries: 1

Rep: Reputation: 48
refer to post #1, try it out yourself.

If I do

cpp -P -C -traditional a.tex > b.tex


then a.tex and b.tex are different.

i want them to be the same since I do not want cpp to interpret \\
and therefore break my latex code.
 
Old 07-13-2012, 05:09 AM   #8
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
See the post by BrianL.

I am quite sure that there are tools out there intended for use with Latex.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Display driver package for Xvesa compatible/not Xorg compatible on multiple Dist Ziggurat6 Linux - Newbie 1 06-16-2009 11:55 PM
hot can make a text browser compatible mior of a sit that isnt normally compatible markyg852 Programming 2 04-14-2009 09:22 AM
Assembler Compatible Not Binary Compatible, Linux btbx Programming 1 09-22-2007 06:17 PM
debian dpkg cpp depends on cpp error darkleaf Linux - Software 2 06-25-2004 01:47 AM
Now I have gcc/cpp/cpp, but still can't install sfingerh Linux - Software 2 07-30-2002 03:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:12 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration