Translate Latex documents in Studio? Sure!

This came up lately as a request and I thought why not to share with everyone else who needs to translate Latex (*.tex) documents.
  1. Click File > Options > File Types > New...
  2. Select Regular Expression Delimited Text and press OK
     
  1. 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 )
       
  2. Click Finish
  1. In the Options dialog go to File Types > Latex FileType > Document structure
  2. 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

 
  1. Go to File Types > Latex FileType > Inline tags
  2. Click Add rule
  3. Select from the drop down list Placeholder
    and in enter the following as Opening rule:

    \\textbf\{

     
     
 
  1. Click OK to confirm the inline rule and click again on Add rule
  2. Select from the drop down list Placeholder and enter the following as Opening rule:
    \}

     
     
  3. Press OK and go to File Types > Latex FileType > Common
     
 
  1. 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!

 
 
  • Hi Kevin, 

    Not sure if you got the answer on your questions, but as you can see from the Richard's images, you need to put a backslah imediatley before any of the "metacharactes".

    What work for me is not:  

    \\newstep{       }      True   

    but rather: 

    \\newstep\{       \}      True   

    * I added backslash in front of curly brackets.

    Simon

  • Hi,
    I am doing a translation of a large document (40k words) and using SDL Trados 2021 to do it. I have both a .tex file and a .docx file. 
    My big question is whether I should do the translation in Word first (MUCH easier and will take a lot less time) and then convert it to LaTex or use the .tex file (which I have never done in Trados or ever and will take forever because of the thousands of strange characters) and then "repair" it or have it "repaired/formatted" when it is finished.
    I can't figure out what is the best option.
    Any ideas?
    Thanks,
    Kevin 
  • Thank you for this, Richard. I am going to test it out. I just had one thing that wouldn't work in the setup. Trados 2021 would not accept these three opening patterns:

    \\newstep{       }      True   

    \\note    $     True

    \\newcommand{\\[a-zA-Z]{0,}}{      }     True

    "This regular expression is incorrect. Line break characters are not supported in opening pattern."

    Is this going to be a problem? 

    All the best!

    Kevin