def _thermr_input(endfin, pendfin, pendfout, mat,
                  temperatures=[293.6], angles=20, iprint=False,
                  err=0.001, emax=10, **kwargs):
    """Write thermr input for free-gas.
    
    Parameters
    ----------
    endfin : `int`
        tape number for input ENDF-6 file
    pendfin : `int`
        tape number for input PENDF file
    pendfout : `int`
        tape number for output PENDF file
    mat : `int`
        MAT number
    temperatures : iterable of `float`
        iterable of temperature values in K (default is 293.6 K)
    angles : `int`
        number of equi-probable angles (default is 20)
    iprint : `bool`
        print option (default is `False`)
    err : `float`
        tolerance (default is 0.001)
    emax : `float`
        maximum energy for thermal treatment (default is 10 eV)

    Returns
    -------
    `str`
        thermr input text
    """
    text = ["thermr"]
    text += ["{:d} {:d} {:d} /".format(endfin, pendfin, pendfout)]
    text += ["0 {:d} {:d} {:d} 1 0 0 1 221 {:d} /".format(mat, angles, len(temperatures), int(iprint))]
    text += [" ".join(map("{:.1f}".format, temperatures)) + " /"]
    text += ["{} {} /".format(err, emax)]
    return "\n".join(text) + "\n"