开发者

How to insert special characters when writing to a text file with LaTex

开发者 https://www.devze.com 2023-02-06 00:51 出处:网络
This is my first post here. I can usually find what I\'m looking for using questions other people have asked, but this time I\'m stumped. Please can anyone help?

This is my first post here. I can usually find what I'm looking for using questions other people have asked, but this time I'm stumped. Please can anyone help?

I'm trying to开发者_JAVA技巧 get Latex to generate a text file every time it is compiled (this bit I can do). I need the text file to have the following format text text

I have found out how to output a text file from LaTex, but I can't get it to insert a tab, only a space. A post here on StackOverflow shows how to include the backslash character in the text output using the following code:

\makeatletter
\immediate\write\outputfile{text \@backslashchar text}
\makeatother

I'm sure that something similar must work for inserting a tab, but I can't find a solution.

If anyone here knows how to do this I would be very, very grateful.

Many thanks!


There is no counterpart to the concept of a tab in (La)TeX, except when you are aligning the columns in a table. If what you meant by a tab is indentation at the beginning of a paragraph, that is considered a matter of design. Namely, the \parindent parameter specifies the distance that each paragraph should be indented. There is no 'tab' character that occupies the initial position of each paragraph.

However, you can forcefully insert a space in an arbitrary position. For example, use \hspace{distance}, where distance can be something like '3em' (3 times the width of m) or '1cm'.

0

精彩评论

暂无评论...
验证码 换一张
取 消