Pen name similar with real name: Zu Yangzu instead of Zu Yang for papers
In CS, no publisher I am aware of strictly requires the name on the paper to be your unaltered true (in the sense of "as written on the passport/birth certificate/ID card/...") name. Customs in other fields might differ, although I see little reason to.

However, some issues might arise where the name from the paper has to match with some other information about you. These issues can sometimes be solved, but you should be aware of them:

Funding agencies may wish to see what you published. If you use a different name on the papers than what you are known as to the agency that funds your position, your participation in a paper you indicate to have contributed to may not be obvious.

Publishers sometimes ask for some meta-information such as your personal website on your institution's website. If you have no influence on how you appear on that personal website (again, because that information may be administered by your employer), the connection might again be non-obvious. The publisher might not care, but readers who see your paper and look at your website might assume an association mistake by the publisher unless the website explicitly states in a prominent place you are using a pen name.

Things might indeed get more complicated if you are in a field that puts emphasis on conferences:


Your conference registration might be coupled to the publication of your paper, in a way that the former is a prerequisite for the latter to happen. Some conferences explicitly ask upon registration which paper (number) you will present, but others will try to do a simple name-match. If you decide to register with your pen-name, though, a chain of other problems might ensue:


Conference registration is sometimes coupled with hotel registration, and the hotel will need to know your real name.
Your funding agency probably needs some registration confirmation from the conference, which may have to show your real name to serve as valid proof that you really paid for and attended the conference.
Even before that happens, you may need a confirmation of acceptance of your paper as a valid proof that you are required to embark on the respective conference trip, which can be more difficult if the confirmation of acceptance is seemingly directed at a person of a different name.



While it is a minor issue (because the existence of workarounds is likely), sometimes employers provide business cards with the information they know about you, without a way to indicate something such as a custom name. Handing out such business cards on conferences (point from above), or also other kinds of meetings with collaborators from other organisations, might be confusing with respect to your publication history.

Note that the workplace-specific items are also relevant because they might apply to any future employer of yours, not just the current one.