This came up lately as a request and I thought why not to share with everyone else who needs to translate Latex (*.tex) documents.
-
Click File > Options > File Types > New...
-
Select Regular Expression Delimited Text and press OK
-
Fill in the necessary information for the fields:
- File type name: (e.g. Latex FileType )
- File type identifier: (e.g. Latex Document )
- Name of individual document: (e.g. Latex )
- Name of individual category: (e.g. Latex )
- File dialog wildcard expression: (e.g. *.tex )
- Click Finish
- In the Options dialog go to File Types > Latex FileType > Document structure
- Add the following patterns:
Opening pattern |
Closing pattern |
Multiline True = tick the box False = do not tick the box |
\\input{\.\./Vorlage/Sprache/ |
} |
True |
\\moduletitle{ |
} |
True |
\\moduledescription{ |
} |
True |
\\modulenotes{ |
} |
True |
\\view{ |
[.!?:]\s?}$ |
True |
\\conditions{ |
} |
True |
\\action{ |
[.!?:]\s?\n?}$ |
True |
\\steptext{ |
}$ |
True |
\\newstep{ |
} |
True |
\\note |
$ |
True |
\\medskip |
}?[.!?:]$ |
True |
\\question{ |
} |
True |
\\answers\s?{ |
} |
True |
\\newcommand{\\[a-zA-Z]{0,}}{ |
} |
True |
- Go to File Types > Latex FileType > Inline tags
- Click Add rule…
-
Select from the
drop down list Placeholder
and in enter the following as Opening rule:\\textbf\{
- Click OK to confirm the inline rule and click again on Add rule…
-
Select from the drop down list Placeholder and enter the following as Opening rule:
\}
- Press OK and go to File Types > Latex FileType > Common
- Apply the following options:
Note: These options are not mandatory and you can set here individual settings. The following option selected are based on cases where it commonly works best.
Line breaks: Remove Line Breaks
Notifications: Untick the box
Unicode UTF-8 byte order mark (BOM): Preserve; don´t add if not originally present
Please note:
This is an example and due to several other possible commands that the Latex file type might be including you need to adjust Document structure, Inline tags rules and the Common settings.
...besides that...
^^ That´s it! ^^
(Just open your document now)
Feel free to share if you think it helps others too!
Write a comment
rpuschmann (Monday, 23 March 2015 09:36)
An interesting discussion can be found at Proz.com and maybe further ideas how to handle/improve the filter:
http://bit.ly/1BngC42
hd wallpaper (Saturday, 16 May 2015 15:18)
nice post :) very helpfull