This is my setting.
I have a main tex-file:
% TextTest.tex \documentclass[a4paper,11pt]{article} \usepackage[utf8]{inputenc} % in order to be able to write åäö. \input{name.tex} \begin{document} Hello ÅÄÖ. \name \end{document}I have a windows batch file:
@echo off cls set /p name= "Name: " echo \def\name{%name%} %% ÅÄÖ >> name.tex REM generate pdf pdflatex.exe textTest.texAnd a generated tex-file name.tex.
However, the above does not work when the name contain e.g. Ä. This is what I have tried: - to set the encoding CHCP 65001 in the batch file. - to set the encoding CHCP 1252 in the batch file. - start the batch file with cmd.exe /U (unicode) and /A (Ansi) - save the tex-files in different encodings.
\usepackage[utf8]{inputenc} % in order to be able to write åäö.by the encoding that you are actually using.[latin1]probably – David Carlisle Oct 30 '15 at 00:07inputencoption must match the encoding used in the textTest file so the letters in that file work, then either you write outname.texwith the same encoding or use{\inputencoding{something}\input{name}}the actual encodings used can be any encoding latex supports utf-8, windows "ansi" iso-8859-1, ...(latin1) .... – David Carlisle Oct 30 '15 at 08:20